* 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?
|
// Hide opcodes which is coming very frequently?
|
||||||
|
// Has only an effect if you have showopcodes > 0
|
||||||
// 1 - yes
|
// 1 - yes
|
||||||
// 0 - No
|
// 0 - No
|
||||||
hidefreqopcodes=1
|
hidefreqopcodes=1
|
||||||
@ -74,7 +75,10 @@ enablecli=1
|
|||||||
// like "Hi" and "What do you think of x" etc.
|
// like "Hi" and "What do you think of x" etc.
|
||||||
enablechatai=1
|
enablechatai=1
|
||||||
|
|
||||||
// show ping responses & ping time
|
// show ping responses
|
||||||
notifyping=1
|
notifyping=1
|
||||||
|
|
||||||
|
// shows the opcodes pseuwow sends to the server
|
||||||
|
showmyopcodes=0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -195,9 +195,17 @@ void PseuInstance::Update()
|
|||||||
_wsession->Start();
|
_wsession->Start();
|
||||||
}
|
}
|
||||||
if(_wsession && _wsession->IsValid())
|
if(_wsession && _wsession->IsValid())
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_wsession->Update(); // update the worldSESSION, which will update the worldsocket itself
|
_wsession->Update(); // update the worldSESSION, which will update the worldsocket itself
|
||||||
}
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
logerror("Unhandled exception in WorldSession::Update()");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if(_wsession && _wsession->DeleteMe())
|
if(_wsession && _wsession->DeleteMe())
|
||||||
{
|
{
|
||||||
delete _wsession;
|
delete _wsession;
|
||||||
|
|||||||
@ -409,9 +409,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
uint8 _slot;
|
uint8 _slot;
|
||||||
// Bag *_bag; // not yet implemented
|
// 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 )
|
void Object::_Create( uint64 guid )
|
||||||
{
|
{
|
||||||
|
//ASSERT(_valuescount > 0);
|
||||||
if(!_uint32values)
|
if(!_uint32values)
|
||||||
_InitValues();
|
_InitValues();
|
||||||
|
|
||||||
@ -48,6 +49,20 @@ void WorldObject::SetPosition(float x, float y, float z, float o, uint16 _map)
|
|||||||
_o = o;
|
_o = o;
|
||||||
_m = _map;
|
_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)
|
void WorldSession::_HandleDestroyObjectOpcode(WorldPacket& recvPacket)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -34,6 +34,7 @@ enum TYPEID
|
|||||||
class Object
|
class Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Object();
|
||||||
virtual ~Object();
|
virtual ~Object();
|
||||||
inline const uint64 GetGUID() const { return GetUInt64Value(0); }
|
inline const uint64 GetGUID() const { return GetUInt64Value(0); }
|
||||||
inline const uint32 GetGUIDLow() const { return GetUInt32Value(0); }
|
inline const uint32 GetGUIDLow() const { return GetUInt32Value(0); }
|
||||||
@ -71,7 +72,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Object();
|
|
||||||
void _Create(uint64 guid);
|
void _Create(uint64 guid);
|
||||||
void _InitValues(void);
|
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;
|
uint8 objtypeid, flags;
|
||||||
recvPacket >> objtypeid >> flags;
|
recvPacket >> objtypeid >> flags;
|
||||||
logdebug("Create Object type %u with guid "I64FMT,objtypeid,uguid);
|
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]
|
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]
|
// Double checked - seems right - if i really am wrong, please correct [Mini]
|
||||||
|
|||||||
@ -106,8 +106,17 @@ void WorldSession::Update(void)
|
|||||||
for (uint16 i = 0; table[i].handler != NULL; i++)
|
for (uint16 i = 0; table[i].handler != NULL; i++)
|
||||||
{
|
{
|
||||||
if (table[i].opcode == packet->GetOpcode())
|
if (table[i].opcode == packet->GetOpcode())
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
(this->*table[i].handler)(*packet);
|
(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;
|
known=true;
|
||||||
break;
|
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");
|
logcustom(1,YELLOW,">> Opcode %u [%s] (%s)", packet->GetOpcode(), LookupName(packet->GetOpcode(),g_worldOpcodeNames), known ? "Known" : "UNKNOWN");
|
||||||
}
|
}
|
||||||
delete packet;
|
delete packet;
|
||||||
|
known=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_DoTimedActions();
|
_DoTimedActions();
|
||||||
@ -422,11 +432,23 @@ void WorldSession::_HandleMessageChatOpcode(WorldPacket& recvPacket)
|
|||||||
}
|
}
|
||||||
else if (type==CHAT_MSG_CHANNEL )
|
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
|
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)
|
if(target_guid!=_myGUID && msg.length()>1 && msg.at(0)=='-' && GetInstance()->GetConf()->allowgamecmd)
|
||||||
|
|||||||
@ -308,6 +308,12 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath=".\Client\World\SharedDefines.h">
|
RelativePath=".\Client\World\SharedDefines.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Client\World\Unit.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Client\World\Unit.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Client\World\UpdateData.cpp">
|
RelativePath=".\Client\World\UpdateData.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user