2019-09-19 22:42:45 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
|
|
|
|
This file is part of NBlood.
|
|
|
|
|
|
|
|
NBlood is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
#pragma once
|
2019-09-07 13:15:39 +00:00
|
|
|
#include "compat.h"
|
|
|
|
#include "build.h"
|
2019-09-19 22:42:45 +00:00
|
|
|
#include "controls.h"
|
2020-08-16 11:26:57 +00:00
|
|
|
#include "mapinfo.h"
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
enum PACKETMODE {
|
|
|
|
PACKETMODE_0 = 0,
|
|
|
|
PACKETMODE_1,
|
|
|
|
PACKETMODE_2,
|
|
|
|
PACKETMODE_3,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum NETWORKMODE {
|
|
|
|
NETWORK_NONE = 0,
|
|
|
|
NETWORK_SERVER,
|
|
|
|
NETWORK_CLIENT
|
|
|
|
};
|
|
|
|
|
|
|
|
#define kNetDefaultPort 23513
|
|
|
|
|
2020-08-16 11:26:57 +00:00
|
|
|
extern MapRecord *gStartNewGame;
|
2019-09-19 22:42:45 +00:00
|
|
|
extern PACKETMODE gPacketMode;
|
|
|
|
extern int gNetFifoTail;
|
|
|
|
extern int gNetFifoHead[8];
|
|
|
|
extern int gPredictTail;
|
|
|
|
extern int gNetFifoMasterTail;
|
|
|
|
extern GINPUT gFifoInput[256][8];
|
|
|
|
extern int myMinLag[8];
|
|
|
|
extern int otherMinLag;
|
|
|
|
extern int myMaxLag;
|
|
|
|
extern int gSendCheckTail;
|
|
|
|
extern int gCheckTail;
|
|
|
|
extern int gInitialNetPlayers;
|
|
|
|
extern int gBufferJitter;
|
|
|
|
extern int gPlayerReady[8];
|
|
|
|
extern bool bNoResend;
|
|
|
|
extern bool gRobust;
|
|
|
|
extern bool bOutOfSync;
|
|
|
|
extern bool ready2send;
|
|
|
|
extern NETWORKMODE gNetMode;
|
|
|
|
extern char gNetAddress[32];
|
|
|
|
extern int gNetPort;
|
|
|
|
|
|
|
|
|
2020-08-03 18:01:08 +00:00
|
|
|
void netReset(void);
|
2019-09-19 22:42:45 +00:00
|
|
|
void netResetToSinglePlayer(void);
|
2020-08-25 21:04:08 +00:00
|
|
|
inline void netWaitForEveryone(char a1) {}
|
|
|
|
inline void netGetPackets(void) {}
|
|
|
|
inline void CalcGameChecksum(void) {}
|
|
|
|
inline void netBroadcastPlayerLogoff(int nPlayer) {}
|
|
|
|
inline void netBroadcastMyLogoff(bool bRestart) {}
|
2019-09-19 22:42:45 +00:00
|
|
|
void netInitialize(bool bConsole);
|
|
|
|
void netBroadcastPlayerInfo(int nPlayer);
|
2020-08-25 21:04:08 +00:00
|
|
|
inline void netCheckSync(void) {}
|
2019-09-19 22:42:45 +00:00
|
|
|
void netMasterUpdate(void);
|
|
|
|
void netGetInput(void);
|
|
|
|
void netPlayerQuit(int nPlayer);
|
|
|
|
void netDeinitialize(void);
|
2019-09-22 06:39:22 +00:00
|
|
|
|
|
|
|
END_BLD_NS
|