* Some changes to command handlers. Patch by ogeraisi
--HG-- branch : trunk
This commit is contained in:
+5
-5
@@ -243,13 +243,13 @@ bool ChatHandler::HandleAccountAddonCommand(const char* args)
|
||||
|
||||
uint32 account_id = m_session->GetAccountId();
|
||||
|
||||
int lev=atoi(szExp); //get int anyway (0 if error)
|
||||
if(lev < 0 || lev > sWorld.getConfig(CONFIG_EXPANSION))
|
||||
return false;
|
||||
int expansion=atoi(szExp); //get int anyway (0 if error)
|
||||
if(expansion < 0 || expansion > sWorld.getConfig(CONFIG_EXPANSION))
|
||||
return false;
|
||||
|
||||
// No SQL injection
|
||||
loginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'",lev,account_id);
|
||||
PSendSysMessage(LANG_ACCOUNT_ADDON,lev);
|
||||
loginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'", expansion, account_id);
|
||||
PSendSysMessage(LANG_ACCOUNT_ADDON, expansion);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -1569,7 +1569,7 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
|
||||
|
||||
float ASpeed = (float)atof((char*)args);
|
||||
|
||||
if (ASpeed > 50 || ASpeed < 0)
|
||||
if (ASpeed > 50.0f || ASpeed < 0.1f)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -1617,7 +1617,7 @@ bool ChatHandler::HandleModifySpeedCommand(const char* args)
|
||||
|
||||
float Speed = (float)atof((char*)args);
|
||||
|
||||
if (Speed > 10 || Speed < 0.1)
|
||||
if (Speed > 50.0f || Speed < 0.1f)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -1662,7 +1662,7 @@ bool ChatHandler::HandleModifySwimCommand(const char* args)
|
||||
|
||||
float Swim = (float)atof((char*)args);
|
||||
|
||||
if (Swim > 10.0f || Swim < 0.01f)
|
||||
if (Swim > 50.0f || Swim < 0.1f)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -1707,7 +1707,7 @@ bool ChatHandler::HandleModifyBWalkCommand(const char* args)
|
||||
|
||||
float BSpeed = (float)atof((char*)args);
|
||||
|
||||
if (BSpeed > 10.0f || BSpeed < 0.1f)
|
||||
if (BSpeed > 50.0f || BSpeed < 0.1f)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -1752,7 +1752,7 @@ bool ChatHandler::HandleModifyFlyCommand(const char* args)
|
||||
|
||||
float FSpeed = (float)atof((char*)args);
|
||||
|
||||
if (FSpeed > 10.0f || FSpeed < 0.1f)
|
||||
if (FSpeed > 50.0f || FSpeed < 0.1f)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -1787,7 +1787,7 @@ bool ChatHandler::HandleModifyScaleCommand(const char* args)
|
||||
return false;
|
||||
|
||||
float Scale = (float)atof((char*)args);
|
||||
if (Scale > 10.0f || Scale <= 0.0f)
|
||||
if (Scale > 10.0f || Scale <= 0.1f)
|
||||
{
|
||||
SendSysMessage(LANG_BAD_VALUE);
|
||||
SetSentErrorMessage(true);
|
||||
|
||||
+5
-5
@@ -6997,13 +6997,13 @@ bool ChatHandler::HandleAccountSetAddonCommand(const char* args)
|
||||
HasLowerSecurityAccount (NULL,account_id,true))
|
||||
return false;
|
||||
|
||||
int lev=atoi(szExp); //get int anyway (0 if error)
|
||||
if(lev < 0 || lev > sWorld.getConfig(CONFIG_EXPANSION))
|
||||
return false;
|
||||
int expansion = atoi(szExp); //get int anyway (0 if error)
|
||||
if(expansion < 0 || expansion > sWorld.getConfig(CONFIG_EXPANSION))
|
||||
return false;
|
||||
|
||||
// No SQL injection
|
||||
loginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'",lev,account_id);
|
||||
PSendSysMessage(LANG_ACCOUNT_SETADDON,account_name.c_str(),account_id,lev);
|
||||
loginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'",expansion,account_id);
|
||||
PSendSysMessage(LANG_ACCOUNT_SETADDON,account_name.c_str(),account_id,expansion);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user