summaryrefslogtreecommitdiff
path: root/src/login/login.h
diff options
context:
space:
mode:
authorhemagx <hemagx2@gmail.com>2016-03-28 21:54:46 +0200
committerHaru <haru@dotalux.com>2016-04-16 07:38:31 +0200
commitd60ef91d8355f117c1ad5209b3f43647b9656892 (patch)
tree6cd5c3de31116b04a9b57ef0ad1edc1947c4c410 /src/login/login.h
parent9defceef6a3371d09b580ac8f2cffd0476033ea6 (diff)
downloadhercules-d60ef91d8355f117c1ad5209b3f43647b9656892.tar.gz
hercules-d60ef91d8355f117c1ad5209b3f43647b9656892.tar.bz2
hercules-d60ef91d8355f117c1ad5209b3f43647b9656892.tar.xz
hercules-d60ef91d8355f117c1ad5209b3f43647b9656892.zip
Rewrite client interface for login server (part 3)
Rewritten login clif parser, using a packet db Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/login/login.h')
-rw-r--r--src/login/login.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/login/login.h b/src/login/login.h
index 0676aee1f..e29953b9e 100644
--- a/src/login/login.h
+++ b/src/login/login.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -28,6 +28,7 @@
struct mmo_account;
struct AccountDB;
+struct login_packet_db;
enum E_LOGINSERVER_ST
{
@@ -43,6 +44,16 @@ enum password_enc {
PWENC_BOTH = PWENC_ENCRYPT|PWENC_ENCRYPT2, ///< both the above
};
+/// Parse function return code
+enum parsefunc_rcode {
+ PACKET_VALID = 1,
+ PACKET_INCOMPLETE = 0,
+ PACKET_UNKNOWN = -1,
+ PACKET_INVALIDLENGTH = -2,
+ PACKET_STOPPARSE = -3,
+ PACKET_SKIP = -4, //internal parser will skip this packet and go parser another, meant for plugins. [hemagx]
+};
+
#define PASSWORDENC PWENC_BOTH
#define PASSWD_LEN (32+1) // 23+1 for plaintext, 32+1 for md5-ed passwords
@@ -203,7 +214,7 @@ struct login_interface {
void (*login_error) (int fd, uint8 error);
void (*parse_ping) (int fd, struct login_session_data* sd);
void (*parse_client_md5) (int fd, struct login_session_data* sd);
- bool (*parse_client_login) (int fd, struct login_session_data* sd, const char *ip);
+ bool (*client_login) (int fd, struct login_session_data *sd);
void (*send_coding_key) (int fd, struct login_session_data* sd);
void (*parse_request_coding_key) (int fd, struct login_session_data* sd);
void (*char_server_connection_status) (int fd, struct login_session_data* sd, uint8 status);
@@ -213,6 +224,10 @@ struct login_interface {
int (*config_read) (const char *cfgName);
char *LOGIN_CONF_NAME;
char *NET_CONF_NAME; ///< Network configuration filename
+
+ // lclif
+ enum parsefunc_rcode (*parse_packet)(const struct login_packet_db *lpd, int fd, struct login_session_data *sd);
+ enum parsefunc_rcode (*parse_login_sub)(int fd, struct login_session_data *sd);
};
#ifdef HERCULES_CORE