diff --git a/bin/conf/PseuWoW.conf.default b/bin/conf/PseuWoW.conf.default index 066fd4a..1d7896d 100644 --- a/bin/conf/PseuWoW.conf.default +++ b/bin/conf/PseuWoW.conf.default @@ -27,6 +27,7 @@ showopcodes=3 // Hide opcodes which is coming very frequently? +// Has only an effect if you have showopcodes > 0 // 1 - yes // 0 - No hidefreqopcodes=1 @@ -74,7 +75,10 @@ enablecli=1 // like "Hi" and "What do you think of x" etc. enablechatai=1 -// show ping responses & ping time +// show ping responses notifyping=1 +// shows the opcodes pseuwow sends to the server +showmyopcodes=0 + diff --git a/src/Client/PseuWoW.cpp b/src/Client/PseuWoW.cpp index 11328cd..d07e50c 100644 --- a/src/Client/PseuWoW.cpp +++ b/src/Client/PseuWoW.cpp @@ -196,7 +196,15 @@ void PseuInstance::Update() } if(_wsession && _wsession->IsValid()) { - _wsession->Update(); // update the worldSESSION, which will update the worldsocket itself + try + { + _wsession->Update(); // update the worldSESSION, which will update the worldsocket itself + } + catch (...) + { + logerror("Unhandled exception in WorldSession::Update()"); + } + } if(_wsession && _wsession->DeleteMe()) { diff --git a/src/Client/World/Item.h b/src/Client/World/Item.h index 401ff44..81ab938 100644 --- a/src/Client/World/Item.h +++ b/src/Client/World/Item.h @@ -409,9 +409,6 @@ public: private: uint8 _slot; // Bag *_bag; // not yet implemented - // ItemProto *_proto; // not yet implemented. - // is it good to use a proto here? - }; diff --git a/src/Client/World/Object.cpp b/src/Client/World/Object.cpp index f2e9804..e05ee70 100644 --- a/src/Client/World/Object.cpp +++ b/src/Client/World/Object.cpp @@ -25,6 +25,7 @@ void Object::_InitValues() void Object::_Create( uint64 guid ) { + //ASSERT(_valuescount > 0); if(!_uint32values) _InitValues(); @@ -48,6 +49,20 @@ void WorldObject::SetPosition(float x, float y, float z, float o, uint16 _map) _o = o; _m = _map; } +/* +void WorldObject::_Create( uint64 guid, uint32 mapid, float x, float y, float z, float ang, uint32 entry ) +{ +Object::_Create(guid); + + SetUInt32Value( OBJECT_FIELD_ENTRY,entry); + + _m = mapid; + _x = x; + _y = y; + _z = z; + _o = ang; +} +*/ void WorldSession::_HandleDestroyObjectOpcode(WorldPacket& recvPacket) { diff --git a/src/Client/World/Object.h b/src/Client/World/Object.h index 41823a2..6eeebd8 100644 --- a/src/Client/World/Object.h +++ b/src/Client/World/Object.h @@ -34,6 +34,7 @@ enum TYPEID class Object { public: + Object(); virtual ~Object(); inline const uint64 GetGUID() const { return GetUInt64Value(0); } inline const uint32 GetGUIDLow() const { return GetUInt32Value(0); } @@ -71,7 +72,6 @@ public: } protected: - Object(); void _Create(uint64 guid); void _InitValues(void); diff --git a/src/Client/World/Unit.cpp b/src/Client/World/Unit.cpp new file mode 100644 index 0000000..2729f43 --- /dev/null +++ b/src/Client/World/Unit.cpp @@ -0,0 +1,9 @@ +#include "common.h" +#include "Unit.h" + +Unit::Unit() : WorldObject() +{ + _type = TYPE_UNIT; + _typeid = TYPEID_UNIT; +} + diff --git a/src/Client/World/Unit.h b/src/Client/World/Unit.h new file mode 100644 index 0000000..05202cc --- /dev/null +++ b/src/Client/World/Unit.h @@ -0,0 +1,15 @@ +#ifndef _UNIT_H +#define _UNIT_H + +#include "Object.h" + +class Unit : public WorldObject +{ +public: + Unit(); +private: + +}; + + +#endif \ No newline at end of file diff --git a/src/Client/World/UpdateData.cpp b/src/Client/World/UpdateData.cpp index 1d7b3b3..3fe20ed 100644 --- a/src/Client/World/UpdateData.cpp +++ b/src/Client/World/UpdateData.cpp @@ -118,6 +118,9 @@ void WorldSession::_HandleUpdateObjectOpcode(WorldPacket& recvPacket) uint8 objtypeid, flags; recvPacket >> objtypeid >> flags; logdebug("Create Object type %u with guid "I64FMT,objtypeid,uguid); + //Object *obj = new Object; + //obj->_Create(uguid); + //objmgr.Add((Object*)obj); this->_MovementUpdate(objtypeid, uguid, recvPacket); // i think thats the wrong place for this [FG] // Double checked - seems right - if i really am wrong, please correct [Mini] diff --git a/src/Client/World/WorldSession.cpp b/src/Client/World/WorldSession.cpp index ab3b885..3fd40cc 100644 --- a/src/Client/World/WorldSession.cpp +++ b/src/Client/World/WorldSession.cpp @@ -107,7 +107,16 @@ void WorldSession::Update(void) { if (table[i].opcode == packet->GetOpcode()) { - (this->*table[i].handler)(*packet); + try + { + (this->*table[i].handler)(*packet); + } + catch (...) + { + logerror("Exception while handling opcode %u!",packet->GetOpcode()); + logerror("Data: pktsize=%u, handler=0x%X queuesize=%u",packet->size(),table[i].handler,pktQueue.size()); + } + known=true; break; } @@ -129,6 +138,7 @@ void WorldSession::Update(void) logcustom(1,YELLOW,">> Opcode %u [%s] (%s)", packet->GetOpcode(), LookupName(packet->GetOpcode(),g_worldOpcodeNames), known ? "Known" : "UNKNOWN"); } delete packet; + known=false; } _DoTimedActions(); @@ -422,11 +432,23 @@ void WorldSession::_HandleMessageChatOpcode(WorldPacket& recvPacket) } else if (type==CHAT_MSG_CHANNEL ) { - logcustom(0,WHITE,"CHANNEL [%s]: %s [%s]: %s",channel.c_str(),plrname.c_str(),LookupName(lang,langNames),msg.c_str()); + logcustom(0,WHITE,"CHANNEL: [%s]: %s [%s]: %s",channel.c_str(),plrname.c_str(),LookupName(lang,langNames),msg.c_str()); + } + else if (type==CHAT_MSG_SAY ) + { + logcustom(0,WHITE,"CHAT: %s [%s]: %s",plrname.c_str(),LookupName(lang,langNames),msg.c_str()); + } + else if (type==CHAT_MSG_YELL ) + { + logcustom(0,WHITE,"CHAT: %s yells [%s]: %s ",plrname.c_str(),LookupName(lang,langNames),msg.c_str()); + } + else if (type==CHAT_MSG_WHISPER_INFORM ) + { + logcustom(0,WHITE,"TO %s [%s]: %s",plrname.c_str(),LookupName(lang,langNames),msg.c_str()); } else { - logcustom(0,WHITE,"CHAT: %s [%s]: %s",plrname.c_str(),LookupName(lang,langNames),msg.c_str()); + logcustom(0,WHITE,"UNK CHAT TYPE (%u): %s [%s]: %s",type,plrname.c_str(),LookupName(lang,langNames),msg.c_str()); } if(target_guid!=_myGUID && msg.length()>1 && msg.at(0)=='-' && GetInstance()->GetConf()->allowgamecmd) diff --git a/src/PseuWoW.vcproj b/src/PseuWoW.vcproj index d93e3a0..124ca7d 100644 --- a/src/PseuWoW.vcproj +++ b/src/PseuWoW.vcproj @@ -308,6 +308,12 @@ + + + +