summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-22 20:38:26 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-22 20:38:26 +0000
commit38b5e25fd06a5d03413f59e3e37c6ffc21d0d02d (patch)
tree2ac7f91b25ed1c8da6e0e8bae0bb1e24b2c144d9 /src/map/map.c
parent256a7ebe4e172686f547cf406fd642d6e76e4ed4 (diff)
downloadhercules-38b5e25fd06a5d03413f59e3e37c6ffc21d0d02d.tar.gz
hercules-38b5e25fd06a5d03413f59e3e37c6ffc21d0d02d.tar.bz2
hercules-38b5e25fd06a5d03413f59e3e37c6ffc21d0d02d.tar.xz
hercules-38b5e25fd06a5d03413f59e3e37c6ffc21d0d02d.zip
- Added the new mail system. Requires optimization and tests.
- Updated the maildb sql structure. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11548 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c67
1 files changed, 15 insertions, 52 deletions
diff --git a/src/map/map.c b/src/map/map.c
index db4f7d077..929ee7c36 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -75,16 +75,6 @@ char log_db_pw[32] = "ragnarok";
char log_db[32] = "log";
Sql* logmysql_handle;
-// mail system
-int mail_server_enable = 0;
-char mail_server_ip[32] = "127.0.0.1";
-int mail_server_port = 3306;
-char mail_server_id[32] = "ragnarok";
-char mail_server_pw[32] = "ragnarok";
-char mail_server_db[32] = "ragnarok";
-char mail_db[32] = "mail";
-Sql* mail_handle;
-
#endif /* not TXT_ONLY */
int lowest_gm_level = 1;
@@ -1857,6 +1847,21 @@ struct map_session_data * map_nick2sd(const char *nick)
return NULL;
}
+struct map_session_data * map_nick2sd_nocase(const char *nick)
+{
+ int i, users;
+ struct map_session_data **pl_allsd;
+
+ pl_allsd = map_getallusers(&users);
+ for (i = 0; i < users; i++)
+ {
+ if ( !strcmp(pl_allsd[i]->status.name, nick) )
+ return pl_allsd[i];
+ }
+
+ return NULL;
+}
+
/*==========================================
* id番?の物を探す
* 一三bjectの場合は配列を引くのみ
@@ -2888,22 +2893,6 @@ int inter_config_read(char *cfgName)
strcpy(log_db_pw, w2);
} else if(strcmpi(w1,"log_db_port")==0) {
log_db_port = atoi(w2);
- // Mail Server SQL
- } else if(strcmpi(w1,"mail_server_enable")==0){
- mail_server_enable = config_switch(w2);
- ShowStatus ("Using Mail Server: %s\n",w2);
- } else if(strcmpi(w1,"mail_server_ip")==0){
- strcpy(mail_server_ip, w2);
- } else if(strcmpi(w1,"mail_server_port")==0){
- mail_server_port=atoi(w2);
- } else if(strcmpi(w1,"mail_server_id")==0){
- strcpy(mail_server_id, w2);
- } else if(strcmpi(w1,"mail_server_pw")==0){
- strcpy(mail_server_pw, w2);
- } else if(strcmpi(w1,"mail_server_db")==0){
- strcpy(mail_server_db, w2);
- } else if(strcmpi(w1,"mail_db")==0) {
- strcpy(mail_db, w2);
#endif
//support the import command, just like any other config
} else if(strcmpi(w1,"import")==0){
@@ -2933,20 +2922,6 @@ int map_sql_init(void)
if ( SQL_ERROR == Sql_SetEncoding(mmysql_handle, default_codepage) )
Sql_ShowDebug(mmysql_handle);
- if(mail_server_enable)
- {
- // mail system
- mail_handle = Sql_Malloc();
-
- ShowInfo("Connecting to the Mail DB Server....\n");
- if( SQL_ERROR == Sql_Connect(mail_handle, mail_server_id, mail_server_pw, mail_server_ip, mail_server_port, mail_server_db) )
- exit(EXIT_FAILURE);
-
- if( strlen(default_codepage) > 0 )
- if ( SQL_ERROR == Sql_SetEncoding(mail_handle, default_codepage) )
- Sql_ShowDebug(mail_handle);
- }
-
return 0;
}
@@ -2963,13 +2938,6 @@ int map_sql_close(void)
logmysql_handle = NULL;
}
- if(mail_server_enable)
- {
- ShowStatus("Close Mail DB Connection....\n");
- Sql_Free(mail_handle);
- mail_handle = NULL;
- }
-
return 0;
}
@@ -2999,8 +2967,6 @@ int map_sql_ping(int tid, unsigned int tick, int id, int data)
Sql_Ping(mmysql_handle);
if (log_config.sql_logs)
Sql_Ping(logmysql_handle);
- if(mail_server_enable)
- Sql_Ping(mail_handle);
return 0;
}
@@ -3382,9 +3348,6 @@ int do_init(int argc, char *argv[])
do_init_npc();
do_init_unit();
#ifndef TXT_ONLY /* mail system [Valaris] */
- if(mail_server_enable)
- do_init_mail();
-
if (log_config.sql_logs)
log_sql_init();