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

Function MultiSendDoneObjects

Descent3/multi_server.cpp:967–992  ·  view source on GitHub ↗

Tells the client that we're done sending objects

Source from the content-addressed store, hash-verified

965
966// Tells the client that we're done sending objects
967void MultiSendDoneObjects(int slot) {
968 int size;
969 uint8_t data[MAX_GAME_DATA_SIZE];
970 int count = 0;
971
972 mprintf(0, "Sending done objects\n");
973
974 // Take the level checksum and clone it.
975 MD5 playermd5(*Level_md5);
976 // Generate a random salt value and send it to the client.
977 int salt = ps_rand();
978 // process the salt through the md5
979 playermd5.update(salt);
980 // process the ships through the md5
981 for (int i = 0; i < MAX_SHIPS; i++)
982 if (Ships[i].used)
983 MultiProcessShipChecksum(&playermd5, i);
984 // save the digest value in the netplayer slot
985 playermd5.digest(NetPlayers[slot].digest);
986
987 size = START_DATA(MP_DONE_OBJECTS, data, &count);
988 MultiAddInt(salt, data, &count);
989 END_DATA(count, data, size);
990
991 nw_SendReliable(NetPlayers[slot].reliable_socket, data, count);
992}
993
994// Tells the client that we're done sending the world states
995void MultiSendDoneWorldStates(int slot) {

Callers 1

MultiDoServerFrameFunction · 0.85

Calls 8

ps_randFunction · 0.85
MultiProcessShipChecksumFunction · 0.85
START_DATAFunction · 0.85
MultiAddIntFunction · 0.85
END_DATAFunction · 0.85
nw_SendReliableFunction · 0.85
digestMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected