summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog.txt2
-rw-r--r--conf-tmpl/login_athena.conf5
-rw-r--r--src/login_sql/login.c18
-rw-r--r--src/map/pc.c3
4 files changed, 21 insertions, 7 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 4be44ca5b..638beb9f0 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,7 @@
Date Added
12/6
+ * Added a case_sensitive to login [MouseJstr]
+ * Fixed follow crashing server when gm dies [MouseJstr]
* Fixed global message not working on txt [Wizputer]
* fixed a server crash in mobinsite [MouseJstr]
* fixed a server crash in party sharing exp [MouseJstr]
diff --git a/conf-tmpl/login_athena.conf b/conf-tmpl/login_athena.conf
index 4b25b6674..547cc66df 100644
--- a/conf-tmpl/login_athena.conf
+++ b/conf-tmpl/login_athena.conf
@@ -23,6 +23,9 @@ ladminallowip: all
// This prevents usage of >& log.file
console: off
+// Are login's case sensitive?
+case_sensitive: on
+
// Gamemaster password, used with the @gm command to obtain GM commands (level of gm set with level_new_gm parameter).
// NOTICE: You should also change this one.
gm_pass: gm
@@ -146,4 +149,4 @@ imalive_time: 60
// Enable GUI flushing for Mugendai's GUI?
flush_on: 0
// How often to flush the buffer in Mugendai's GUI
-flush_time: 60 \ No newline at end of file
+flush_time: 60
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 3a261bdf0..48b29fdda 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -135,6 +135,8 @@ char tmpsql[65535], tmp_sql[65535];
int console = 0;
+int case_sensitive = 1;
+
//-----------------------------------------------------
#define AUTH_FIFO_SIZE 256
@@ -399,7 +401,7 @@ int mmo_auth( struct mmo_account* account , int fd){
// make query
sprintf(tmpsql, "SELECT `%s`,`%s`,`%s`,`lastlogin`,`logincount`,`sex`,`connect_until`,`last_ip`,`ban_until`,`state`,`%s`"
- " FROM `%s` WHERE BINARY `%s`='%s'", login_db_account_id, login_db_userid, login_db_user_pass, login_db_level, login_db, login_db_userid, t_uid);
+ " FROM `%s` WHERE %s `%s`='%s'", login_db_account_id, login_db_userid, login_db_user_pass, login_db_level, login_db, case_sensitive ? "BINARY" : "", login_db_userid, t_uid);
//login {0-account_id/1-userid/2-user_pass/3-lastlogin/4-logincount/5-sex/6-connect_untl/7-last_ip/8-ban_until/9-state}
// query
@@ -563,7 +565,7 @@ int mmo_auth( struct mmo_account* account , int fd){
return 6; // 6 = Your are Prohibited to log in until %s
} else { // ban is finished
// reset the ban time
- sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' WHERE BINARY `%s`='%s'", login_db, login_db_userid, t_uid);
+ sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' WHERE %s `%s`='%s'", login_db, case_sensitive ? "BINARY" : "", login_db_userid, t_uid);
if (mysql_query(&mysql_handle, tmpsql)) {
printf("DB server Error - %s\n", mysql_error(&mysql_handle));
}
@@ -588,8 +590,8 @@ int mmo_auth( struct mmo_account* account , int fd){
memcpy(account->lastlogin, tmpstr, 24);
account->sex = sql_row[5][0] == 'S' ? 2 : sql_row[5][0]=='M';
- sprintf(tmpsql, "UPDATE `%s` SET `lastlogin` = NOW(), `logincount`=`logincount` +1, `last_ip`='%s' WHERE BINARY `%s` = '%s'",
- login_db, ip, login_db_userid, sql_row[1]);
+ sprintf(tmpsql, "UPDATE `%s` SET `lastlogin` = NOW(), `logincount`=`logincount` +1, `last_ip`='%s' WHERE %s `%s` = '%s'",
+ login_db, ip, case_sensitive ? "BINARY" : "", login_db_userid, sql_row[1]);
mysql_free_result(sql_res) ; //resource free
if (mysql_query(&mysql_handle, tmpsql)) {
printf("DB server Error - %s\n", mysql_error(&mysql_handle));
@@ -1328,7 +1330,7 @@ int parse_login(int fd) {
result = -3;
}
- sprintf(tmpsql,"SELECT `ban_until` FROM `%s` WHERE BINARY `%s` = '%s'",login_db,login_db_userid, t_uid);
+ sprintf(tmpsql,"SELECT `ban_until` FROM `%s` WHERE %s `%s` = '%s'",login_db, case_sensitive ? "BINARY" : "",login_db_userid, t_uid);
if(mysql_query(&mysql_handle, tmpsql)) {
printf("DB server Error - %s\n", mysql_error(&mysql_handle));
}
@@ -1671,6 +1673,12 @@ int login_config_read(const char *cfgName){
if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 )
console = 1;
}
+ else if (strcmpi(w1, "case_sensitive") == 0) {
+ if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 )
+ case_sensitive = 1;
+ if(strcmpi(w2,"off") == 0 || strcmpi(w2,"no") == 0 )
+ case_sensitive = 0;
+ }
}
fclose(fp);
printf ("End reading configuration...\n");
diff --git a/src/map/pc.c b/src/map/pc.c
index 0c8c32b9a..3988b950d 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4606,7 +4606,8 @@ int pc_follow_timer(int tid,unsigned int tick,int id,int data)
struct map_session_data *sd, *bl;
sd=map_id2sd(id);
- if(sd == NULL || sd->followtimer != tid)
+
+ if(sd == NULL || sd->followtimer != tid || pc_isdead(sd))
return 0;
sd->followtimer=-1;