From: Anders R. <ma...@us...> - 2006-02-22 22:19:49
|
Update of /cvsroot/planeshift/planeshift/src/npcclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8277/src/npcclient Modified Files: networkmgr.cpp Log Message: - Normalized all MSG_TYPES to use MSGTYPE_ for prefix. - Added PSF for a number of messages. - Created uniq number for petition request message. Used different format for same id before => NETVERSION BUMPED - Added force of character type to NPC for importnpc. Index: networkmgr.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/npcclient/networkmgr.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** networkmgr.cpp 6 Feb 2006 21:46:35 -0000 1.104 --- networkmgr.cpp 22 Feb 2006 22:19:43 -0000 1.105 *************** *** 47,61 **** ready = false; connected = false; ! msghandler->Subscribe(this,MSGTYPENPCLIST); ! msghandler->Subscribe(this,MSGTYPEMAPLIST); ! msghandler->Subscribe(this,MSGTYPECELPERSIST); ! msghandler->Subscribe(this,MSGTYPEALLENTITYPOS); ! msghandler->Subscribe(this,MSGTYPENPCOMMANDLIST); ! msghandler->Subscribe(this,MSG_PERSIST_ACTOR); ! msghandler->Subscribe(this,MSG_PERSIST_ITEM); ! msghandler->Subscribe(this,MSG_REMOVE_OBJECT); ! msghandler->Subscribe(this,MSGTYPEDISCONNECT); ! msghandler->Subscribe(this,MSGTYPEWEATHER); ! msghandler->Subscribe(this,MSGTYPEMSGSTRINGS); msghandler->Subscribe(this,MSGTYPE_NEW_NPC); msghandler->Subscribe(this,MSGTYPE_NPC_SETOWNER); --- 47,61 ---- ready = false; connected = false; ! msghandler->Subscribe(this,MSGTYPE_NPCLIST); ! msghandler->Subscribe(this,MSGTYPE_MAPLIST); ! msghandler->Subscribe(this,MSGTYPE_CELPERSIST); ! msghandler->Subscribe(this,MSGTYPE_ALLENTITYPOS); ! msghandler->Subscribe(this,MSGTYPE_NPCOMMANDLIST); ! msghandler->Subscribe(this,MSGTYPE_PERSIST_ACTOR); ! msghandler->Subscribe(this,MSGTYPE_PERSIST_ITEM); ! msghandler->Subscribe(this,MSGTYPE_REMOVE_OBJECT); ! msghandler->Subscribe(this,MSGTYPE_DISCONNECT); ! msghandler->Subscribe(this,MSGTYPE_WEATHER); ! msghandler->Subscribe(this,MSGTYPE_MSGSTRINGS); msghandler->Subscribe(this,MSGTYPE_NEW_NPC); msghandler->Subscribe(this,MSGTYPE_NPC_SETOWNER); *************** *** 71,85 **** if (msghandler) { ! msghandler->Unsubscribe(this,MSGTYPENPCLIST); ! msghandler->Unsubscribe(this,MSGTYPEMAPLIST); ! msghandler->Unsubscribe(this,MSGTYPECELPERSIST); ! msghandler->Unsubscribe(this,MSGTYPEALLENTITYPOS); ! msghandler->Unsubscribe(this,MSGTYPENPCOMMANDLIST); ! msghandler->Unsubscribe(this,MSG_PERSIST_ACTOR); ! msghandler->Unsubscribe(this,MSG_PERSIST_ITEM); ! msghandler->Unsubscribe(this,MSG_REMOVE_OBJECT); ! msghandler->Unsubscribe(this,MSGTYPEDISCONNECT); ! msghandler->Unsubscribe(this,MSGTYPEWEATHER); ! msghandler->Unsubscribe(this,MSGTYPEMSGSTRINGS); msghandler->Unsubscribe(this,MSGTYPE_NPC_SETOWNER); } --- 71,85 ---- if (msghandler) { ! msghandler->Unsubscribe(this,MSGTYPE_NPCLIST); ! msghandler->Unsubscribe(this,MSGTYPE_MAPLIST); ! msghandler->Unsubscribe(this,MSGTYPE_CELPERSIST); ! msghandler->Unsubscribe(this,MSGTYPE_ALLENTITYPOS); ! msghandler->Unsubscribe(this,MSGTYPE_NPCOMMANDLIST); ! msghandler->Unsubscribe(this,MSGTYPE_PERSIST_ACTOR); ! msghandler->Unsubscribe(this,MSGTYPE_PERSIST_ITEM); ! msghandler->Unsubscribe(this,MSGTYPE_REMOVE_OBJECT); ! msghandler->Unsubscribe(this,MSGTYPE_DISCONNECT); ! msghandler->Unsubscribe(this,MSGTYPE_WEATHER); ! msghandler->Unsubscribe(this,MSGTYPE_MSGSTRINGS); msghandler->Unsubscribe(this,MSGTYPE_NPC_SETOWNER); } *************** *** 117,121 **** switch ( me->GetType() ) { ! case MSGTYPEMAPLIST: { connected = true; --- 117,121 ---- switch ( me->GetType() ) { ! case MSGTYPE_MAPLIST: { connected = true; *************** *** 126,130 **** break; } ! case MSGTYPENPCLIST: { ReceiveNPCList(me); --- 126,130 ---- break; } ! case MSGTYPE_NPCLIST: { ReceiveNPCList(me); *************** *** 132,136 **** break; } ! case MSG_PERSIST_ACTOR: { HandleActor( me ); --- 132,136 ---- break; } ! case MSGTYPE_PERSIST_ACTOR: { HandleActor( me ); *************** *** 138,142 **** } ! case MSG_PERSIST_ITEM: { HandleItem( me ); --- 138,142 ---- } ! case MSGTYPE_PERSIST_ITEM: { HandleItem( me ); *************** *** 144,148 **** } ! case MSG_REMOVE_OBJECT: { HandleObjectRemoval( me ); --- 144,148 ---- } ! case MSGTYPE_REMOVE_OBJECT: { HandleObjectRemoval( me ); *************** *** 150,164 **** } ! case MSGTYPEALLENTITYPOS: { HandlePositionUpdates(me); break; } ! case MSGTYPENPCOMMANDLIST: { HandlePerceptions(me); break; } ! case MSGTYPEMSGSTRINGS: { csRef<iEngine> engine = CS_QUERY_REGISTRY(npcclient->GetObjectReg(), iEngine); --- 150,164 ---- } ! case MSGTYPE_ALLENTITYPOS: { HandlePositionUpdates(me); break; } ! case MSGTYPE_NPCOMMANDLIST: { HandlePerceptions(me); break; } ! case MSGTYPE_MSGSTRINGS: { csRef<iEngine> engine = CS_QUERY_REGISTRY(npcclient->GetObjectReg(), iEngine); *************** *** 171,180 **** break; } ! case MSGTYPEDISCONNECT: { HandleDisconnect(me); break; } ! case MSGTYPEWEATHER: { HandleTimeUpdate(me); --- 171,180 ---- break; } ! case MSGTYPE_DISCONNECT: { HandleDisconnect(me); break; } ! case MSGTYPE_WEATHER: { HandleTimeUpdate(me); |