From d8280002947c462b0bb731c12c20efc301ccb891 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 16 Feb 2013 19:30:21 -0200 Subject: Minor changes; check description Login and Char servers will now exit when failing to bind to the port (as map server has always done). Moved Sql_HerculesUpdateCheck() to be run before "server is 'ready' " thing for layout-purposes. Signed-off-by: shennetsind --- src/login/login.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/login') diff --git a/src/login/login.c b/src/login/login.c index c7e250040..984326532 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1863,24 +1863,25 @@ int do_init(int argc, char** argv) } } - if( login_config.console ) - { + if( login_config.console ) { //##TODO invoke a CONSOLE_START plugin event } - // server port open & binding - login_fd = make_listen_bind(login_config.login_ip, login_config.login_port); + // server port open & binding + if( (login_fd = make_listen_bind(login_config.login_ip,login_config.login_port)) == -1 ) { + ShowFatalError("Failed to bind to port '"CL_WHITE"%d"CL_RESET"'\n",login_config.login_port); + exit(EXIT_FAILURE); + } - if( runflag != CORE_ST_STOP ) - { + if( runflag != CORE_ST_STOP ) { shutdown_callback = do_shutdown; runflag = LOGINSERVER_ST_RUNNING; } - ShowStatus("The login-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %u).\n\n", login_config.login_port); - login_log(0, "login server", 100, "login server started"); - account_db_sql_up(accounts); + ShowStatus("The login-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %u).\n\n", login_config.login_port); + login_log(0, "login server", 100, "login server started"); + return 0; } -- cgit v1.2.3-60-g2f50