- Updated Box of thunder to use "agi up" effect for 30 secs instead of NPC Agi Up for 20.
- Guild expulsion now will fail when the character to be kicked is in a guild castle (rather than checking for the character doing the expulsion) - pk damage reduction settings now will take effect only on Player VS player damage. - Fixed produce_db2.txt entries overwriting produce_db.txt ones. - Fixed item-granted/plagiarized skills unlocking skill trees when only your real learned level should. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9902 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
df5c20339b
commit
031cd5fb58
@ -1317,7 +1317,7 @@ int mmo_auth(struct mmo_account* account, int fd) {
|
|||||||
struct online_login_data* data = idb_get(online_db,auth_dat[i].account_id);
|
struct online_login_data* data = idb_get(online_db,auth_dat[i].account_id);
|
||||||
if (data && data->char_server > -1) {
|
if (data && data->char_server > -1) {
|
||||||
//Request char servers to kick this account out. [Skotlex]
|
//Request char servers to kick this account out. [Skotlex]
|
||||||
ShowWarning("User [%d] is already online - Rejected.\n",auth_dat[i].account_id);
|
ShowNotice("User [%d] is already online - Rejected.\n",auth_dat[i].account_id);
|
||||||
WBUFW(buf,0) = 0x2734;
|
WBUFW(buf,0) = 0x2734;
|
||||||
WBUFL(buf,2) = auth_dat[i].account_id;
|
WBUFL(buf,2) = auth_dat[i].account_id;
|
||||||
charif_sendallwos(-1, buf, 6);
|
charif_sendallwos(-1, buf, 6);
|
||||||
@ -3039,15 +3039,15 @@ int lan_subnetcheck(long *p) {
|
|||||||
|
|
||||||
sbn = (char *)&subnet[i].subnet;
|
sbn = (char *)&subnet[i].subnet;
|
||||||
msk = (char *)&subnet[i].mask;
|
msk = (char *)&subnet[i].mask;
|
||||||
|
/*
|
||||||
ShowInfo("Subnet check [%u.%u.%u.%u]: Matches "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
|
ShowInfo("Subnet check [%u.%u.%u.%u]: Matches "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
|
||||||
src[0], src[1], src[2], src[3], sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
|
src[0], src[1], src[2], src[3], sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
|
||||||
|
*/
|
||||||
return subnet[i].char_ip;
|
return subnet[i].char_ip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowInfo("Subnet check [%u.%u.%u.%u]: "CL_CYAN"WAN"CL_RESET"\n", src[0], src[1], src[2], src[3]);
|
// ShowInfo("Subnet check [%u.%u.%u.%u]: "CL_CYAN"WAN"CL_RESET"\n", src[0], src[1], src[2], src[3]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3248,11 +3248,6 @@ int parse_login(int fd) {
|
|||||||
}
|
}
|
||||||
ld = (struct login_session_data*)aCalloc(1, sizeof(struct login_session_data));
|
ld = (struct login_session_data*)aCalloc(1, sizeof(struct login_session_data));
|
||||||
session[fd]->session_data = ld;
|
session[fd]->session_data = ld;
|
||||||
if (!ld) {
|
|
||||||
ShowFatalError("login: Request for md5 key: memory allocation failure (malloc)!\n");
|
|
||||||
session[fd]->eof = 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (RFIFOW(fd,0) == 0x01db)
|
if (RFIFOW(fd,0) == 0x01db)
|
||||||
login_log("Sending request of the coding key (ip: %s)" RETCODE, ip);
|
login_log("Sending request of the coding key (ip: %s)" RETCODE, ip);
|
||||||
else
|
else
|
||||||
|
@ -392,9 +392,6 @@ int mmo_auth_sqldb_init(void) {
|
|||||||
|
|
||||||
ShowStatus("Login server init....\n");
|
ShowStatus("Login server init....\n");
|
||||||
|
|
||||||
// memory initialize
|
|
||||||
ShowStatus("memory initialize....\n");
|
|
||||||
|
|
||||||
mysql_init(&mysql_handle);
|
mysql_init(&mysql_handle);
|
||||||
|
|
||||||
// DB connection start
|
// DB connection start
|
||||||
@ -636,7 +633,6 @@ int mmo_auth( struct mmo_account* account , int fd){
|
|||||||
// End DNS Blacklist check [Zido]
|
// End DNS Blacklist check [Zido]
|
||||||
|
|
||||||
sprintf(ip, "%d.%d.%d.%d", sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3]);
|
sprintf(ip, "%d.%d.%d.%d", sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3]);
|
||||||
//ShowInfo("auth start for %s...\n", ip);
|
|
||||||
|
|
||||||
//accountreg with _M/_F .. [Sirius]
|
//accountreg with _M/_F .. [Sirius]
|
||||||
len = strlen(account->userid) -2;
|
len = strlen(account->userid) -2;
|
||||||
@ -735,11 +731,11 @@ int mmo_auth( struct mmo_account* account , int fd){
|
|||||||
} else {
|
} else {
|
||||||
jstrescapecpy(user_password, account->passwd);
|
jstrescapecpy(user_password, account->passwd);
|
||||||
}
|
}
|
||||||
//ShowInfo("account id ok encval:%d\n",account->passwdenc);
|
|
||||||
#ifdef PASSWORDENC
|
#ifdef PASSWORDENC
|
||||||
if (account->passwdenc > 0) {
|
if (account->passwdenc > 0) {
|
||||||
int j = account->passwdenc;
|
int j = account->passwdenc;
|
||||||
//ShowInfo("start md5calc..\n");
|
|
||||||
if (j > 2)
|
if (j > 2)
|
||||||
j = 1;
|
j = 1;
|
||||||
do {
|
do {
|
||||||
@ -749,18 +745,14 @@ int mmo_auth( struct mmo_account* account , int fd){
|
|||||||
sprintf(md5str, "%s%s", sql_row[2], md5key);
|
sprintf(md5str, "%s%s", sql_row[2], md5key);
|
||||||
} else
|
} else
|
||||||
md5str[0] = 0;
|
md5str[0] = 0;
|
||||||
//ShowDebug("j:%d mdstr:%s\n", j, md5str);
|
|
||||||
MD5_String2binary(md5str, md5bin);
|
MD5_String2binary(md5str, md5bin);
|
||||||
encpasswdok = (memcmp(user_password, md5bin, 16) == 0);
|
encpasswdok = (memcmp(user_password, md5bin, 16) == 0);
|
||||||
} while (j < 2 && !encpasswdok && (j++) != account->passwdenc);
|
} while (j < 2 && !encpasswdok && (j++) != account->passwdenc);
|
||||||
//printf("key[%s] md5 [%s] ", md5key, md5);
|
|
||||||
//ShowInfo("client [%s] accountpass [%s]\n", user_password, sql_row[2]);
|
|
||||||
//ShowInfo("end md5calc..\n");
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ((strcmp(user_password, sql_row[2]) && !encpasswdok)) {
|
if ((strcmp(user_password, sql_row[2]) && !encpasswdok)) {
|
||||||
if (account->passwdenc == 0) {
|
if (account->passwdenc == 0) {
|
||||||
ShowNotice("auth failed pass error %s %s %s" RETCODE, tmpstr, account->userid, user_password);
|
ShowInfo("auth failed pass error %s %s %s" RETCODE, tmpstr, account->userid, user_password);
|
||||||
#ifdef PASSWORDENC
|
#ifdef PASSWORDENC
|
||||||
} else {
|
} else {
|
||||||
char logbuf[1024], *p = logbuf;
|
char logbuf[1024], *p = logbuf;
|
||||||
@ -775,12 +767,11 @@ int mmo_auth( struct mmo_account* account , int fd){
|
|||||||
for(j = 0; j < md5keylen; j++)
|
for(j = 0; j < md5keylen; j++)
|
||||||
p += sprintf(p, "%02x", ((unsigned char *)md5key)[j]);
|
p += sprintf(p, "%02x", ((unsigned char *)md5key)[j]);
|
||||||
p += sprintf(p, "]" RETCODE);
|
p += sprintf(p, "]" RETCODE);
|
||||||
ShowNotice("%s\n", p);
|
ShowInfo("%s\n", p);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
//ShowInfo("auth ok %s %s" RETCODE, tmpstr, account->userid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -869,7 +860,7 @@ int mmo_auth( struct mmo_account* account , int fd){
|
|||||||
unsigned char buf[8];
|
unsigned char buf[8];
|
||||||
if (data && data->char_server > -1) {
|
if (data && data->char_server > -1) {
|
||||||
//Request char servers to kick this account out. [Skotlex]
|
//Request char servers to kick this account out. [Skotlex]
|
||||||
ShowWarning("User [%s] is already online - Rejected.\n",sql_row[1]);
|
ShowNotice("User [%s] is already online - Rejected.\n",sql_row[1]);
|
||||||
WBUFW(buf,0) = 0x2734;
|
WBUFW(buf,0) = 0x2734;
|
||||||
WBUFL(buf,2) = atol(sql_row[0]);
|
WBUFL(buf,2) = atol(sql_row[0]);
|
||||||
charif_sendallwos(-1, buf, 6);
|
charif_sendallwos(-1, buf, 6);
|
||||||
@ -990,7 +981,6 @@ int parse_fromchar(int fd){
|
|||||||
!auth_fifo[i].delflag)
|
!auth_fifo[i].delflag)
|
||||||
{
|
{
|
||||||
auth_fifo[i].delflag = 1;
|
auth_fifo[i].delflag = 1;
|
||||||
ShowDebug("auth -> %d\n", i);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1462,15 +1452,15 @@ int lan_subnetcheck(long p) {
|
|||||||
|
|
||||||
sbn = (unsigned char *)&subnet[i].subnet;
|
sbn = (unsigned char *)&subnet[i].subnet;
|
||||||
msk = (unsigned char *)&subnet[i].mask;
|
msk = (unsigned char *)&subnet[i].mask;
|
||||||
|
/*
|
||||||
ShowInfo("Subnet check [%u.%u.%u.%u]: Matches "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
|
ShowInfo("Subnet check [%u.%u.%u.%u]: Matches "CL_CYAN"%u.%u.%u.%u/%u.%u.%u.%u"CL_RESET"\n",
|
||||||
src[0], src[1], src[2], src[3], sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
|
src[0], src[1], src[2], src[3], sbn[0], sbn[1], sbn[2], sbn[3], msk[0], msk[1], msk[2], msk[3]);
|
||||||
|
*/
|
||||||
return subnet[i].char_ip;
|
return subnet[i].char_ip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowInfo("Subnet check [%u.%u.%u.%u]: "CL_CYAN"WAN"CL_RESET"\n", src[0], src[1], src[2], src[3]);
|
// ShowInfo("Subnet check [%u.%u.%u.%u]: "CL_CYAN"WAN"CL_RESET"\n", src[0], src[1], src[2], src[3]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1501,7 +1491,7 @@ int login_ip_ban_check(unsigned char *p, unsigned long ipl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ip ban ok.
|
// ip ban ok.
|
||||||
ShowWarning("packet from banned ip : %d.%d.%d.%d\n" RETCODE, p[0], p[1], p[2], p[3]);
|
ShowInfo("Packet from banned ip : %d.%d.%d.%d\n" RETCODE, p[0], p[1], p[2], p[3]);
|
||||||
|
|
||||||
if (log_login)
|
if (log_login)
|
||||||
{
|
{
|
||||||
@ -1548,7 +1538,6 @@ int parse_login(int fd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while(RFIFOREST(fd)>=2 && !session[fd]->eof){
|
while(RFIFOREST(fd)>=2 && !session[fd]->eof){
|
||||||
// ShowDebug("parse_login : %d %d packet case=%x\n", fd, RFIFOREST(fd), RFIFOW(fd,0));
|
|
||||||
|
|
||||||
switch(RFIFOW(fd,0)){
|
switch(RFIFOW(fd,0)){
|
||||||
case 0x200: // New alive packet: structure: 0x200 <account.userid>.24B. used to verify if client is always alive.
|
case 0x200: // New alive packet: structure: 0x200 <account.userid>.24B. used to verify if client is always alive.
|
||||||
@ -1599,7 +1588,7 @@ int parse_login(int fd) {
|
|||||||
memcpy(account.passwd,RFIFOP(fd, 30),NAME_LENGTH);
|
memcpy(account.passwd,RFIFOP(fd, 30),NAME_LENGTH);
|
||||||
account.passwd[23] = '\0';
|
account.passwd[23] = '\0';
|
||||||
|
|
||||||
ShowInfo("client connection request %s from %d.%d.%d.%d\n", RFIFOP(fd, 6), p[0], p[1], p[2], p[3]);
|
// ShowDebug("client connection request %s from %d.%d.%d.%d\n", RFIFOP(fd, 6), p[0], p[1], p[2], p[3]);
|
||||||
#ifdef PASSWORDENC
|
#ifdef PASSWORDENC
|
||||||
account.passwdenc= (RFIFOW(fd,0)!=0x01dd)?0:PASSWORDENC;
|
account.passwdenc= (RFIFOW(fd,0)!=0x01dd)?0:PASSWORDENC;
|
||||||
#else
|
#else
|
||||||
@ -1860,8 +1849,6 @@ int parse_login(int fd) {
|
|||||||
WFIFOW(fd,2)=4+md5keylen;
|
WFIFOW(fd,2)=4+md5keylen;
|
||||||
memcpy(WFIFOP(fd,4),md5key,md5keylen);
|
memcpy(WFIFOP(fd,4),md5key,md5keylen);
|
||||||
WFIFOSET(fd,WFIFOW(fd,2));
|
WFIFOSET(fd,WFIFOW(fd,2));
|
||||||
|
|
||||||
ShowDebug("Request Password key -%s\n",md5key);
|
|
||||||
RFIFOSKIP(fd,2);
|
RFIFOSKIP(fd,2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2363,23 +2350,17 @@ int do_init(int argc,char **argv){
|
|||||||
sql_config_read(SQL_CONF_NAME);
|
sql_config_read(SQL_CONF_NAME);
|
||||||
login_lan_config_read((argc > 2) ? argv[2] : LAN_CONF_NAME);
|
login_lan_config_read((argc > 2) ? argv[2] : LAN_CONF_NAME);
|
||||||
//Generate Passworded Key.
|
//Generate Passworded Key.
|
||||||
ShowInfo("Initializing md5key...\n");
|
|
||||||
memset(md5key, 0, sizeof(md5key));
|
memset(md5key, 0, sizeof(md5key));
|
||||||
md5keylen=rand()%4+12;
|
md5keylen=rand()%4+12;
|
||||||
for(i=0;i<md5keylen;i++)
|
for(i=0;i<md5keylen;i++)
|
||||||
md5key[i]=rand()%255+1;
|
md5key[i]=rand()%255+1;
|
||||||
ShowInfo("md5key setup complete\n");
|
|
||||||
|
|
||||||
|
|
||||||
ShowInfo("set FIFO Size\n");
|
|
||||||
for(i=0;i<AUTH_FIFO_SIZE;i++)
|
for(i=0;i<AUTH_FIFO_SIZE;i++)
|
||||||
auth_fifo[i].delflag=1;
|
auth_fifo[i].delflag=1;
|
||||||
ShowInfo("set FIFO Size complete\n");
|
|
||||||
|
|
||||||
ShowInfo("set max servers\n");
|
|
||||||
for(i=0;i<MAX_SERVERS;i++)
|
for(i=0;i<MAX_SERVERS;i++)
|
||||||
server_fd[i]=-1;
|
server_fd[i]=-1;
|
||||||
ShowInfo("set max servers complete\n");
|
|
||||||
//server port open & binding
|
//server port open & binding
|
||||||
|
|
||||||
// Online user database init
|
// Online user database init
|
||||||
@ -2389,9 +2370,7 @@ int do_init(int argc,char **argv){
|
|||||||
login_fd = make_listen_bind(bind_ip?bind_ip:INADDR_ANY,login_port);
|
login_fd = make_listen_bind(bind_ip?bind_ip:INADDR_ANY,login_port);
|
||||||
|
|
||||||
//Auth start
|
//Auth start
|
||||||
ShowInfo("Running mmo_auth_sqldb_init()\n");
|
|
||||||
mmo_auth_sqldb_init();
|
mmo_auth_sqldb_init();
|
||||||
ShowInfo("finished mmo_auth_sqldb_init()\n");
|
|
||||||
|
|
||||||
if(login_gm_read)
|
if(login_gm_read)
|
||||||
//Read account information.
|
//Read account information.
|
||||||
@ -2401,7 +2380,6 @@ int do_init(int argc,char **argv){
|
|||||||
set_defaultparse(parse_login);
|
set_defaultparse(parse_login);
|
||||||
|
|
||||||
// ban deleter timer - 1 minute term
|
// ban deleter timer - 1 minute term
|
||||||
ShowStatus("add interval tic (ip_ban_check)....\n");
|
|
||||||
add_timer_func_list(ip_ban_check,"ip_ban_check");
|
add_timer_func_list(ip_ban_check,"ip_ban_check");
|
||||||
add_timer_interval(gettick()+10, ip_ban_check,0,0,60*1000);
|
add_timer_interval(gettick()+10, ip_ban_check,0,0,60*1000);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user