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 | |
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')
-rw-r--r-- | src/login/login.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/login/login.c b/src/login/login.c index 0cd9b5b9b..949b1d80c 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -262,6 +262,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;
+}
+
//----------------------------------------------------------------------
// Determine if an account (id) is a GM account
// and returns its level (or 0 if it isn't a GM account or if not found)
@@ -1958,6 +1970,16 @@ int parse_fromchar(int fd) { }
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;
+
case 0x3000: //change sex for chrif_changesex()
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
return 0;
@@ -4166,6 +4188,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();
|