UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
e_server.cpp
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 2002-2020 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;
48 }
49 
51 {
52  Cmd_AddCommand("nextround", CL_NextRound_f, N_("End current turn."));
53 }
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
Definition: cmd.cpp:744
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
bool isOurRound() const
Definition: client.h:106
#define _(String)
Definition: cl_shared.h:43
void CL_ServerEventsInit(void)
Definition: e_server.cpp:50
Events that are send from the client to the server.
client_static_t cls
Definition: cl_main.cpp:83
struct net_stream * netStream
Definition: client.h:74
bool CL_BattlescapeRunning(void)
Check whether we already have actors spawned on the battlefield.
void NET_WriteByte(dbuffer *buf, byte c)
Definition: netpack.cpp:39
#define N_(String)
Definition: cl_shared.h:45
void HUD_DisplayMessage(const char *text)
Displays a message on the hud.
Definition: cl_hud.cpp:138
void NET_WriteMsg(struct net_stream *s, dbuffer &buf)
Enqueue the buffer in the net stream for ONE client.
Definition: netpack.cpp:569