From: Keith F. <ven...@us...> - 2002-05-08 06:11:20
|
Update of /cvsroot/planeshift/planeshift/src/server In directory usw-pr-cvs1:/tmp/cvs-serv10309 Modified Files: psserverchar.cpp psdatabase.cpp guildmanager.cpp Log Message: Fixed a couple of guild command update problems. Index: psserverchar.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/psserverchar.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** psserverchar.cpp 8 May 2002 01:56:54 -0000 1.16 --- psserverchar.cpp 8 May 2002 06:11:17 -0000 1.17 *************** *** 164,168 **** } ! CPrintf("Player was added to database\n"); psCharApprovedMessage app(me->clientnum); msghandler->SendMessage(app.msg); --- 164,168 ---- } ! CPrintf("Player %d was added to database\n",playerID); psCharApprovedMessage app(me->clientnum); msghandler->SendMessage(app.msg); Index: psdatabase.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/psdatabase.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** psdatabase.cpp 7 May 2002 06:38:58 -0000 1.27 --- psdatabase.cpp 8 May 2002 06:11:17 -0000 1.28 *************** *** 422,429 **** --- 422,433 ---- { lasterror = GetLastSQLError(); + printf("GetGuildLevelName didn't work for guild %d and level %d. Error: %s\n", + guild,level,(const char *)lasterror); return false; } levelname = result[0][0]; + printf("Player is %s (%d) in guild %d.\n",(const char *)levelname,level,guild); + return true; } Index: guildmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/guildmanager.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** guildmanager.cpp 5 May 2002 13:04:41 -0000 1.21 --- guildmanager.cpp 8 May 2002 06:11:17 -0000 1.22 *************** *** 269,272 **** --- 269,276 ---- return false; } + if (level!=1 && !database->UpdateGuildLevel(client->GetPlayerID(),level)) + { + return false; + } client->SetGuildID(guild); *************** *** 439,443 **** char text[1024]; cs_snprintf(text,sizeof(text),"Guild level %d is now called: %s", msg.level, (const char *)msg.levelname ); ! psChatMessage guildmsg(-1,"System",text,CHAT_GUILD); chatserver->HandleMessage(guildmsg.msg); } --- 443,447 ---- char text[1024]; cs_snprintf(text,sizeof(text),"Guild level %d is now called: %s", msg.level, (const char *)msg.levelname ); ! psChatMessage guildmsg(clientnum,"System",text,CHAT_GUILD); chatserver->HandleMessage(guildmsg.msg); } *************** *** 497,504 **** csString levelname; database->GetGuildLevelName(guild, msg.level,levelname); char text[1024]; cs_snprintf(text,sizeof(text),"%s has been promoted to '%s'", (const char *)msg.player, (const char *)levelname); ! psChatMessage guildmsg(-1,"System",text,CHAT_GUILD); chatserver->HandleMessage(guildmsg.msg); } --- 501,511 ---- csString levelname; database->GetGuildLevelName(guild, msg.level,levelname); + Client *client2 = clients->Find(msg.player); + if (client2) + client2->SetPlayerGuildLevel(levelname); char text[1024]; cs_snprintf(text,sizeof(text),"%s has been promoted to '%s'", (const char *)msg.player, (const char *)levelname); ! psChatMessage guildmsg(clientnum,"System",text,CHAT_GUILD); chatserver->HandleMessage(guildmsg.msg); } |