Prints out a message we got from the server
| 4928 | |
| 4929 | // Prints out a message we got from the server |
| 4930 | void MultiDoMessageFromServer(uint8_t *data) { |
| 4931 | static int sound_id = -2; |
| 4932 | int count = 0; |
| 4933 | char message[255]; |
| 4934 | |
| 4935 | SKIP_HEADER(data, &count); |
| 4936 | |
| 4937 | ddgr_color color = MultiGetInt(data, &count); |
| 4938 | uint8_t len = MultiGetByte(data, &count); |
| 4939 | |
| 4940 | memcpy(message, &data[count], len); |
| 4941 | count += len; |
| 4942 | |
| 4943 | // Play the player hud message sound |
| 4944 | if (sound_id == -2) { |
| 4945 | sound_id = FindSoundName("Hudmessage"); |
| 4946 | } |
| 4947 | |
| 4948 | if (sound_id > -1) { |
| 4949 | Sound_system.Play2dSound(sound_id); |
| 4950 | } |
| 4951 | |
| 4952 | AddColoredHUDMessage(color, "%s", message); // added "%s" because message could have % signs, formatting issue. |
| 4953 | } |
| 4954 | |
| 4955 | // Sends a message from the server to the client |
| 4956 | void MultiSendMessageFromServer(int color, char *message, int to) { |
no test coverage detected