mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
if ServerID is null, it will crash the loginserver when it tries to add the new server to tblWorldServerRegistration table
This commit is contained in:
parent
79928c190b
commit
1ab3cf53e2
@ -254,7 +254,7 @@ bool DatabaseMySQL::CreateWorldRegistration(string long_name, string short_name,
|
|||||||
length = mysql_real_escape_string(db, escaped_short_name, short_name.substr(0, 100).c_str(), short_name.substr(0, 100).length());
|
length = mysql_real_escape_string(db, escaped_short_name, short_name.substr(0, 100).c_str(), short_name.substr(0, 100).length());
|
||||||
escaped_short_name[length+1] = 0;
|
escaped_short_name[length+1] = 0;
|
||||||
stringstream query(stringstream::in | stringstream::out);
|
stringstream query(stringstream::in | stringstream::out);
|
||||||
query << "SELECT max(ServerID) FROM " << server.options.GetWorldRegistrationTable();
|
query << "SELECT ifnull(max(ServerID),0) FROM " << server.options.GetWorldRegistrationTable();
|
||||||
|
|
||||||
if(mysql_query(db, query.str().c_str()) != 0)
|
if(mysql_query(db, query.str().c_str()) != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user