Made custom error message for invalid high-levels (Thank you gooby for the bug report XP)
This commit is contained in:
parent
de392d8d57
commit
40618da612
1 changed files with 9 additions and 0 deletions
|
|
@ -53,6 +53,11 @@ class chatHandler{
|
|||
* Max chat buffer message count
|
||||
*/
|
||||
this.chatBufferSize = 50;
|
||||
|
||||
/**
|
||||
* set max high level
|
||||
*/
|
||||
this.maxHighLevel = 10;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -123,6 +128,10 @@ class chatHandler{
|
|||
|
||||
if(userDB){
|
||||
try{
|
||||
if(data.highLevel < 0 || data.highLevel > this.maxHighLevel){
|
||||
throw loggerUtils.exceptionSmith("Invalid High Level!", "High Level");
|
||||
}
|
||||
|
||||
//Floor input to an integer and set high level
|
||||
userDB.highLevel = Math.floor(data.highLevel);
|
||||
//Save user DB Document
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue