diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-01-21 21:50:36 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-02-01 12:36:51 -0800 |
commit | 90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee (patch) | |
tree | 42667ee8211853727c14645c05280e2500a7a994 /src/login/login.cpp | |
parent | b3ca4bccc4fa6b7f5d637bdecb4fac6ca9649f3c (diff) | |
download | tmwa-90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee.tar.gz tmwa-90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee.tar.bz2 tmwa-90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee.tar.xz tmwa-90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee.zip |
Remove unnecessary includes, speeding up recompilation
Diffstat (limited to 'src/login/login.cpp')
-rw-r--r-- | src/login/login.cpp | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/src/login/login.cpp b/src/login/login.cpp index 29b9954..7af76f8 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -1,26 +1,18 @@ -#include "login.hpp" - #include <arpa/inet.h> -#include <netinet/in.h> -#include <sys/ioctl.h> -#include <sys/socket.h> #include <sys/stat.h> -#include <sys/time.h> #include <sys/types.h> #include <sys/wait.h> -#include <fcntl.h> #include <netdb.h> #include <unistd.h> -#include <csignal> -#include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <fstream> +#include <type_traits> #include "../common/core.hpp" #include "../common/cxxstdio.hpp" @@ -33,13 +25,44 @@ #include "../common/socket.hpp" #include "../common/timer.hpp" #include "../common/version.hpp" - -#include <type_traits> +#include "../common/utils.hpp" #include "../poison.hpp" static_assert(std::is_same<time_t, long>::value, "much code assumes time_t is a long (sorry)"); +#define MAX_SERVERS 30 + +#define LOGIN_CONF_NAME "conf/login_athena.conf" +#define LAN_CONF_NAME "conf/lan_support.conf" + +#define START_ACCOUNT_NUM 2000000 +#define END_ACCOUNT_NUM 100000000 + +struct mmo_account +{ + char userid[24]; + char passwd[24]; + int passwdenc; + + long account_id; + long login_id1; + long login_id2; + long char_id; + char lastlogin[24]; + int sex; +}; + +struct mmo_char_server +{ + char name[20]; + long ip; + short port; + int users; + int maintenance; + int is_new; +}; + static int account_id_count = START_ACCOUNT_NUM; static @@ -1084,7 +1107,6 @@ void parse_fromchar(int fd) server_fd[id] = -1; memset(&server[id], 0, sizeof(struct mmo_char_server)); } - close(fd); delete_session(fd); return; } @@ -1773,7 +1795,6 @@ void parse_admin(int fd) if (session[fd]->eof) { - close(fd); delete_session(fd); PRINTF("Remote administration has disconnected (session #%d).\n", fd); @@ -3029,7 +3050,6 @@ void parse_login(int fd) if (session[fd]->eof) { - close(fd); delete_session(fd); return; } |