From: Anders R. <ma...@us...> - 2005-12-02 13:27:04
|
Update of /cvsroot/planeshift/planeshift/src/server/bulkobjects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17330/src/server/bulkobjects Modified Files: servervitals.cpp Log Message: - Fixed bug #790 where statDR dirty flags where cleared when the statDR was sent to a client that targeted a client. When the statDR than should be sent to the client the dirty flag was clear so no statDR was sent. Now forceing sending HP/HP_RATE to clients that target another player. - Created a message logging system. By setting LOG_MESSAGE every message sent and received are logged. This helped very much in finding the #790 bug. Atm only the statDR message have a implemented ToString function. All other messages are dumpt in hex. Not very usefull but you see that the message go and when you need information from that message you only have to create a ToString function and add insansiating of the message in the LogMessages function in the messages.cpp file. System have been created so that a minimum of CPU is used if LOG_MESSAGE isn't turned on. Index: servervitals.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/servervitals.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** servervitals.cpp 1 Dec 2005 22:09:34 -0000 1.14 --- servervitals.cpp 2 Dec 2005 13:26:53 -0000 1.15 *************** *** 43,51 **** statsDirty = DIRTY_VITAL_ALL; if (!statsDirty) return false; - me->Add((uint32_t)statsDirty); - if (statsDirty & DIRTY_VITAL_HP) me->Add( vitals[VITAL_HITPOINTS].value / vitals[VITAL_HITPOINTS].max ); --- 43,52 ---- statsDirty = DIRTY_VITAL_ALL; + // Allways add the stat word. Else you will not know how much to read. + me->Add((uint32_t)statsDirty); + if (!statsDirty) return false; if (statsDirty & DIRTY_VITAL_HP) me->Add( vitals[VITAL_HITPOINTS].value / vitals[VITAL_HITPOINTS].max ); *************** *** 55,59 **** if (statsDirty & DIRTY_VITAL_MANA) ! me->Add( vitals[VITAL_MANA].value / vitals[VITAL_MANA].max ); if (statsDirty & DIRTY_VITAL_MANA_RATE) me->Add( vitals[VITAL_MANA].drRate / vitals[VITAL_MANA].max ); --- 56,61 ---- if (statsDirty & DIRTY_VITAL_MANA) ! me->Add( vitals[VITAL_MANA].value / vitals[VITAL_MANA].max ); ! if (statsDirty & DIRTY_VITAL_MANA_RATE) me->Add( vitals[VITAL_MANA].drRate / vitals[VITAL_MANA].max ); |