summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-SVN.txt2
-rw-r--r--conf-tmpl/login_athena.conf3
-rw-r--r--src/login_sql/login.c12
3 files changed, 16 insertions, 1 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt
index 802808801..22535a8ed 100644
--- a/Changelog-SVN.txt
+++ b/Changelog-SVN.txt
@@ -1,6 +1,8 @@
Date Added
04/02
+ * Allowed people to enable/disable using the online column via
+ 'register_users_online' in the login_athena.conf [Codemaster]
* Added the 3 baby skills WE_BABY, CALLBABY and CALLPARENT [celest]
* Some tidying up in skill.c [celest]
diff --git a/conf-tmpl/login_athena.conf b/conf-tmpl/login_athena.conf
index ade701d23..29c20a78e 100644
--- a/conf-tmpl/login_athena.conf
+++ b/conf-tmpl/login_athena.conf
@@ -147,6 +147,9 @@ client_version_to_connect: 20
//Passwords in Login DB are MD5 - <passwordencrypt> cannot b used on client with this on
use_MD5_passwords: no
+// Use the 'online' column to set users online and offline [MySQL only]
+register_users_online: 0
+
//Ban features: read readme for more info if you dont know this.
ipban: 1
dynamic_pass_failure_ban: 1
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 414b0efda..45b9dd2f4 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -99,6 +99,7 @@ int min_level_to_connect = 0; // minimum level of player/GM (0: player, 1-99: gm
int check_ip_flag = 1; // It's to check IP of a player between login-server and char-server (part of anti-hacking system)
int check_client_version = 0; //Client version check ON/OFF .. (sirius)
int client_version_to_connect = 20; //Client version needed to connect ..(sirius)
+int register_users_online = 1;
MYSQL mysql_handle;
@@ -154,6 +155,8 @@ struct dbt *online_db;
//-----------------------------------------------------
void add_online_user(int account_id) {
+ if(register_users_online <= 0)
+ return;
int *p;
p = (int*)aMalloc(sizeof(int));
if (p == NULL) {
@@ -165,6 +168,8 @@ void add_online_user(int account_id) {
}
int is_user_online(int account_id) {
+ if(register_users_online <= 0)
+ return 0;
int *p;
p = (int*)numdb_search(online_db, account_id);
@@ -175,6 +180,8 @@ int is_user_online(int account_id) {
}
void remove_online_user(int account_id) {
+ if(register_users_online <= 0)
+ return;
int *p;
p = (int*)numdb_erase(online_db,account_id);
aFree(p);
@@ -600,7 +607,7 @@ int mmo_auth( struct mmo_account* account , int fd){
return 2; // 2 = This ID is expired
}
- if ( is_user_online(atol(sql_row[0])) ) {
+ if ( is_user_online(atol(sql_row[0])) && register_users_online > 0) {
printf("User [%s] is already online - Rejected.\n",sql_row[1]);
#ifndef TWILIGHT
return 3; // Rejected
@@ -1735,6 +1742,9 @@ int login_config_read(const char *cfgName){
if(strcmpi(w2,"off") == 0 || strcmpi(w2,"no") == 0 )
case_sensitive = 0;
}
+ else if(strcmpi(w1, "register_users_online") == 0) {
+ register_users_online = config_switch(w2);
+ }
}
fclose(fp);
printf ("End reading configuration...\n");