From: Matze B. <mat...@us...> - 2002-03-27 20:21:25
|
Update of /cvsroot/planeshift/planeshift/src/server In directory usw-pr-cvs1:/tmp/cvs-serv12138/src/server Modified Files: authentserver.cpp command.cpp psserverdr.cpp usermanager.cpp Log Message: some changes to allow proper kicking and disconnecting of clients Index: authentserver.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/authentserver.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** authentserver.cpp 26 Mar 2002 21:52:32 -0000 1.28 --- authentserver.cpp 27 Mar 2002 20:21:19 -0000 1.29 *************** *** 164,168 **** psDisconnectMessage msg(client->GetClientNum(), client->GetEntity()->GetID()); ! pMsgQueue->Broadcast(msg.msg); } --- 164,168 ---- psDisconnectMessage msg(client->GetClientNum(), client->GetEntity()->GetID()); ! pMsgQueue->Broadcast(msg.msg, NetBase::BC_FINALPACKET); } Index: command.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/command.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** command.cpp 27 Mar 2002 17:17:23 -0000 1.31 --- command.cpp 27 Mar 2002 20:21:20 -0000 1.32 *************** *** 85,93 **** CPrintf ("\nList:\n"); CPrintf (COL_GREEN " Name CNum Ready\n" COL_NORMAL); ! BinaryTreeIterator<Client>* i = ! psserver->GetNetThread()->GetConnections()->GetIterator(); if (psserver->GetNetThread()->GetConnections()->Count() == 0 || !i) { CPrintf (" *** List Empty ***\n"); return 0; } --- 85,96 ---- CPrintf ("\nList:\n"); CPrintf (COL_GREEN " Name CNum Ready\n" COL_NORMAL); ! ! ClientConnectionSet* clients = psserver->GetNetThread()->GetConnections(); ! int key = clients->GetLock(); ! BinaryTreeIterator<Client>* i = clients->GetIterator(key); if (psserver->GetNetThread()->GetConnections()->Count() == 0 || !i) { CPrintf (" *** List Empty ***\n"); + clients->ReleaseLock(key); return 0; } *************** *** 100,103 **** --- 103,107 ---- client->GetEntity() ? "ok" : "loading"); } + clients->ReleaseLock(key); return 0; Index: psserverdr.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/psserverdr.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** psserverdr.cpp 27 Mar 2002 17:17:23 -0000 1.8 --- psserverdr.cpp 27 Mar 2002 20:21:20 -0000 1.9 *************** *** 71,76 **** { msghandler->Broadcast(me); - CPrintf (","); - fflush(stdout); } --- 71,74 ---- Index: usermanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/usermanager.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** usermanager.cpp 27 Mar 2002 17:17:23 -0000 1.7 --- usermanager.cpp 27 Mar 2002 20:21:20 -0000 1.8 *************** *** 89,93 **** void UserManager::Who(psUserCmdMessage& ,Client* ,int clientnum) { ! BinaryTreeIterator<Client> *loop = clients->GetIterator(); if (!loop) --- 89,94 ---- void UserManager::Who(psUserCmdMessage& ,Client* ,int clientnum) { ! int key = clients->GetLock(); ! BinaryTreeIterator<Client> *loop = clients->GetIterator(key); if (!loop) *************** *** 95,98 **** --- 96,100 ---- psSystemMessage newmsg(clientnum,"Internal server error in Who command processor.\n"); msghandler->SendMessage(newmsg.msg); + clients->ReleaseLock(key); return; } *************** *** 107,110 **** --- 109,113 ---- msghandler->SendMessage(newmsg.msg); } + clients->ReleaseLock(key); return; |