Change chat arbitrary data field from an int64 to a struct.

This commit is contained in:
Jonathan G Rennison
2017-03-03 22:32:33 +00:00
parent c70a60fd18
commit 3001595916
11 changed files with 38 additions and 21 deletions

View File

@@ -416,7 +416,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::SendCommand(const CommandPacke
}
/** Send a chat-packet over the network */
NetworkRecvStatus ClientNetworkGameSocketHandler::SendChat(NetworkAction action, DestType type, int dest, const char *msg, int64 data)
NetworkRecvStatus ClientNetworkGameSocketHandler::SendChat(NetworkAction action, DestType type, int dest, const char *msg, NetworkTextMessageData data)
{
Packet *p = new Packet(PACKET_CLIENT_CHAT);
@@ -424,7 +424,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::SendChat(NetworkAction action,
p->Send_uint8 (type);
p->Send_uint32(dest);
p->Send_string(msg);
p->Send_uint64(data);
data.send(p);
my_client->SendPacket(p);
return NETWORK_RECV_STATUS_OKAY;
@@ -948,7 +948,8 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CHAT(Packet *p)
ClientID client_id = (ClientID)p->Recv_uint32();
bool self_send = p->Recv_bool();
p->Recv_string(msg, NETWORK_CHAT_LENGTH);
int64 data = p->Recv_uint64();
NetworkTextMessageData data;
data.recv(p);
ci_to = NetworkClientInfo::GetByClientID(client_id);
if (ci_to == NULL) return NETWORK_RECV_STATUS_OKAY;
@@ -1248,7 +1249,7 @@ void NetworkUpdateClientName()
* @param msg The actual message.
* @param data Arbitrary extra data.
*/
void NetworkClientSendChat(NetworkAction action, DestType type, int dest, const char *msg, int64 data)
void NetworkClientSendChat(NetworkAction action, DestType type, int dest, const char *msg, NetworkTextMessageData data)
{
MyClient::SendChat(action, type, dest, msg, data);
}