[go: up one dir, main page]

Menu

[904618]: / src / d_netcmd.h  Maximize  Restore  History

Download this file

147 lines (111 with data), 5.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
// ----------------------------------------------------------------------------
// :oCCCCOCoc.
// .cCO8OOOOOOOOO8Oo:
// .oOO8OOOOOOOOOOOOOOOCc
// cO8888: .:oOOOOC. TM
// :888888: :CCCc .oOOOOC. ### ### #########
// C888888: .ooo: .C######## ##### ##### ###### ###### ##########
// O888888: .oO### ### ##### ##### ######## ######## #### ###
// C888888: :8O. .C########## ### #### ### ## ## ## ## #### ###
// :8@@@@8: :888c o### ### #### ### ######## ######## ##########
// :8@@@@C C@@@@ oo######## ### ## ### ###### ###### #########
// cO@@@@@@@@@@@@@@@@@Oc0
// :oO8@@@@@@@@@@Oo.
// .oCOOOOOCc. http://remood.org/
// ----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 2008-2013 GhostlyDeath <ghostlydeath@remood.org>
// <ghostlydeath@gmail.com>
// ----------------------------------------------------------------------------
// This program 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 3
// 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.
// ----------------------------------------------------------------------------
// DESCRIPTION: host/client network commands
// commands are executed through the command buffer
// like console commands
#ifndef __D_NETCMD_H__
#define __D_NETCMD_H__
// add game commands, needs cleanup
void D_RegisterClientCommands(void);
void D_SendPlayerConfig(void);
void Command_ExitGame_f(void);
/*****************************
*** EXTENDED NETWORK STUFF ***
*****************************/
/*** CONSTANTS ***/
#define MAXDNETTICCMDCOUNT 64 // Max allowed buffered tics
/*** STRUCTURES ***/
/* Define D_Prof_t */
#if !defined(__REMOOD_DPROFTDEFINED)
#define __REMOOD_DPROFTDEFINED
typedef struct D_Prof_s D_Prof_t;
#endif
/* Define ticcmd_t */
#if !defined(__REMOOD_TICCMDT_DEFINED)
typedef union ticcmd_u ticcmd_t;
#define __REMOOD_TICCMDT_DEFINED
#endif
/* Define SN_Port_t */
#if !defined(__REMOOD_SNPORT_DEFINED)
typedef struct SN_Port_s SN_Port_t;
#define __REMOOD_SNPORT_DEFINED
#endif
/* D_SplitInfo_t -- Split Screen Info */
typedef struct D_SplitInfo_s
{
bool_t Active; // Is Active
bool_t Waiting; // Waiting for fill
int32_t Console; // The console player
int32_t Display; // Display Player
uint32_t ProcessID; // Local Processing ID
D_Prof_t* Profile; // Player Profile
SN_Port_t* Port; // Control Port
bool_t DoNotSteal; // Do not steal port
tic_t PortTimeOut; // Timeout for port
bool_t JoyBound; // Joystick Bound
uint32_t JoyID; // Joystick ID
uint8_t RequestSent; // Sent join request
tic_t GiveUpAt; // Give up joining at this time
bool_t OverlayMap; // Overlay automap
bool_t MapKeyStillDown; // Automap key still down
int8_t ChatMode; // All? Spec? Team?
uint32_t ChatTargetID; // Player to talk to
tic_t ChatTimeOut; // Chat timeout
tic_t CoopSpyTime; // Time to wait to respy
tic_t TurnHeld; // Time turning is held
int32_t Scores; // Scoreboard showing
bool_t Turned180; // Did 180 degre turn
// Automap Stuff
bool_t AutomapActive; // Activated Automap
fixed_t MapZoom; // Zoom in the map
bool_t MapFreeMode; // Free movement mode
fixed_t MapPos[2]; // Map position
// Profile Select
bool_t SelProfile; // Selecting profile
D_Prof_t* AtProf; // At this profile
} D_SplitInfo_t;
/*** GLOBALS ***/
extern int g_SplitScreen; // Players in splits
extern D_SplitInfo_t g_Splits[MAXSPLITS]; // Split Information
extern bool_t g_NetDev;
extern angle_t localangle[MAXSPLITS];
extern int localaiming[MAXSPLITS]; // should be a angle_t but signed
/*** FUNCTIONS ***/
bool_t D_ScrSplitHasPlayer(const int8_t a_Player);
bool_t D_ScrSplitVisible(const int8_t a_Player);
void D_NCRemoveSplit(const int32_t a_Split, const bool_t a_Demo);
void D_NCResetSplits(const bool_t a_Demo);
int8_t D_NCSFindSplitByProcess(const uint32_t a_ID);
void D_XNetMergeTics(ticcmd_t* const a_DestCmd, const ticcmd_t* const a_SrcList, const size_t a_NumSrc);
const char* D_NCSGetPlayerName(const uint32_t a_PlayerID);
uint32_t D_CMakePureRandom(void);
void D_CMakeUUID(char* const a_Buf);
#endif