Fix multiplayer.

git-svn-id: https://svn.eduke32.com/eduke32@1668 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2010-07-05 08:10:15 +00:00
parent d62c6117fe
commit 1374de7492
3 changed files with 10 additions and 12 deletions

View file

@ -487,7 +487,8 @@ typedef struct {
char name[32];
} DukePlayer_t;
extern char tempbuf[2048], packbuf[4096], menutextbuf[128];
#define PACKBUF_SIZE 65535
extern char tempbuf[2048], packbuf[PACKBUF_SIZE], menutextbuf[128];
extern int32_t g_spriteGravity;

View file

@ -1002,8 +1002,6 @@ void Net_ParseServerPacket(ENetEvent * event)
TRAVERSE_CONNECT(i)
{
if (g_player[i].playerquitflag == 0) continue;
g_player[i].ps->dead_flag = *(int16_t *)&packbuf[j];
j += sizeof(int16_t);
@ -1017,12 +1015,12 @@ void Net_ParseServerPacket(ENetEvent * event)
nsyn = (input_t *)&inputfifo[0][0];
Bmemcpy(&nsyn[i], &packbuf[j], sizeof(input_t));
Bmemcpy(&nsyn[i], &packbuf[j], offsetof(input_t, filler));
j += offsetof(input_t, filler);
if (TEST_SYNC_KEY(nsyn[i].bits,SK_GAMEQUIT)) g_player[i].playerquitflag = 0;
g_player[i].movefifoend++;
if (g_player[i].playerquitflag == 0) continue;
// Bmemcpy(&g_player[i].ps->opos.x, &g_player[i].ps->pos.x, sizeof(vec3_t));
@ -1962,8 +1960,6 @@ void Net_UpdateClients(void)
TRAVERSE_CONNECT(i)
{
if (g_player[i].playerquitflag == 0) continue;
Bmemcpy(&osyn[i], &nsyn[i], offsetof(input_t, filler));
*(int16_t *)&packbuf[j] = g_player[i].ps->dead_flag;
@ -1971,6 +1967,7 @@ void Net_UpdateClients(void)
Bmemcpy(&packbuf[j], &nsyn[i], offsetof(input_t, filler));
j += offsetof(input_t, filler);
if (g_player[i].playerquitflag == 0) continue;
Bmemcpy(&packbuf[j], &g_player[i].ps->pos.x, sizeof(vec3_t) * 2);
j += sizeof(vec3_t) * 2;
@ -2229,7 +2226,7 @@ void Net_UpdateClients(void)
}
{
char buf[4096];
char *buf = alloca(PACKBUF_SIZE);
j = qlz_compress((char *)(packbuf)+1, (char *)buf, j, state_compress);
Bmemcpy((char *)(packbuf)+1, (char *)buf, j);
@ -11834,9 +11831,9 @@ MAIN_LOOP_RESTART:
OSD_DispatchQueued();
if (!(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO)) && totalclock >= ototalclock+TICSPERFRAME)
{
CONTROL_ProcessBinds();
if (!(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO)) && totalclock >= ototalclock+TICSPERFRAME)
{
CONTROL_ProcessBinds();
getinput(myconnectindex);
avg.fvel += loc.fvel;

View file

@ -48,7 +48,7 @@ int16_t cyclers[MAXCYCLERS][6],g_numCyclers;
char *ScriptQuotes[MAXQUOTES], *ScriptQuoteRedefinitions[MAXQUOTES];
char tempbuf[2048], packbuf[4096], menutextbuf[128], buf[1024];
char tempbuf[2048], packbuf[PACKBUF_SIZE], menutextbuf[128], buf[1024];
int16_t camsprite;
int16_t g_mirrorWall[64], g_mirrorSector[64], g_mirrorCount;