summaryrefslogtreecommitdiff
path: root/src/login_sql/login.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-19 19:44:21 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-19 19:44:21 +0000
commitcb227339015cdd739580b36222d31b6755694d49 (patch)
tree60f6f9376731e9ab5bddc8c59775aa86c40f9dc5 /src/login_sql/login.c
parentb4633cd02038b02bf6760e9f1fffec3a0a820cab (diff)
downloadhercules-cb227339015cdd739580b36222d31b6755694d49.tar.gz
hercules-cb227339015cdd739580b36222d31b6755694d49.tar.bz2
hercules-cb227339015cdd739580b36222d31b6755694d49.tar.xz
hercules-cb227339015cdd739580b36222d31b6755694d49.zip
- Removed the last argument from skillitem, the skill name passed to the client should always be of the type "AL_HEAL" anyway.
- Added skill ITEM_ENCHANTARMS, this is what weapon enchanting items should use. - Corrected itemskill calls in the item_db, also made the weapon enchanting items invoke the ITEM_ENCHANTARMS skill. Corrected Holy Egg not being type 11 (delay consume) - Updated item_db.sql with item_db information. - Added support for specifying different elements per skill level in the skill_db - Added bonus bNoKnockback - Corrected typo in bonus bSubRace2 (it was called bSPSubRace2 for some reason) - Corrected login sql server not resetting your account state to 0 when the banuntil duration expires. - Corrected use of UINT_MAX instead of INT_MAX in some jailing check. - Made the skillatk bonus it's own function, it can now be used to boost Heal/Sanctuary/Potion Pitcher and Slim Pitcher as well. - Cleaned up TK_WARMWIND to use the element acquired from the skill_db rather than hardcoded values. - Corrected Teleport's save map entry being sent without the .gat extension. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10031 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql/login.c')
-rw-r--r--src/login_sql/login.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 3986279f5..b895bbab8 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -524,7 +524,7 @@ int mmo_auth(struct mmo_account* account, int fd)
char t_uid[256], t_pass[256];
char user_password[256];
- int encpasswdok = 0;
+ int encpasswdok = 0, state;
char md5str[64], md5bin[32];
@@ -610,6 +610,7 @@ int mmo_auth(struct mmo_account* account, int fd)
return 0;
}
+ state = atoi(sql_row[9]);
//Client Version check
if (login_config.check_client_version && account->version != 0) {
if (account->version != login_config.client_version_to_connect) {
@@ -618,15 +619,11 @@ int mmo_auth(struct mmo_account* account, int fd)
}
}
- if (atoi(sql_row[9]) == -3) {
- //id is banned
+ switch (state) {
+ case -3: //id is banned
+ case -2: //dynamic ban
mysql_free_result(sql_res);
- return -3;
- } else if (atoi(sql_row[9]) == -2) { //dynamic ban
- //id is banned
- mysql_free_result(sql_res);
- //add IP list.
- return -2;
+ return state;
}
if (login_config.use_md5_passwds) {
@@ -683,15 +680,17 @@ int mmo_auth(struct mmo_account* account, int fd)
if (ban_until_time > time(NULL)) // always banned
return 6; // 6 = Your are Prohibited to log in until %s
- sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' WHERE `%s`= %s '%s'", login_db, login_db_userid, login_config.case_sensitive ? "BINARY" : "", t_uid);
+ sprintf(tmpsql, "UPDATE `%s` SET `ban_until`='0' %s WHERE `%s`= %s '%s'",
+ login_db, state==7?",state='0'":"", login_db_userid,
+ login_config.case_sensitive ? "BINARY" : "", t_uid);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmpsql);
}
}
- if (atoi(sql_row[9])) {
- switch(atoi(sql_row[9])) { // packet 0x006a value + 1
+ if (state) {
+ switch(state) { // packet 0x006a value + 1
case 1: // 0 = Unregistered ID
case 2: // 1 = Incorrect Password
case 3: // 2 = This ID is expired