summaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-09-30 19:54:06 -0600
committerJared Adams <jaxad0127@gmail.com>2009-09-30 19:54:06 -0600
commitd4f32a38fd498c180d562ced38a9129e0abf2252 (patch)
treee655b59ff686ad5fe2bdd11d6e072f5c3a4493b7 /src/main.h
parent6707d108790ab1fe1d4a3ef52d717966990fdf0a (diff)
downloadmana-d4f32a38fd498c180d562ced38a9129e0abf2252.tar.gz
mana-d4f32a38fd498c180d562ced38a9129e0abf2252.tar.bz2
mana-d4f32a38fd498c180d562ced38a9129e0abf2252.tar.xz
mana-d4f32a38fd498c180d562ced38a9129e0abf2252.zip
Merge login state machines for both clients
Also do some cleanup and refactoring of related code.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h63
1 files changed, 29 insertions, 34 deletions
diff --git a/src/main.h b/src/main.h
index bd1c6184..89ab5edd 100644
--- a/src/main.h
+++ b/src/main.h
@@ -75,48 +75,47 @@
#define PKG_DATADIR ""
#endif
+#define MAX_CHARACTER_COUNT 3
+
/*
* Client different States
*/
enum State {
- STATE_EXIT,
- STATE_LOADDATA,
- STATE_LOGIN,
- STATE_REGISTER,
- STATE_CHAR_SELECT,
- STATE_GAME,
- STATE_ERROR,
- STATE_UPDATE,
- STATE_CHANGEPASSWORD_ATTEMPT,
- STATE_CHANGEPASSWORD,
- STATE_ACCOUNTCHANGE_ERROR,
-#ifdef TMWSERV_SUPPORT
+ STATE_ERROR = -1,
+ STATE_START = 0,
STATE_CHOOSE_SERVER,
- STATE_CONNECT_ACCOUNT,
+ STATE_CONNECT_SERVER,
+ STATE_LOGIN,
STATE_LOGIN_ATTEMPT,
+ STATE_WORLD_SELECT, // 5
+ STATE_WORLD_SELECT_ATTEMPT,
+ STATE_UPDATE,
+ STATE_LOAD_DATA,
+ STATE_GET_CHARACTERS,
+ STATE_CHAR_SELECT, // 10
+ STATE_CONNECT_GAME,
+ STATE_GAME,
+ STATE_CHANGE_MAP, // Switch map-server/gameserver
STATE_LOGIN_ERROR,
+ STATE_ACCOUNTCHANGE_ERROR, // 15
+ STATE_REGISTER,
STATE_REGISTER_ATTEMPT,
- STATE_CHANGEEMAIL_ATTEMPT,
+ STATE_CHANGEPASSWORD_ATTEMPT,
+ STATE_CHANGEPASSWORD,
+ STATE_CHANGEEMAIL_ATTEMPT, // 20
STATE_CHANGEEMAIL,
STATE_UNREGISTER_ATTEMPT,
STATE_UNREGISTER,
+ STATE_SWITCH_SERVER,
+ STATE_SWITCH_SERVER_ATTEMPT, // 25
+ STATE_SWITCH_LOGIN,
+ STATE_SWITCH_LOGIN_ATTEMPT,
STATE_SWITCH_CHARACTER,
- STATE_RECONNECT_ACCOUNT,
- STATE_SWITCH_ACCOUNTSERVER_ATTEMPT,
- STATE_SWITCH_ACCOUNTSERVER,
- STATE_LOGOUT_ATTEMPT,
- STATE_CONNECT_GAME,
+ STATE_SWITCH_CHARACTER_ATTEMPT,
+ STATE_LOGOUT_ATTEMPT, // 30
STATE_WAIT,
- STATE_FORCE_QUIT,
-#else
- STATE_ACCOUNT,
- STATE_CHAR_CONNECT,
- STATE_CHAR_SERVER,
- STATE_CHAR_NEW,
- STATE_CHAR_DEL,
- STATE_CONNECTING,
-#endif
- STATE_NULL
+ STATE_EXIT,
+ STATE_FORCE_QUIT
};
/* length definitions for several char[]s in order
@@ -130,11 +129,7 @@ enum {
LEN_MIN_PASSWORD = 4
};
-// Defines the number of usable player slots
-const short maxSlot = 2;
-
-extern std::string token;
-extern char n_server, n_character;
+extern char n_character;
extern State state;
extern std::string errorMessage;