Revert "Chat Feature"

This reverts commit 95e454232a.
This commit is contained in:
JadeShrineMaiden 2020-08-19 18:43:24 +01:00
parent 95e454232a
commit a17b72b0b3
3 changed files with 7 additions and 25 deletions

View File

@ -18,6 +18,7 @@ enum SHARDPACKETID {
P_CL2FE_GM_REQ_PC_SET_VALUE = 318767211, P_CL2FE_GM_REQ_PC_SET_VALUE = 318767211,
P_CL2FE_REQ_SEND_FREECHAT_MESSAGE = 318767111, P_CL2FE_REQ_SEND_FREECHAT_MESSAGE = 318767111,
P_CL2FE_REQ_PC_AVATAR_EMOTES_CHAT = 318767184, P_CL2FE_REQ_PC_AVATAR_EMOTES_CHAT = 318767184,
P_CL2FE_REQ_PC_EXIT = 318767106,
// shard 2 client // shard 2 client
P_FE2CL_REP_PC_ENTER_SUCC = 822083586, P_FE2CL_REP_PC_ENTER_SUCC = 822083586,
@ -32,7 +33,8 @@ enum SHARDPACKETID {
P_FE2CL_REP_PC_GOTO_SUCC = 822083633, P_FE2CL_REP_PC_GOTO_SUCC = 822083633,
P_FE2CL_GM_REP_PC_SET_VALUE = 822083781, P_FE2CL_GM_REP_PC_SET_VALUE = 822083781,
P_FE2CL_REP_PC_AVATAR_EMOTES_CHAT = 822083730, P_FE2CL_REP_PC_AVATAR_EMOTES_CHAT = 822083730,
P_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC = 822083602 P_FE2CL_REP_PC_EXIT_SUCC = 822083589,
P_FE2CL_PC_MOTD_LOGIN = 822083793
}; };
#define REGISTER_SHARD_PACKET(pactype, handlr) CNShardServer::ShardPackets[pactype] = handlr; #define REGISTER_SHARD_PACKET(pactype, handlr) CNShardServer::ShardPackets[pactype] = handlr;

View File

@ -547,12 +547,9 @@ struct sP_FE2CL_REP_PC_EXIT_SUCC {
struct sP_FE2CL_PC_MOTD_LOGIN { struct sP_FE2CL_PC_MOTD_LOGIN {
int8_t iType; int8_t iType;
uint16_t szSystemMsg[512]; uint16_t szSystemMsg[512];
struct sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC {
int32_t iPC_ID;
char16_t szFreeChat[128];
int32_t iEmoteCode;
}; };
#pragma pack(pop) #pragma pack(pop)
#endif

View File

@ -10,25 +10,8 @@ void ChatManager::init() {
void ChatManager::chatHandler(CNSocket* sock, CNPacketData* data) { void ChatManager::chatHandler(CNSocket* sock, CNPacketData* data) {
sP_CL2FE_REQ_SEND_FREECHAT_MESSAGE* chat = (sP_CL2FE_REQ_SEND_FREECHAT_MESSAGE*)data->buf; sP_CL2FE_REQ_SEND_FREECHAT_MESSAGE* chat = (sP_CL2FE_REQ_SEND_FREECHAT_MESSAGE*)data->buf;
PlayerView plr = PlayerManager::players[sock];
DEBUGLOG( // stubbed for now
std::cout << "\tChat Message: " << U16toU8(chat->szFreeChat) << std::endl;
)
sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC* resp = (sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC*)xmalloc(sizeof(sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC));
resp->iPC_ID = PlayerManager::players[sock].plr.iID;
memcpy(resp->szFreeChat, chat->szFreeChat, sizeof(chat->szFreeChat));
resp->iEmoteCode = chat->iEmoteCode;
sock->sendPacket(new CNPacketData((void*)resp, P_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC, sizeof(sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC), sock->getFEKey()));
for (CNSocket* otherSock : plr.viewable) {
sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC* resp = (sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC*)xmalloc(sizeof(sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC));
resp->iPC_ID = PlayerManager::players[sock].plr.iID;
memcpy(resp->szFreeChat, chat->szFreeChat, sizeof(chat->szFreeChat));
resp->iEmoteCode = chat->iEmoteCode;
otherSock->sendPacket(new CNPacketData((void*)resp, P_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC, sizeof(sP_FE2CL_REP_SEND_FREECHAT_MESSAGE_SUCC), otherSock->getFEKey()));
}
} }
void ChatManager::emoteHandler(CNSocket* sock, CNPacketData* data) { void ChatManager::emoteHandler(CNSocket* sock, CNPacketData* data) {