MCPcopy Create free account
hub / github.com/TurningWheel/Barony / serverUpdateHunger

Function serverUpdateHunger

src/net.cpp:1042–1063  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1040-------------------------------------------------------------------------------*/
1041
1042void serverUpdateHunger(int player)
1043{
1044 if ( multiplayer != SERVER || clientnum == player )
1045 {
1046 return;
1047 }
1048 if ( player <= 0 || player >= MAXPLAYERS )
1049 {
1050 return;
1051 }
1052 if ( client_disconnected[player] == true || players[player]->isLocalPlayer() )
1053 {
1054 return;
1055 }
1056
1057 strcpy((char*)net_packet->data, "HNGR");
1058 SDLNet_Write32(stats[player]->HUNGER, &net_packet->data[4]);
1059 net_packet->address.host = net_clients[player - 1].host;
1060 net_packet->address.port = net_clients[player - 1].port;
1061 net_packet->len = 8;
1062 sendPacketSafe(net_sock, -1, net_packet, player - 1);
1063}
1064
1065/*-------------------------------------------------------------------------------
1066

Callers 15

actFountainFunction · 0.85
actPlayerFunction · 0.85
gameLogicFunction · 0.85
item_PotionWaterFunction · 0.85
item_PotionBoozeFunction · 0.85
item_PotionJuiceFunction · 0.85
item_PotionUnstableStormFunction · 0.85
item_PotionRestoreMagicFunction · 0.85
item_FoodAutomatonFunction · 0.85
updateHungerMessagesFunction · 0.85
actSinkFunction · 0.85

Calls 2

sendPacketSafeFunction · 0.85
isLocalPlayerMethod · 0.80

Tested by

no test coverage detected