UFO: Alien Invasion
Loading...
Searching...
No Matches
e_server.cpp
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, 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"
32static void CL_NextRound_f (void)
33{
34 /* can't end round if we are not in battlescape */
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;
47 NET_WriteMsg(cls.netStream, msg);
48}
49
51{
52 Cmd_AddCommand("nextround", CL_NextRound_f, N_("End current turn."));
53}
void CL_NextRound_f(void)
bool CL_BattlescapeRunning(void)
Check whether we already have actors spawned on the battlefield.
void HUD_DisplayMessage(const char *text)
Displays a message on the hud.
Definition cl_hud.cpp:138
HUD related routines.
client_static_t cls
Definition cl_main.cpp:83
#define _(String)
Definition cl_shared.h:44
#define N_(String)
Definition cl_shared.h:46
Primary header for client.
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
Definition common.h:176
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
void CL_ServerEventsInit(void)
Definition e_server.cpp:50
Events that are send from the client to the server.
void NET_WriteMsg(struct net_stream *s, dbuffer &buf)
Enqueue the buffer in the net stream for ONE client.
Definition netpack.cpp:569
void NET_WriteByte(dbuffer *buf, byte c)
Definition netpack.cpp:39