Some groundwork for replacing the ACE based WorldSocket handling

This commit is contained in:
leak committed 2014-07-06 01:26:29 +02:00
1 parent 021e18d152
commit 7befb26625
13 files changed
+579 -1819

No files matched your search

+12 -12
View File
@@ -57,7 +57,7 @@ class Transport;
class Unit;
class Vehicle;
class WorldPacket;
class WorldSocket;
class WorldTcpSession;
class WorldObject;
struct AchievementCriteriaData;
@@ -214,30 +214,30 @@ class ServerScript : public ScriptObject
public:
// Called when reactive socket I/O is started (WorldSocketMgr).
// Called when reactive socket I/O is started (WorldTcpSessionMgr).
virtual void OnNetworkStart() { }
// Called when reactive I/O is stopped.
virtual void OnNetworkStop() { }
// Called when a remote socket establishes a connection to the server. Do not store the socket object.
virtual void OnSocketOpen(WorldSocket* /*socket*/) { }
virtual void OnSocketOpen(WorldTcpSession* /*socket*/) { }
// Called when a socket is closed. Do not store the socket object, and do not rely on the connection
// being open; it is not.
virtual void OnSocketClose(WorldSocket* /*socket*/, bool /*wasNew*/) { }
virtual void OnSocketClose(WorldTcpSession* /*socket*/, bool /*wasNew*/) { }
// Called when a packet is sent to a client. The packet object is a copy of the original packet, so reading
// and modifying it is safe.
virtual void OnPacketSend(WorldSocket* /*socket*/, WorldPacket& /*packet*/) { }
virtual void OnPacketSend(WorldTcpSession* /*socket*/, WorldPacket& /*packet*/) { }
// Called when a (valid) packet is received by a client. The packet object is a copy of the original packet, so
// reading and modifying it is safe.
virtual void OnPacketReceive(WorldSocket* /*socket*/, WorldPacket& /*packet*/) { }
virtual void OnPacketReceive(WorldTcpSession* /*socket*/, WorldPacket& /*packet*/) { }
// Called when an invalid (unknown opcode) packet is received by a client. The packet is a reference to the orignal
// packet; not a copy. This allows you to actually handle unknown packets (for whatever purpose).
virtual void OnUnknownPacketReceive(WorldSocket* /*socket*/, WorldPacket& /*packet*/) { }
virtual void OnUnknownPacketReceive(WorldTcpSession* /*socket*/, WorldPacket& /*packet*/) { }
};
class WorldScript : public ScriptObject
@@ -908,11 +908,11 @@ class ScriptMgr
void OnNetworkStart();
void OnNetworkStop();
void OnSocketOpen(WorldSocket* socket);
void OnSocketClose(WorldSocket* socket, bool wasNew);
void OnPacketReceive(WorldSocket* socket, WorldPacket packet);
void OnPacketSend(WorldSocket* socket, WorldPacket packet);
void OnUnknownPacketReceive(WorldSocket* socket, WorldPacket packet);
void OnSocketOpen(WorldTcpSession* socket);
void OnSocketClose(WorldTcpSession* socket, bool wasNew);
void OnPacketReceive(WorldTcpSession* socket, WorldPacket packet);
void OnPacketSend(WorldTcpSession* socket, WorldPacket packet);
void OnUnknownPacketReceive(WorldTcpSession* socket, WorldPacket packet);
public: /* WorldScript */