* added some error handling
* chat msg formatting updates * misc stuff
This commit is contained in:
parent
f4148cefc1
commit
2d90dc3cfe
@ -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
|
||||
|
||||
|
||||
|
||||
@ -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())
|
||||
{
|
||||
|
||||
@ -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?
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
9
src/Client/World/Unit.cpp
Normal file
9
src/Client/World/Unit.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "common.h"
|
||||
#include "Unit.h"
|
||||
|
||||
Unit::Unit() : WorldObject()
|
||||
{
|
||||
_type = TYPE_UNIT;
|
||||
_typeid = TYPEID_UNIT;
|
||||
}
|
||||
|
||||
15
src/Client/World/Unit.h
Normal file
15
src/Client/World/Unit.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef _UNIT_H
|
||||
#define _UNIT_H
|
||||
|
||||
#include "Object.h"
|
||||
|
||||
class Unit : public WorldObject
|
||||
{
|
||||
public:
|
||||
Unit();
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@ -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]
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -308,6 +308,12 @@
|
||||
<File
|
||||
RelativePath=".\Client\World\SharedDefines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Client\World\Unit.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Client\World\Unit.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Client\World\UpdateData.cpp">
|
||||
</File>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user