MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MultiSendMessageToServer

Function MultiSendMessageToServer

Descent3/multi.cpp:5040–5060  ·  view source on GitHub ↗

Sends a message from the server to the client

Source from the content-addressed store, hash-verified

5038
5039// Sends a message from the server to the client
5040void MultiSendMessageToServer(int color, char *message, int to_who) {
5041 int count = 0;
5042 uint8_t data[MAX_GAME_DATA_SIZE];
5043 int size_offset;
5044
5045 size_offset = START_DATA(MP_MESSAGE_TO_SERVER, data, &count);
5046 MultiAddByte(Player_num, data, &count);
5047 MultiAddByte(to_who, data, &count);
5048
5049 uint8_t len = strlen(message) + 1;
5050
5051 MultiAddByte(len, data, &count);
5052
5053 memcpy(&data[count], message, len);
5054
5055 count += len;
5056
5057 END_DATA(count, data, size_offset);
5058
5059 nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count, false);
5060}
5061
5062// Executes a dll that the server says to
5063void MultiDoExecuteDLL(uint8_t *data) {

Callers 3

SendCheaterTextFunction · 0.85
SendCheaterAttemptTextFunction · 0.85
SendOffHUDInputMessageFunction · 0.85

Calls 4

START_DATAFunction · 0.85
MultiAddByteFunction · 0.85
END_DATAFunction · 0.85
nw_SendReliableFunction · 0.85

Tested by

no test coverage detected