From 8acf5ed7880c1769d371bb07cb847d0c3a9d8dc7 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 15 Nov 2008 13:29:56 +0000 Subject: upgraded the master server code so it can handle more servers --- src/tools/fake_server.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/tools') diff --git a/src/tools/fake_server.c b/src/tools/fake_server.c index 1ea999fe..04eeac4d 100644 --- a/src/tools/fake_server.c +++ b/src/tools/fake_server.c @@ -91,8 +91,8 @@ static void writeint(int i) static void build_infomessage() { int i; - infomsg_size = sizeof(SERVERBROWSE_INFO); - memcpy(infomsg, SERVERBROWSE_INFO, infomsg_size); + infomsg_size = sizeof(SERVERBROWSE_OLD_INFO); + memcpy(infomsg, SERVERBROWSE_OLD_INFO, infomsg_size); writestr(version); writestr(server_name); @@ -147,8 +147,8 @@ static int run() { if(p.client_id == -1) { - if(p.data_size == sizeof(SERVERBROWSE_GETINFO) && - memcmp(p.data, SERVERBROWSE_GETINFO, sizeof(SERVERBROWSE_GETINFO)) == 0) + if(p.data_size == sizeof(SERVERBROWSE_OLD_GETINFO) && + memcmp(p.data, SERVERBROWSE_OLD_GETINFO, sizeof(SERVERBROWSE_OLD_GETINFO)) == 0) { send_serverinfo(&p.address); } @@ -163,11 +163,11 @@ static int run() /* send heartbeats if needed */ if(next_heartbeat < time_get()) { - next_heartbeat = time_get()+time_freq()*30; + next_heartbeat = time_get()+time_freq()*(15+(rand()%15)); send_heartbeats(); } - thread_sleep(10); + thread_sleep(100); } } -- cgit 1.4.1