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

Function MultiStoreWorldPacket

Descent3/multi_server.cpp:1454–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1452}
1453
1454void MultiStoreWorldPacket(int slot, uint8_t *big_data, int *big_count, uint8_t *cur_data, int *cur_count,
1455 int *size_offset) {
1456 if (*big_count + *cur_count >= (MAX_GAME_DATA_SIZE - 3)) {
1457 mprintf(0, "Starting another world packet!\n");
1458 MultiAddByte(WS_END, big_data, big_count);
1459 END_DATA(*big_count, big_data, *size_offset);
1460
1461 // Send it out
1462 nw_SendReliable(NetPlayers[slot].reliable_socket, big_data, *big_count);
1463
1464 // Restart another packet
1465 *big_count = 0;
1466 *size_offset = START_DATA(MP_WORLD_STATES, big_data, big_count);
1467 }
1468
1469 memcpy(&big_data[*big_count], cur_data, *cur_count);
1470 *big_count += *cur_count;
1471 *cur_count = 0;
1472 ASSERT(*big_count < (MAX_GAME_DATA_SIZE - 3));
1473}
1474
1475doorway *GetDoorwayFromObject(int door_obj_handle);
1476// Function that sends all the changed world states to an incoming player

Callers 1

MultiSendWorldStatesFunction · 0.85

Calls 4

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

Tested by

no test coverage detected