summaryrefslogtreecommitdiff
path: root/src/login_sql
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-02 18:24:27 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-02 18:24:27 +0000
commit571fb052a6712e5cd387fe1705fae778f5af7cf3 (patch)
treefda1ef205ae1e814de56b8ab22d802e2ed02df65 /src/login_sql
parent665680682b57d01415afb478b67d0c7c61d21119 (diff)
downloadhercules-571fb052a6712e5cd387fe1705fae778f5af7cf3.tar.gz
hercules-571fb052a6712e5cd387fe1705fae778f5af7cf3.tar.bz2
hercules-571fb052a6712e5cd387fe1705fae778f5af7cf3.tar.xz
hercules-571fb052a6712e5cd387fe1705fae778f5af7cf3.zip
speedup of SQL logs
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@437 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql')
-rw-r--r--src/login_sql/login.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 1863913fc..6e967ec72 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -294,7 +294,7 @@ int mmo_auth_sqldb_init(void) {
printf("connect success!\n");
}
- sprintf(tmpsql, "INSERT 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(), '', 'lserver', '100','login server started')", loginlog_db);
//query
if (mysql_query(&mysql_handle, tmpsql)) {
@@ -319,7 +319,7 @@ void mmo_db_close(void) {
int i, fd;
//set log.
- sprintf(tmpsql,"INSERT 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(), '', 'lserver','100', 'login server shutdown')", loginlog_db);
//query
if (mysql_query(&mysql_handle, tmpsql)) {
@@ -1119,7 +1119,7 @@ int parse_login(int fd) {
if (atoi(sql_row[0]) >0) {
// ip ban ok.
printf ("packet from banned ip : %d.%d.%d.%d" RETCODE, p[0], p[1], p[2], p[3]);
- sprintf(tmpsql,"INSERT 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(), '%d.%d.%d.%d', 'unknown','-3', 'ip banned')", loginlog_db, p[0], p[1], p[2], p[3]);
// query
if(mysql_query(&mysql_handle, tmpsql)) {
@@ -1186,7 +1186,7 @@ int parse_login(int fd) {
WFIFOSET(fd,3);
} else {
if (p[0] != 127) {
- sprintf(tmpsql,"INSERT 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(), '%d.%d.%d.%d', '%s','100', 'login ok')", loginlog_db, p[0], p[1], p[2], p[3], t_uid);
//query
if(mysql_query(&mysql_handle, tmpsql)) {
printf("DB server Error - %s\n", mysql_error(&mysql_handle));
@@ -1241,7 +1241,7 @@ int parse_login(int fd) {
} else {
char tmp_sql[512];
char error[64];
- sprintf(tmp_sql,"INSERT 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(), '%d.%d.%d.%d', '%s', '%d','login failed : %%s')", loginlog_db, p[0], p[1], p[2], p[3], t_uid, result);
switch((result + 1)) {
case -2: //-3 = Account Banned
sprintf(tmpsql,tmp_sql,"Account banned.");
@@ -1374,7 +1374,7 @@ int parse_login(int fd) {
return 0;
{
unsigned char* server_name;
- sprintf(tmpsql,"INSERT 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(), '%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));
//query
if(mysql_query(&mysql_handle, tmpsql)) {