summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-27 12:40:29 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-27 12:40:29 +0000
commit807577cbc6c8e93e99ab4140789babaae10be279 (patch)
tree238efb9c21709092c71ab6a9fbf6c8a36126102d /src/login
parentecbb7655309ca4cda4b4cf2b92e1c52e250505e2 (diff)
downloadhercules-807577cbc6c8e93e99ab4140789babaae10be279.tar.gz
hercules-807577cbc6c8e93e99ab4140789babaae10be279.tar.bz2
hercules-807577cbc6c8e93e99ab4140789babaae10be279.tar.xz
hercules-807577cbc6c8e93e99ab4140789babaae10be279.zip
Cleaned up several poorly chosen loginlog variable names.
Removed the unused login and txt->sql options in inter_athena.conf. Renamed config option log_db to log_db_db in inter_athena.conf. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13005 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login')
-rw-r--r--src/login/loginlog_sql.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c
index 69a1c1910..1443abff9 100644
--- a/src/login/loginlog_sql.c
+++ b/src/login/loginlog_sql.c
@@ -9,14 +9,13 @@
#include <string.h>
#include <stdlib.h> // exit
-char log_db_ip[32] = "127.0.0.1";
+char log_db_hostname[32] = "127.0.0.1";
uint16 log_db_port = 3306;
-char log_db_id[32] = "ragnarok";
-char log_db_pw[32] = "ragnarok";
-char log_db_db[32] = "ragnarok";
-char log_db[32] = "log";
+char log_db_username[32] = "ragnarok";
+char log_db_password[32] = "ragnarok";
+char log_db_database[32] = "log";
+char loginlog_table[256] = "loginlog";
-char loginlog_db[256] = "loginlog";
Sql* sql_handle;
bool enabled = false;
@@ -38,7 +37,7 @@ void login_log(uint32 ip, const char* username, int rcode, const char* message)
retcode = Sql_Query(sql_handle,
"INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%s', '%s', '%d', '%s')",
- loginlog_db, ip2str(ip,NULL), esc_username, rcode, message);
+ loginlog_table, ip2str(ip,NULL), esc_username, rcode, message);
if( retcode != SQL_SUCCESS )
Sql_ShowDebug(sql_handle);
@@ -48,7 +47,7 @@ bool loginlog_init(void)
{
sql_handle = Sql_Malloc();
- if( SQL_ERROR == Sql_Connect(sql_handle, log_db_id, log_db_pw, log_db_ip, log_db_port, log_db_db) )
+ if( SQL_ERROR == Sql_Connect(sql_handle, log_db_username, log_db_password, log_db_hostname, log_db_port, log_db_database) )
{
Sql_ShowDebug(sql_handle);
Sql_Free(sql_handle);
@@ -69,26 +68,23 @@ bool loginlog_final(void)
bool loginlog_config_read(const char* key, const char* value)
{
- if( strcmpi(key, "log_db_ip") == 0 )
- safestrncpy(log_db_ip, value, sizeof(log_db_ip));
+ if( strcmpi(key, "log_db_hostname") == 0 )
+ safestrncpy(log_db_hostname, value, sizeof(log_db_hostname));
else
if( strcmpi(key, "log_db_port") == 0 )
log_db_port = (uint16)strtoul(value, NULL, 10);
else
- if( strcmpi(key, "log_db_id") == 0 )
- safestrncpy(log_db_id, value, sizeof(log_db_id));
+ if( strcmpi(key, "log_db_username") == 0 )
+ safestrncpy(log_db_username, value, sizeof(log_db_username));
else
- if( strcmpi(key, "log_db_pw") == 0 )
- safestrncpy(log_db_pw, value, sizeof(log_db_pw));
+ if( strcmpi(key, "log_db_password") == 0 )
+ safestrncpy(log_db_password, value, sizeof(log_db_password));
else
- if( strcmpi(key, "log_db_db") == 0 )
- safestrncpy(log_db_db, value, sizeof(log_db_db));
+ if( strcmpi(key, "log_db_database") == 0 )
+ safestrncpy(log_db_database, value, sizeof(log_db_database));
else
- if( strcmpi(key, "log_db") == 0 )
- safestrncpy(log_db, value, sizeof(log_db));
- else
- if( strcmpi(key, "loginlog_db") == 0 )
- safestrncpy(loginlog_db, value, sizeof(loginlog_db));
+ if( strcmpi(key, "loginlog_table") == 0 )
+ safestrncpy(loginlog_table, value, sizeof(loginlog_table));
else
return false;