Merge branch 'send_money_company' into jgrpp
This commit is contained in:
@@ -748,7 +748,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendCommand(const CommandPacke
|
||||
* @param msg The actual message.
|
||||
* @param data Arbitrary extra data.
|
||||
*/
|
||||
NetworkRecvStatus ServerNetworkGameSocketHandler::SendChat(NetworkAction action, ClientID client_id, bool self_send, const char *msg, int64 data)
|
||||
NetworkRecvStatus ServerNetworkGameSocketHandler::SendChat(NetworkAction action, ClientID client_id, bool self_send, const char *msg, NetworkTextMessageData data)
|
||||
{
|
||||
if (this->status < STATUS_PRE_ACTIVE) return NETWORK_RECV_STATUS_OKAY;
|
||||
|
||||
@@ -758,7 +758,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendChat(NetworkAction action,
|
||||
p->Send_uint32(client_id);
|
||||
p->Send_bool (self_send);
|
||||
p->Send_string(msg);
|
||||
p->Send_uint64(data);
|
||||
data.send(p);
|
||||
|
||||
this->SendPacket(p);
|
||||
return NETWORK_RECV_STATUS_OKAY;
|
||||
@@ -1270,7 +1270,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_ACK(Packet *p)
|
||||
* @param data Arbitrary data.
|
||||
* @param from_admin Whether the origin is an admin or not.
|
||||
*/
|
||||
void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, const char *msg, ClientID from_id, int64 data, bool from_admin)
|
||||
void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, const char *msg, ClientID from_id, NetworkTextMessageData data, bool from_admin)
|
||||
{
|
||||
NetworkClientSocket *cs;
|
||||
const NetworkClientInfo *ci, *ci_own, *ci_to;
|
||||
@@ -1368,15 +1368,17 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||
DEBUG(net, 0, "[server] received unknown chat destination type %d. Doing broadcast instead", desttype);
|
||||
/* FALL THROUGH */
|
||||
case DESTTYPE_BROADCAST:
|
||||
case DESTTYPE_BROADCAST_SS:
|
||||
FOR_ALL_CLIENT_SOCKETS(cs) {
|
||||
cs->SendChat(action, from_id, false, msg, data);
|
||||
cs->SendChat(action, from_id, (desttype == DESTTYPE_BROADCAST_SS && from_id == cs->client_id), msg, data);
|
||||
}
|
||||
|
||||
NetworkAdminChat(action, desttype, from_id, msg, data, from_admin);
|
||||
|
||||
ci = NetworkClientInfo::GetByClientID(from_id);
|
||||
if (ci != NULL) {
|
||||
NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
|
||||
NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas),
|
||||
(desttype == DESTTYPE_BROADCAST_SS && from_id == CLIENT_ID_SERVER), ci->client_name, msg, data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1395,7 +1397,8 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_CHAT(Packet *p)
|
||||
char msg[NETWORK_CHAT_LENGTH];
|
||||
|
||||
p->Recv_string(msg, NETWORK_CHAT_LENGTH);
|
||||
int64 data = p->Recv_uint64();
|
||||
NetworkTextMessageData data;
|
||||
data.recv(p);
|
||||
|
||||
NetworkClientInfo *ci = this->GetInfo();
|
||||
switch (action) {
|
||||
|
Reference in New Issue
Block a user