2019-12-02 20:05:19 +00:00
|
|
|
#pragma once
|
2015-05-19 21:54:34 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
|
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-10-09 16:09:05 +00:00
|
|
|
BEGIN_SW_NS
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-08-16 08:40:20 +00:00
|
|
|
#define SYNC_TEST 0
|
2015-05-19 21:54:34 +00:00
|
|
|
#define MAXSYNCBYTES 16
|
|
|
|
|
2020-04-14 19:59:45 +00:00
|
|
|
#pragma pack(push,1)
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-04-14 19:59:45 +00:00
|
|
|
typedef struct
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2015-05-19 21:58:29 +00:00
|
|
|
uint8_t PacketType; // first byte is always packet type
|
|
|
|
uint8_t FirstPlayerIndex;
|
|
|
|
SWBOOL AutoAim;
|
|
|
|
uint8_t Level;
|
|
|
|
uint8_t Episode;
|
|
|
|
int8_t Skill;
|
|
|
|
uint8_t GameType;
|
|
|
|
SWBOOL HurtTeammate;
|
|
|
|
SWBOOL SpawnMarkers;
|
|
|
|
SWBOOL TeamPlay;
|
|
|
|
uint8_t KillLimit;
|
|
|
|
uint8_t TimeLimit;
|
|
|
|
SWBOOL Nuke;
|
2015-05-19 21:54:34 +00:00
|
|
|
} PACKET_NEW_GAME,*PACKET_NEW_GAMEp;
|
|
|
|
|
2020-04-14 19:59:45 +00:00
|
|
|
#pragma pack(pop)
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2015-05-19 21:58:29 +00:00
|
|
|
extern uint8_t syncstat[MAXSYNCBYTES];
|
|
|
|
extern SWBOOL PredictionOn;
|
2015-05-19 21:54:34 +00:00
|
|
|
extern PLAYER PredictPlayer;
|
|
|
|
extern PLAYERp ppp;
|
|
|
|
extern short predictangpos[MOVEFIFOSIZ];
|
|
|
|
extern int predictmovefifoplc;
|
2015-05-19 21:58:29 +00:00
|
|
|
extern SWBOOL Prediction;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
void InitPrediction(PLAYERp pp);
|
|
|
|
void DoPrediction(PLAYERp ppp);
|
|
|
|
void CorrectPrediction(int actualfifoplc);
|
|
|
|
|
|
|
|
|
|
|
|
enum MultiGameTypes
|
|
|
|
{
|
|
|
|
MULTI_GAME_NONE,
|
|
|
|
MULTI_GAME_COMMBAT,
|
|
|
|
MULTI_GAME_COMMBAT_NO_RESPAWN, // JUST a place holder for menus. DO NOT USE!!!
|
|
|
|
MULTI_GAME_COOPERATIVE,
|
|
|
|
MULTI_GAME_AI_BOTS
|
|
|
|
};
|
|
|
|
|
2015-05-19 21:58:29 +00:00
|
|
|
//extern int16_t MultiGameType; // defaults to NONE
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// global net vars
|
|
|
|
// not saved in .CFG file
|
|
|
|
// used for current game
|
|
|
|
typedef struct
|
|
|
|
{
|
2015-05-19 21:58:29 +00:00
|
|
|
int32_t KillLimit;
|
|
|
|
int32_t TimeLimit;
|
|
|
|
int32_t TimeLimitClock;
|
|
|
|
int16_t MultiGameType; // used to be a stand alone global
|
|
|
|
SWBOOL TeamPlay;
|
|
|
|
SWBOOL HurtTeammate;
|
|
|
|
SWBOOL SpawnMarkers;
|
|
|
|
SWBOOL AutoAim;
|
|
|
|
SWBOOL NoRespawn; // for commbat type games
|
|
|
|
SWBOOL Nuke;
|
2015-05-19 21:54:34 +00:00
|
|
|
} gNET,*gNETp;
|
|
|
|
|
|
|
|
extern gNET gNet;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int Rules,
|
|
|
|
Level,
|
|
|
|
Enemy,
|
|
|
|
Markers,
|
|
|
|
Team,
|
|
|
|
HurtTeam,
|
|
|
|
Kill,
|
|
|
|
Time,
|
|
|
|
Color,
|
|
|
|
Nuke;
|
|
|
|
} AUTO_NET, *AUTO_NETp;
|
|
|
|
|
|
|
|
extern AUTO_NET Auto;
|
2015-05-19 21:58:29 +00:00
|
|
|
extern SWBOOL AutoNet;
|
|
|
|
|
2020-05-21 23:23:39 +00:00
|
|
|
void UpdateInputs(void);
|
2015-05-19 21:58:29 +00:00
|
|
|
void InitNetVars(void);
|
|
|
|
void InitTimingVars(void);
|
2015-05-19 21:54:34 +00:00
|
|
|
void waitforeverybody(void);
|
2015-05-19 21:58:29 +00:00
|
|
|
void InitNetPlayerOptions(void);
|
2020-08-16 08:40:20 +00:00
|
|
|
inline void SW_SendMessage(short, const char*) {}
|
2015-05-19 21:54:34 +00:00
|
|
|
void ResumeGame(void);
|
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
END_SW_NS
|