diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-21 10:55:26 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-21 10:55:26 +0000 |
commit | bc03dcf3609194073da5fdf8e2e267a90f64cc48 (patch) | |
tree | e77c36250e9986b6b939bd875a0772db89d05df6 /src/login_sql | |
parent | 3c585c70f62a60068cca56be027a4f02b958a787 (diff) | |
download | hercules-bc03dcf3609194073da5fdf8e2e267a90f64cc48.tar.gz hercules-bc03dcf3609194073da5fdf8e2e267a90f64cc48.tar.bz2 hercules-bc03dcf3609194073da5fdf8e2e267a90f64cc48.tar.xz hercules-bc03dcf3609194073da5fdf8e2e267a90f64cc48.zip |
* [Added]:
- DNS (WAN) sync for those pesky disconnections (dynamic ip renewal).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7275 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql')
-rw-r--r-- | src/login_sql/login.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index f6365e0f2..14c71722c 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -210,6 +210,18 @@ int waiting_disconnect_timer(int tid, unsigned int tick, int id, int data) return 0;
}
+static int sync_ip_addresses(int tid, unsigned int tick, int id, int data){
+ int i;
+ ShowInfo("IP Sync in progress...\n");
+ for(i = 0; i < MAX_SERVERS; i++) {
+ if (server_fd[i] >= 0) {
+ WFIFOW(server_fd[i], 0) = 0x2735;
+ WFIFOSET(server_fd[i],2);
+ }
+ }
+ return 0;
+}
+
//-----------------------------------------------------
// Read GM accounts
//-----------------------------------------------------
@@ -1403,6 +1415,16 @@ int parse_fromchar(int fd){ mysql_free_result(sql_res);
}
break;
+
+ case 0x2736: // WAN IP update from char-server
+ for(i = 0; i < MAX_SERVERS; i++) {
+ if (server_fd[i] == fd) {
+ ShowInfo("IP Sync (Server #%d) successful.\n",i);
+ server[i].ip = RFIFOL(fd,2);
+ }
+ }
+ RFIFOSKIP(fd,6);
+ break;
default:
ShowError("login: unknown packet %x! (from char).\n", RFIFOW(fd,0));
session[fd]->eof = 1;
@@ -2348,6 +2370,10 @@ int do_init(int argc,char **argv){ add_timer_func_list(online_data_cleanup, "online_data_cleanup");
add_timer_interval(gettick() + 600*1000, online_data_cleanup, 0, 0, 600*1000); // every 10 minutes cleanup online account db.
+ add_timer_func_list(sync_ip_addresses, "sync_ip_addresses");
+ add_timer_interval(gettick() + 600*1000, sync_ip_addresses, 0, 0, 600*1000); // Every 10 minutes to sync IPs.
+
+
if (console) {
set_defaultconsoleparse(parse_console);
start_console();
|