| 1 |
/* |
| 2 |
* The Mana World |
| 3 |
* Copyright (C) 2004 The Mana World Development Team |
| 4 |
* |
| 5 |
* This file is part of The Mana World. |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or |
| 10 |
* any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef MAIN_H |
| 23 |
#define MAIN_H |
| 24 |
|
| 25 |
/** |
| 26 |
* \mainpage |
| 27 |
* |
| 28 |
* \section Introduction Introduction |
| 29 |
* |
| 30 |
* This is the documentation for the client of The Mana World |
| 31 |
* (http://themanaworld.org). It is always a work in progress, with the intent |
| 32 |
* to make it easier for new developers to grow familiar with the source code. |
| 33 |
* |
| 34 |
* \section General General information |
| 35 |
* |
| 36 |
* During the game, the current Map is displayed by the main Viewport, which |
| 37 |
* is the bottom-most widget in the WindowContainer. Aside the viewport, the |
| 38 |
* window container keeps track of all the \link Window Windows\endlink |
| 39 |
* displayed during the game. It is the <i>top</i> widget for Guichan. |
| 40 |
* |
| 41 |
* A Map is composed of several layers of \link Image Images\endlink (tiles), |
| 42 |
* a layer with collision information and \link Sprite Sprites\endlink. The |
| 43 |
* sprites define the visible part of \link Being Beings\endlink and |
| 44 |
* \link FloorItem FloorItems\endlink, they are drawn from top to bottom |
| 45 |
* by the map, interleaved with the tiles in the fringe layer. |
| 46 |
* |
| 47 |
* The server is split up into an \link Net::AccountServer account |
| 48 |
* server\endlink, a \link Net::ChatServer chat server\endlink and a \link |
| 49 |
* Net::GameServer game server\endlink. There may be multiple game servers. |
| 50 |
* Handling of incoming messages is spread over several \link MessageHandler |
| 51 |
* MessageHanders\endlink. |
| 52 |
*/ |
| 53 |
|
| 54 |
#include <string> |
| 55 |
|
| 56 |
#ifdef HAVE_CONFIG_H |
| 57 |
#include "../config.h" |
| 58 |
#elif defined WIN32 |
| 59 |
#include "winver.h" |
| 60 |
#elif defined __APPLE__ |
| 61 |
#define PACKAGE_VERSION "0.0.29.1" |
| 62 |
#endif |
| 63 |
|
| 64 |
#ifdef PACKAGE_VERSION |
| 65 |
#ifdef TMWSERV_SUPPORT |
| 66 |
#define FULL_VERSION "v" PACKAGE_VERSION " (tmwserv)" |
| 67 |
#else |
| 68 |
#define FULL_VERSION "v" PACKAGE_VERSION " [Intel Mac] (eAthena)" |
| 69 |
#endif |
| 70 |
#else |
| 71 |
#define FULL_VERSION "Unknown Version" |
| 72 |
#endif |
| 73 |
|
| 74 |
#ifndef PKG_DATADIR |
| 75 |
#define PKG_DATADIR "" |
| 76 |
#endif |
| 77 |
|
| 78 |
#define MAX_CHARACTER_COUNT 3 |
| 79 |
|
| 80 |
#ifdef TWMSERV_SUPPORT |
| 81 |
#define DEFAULT_PORT 9601 |
| 82 |
#else |
| 83 |
#define DEFAULT_PORT 6901 |
| 84 |
#endif |
| 85 |
|
| 86 |
/* |
| 87 |
* Client different States |
| 88 |
*/ |
| 89 |
enum State { |
| 90 |
STATE_ERROR = -1, |
| 91 |
STATE_START = 0, |
| 92 |
STATE_CHOOSE_SERVER, |
| 93 |
STATE_CONNECT_SERVER, |
| 94 |
STATE_LOGIN, |
| 95 |
STATE_LOGIN_ATTEMPT, |
| 96 |
STATE_WORLD_SELECT, // 5 |
| 97 |
STATE_WORLD_SELECT_ATTEMPT, |
| 98 |
STATE_UPDATE, |
| 99 |
STATE_LOAD_DATA, |
| 100 |
STATE_GET_CHARACTERS, |
| 101 |
STATE_CHAR_SELECT, // 10 |
| 102 |
STATE_CONNECT_GAME, |
| 103 |
STATE_GAME, |
| 104 |
STATE_CHANGE_MAP, // Switch map-server/gameserver |
| 105 |
STATE_LOGIN_ERROR, |
| 106 |
STATE_ACCOUNTCHANGE_ERROR, // 15 |
| 107 |
STATE_REGISTER, |
| 108 |
STATE_REGISTER_ATTEMPT, |
| 109 |
STATE_CHANGEPASSWORD, |
| 110 |
STATE_CHANGEPASSWORD_ATTEMPT, |
| 111 |
STATE_CHANGEPASSWORD_SUCCESS, // 20 |
| 112 |
STATE_CHANGEEMAIL, |
| 113 |
STATE_CHANGEEMAIL_ATTEMPT, |
| 114 |
STATE_CHANGEEMAIL_SUCCESS, |
| 115 |
STATE_UNREGISTER, |
| 116 |
STATE_UNREGISTER_ATTEMPT, // 25 |
| 117 |
STATE_UNREGISTER_SUCCESS, |
| 118 |
STATE_SWITCH_SERVER, |
| 119 |
STATE_SWITCH_LOGIN, |
| 120 |
STATE_SWITCH_CHARACTER, |
| 121 |
STATE_LOGOUT_ATTEMPT, // 30 |
| 122 |
STATE_WAIT, |
| 123 |
STATE_EXIT, |
| 124 |
STATE_FORCE_QUIT |
| 125 |
}; |
| 126 |
|
| 127 |
extern State state; |
| 128 |
extern std::string errorMessage; |
| 129 |
|
| 130 |
#endif |