2020-08-18 20:42:30 +00:00
|
|
|
#ifndef _CNSS_HPP
|
|
|
|
#define _CNSS_HPP
|
|
|
|
|
|
|
|
#include "CNProtocol.hpp"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
enum SHARDPACKETID {
|
|
|
|
// client 2 shard
|
|
|
|
P_CL2FE_REQ_PC_ENTER = 318767105,
|
|
|
|
P_CL2FE_REQ_PC_LOADING_COMPLETE = 318767245,
|
2020-08-19 01:34:39 +00:00
|
|
|
P_CL2FE_REP_LIVE_CHECK = 318767221,
|
2020-08-20 15:43:37 +00:00
|
|
|
P_CL2FE_REQ_NANO_ACTIVE = 318767119,
|
2020-08-18 20:42:30 +00:00
|
|
|
P_CL2FE_REQ_PC_MOVE = 318767107,
|
|
|
|
P_CL2FE_REQ_PC_STOP = 318767108,
|
|
|
|
P_CL2FE_REQ_PC_JUMP = 318767109,
|
|
|
|
P_CL2FE_REQ_PC_MOVEPLATFORM = 318767168,
|
|
|
|
P_CL2FE_REQ_PC_GOTO = 318767124,
|
|
|
|
P_CL2FE_GM_REQ_PC_SET_VALUE = 318767211,
|
|
|
|
P_CL2FE_REQ_SEND_FREECHAT_MESSAGE = 318767111,
|
|
|
|
P_CL2FE_REQ_PC_AVATAR_EMOTES_CHAT = 318767184,
|
2020-08-19 17:43:24 +00:00
|
|
|
P_CL2FE_REQ_PC_EXIT = 318767106,
|
2020-08-18 20:42:30 +00:00
|
|
|
|
|
|
|
// shard 2 client
|
2020-08-20 15:43:37 +00:00
|
|
|
P_FE2CL_REP_NANO_ACTIVE_SUCC = 822083624,
|
2020-08-18 20:42:30 +00:00
|
|
|
P_FE2CL_REP_PC_ENTER_SUCC = 822083586,
|
|
|
|
P_FE2CL_REP_PC_LOADING_COMPLETE_SUCC = 822083833,
|
2020-08-19 01:34:39 +00:00
|
|
|
P_FE2CL_REQ_LIVE_CHECK = 822083792,
|
2020-08-18 20:42:30 +00:00
|
|
|
P_FE2CL_PC_NEW = 822083587,
|
|
|
|
P_FE2CL_PC_MOVE = 822083592,
|
|
|
|
P_FE2CL_PC_STOP = 822083593,
|
|
|
|
P_FE2CL_PC_JUMP = 822083594,
|
|
|
|
P_FE2CL_PC_EXIT = 822083590,
|
|
|
|
P_FE2CL_PC_MOVEPLATFORM = 822083704,
|
|
|
|
P_FE2CL_REP_PC_GOTO_SUCC = 822083633,
|
|
|
|
P_FE2CL_GM_REP_PC_SET_VALUE = 822083781,
|
2020-08-19 17:47:25 +00:00
|
|
|
P_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC = 822083602,
|
2020-08-19 17:22:54 +00:00
|
|
|
P_FE2CL_REP_PC_AVATAR_EMOTES_CHAT = 822083730,
|
2020-08-19 17:43:24 +00:00
|
|
|
P_FE2CL_REP_PC_EXIT_SUCC = 822083589,
|
|
|
|
P_FE2CL_PC_MOTD_LOGIN = 822083793
|
2020-08-18 20:42:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define REGISTER_SHARD_PACKET(pactype, handlr) CNShardServer::ShardPackets[pactype] = handlr;
|
|
|
|
|
|
|
|
class CNShardServer : public CNServer {
|
|
|
|
private:
|
|
|
|
static void handlePacket(CNSocket* sock, CNPacketData* data);
|
2020-08-19 00:11:31 +00:00
|
|
|
|
2020-08-18 20:42:30 +00:00
|
|
|
public:
|
|
|
|
static std::map<uint32_t, PacketHandler> ShardPackets;
|
|
|
|
|
|
|
|
CNShardServer(uint16_t p);
|
|
|
|
|
|
|
|
void killConnection(CNSocket* cns);
|
2020-08-19 01:34:39 +00:00
|
|
|
void onTimer();
|
2020-08-18 20:42:30 +00:00
|
|
|
};
|
|
|
|
|
2020-08-19 17:43:24 +00:00
|
|
|
#endif
|