UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
e_server.cpp
Go to the documentation of this file.
1
5
6
/*
7
Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18
See the GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24
*/
25
26
#include "
e_server.h
"
27
#include "
../../client.h
"
28
#include "
../cl_hud.h
"
32
static
void
CL_NextRound_f
(
void
)
33
{
34
/* can't end round if we are not in battlescape */
35
if
(!
CL_BattlescapeRunning
())
36
return
;
37
38
/* can't end round if we're not active */
39
if
(!
cls
.isOurRound()) {
40
HUD_DisplayMessage
(
_
(
"It is not your turn!"
));
41
return
;
42
}
43
44
/* send endround */
45
dbuffer
msg;
46
NET_WriteByte
(&msg,
clc_endround
);
47
NET_WriteMsg
(
cls
.netStream, msg);
48
}
49
50
void
CL_ServerEventsInit
(
void
)
51
{
52
Cmd_AddCommand
(
"nextround"
,
CL_NextRound_f
,
N_
(
"End current turn."
));
53
}
CL_NextRound_f
void CL_NextRound_f(void)
CL_BattlescapeRunning
bool CL_BattlescapeRunning(void)
Check whether we already have actors spawned on the battlefield.
Definition
cl_battlescape.cpp:82
HUD_DisplayMessage
void HUD_DisplayMessage(const char *text)
Displays a message on the hud.
Definition
cl_hud.cpp:138
cl_hud.h
HUD related routines.
cls
client_static_t cls
Definition
cl_main.cpp:83
_
#define _(String)
Definition
cl_shared.h:44
N_
#define N_(String)
Definition
cl_shared.h:46
dbuffer
Definition
dbuffer.h:20
client.h
Primary header for client.
Cmd_AddCommand
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
Definition
cmd.cpp:744
clc_endround
@ clc_endround
Definition
common.h:176
CL_NextRound_f
static void CL_NextRound_f(void)
Finishes the current turn of the player in battlescape and starts the turn for the next team.
Definition
e_server.cpp:32
CL_ServerEventsInit
void CL_ServerEventsInit(void)
Definition
e_server.cpp:50
e_server.h
Events that are send from the client to the server.
NET_WriteMsg
void NET_WriteMsg(struct net_stream *s, dbuffer &buf)
Enqueue the buffer in the net stream for ONE client.
Definition
netpack.cpp:569
NET_WriteByte
void NET_WriteByte(dbuffer *buf, byte c)
Definition
netpack.cpp:39
src
client
battlescape
events
e_server.cpp
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0