diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-31 02:13:23 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-31 02:13:23 +0000 |
commit | be8db8ecd1b8ddc8c77b387f617056abb25bd31e (patch) | |
tree | d0cd0cbdbadfb2003d7c3418f41cf4c909c5251b | |
parent | 6c9523ffa90ae80ab5d92162704ac994116a6173 (diff) | |
download | hercules-be8db8ecd1b8ddc8c77b387f617056abb25bd31e.tar.gz hercules-be8db8ecd1b8ddc8c77b387f617056abb25bd31e.tar.bz2 hercules-be8db8ecd1b8ddc8c77b387f617056abb25bd31e.tar.xz hercules-be8db8ecd1b8ddc8c77b387f617056abb25bd31e.zip |
[Improved]:
- loginlog using unsigned long `ip` field. (Please check for compatibility problems).
[Added]:
- Mercenary.c in VS.NET 2005 project files
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6868 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 5 | ||||
-rw-r--r-- | sql-files/main.sql | 2 | ||||
-rw-r--r-- | src/login_sql/login.c | 18 | ||||
-rw-r--r-- | vcproj-8/map-server_sql.vcproj | 4 | ||||
-rw-r--r-- | vcproj-8/map-server_txt.vcproj | 4 |
5 files changed, 23 insertions, 10 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index e02f8ca3d..1bcc6f943 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/30
+ * [Added]:
+ - Mercenary.c in VS.NET 2005 project files
+ [Improved]:
+ - loginlog using unsigned long `ip` field.
+ (Please check for compatibility problems). [Lance]
* Fixed status_calc_pc not zero'ing ALL vars it should, allowing certain
bonuses (like effect-on-hit) to stack. [Skotlex]
* slaves inherit speed setting will now work regardless of whether the
diff --git a/sql-files/main.sql b/sql-files/main.sql index 28548ba19..4e7a00a54 100644 --- a/sql-files/main.sql +++ b/sql-files/main.sql @@ -407,7 +407,7 @@ CREATE TABLE `sc_data` ( DROP TABLE IF EXISTS `loginlog`;
CREATE TABLE `loginlog` (
`time` datetime NOT NULL default '0000-00-00 00:00:00',
- `ip` char(15) NOT NULL default '',
+ `ip` int(10) unsigned NOT NULL default '0',
`user` varchar(32) NOT NULL default '',
`rcode` tinyint(4) NOT NULL default '0',
`log` varchar(255) NOT NULL default '',
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 4f8a8d1b2..8c2ccb99b 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -396,7 +396,7 @@ int mmo_auth_sqldb_init(void) { if (log_login)
{
- sprintf(tmpsql, "INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '', 'lserver', '100','login server started')", loginlog_db);
+ sprintf(tmpsql, "INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '0', '100','login server started')", loginlog_db);
//query
if (mysql_query(&mysql_handle, tmpsql)) {
@@ -430,7 +430,7 @@ void mmo_db_close(void) { //set log.
if (log_login)
{
- sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '', 'lserver','100', 'login server shutdown')", loginlog_db);
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '0', '0','100', 'login server shutdown')", loginlog_db);
//query
if (mysql_query(&mysql_handle, tmpsql)) {
@@ -946,7 +946,7 @@ int parse_fromchar(int fd){ case 0x2709:
if (log_login)
{
- sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s','%s', 'GM reload request')", loginlog_db, p[0], p[1], p[2], p[3], server[id].name, RETCODE);
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%lu', '%s','%s', 'GM reload request')", loginlog_db, session[fd]->client_addr.sin_addr.S_un.S_addr,server[id].name, RETCODE);
if (mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
@@ -1483,7 +1483,7 @@ int parse_login(int fd) { ShowWarning("packet from banned ip : %d.%d.%d.%d\n" RETCODE, p[0], p[1], p[2], p[3]);
if (log_login)
{
- sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', 'unknown','-3', 'ip banned')", loginlog_db, p[0], p[1], p[2], p[3]);
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%lu', 'unknown','-3', 'ip banned')", loginlog_db, session[fd]->client_addr.sin_addr.S_un.S_addr);
// query
if(mysql_query(&mysql_handle, tmpsql)) {
@@ -1557,7 +1557,7 @@ int parse_login(int fd) { } else {
if (p[0] != 127 && log_login) {
- sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s','100', 'login ok')", loginlog_db, p[0], p[1], p[2], p[3], t_uid);
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%lu', '%s','100', 'login ok')", loginlog_db, session[fd]->client_addr.sin_addr.S_un.S_addr, t_uid);
//query
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
@@ -1615,7 +1615,7 @@ int parse_login(int fd) { char error[64];
if (log_login)
{
- sprintf(tmp_sql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s', '%d','login failed : %%s')", loginlog_db, p[0], p[1], p[2], p[3], t_uid, result);
+ sprintf(tmp_sql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%lu', '%s', '%d','login failed : %%s')", loginlog_db, session[fd]->client_addr.sin_addr.S_un.S_addr, t_uid, result);
switch((result + 1)) {
case -2: //-3 = Account Banned
sprintf(tmpsql,tmp_sql,"Account banned.");
@@ -1725,8 +1725,8 @@ int parse_login(int fd) { }
} //End login log of error.
if ((result == 1) && (dynamic_pass_failure_ban != 0) && log_login){ // failed password
- sprintf(tmpsql,"SELECT count(*) FROM `%s` WHERE `ip` = '%d.%d.%d.%d' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %d MINUTE",
- loginlog_db, p[0], p[1], p[2], p[3], dynamic_pass_failure_ban_time); //how many times filed account? in one ip.
+ sprintf(tmpsql,"SELECT count(*) FROM `%s` WHERE `ip` = '%lu' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %d MINUTE",
+ loginlog_db,session[fd]->client_addr.sin_addr.S_un.S_addr, dynamic_pass_failure_ban_time); //how many times filed account? in one ip.
if(mysql_query(&mysql_handle, tmpsql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
@@ -1804,7 +1804,7 @@ int parse_login(int fd) { unsigned char* server_name;
if (log_login)
{
- sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%d.%d.%d.%d', '%s@%s','100', 'charserver - %s@%d.%d.%d.%d:%d')", loginlog_db, p[0], p[1], p[2], p[3], RFIFOP(fd, 2),RFIFOP(fd, 60),RFIFOP(fd, 60), RFIFOB(fd, 54), RFIFOB(fd, 55), RFIFOB(fd, 56), RFIFOB(fd, 57), RFIFOW(fd, 58));
+ sprintf(tmpsql,"INSERT DELAYED INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%lu', '%s@%s','100', 'charserver - %s@%d.%d.%d.%d:%d')", loginlog_db, session[fd]->client_addr.sin_addr.S_un.S_addr, RFIFOP(fd, 2),RFIFOP(fd, 60),RFIFOP(fd, 60), RFIFOB(fd, 54), RFIFOB(fd, 55), RFIFOB(fd, 56), RFIFOB(fd, 57), RFIFOW(fd, 58));
//query
if(mysql_query(&mysql_handle, tmpsql)) {
diff --git a/vcproj-8/map-server_sql.vcproj b/vcproj-8/map-server_sql.vcproj index a32be5f2c..e5ccbaa6c 100644 --- a/vcproj-8/map-server_sql.vcproj +++ b/vcproj-8/map-server_sql.vcproj @@ -383,6 +383,10 @@ RelativePath="..\src\map\vending.c"
>
</File>
+ <File
+ RelativePath="..\src\map\mercenary.c"
+ >
+ </File>
</Filter>
</Files>
<Globals>
diff --git a/vcproj-8/map-server_txt.vcproj b/vcproj-8/map-server_txt.vcproj index 762363346..f4ceabee8 100644 --- a/vcproj-8/map-server_txt.vcproj +++ b/vcproj-8/map-server_txt.vcproj @@ -385,6 +385,10 @@ RelativePath="..\src\map\vending.c"
>
</File>
+ <File
+ RelativePath="..\src\map\mercenary.c"
+ >
+ </File>
</Filter>
</Files>
<Globals>
|