Merge remote-tracking branch 'remotes/origin/master' into blob_conversion

Conflicts:
	changelog.txt
	common/database.cpp
	world/client.cpp
	world/zoneserver.cpp
	zone/command.cpp
This commit is contained in:
akkadius
2014-09-21 02:32:31 -05:00
22 changed files with 271 additions and 172 deletions
+15 -5
View File
@@ -770,10 +770,20 @@ uint32 Database::GetCharacterID(const char *name) {
the name "name" or zero if no character with that name was found
Zero will also be returned if there is a database error.
*/
uint32 Database::GetAccountIDByChar(const char* charname) {
uint32 accountId = 0;
std::string query = StringFormat("SELECT `account_id`, `id` FROM `character_data` WHERE `name` = '%s' LIMIT 1", charname);
auto results = QueryDatabase(query);
uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
std::string query = StringFormat("SELECT account_id, id FROM character_ WHERE name='%s'", EscapeString(charname).c_str());
auto results = QueryDatabase(query);
if (!results.Success())
{
std::cerr << "Error in GetAccountIDByChar query '" << query << "' " << results.ErrorMessage() << std::endl;
return 0;
}
if (results.RowCount() != 1)
return 0;
auto row = results.begin();
if (row[0]){ accountId = atoi(row[0]); }
return accountId;
@@ -2244,7 +2254,7 @@ bool Database::CheckNameFilter(const char* name, bool surname)
else
{
// the minimum 4 is enforced by the client too
if(!name || strlen(name) < 4 || strlen(name) > 64)
if(!name || strlen(name) < 4 || strlen(name) > 15)
{
return false;
}
+5 -5
View File
@@ -10,7 +10,7 @@ MySQLRequestResult::MySQLRequestResult()
MySQLRequestResult::MySQLRequestResult(MYSQL_RES* result, uint32 rowsAffected, uint32 rowCount, uint32 columnCount, uint32 lastInsertedID, uint32 errorNumber, char *errorBuffer)
: m_CurrentRow(result), m_OneBeyondRow()
{
m_Result = result;
m_Result = result;
m_RowsAffected = rowsAffected;
m_RowCount = rowCount;
m_ColumnCount = columnCount;
@@ -22,12 +22,12 @@ MySQLRequestResult::MySQLRequestResult(MYSQL_RES* result, uint32 rowsAffected, u
m_ColumnLengths = nullptr;
m_Fields = nullptr;
if (errorBuffer != nullptr)
m_Success = true;
if (errorBuffer != nullptr)
m_Success = false;
m_Success = true;
m_ErrorNumber = errorNumber;
m_ErrorBuffer = errorBuffer;
m_ErrorNumber = errorNumber;
m_ErrorBuffer = errorBuffer;
}
void MySQLRequestResult::FreeInternals()
+2
View File
@@ -171,6 +171,7 @@ RULE_INT ( World, PVPSettings, 0) // Sets the PVP settings for the server, 1 = R
RULE_BOOL (World, IsGMPetitionWindowEnabled, false)
RULE_INT (World, FVNoDropFlag, 0) // Sets the Firiona Vie settings on the client. If set to 2, the flag will be set for GMs only, allowing trading of no-drop items.
RULE_BOOL (World, IPLimitDisconnectAll, false)
RULE_INT (World, TellQueueSize, 20)
RULE_CATEGORY_END()
RULE_CATEGORY( Zone )
@@ -320,6 +321,7 @@ RULE_INT ( Spells, AI_PursueDetrimentalChance, 90) // Chance while chasing targe
RULE_INT ( Spells, AI_IdleNoSpellMinRecast, 500) // AI spell recast time(MS) check when no spell is cast while idle. (min time in random)
RULE_INT ( Spells, AI_IdleNoSpellMaxRecast, 2000) // AI spell recast time(MS) check when no spell is cast while chasing target. (max time in random)
RULE_INT ( Spells, AI_IdleBeneficialChance, 100) // Chance while idle to do a beneficial spell on self or others.
RULE_BOOL ( Spells, SHDProcIDOffByOne, true) // pre June 2009 SHD spell procs were off by 1, they stopped doing this in June 2009 (so UF+ spell files need this false)
RULE_CATEGORY_END()
+6
View File
@@ -83,6 +83,7 @@
#define ServerOP_QGlobalUpdate 0x0063
#define ServerOP_QGlobalDelete 0x0064
#define ServerOP_DepopPlayerCorpse 0x0065
#define ServerOP_RequestTellQueue 0x0066 // client asks for it's tell queues
#define ServerOP_RaidAdd 0x0100 //in use
#define ServerOP_RaidRemove 0x0101 //in use
@@ -348,6 +349,7 @@ struct ServerChannelMessage_Struct {
uint16 chan_num;
uint32 guilddbid;
uint16 language;
uint8 queued; // 0 = not queued, 1 = queued, 2 = queue full, 3 = offline
char message[0];
};
@@ -1250,6 +1252,10 @@ struct ReloadWorld_Struct{
uint32 Option;
};
struct ServerRequestTellQueue_Struct {
char name[64];
};
#pragma pack()
#endif