MCPcopy Create free account
hub / github.com/ZDoom/Raze / NetUpdate

Function NetUpdate

source/core/d_net.cpp:947–1364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

945int gametime;
946
947void NetUpdate (void)
948{
949 int lowtic;
950 int nowtime;
951 int newtics;
952 int i,j;
953 int realstart;
954 uint8_t *cmddata;
955 bool resendOnly;
956
957 GC::CheckGC();
958
959 if (ticdup == 0)
960 {
961 return;
962 }
963
964 // check time
965 nowtime = I_GetTime ();
966 newtics = nowtime - gametime;
967 gametime = nowtime;
968
969 if (newtics <= 0) // nothing new to update
970 {
971 GetPackets ();
972 return;
973 }
974
975 if (skiptics <= newtics)
976 {
977 newtics -= skiptics;
978 skiptics = 0;
979 }
980 else
981 {
982 skiptics -= newtics;
983 newtics = 0;
984 }
985
986 // build new ticcmds for console player
987 for (i = 0; i < newtics; i++)
988 {
989 I_StartTic ();
990 D_ProcessEvents ();
991 if (pauseext || (maketic - gametic) / ticdup >= BACKUPTICS/2-1)
992 break; // can't hold any more
993
994 //Printf ("mk:%i ",maketic);
995 G_BuildTiccmd (&localcmds[maketic % LOCALCMDTICS]);
996 maketic++;
997
998 if (ticdup == 1 || maketic == 0)
999 {
1000 Net_NewMakeTic ();
1001 }
1002 else
1003 {
1004 // Once ticdup tics have been collected, average their movements

Callers 2

DrawOverlaysFunction · 0.85
TryRunTicsFunction · 0.85

Calls 15

CheckGCFunction · 0.85
I_GetTimeFunction · 0.85
GetPacketsFunction · 0.85
D_ProcessEventsFunction · 0.85
G_BuildTiccmdFunction · 0.85
Net_NewMakeTicFunction · 0.85
PlayerIsGoneFunction · 0.85
I_ErrorFunction · 0.85
WriteWordFunction · 0.85
WriteUserCmdMessageFunction · 0.85
HSendPacketFunction · 0.85
setNewWeaponMethod · 0.80

Tested by

no test coverage detected