diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-11-15 13:29:56 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-11-15 13:29:56 +0000 |
| commit | 8acf5ed7880c1769d371bb07cb847d0c3a9d8dc7 (patch) | |
| tree | 744d974f3d94eaeb114c16c236dfb4f473673c09 /src/tools/fake_server.c | |
| parent | 54429b70cfc57ada380af86127a941f3d20235f4 (diff) | |
| download | zcatch-8acf5ed7880c1769d371bb07cb847d0c3a9d8dc7.tar.gz zcatch-8acf5ed7880c1769d371bb07cb847d0c3a9d8dc7.zip | |
upgraded the master server code so it can handle more servers
Diffstat (limited to 'src/tools/fake_server.c')
| -rw-r--r-- | src/tools/fake_server.c | 12 |
1 files changed, 6 insertions, 6 deletions
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); } } |