2008-11-17 00:38:26 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
|
|
|
|
|
|
|
This file is part of Shadow Warrior version 1.2
|
|
|
|
|
|
|
|
Shadow Warrior is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
|
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_numSyncBytes = 1;
|
2008-11-21 12:14:05 +00:00
|
|
|
char g_szfirstSyncMsg[MAXSYNCBYTES][60];
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t g_foundSyncError = 0;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
static int32_t crctable[256];
|
2008-11-17 00:38:26 +00:00
|
|
|
#define updatecrc(dcrc,xz) (dcrc = (crctable[((dcrc)>>8)^((xz)&255)]^((dcrc)<<8)))
|
|
|
|
|
|
|
|
void initsynccrc(void)
|
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t i, j, k, a;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2009-02-19 16:47:54 +00:00
|
|
|
for (j=0; j<256; j++) //Calculate CRC table
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
k = (j<<8); a = 0;
|
2009-02-19 16:47:54 +00:00
|
|
|
for (i=7; i>=0; i--)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
if (((k^a)&0x8000) > 0)
|
|
|
|
a = ((a<<1)&65535) ^ 0x1021; //0x1021 = genpoly
|
|
|
|
else
|
|
|
|
a = ((a<<1)&65535);
|
|
|
|
k = ((k<<1)&65535);
|
|
|
|
}
|
|
|
|
crctable[j] = (a&65535);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
char Net_PlayerSync(void)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
int16_t i;
|
|
|
|
uint16_t crc = 0;
|
2008-11-20 14:06:36 +00:00
|
|
|
DukePlayer_t *pp;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_CONNECT(i)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
pp = g_player[i].ps;
|
|
|
|
updatecrc(crc, pp->posx & 255);
|
|
|
|
updatecrc(crc, pp->posy & 255);
|
|
|
|
updatecrc(crc, pp->posz & 255);
|
|
|
|
updatecrc(crc, pp->ang & 255);
|
|
|
|
}
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
return ((uint8_t) crc & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
char Net_PlayerSync2(void)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t i;
|
|
|
|
int32_t j, nextj;
|
|
|
|
uint16_t crc = 0;
|
2008-11-20 14:06:36 +00:00
|
|
|
DukePlayer_t *pp;
|
|
|
|
spritetype *spr;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_CONNECT(i)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
pp = g_player[i].ps;
|
|
|
|
|
|
|
|
updatecrc(crc, pp->horiz & 255);
|
|
|
|
updatecrc(crc, sprite[pp->i].extra & 255);
|
|
|
|
updatecrc(crc, pp->bobcounter & 255);
|
|
|
|
}
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_SPRITE_STAT(headspritestat[STAT_PLAYER], j, nextj)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
spr = &sprite[j];
|
|
|
|
updatecrc(crc, (spr->x) & 255);
|
|
|
|
updatecrc(crc, (spr->y) & 255);
|
|
|
|
updatecrc(crc, (spr->z) & 255);
|
|
|
|
updatecrc(crc, (spr->ang) & 255);
|
|
|
|
}
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
return ((uint8_t) crc & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
char Net_ActorSync(void)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
uint16_t crc = 0;
|
|
|
|
int32_t j, nextj;
|
2008-11-17 00:38:26 +00:00
|
|
|
spritetype *spr;
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_SPRITE_STAT(headspritestat[STAT_ACTOR], j, nextj)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
spr = &sprite[j];
|
|
|
|
updatecrc(crc, (spr->x) & 255);
|
|
|
|
updatecrc(crc, (spr->y) & 255);
|
|
|
|
updatecrc(crc, (spr->z) & 255);
|
2008-11-20 14:06:36 +00:00
|
|
|
updatecrc(crc, (spr->lotag) & 255);
|
|
|
|
updatecrc(crc, (spr->hitag) & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
updatecrc(crc, (spr->ang) & 255);
|
|
|
|
}
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_SPRITE_STAT(headspritestat[STAT_ZOMBIEACTOR], j, nextj)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
spr = &sprite[j];
|
|
|
|
updatecrc(crc, (spr->x) & 255);
|
|
|
|
updatecrc(crc, (spr->y) & 255);
|
|
|
|
updatecrc(crc, (spr->z) & 255);
|
2008-11-20 14:06:36 +00:00
|
|
|
updatecrc(crc, (spr->lotag) & 255);
|
|
|
|
updatecrc(crc, (spr->hitag) & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
updatecrc(crc, (spr->ang) & 255);
|
|
|
|
}
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
return ((uint8_t) crc & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
char Net_WeaponSync(void)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
uint16_t crc = 0;
|
|
|
|
int32_t j, nextj;
|
2008-11-17 00:38:26 +00:00
|
|
|
spritetype *spr;
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_SPRITE_STAT(headspritestat[STAT_PROJECTILE], j, nextj)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
spr = &sprite[j];
|
|
|
|
updatecrc(crc, (spr->x) & 255);
|
|
|
|
updatecrc(crc, (spr->y) & 255);
|
|
|
|
updatecrc(crc, (spr->z) & 255);
|
|
|
|
updatecrc(crc, (spr->ang) & 255);
|
|
|
|
}
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
return ((uint8_t) crc & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
char Net_MapSync(void)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
uint16_t crc = 0;
|
|
|
|
int32_t j, nextj;
|
2008-11-17 00:38:26 +00:00
|
|
|
spritetype *spr;
|
2008-11-20 14:06:36 +00:00
|
|
|
walltype *wal;
|
|
|
|
sectortype *sect;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_SPRITE_STAT(headspritestat[STAT_EFFECTOR], j, nextj)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
spr = &sprite[j];
|
|
|
|
updatecrc(crc, (spr->x) & 255);
|
|
|
|
updatecrc(crc, (spr->y) & 255);
|
|
|
|
updatecrc(crc, (spr->z) & 255);
|
|
|
|
updatecrc(crc, (spr->ang) & 255);
|
2008-11-20 14:06:36 +00:00
|
|
|
updatecrc(crc, (spr->lotag) & 255);
|
|
|
|
updatecrc(crc, (spr->hitag) & 255);
|
|
|
|
}
|
|
|
|
|
2009-02-19 16:47:54 +00:00
|
|
|
for (j=numwalls; j>=0; j--)
|
2008-11-20 14:06:36 +00:00
|
|
|
{
|
|
|
|
wal = &wall[j];
|
|
|
|
updatecrc(crc, (wal->x) & 255);
|
|
|
|
updatecrc(crc, (wal->y) & 255);
|
|
|
|
}
|
|
|
|
|
2009-02-19 16:47:54 +00:00
|
|
|
for (j=numsectors; j>=0; j--)
|
2008-11-20 14:06:36 +00:00
|
|
|
{
|
|
|
|
sect = §or[j];
|
|
|
|
updatecrc(crc, (sect->floorz) & 255);
|
|
|
|
updatecrc(crc, (sect->ceilingz) & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
return ((uint8_t) crc & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
2008-11-20 14:06:36 +00:00
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
char Net_RandomSync(void)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
uint16_t crc = 0;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
|
|
|
updatecrc(crc, randomseed & 255);
|
|
|
|
updatecrc(crc, (randomseed >> 8) & 255);
|
2008-11-20 14:06:36 +00:00
|
|
|
updatecrc(crc, g_globalRandom & 255);
|
|
|
|
updatecrc(crc, (g_globalRandom >> 8) & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
if (g_numSyncBytes == 1)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
updatecrc(crc,Net_PlayerSync() & 255);
|
|
|
|
updatecrc(crc,Net_PlayerSync2() & 255);
|
|
|
|
updatecrc(crc,Net_WeaponSync() & 255);
|
|
|
|
updatecrc(crc,Net_ActorSync() & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
return ((uint8_t) crc & 255);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
char *SyncNames[] =
|
|
|
|
{
|
2008-11-20 14:06:36 +00:00
|
|
|
"Net_CheckRandomSync",
|
|
|
|
"Net_CheckPlayerSync",
|
|
|
|
"Net_CheckPlayerSync2",
|
|
|
|
"Net_CheckWeaponSync",
|
|
|
|
"Net_CheckActorSync",
|
|
|
|
"Net_CheckMapSync",
|
2008-11-17 00:38:26 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static char(*SyncFunc[MAXSYNCBYTES + 1])(void) =
|
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
Net_RandomSync,
|
|
|
|
Net_PlayerSync,
|
|
|
|
Net_PlayerSync2,
|
|
|
|
Net_WeaponSync,
|
|
|
|
Net_ActorSync,
|
|
|
|
Net_MapSync,
|
2008-11-17 00:38:26 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
void Net_GetSyncStat(void)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t i;
|
2008-11-17 00:38:26 +00:00
|
|
|
playerdata_t *pp = &g_player[myconnectindex];
|
2009-01-09 09:29:17 +00:00
|
|
|
uint32_t val;
|
|
|
|
static uint32_t count;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
|
|
|
if (numplayers < 2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; SyncFunc[i]; i++)
|
|
|
|
{
|
|
|
|
pp->syncval[pp->syncvalhead & (SYNCFIFOSIZ - 1)][i] = (*SyncFunc[i])();
|
|
|
|
}
|
|
|
|
|
|
|
|
val = pp->syncval[pp->syncvalhead & (SYNCFIFOSIZ - 1)][0];
|
|
|
|
count += val;
|
|
|
|
|
|
|
|
pp->syncvalhead++;
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Sync Message print
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
void Net_DisplaySyncMsg(void)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t i, j;
|
|
|
|
static uint32_t moveCount = 0;
|
|
|
|
extern uint32_t g_moveThingsCount;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
|
|
|
// if (!SyncPrintMode)
|
|
|
|
// return;
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
if (numplayers < 2)
|
2008-11-17 00:38:26 +00:00
|
|
|
return;
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
for (i = 0; i < g_numSyncBytes; i++)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
// syncstat is NON 0 - out of sync
|
|
|
|
if (syncstat[i] != 0)
|
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
if (g_numSyncBytes > 1)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-02-02 01:49:14 +00:00
|
|
|
Bsprintf(tempbuf, "Out Of Sync - %s", SyncNames[i]);
|
2008-11-20 14:06:36 +00:00
|
|
|
printext256(4L, 100L + (i * 8), 31, 1, tempbuf, 0);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
if (!g_foundSyncError && g_szfirstSyncMsg[i][0] == '\0')
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
// g_foundSyncError one so test all of them and then never test again
|
|
|
|
g_foundSyncError = TRUE;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
|
|
|
// save off loop count
|
2008-11-21 12:14:05 +00:00
|
|
|
moveCount = g_moveThingsCount;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
for (j = 0; j < g_numSyncBytes; j++)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
if (syncstat[j] != 0 && g_szfirstSyncMsg[j][0] == '\0')
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-02-02 01:49:14 +00:00
|
|
|
Bsprintf(tempbuf, "Out Of Sync - %s", SyncNames[j]);
|
2008-11-21 12:14:05 +00:00
|
|
|
strcpy(g_szfirstSyncMsg[j], tempbuf);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
// print out the g_szfirstSyncMsg message you got
|
|
|
|
for (i = 0; i < g_numSyncBytes; i++)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
if (g_szfirstSyncMsg[i][0] != '\0')
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
if (g_numSyncBytes > 1)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-02-02 01:49:14 +00:00
|
|
|
Bsprintf(tempbuf, "FIRST %s", g_szfirstSyncMsg[i]);
|
2008-11-20 14:06:36 +00:00
|
|
|
printext256(4L, 44L + (i * 8), 31, 1, tempbuf, 0);
|
2009-02-02 01:49:14 +00:00
|
|
|
Bsprintf(tempbuf, "moveCount %d",moveCount);
|
2008-11-20 14:06:36 +00:00
|
|
|
printext256(4L, 52L + (i * 8), 31, 1, tempbuf, 0);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-11-20 14:06:36 +00:00
|
|
|
printext256(4L,100L,31,0,"Out Of Sync - Please restart game",0);
|
2008-11-17 00:38:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// if (syncstate != 0)
|
|
|
|
// printext256(68L, 92L, 1, 31, "Missed Network packet!", 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-02-02 01:49:14 +00:00
|
|
|
static inline void Net_AddSyncData(int32_t *j)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t sb;
|
|
|
|
int32_t count = 0;
|
2008-11-17 00:38:26 +00:00
|
|
|
|
|
|
|
// sync testing
|
|
|
|
while (g_player[myconnectindex].syncvalhead != syncvaltail && count++ < 4)
|
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
for (sb = 0; sb < g_numSyncBytes; sb++)
|
2008-11-17 00:38:26 +00:00
|
|
|
packbuf[(*j)++] = g_player[myconnectindex].syncval[syncvaltail & (SYNCFIFOSIZ - 1)][sb];
|
|
|
|
|
|
|
|
syncvaltail++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-02 01:49:14 +00:00
|
|
|
void Net_GetSyncData(char *packbuf, int32_t packbufleng, int32_t *j, int32_t otherconnectindex)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t sb, i;
|
|
|
|
extern int32_t syncvaltail, syncvaltottail;
|
2008-11-17 00:38:26 +00:00
|
|
|
playerdata_t *ppo = &g_player[otherconnectindex];
|
|
|
|
char found = 0;
|
|
|
|
|
|
|
|
// have had problems with this routine crashing when players quit
|
|
|
|
// games.
|
|
|
|
|
|
|
|
// if ready2send is not set then don't try to get sync info
|
|
|
|
|
|
|
|
if (!ready2send)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Suspect that its trying to traverse the connect list
|
|
|
|
// for a player that does not exist. This tries to take care of that
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_CONNECT(i)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
if (otherconnectindex == i)
|
|
|
|
found = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// sync testing
|
|
|
|
//while ((*j) != packbufleng) // changed this on Kens suggestion
|
|
|
|
while ((*j) < packbufleng)
|
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
for (sb = 0; sb < g_numSyncBytes; sb++)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
ppo->syncval[ppo->syncvalhead & (SYNCFIFOSIZ - 1)][sb] = packbuf[(*j)++];
|
|
|
|
}
|
|
|
|
ppo->syncvalhead++;
|
|
|
|
}
|
|
|
|
|
|
|
|
// update syncstat
|
|
|
|
// if any of the syncstat vars is non-0 then there is a problem
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_CONNECT(i)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
if (g_player[i].syncvalhead == syncvaltottail)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-11-21 12:14:05 +00:00
|
|
|
//for (sb = 0; sb < g_numSyncBytes; sb++)
|
2008-11-17 00:38:26 +00:00
|
|
|
// syncstat[sb] = 0;
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
for (i = connectpoint2[connecthead]; i >= 0; i = connectpoint2[i])
|
|
|
|
{
|
2008-11-21 12:14:05 +00:00
|
|
|
for (sb = 0; sb < g_numSyncBytes; sb++)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
if (g_player[i].syncval[syncvaltottail & (SYNCFIFOSIZ - 1)][sb] != g_player[connecthead].syncval[syncvaltottail & (SYNCFIFOSIZ - 1)][sb])
|
|
|
|
{
|
|
|
|
syncstat[sb] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
syncvaltottail++;
|
|
|
|
|
2008-11-20 14:06:36 +00:00
|
|
|
TRAVERSE_CONNECT(i)
|
2008-11-17 00:38:26 +00:00
|
|
|
{
|
|
|
|
if (g_player[i].syncvalhead == syncvaltottail)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|