Forráskód Böngészése

* Move ison timer to server_secondly

Bryan Drewery 16 éve
szülő
commit
450bbc24cb
2 módosított fájl, 14 hozzáadás és 11 törlés
  1. 1 11
      src/main.c
  2. 13 0
      src/mod/server.mod/server.c

+ 1 - 11
src/main.c

@@ -514,7 +514,7 @@ static void event_resettraffic()
 
 static void core_secondly()
 {
-  static int cnt = 0, ison_cnt = 0;
+  static int cnt = 0;
   time_t miltime;
 
   if (fork_interval && backgrd && ((now - lastfork) > fork_interval))
@@ -526,16 +526,6 @@ static void core_secondly()
     cnt = 0;
   }
 
-  if (!conf.bot->hub) {
-    if (ison_time == 0) //If someone sets this to 0, all hell will break loose!
-      ison_time = 10;
-    if (ison_cnt >= ison_time) {
-      server_send_ison();
-      ison_cnt = 0;
-    } else
-      ++ison_cnt;
-  }
-
   memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
   if (nowtm.tm_min != lastmin) {
     int i = 0;

+ 13 - 0
src/mod/server.mod/server.c

@@ -986,6 +986,19 @@ static void server_secondly()
   deq_msg();
   if (!resolvserv && serv < 0 && !trying_server)
     connect_server();
+
+  if (!conf.bot->hub) {
+    static int ison_cnt = 0;
+
+    if (ison_time == 0) //If someone sets this to 0, all hell will break loose!
+      ison_time = 10;
+    if (ison_cnt >= ison_time) {
+      server_send_ison();
+      ison_cnt = 0;
+    } else
+      ++ison_cnt;
+  }
+
 }
 
 static void server_check_lag()