_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
games.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 2005 by Edward Haase and Jimmy Salmon
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __GAMES_H__
31 #define __GAMES_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Defines
37 ----------------------------------------------------------------------------*/
38 
39 #define MAX_GAME_PASSWORD_LENGTH 16
40 #define MAX_DESCRIPTION_LENGTH 64
41 #define MAX_MAP_LENGTH 64
42 
43 /*----------------------------------------------------------------------------
44 -- Declarations
45 ----------------------------------------------------------------------------*/
46 
47 class Session;
48 
49 class GameData
50 {
51 public:
52  char IP[16];
53  char Port[6];
56  char Map[MAX_MAP_LENGTH + 1];
57  int OpenSlots;
58  int MaxSlots;
59 
60  char *GameName;
61  char *Version;
62 
65  int ID;
66  int Started;
67 
70 };
71 
72 extern int GameID;
73 
74 /*----------------------------------------------------------------------------
75 -- Functions
76 ----------------------------------------------------------------------------*/
77 
78 extern void CreateGame(Session *session, char *description, char *map,
79  char *players, char *ip, char *port, char *password);
80 extern int CancelGame(Session *session);
81 extern int StartGame(Session *session);
82 extern int JoinGame(Session *session, int id, char *password);
83 extern int PartGame(Session *session);
84 extern void ListGames(Session *session);
85 
87 
88 #endif // __GAMES_H__
int CancelGame(Session *session)
Definition: games.cpp:98
int StartGame(Session *session)
Definition: games.cpp:130
char Password[MAX_GAME_PASSWORD_LENGTH+1]
Definition: games.h:54
int MaxSlots
Definition: games.h:58
int PartGame(Session *session)
Definition: games.cpp:179
char Description[MAX_DESCRIPTION_LENGTH+1]
Definition: games.h:55
#define MAX_GAME_PASSWORD_LENGTH
Definition: games.h:39
void CreateGame(Session *session, char *description, char *map, char *players, char *ip, char *port, char *password)
Definition: games.cpp:58
int Started
Definition: games.h:66
int ID
Definition: games.h:65
char Port[6]
Definition: games.h:53
#define MAX_DESCRIPTION_LENGTH
Definition: games.h:40
#define MAX_MAP_LENGTH
Definition: games.h:41
int JoinGame(Session *session, int id, char *password)
Definition: games.cpp:143
Session * Sessions[16]
Definition: games.h:63
GameData * Prev
Definition: games.h:69
char IP[16]
Definition: games.h:52
int NumSessions
Definition: games.h:64
Definition: netdriver.h:84
void ListGames(Session *session)
Definition: games.cpp:223
int GameID
Definition: games.cpp:49
char * Version
Definition: games.h:61
int OpenSlots
Definition: games.h:57
GameData * Next
Definition: games.h:68
Definition: games.h:49
char Map[MAX_MAP_LENGTH+1]
Definition: games.h:56
char * GameName
Definition: games.h:60
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.