diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-09-09 18:21:14 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-09-09 18:21:14 +0000 |
| commit | 3f4587ede831760b2f6976960658d202c9d847ff (patch) | |
| tree | 6c3a22251906673e5e7491dcd86faec23887691b /src/tools/crapnet.cpp | |
| parent | 350e968f514a00d4a89395ed13e415103390b9d9 (diff) | |
| download | zcatch-3f4587ede831760b2f6976960658d202c9d847ff.tar.gz zcatch-3f4587ede831760b2f6976960658d202c9d847ff.zip | |
a lot of changes. client side prediction added
Diffstat (limited to 'src/tools/crapnet.cpp')
| -rw-r--r-- | src/tools/crapnet.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/crapnet.cpp b/src/tools/crapnet.cpp index 5b7adf52..1c5e3dc3 100644 --- a/src/tools/crapnet.cpp +++ b/src/tools/crapnet.cpp @@ -38,8 +38,8 @@ int run(int port, NETADDR4 dest) if(bytes <= 0) break; - if((rand()%10) == 0) // drop the packet - continue; + //if((rand()%10) == 0) // drop the packet + // continue; // create new packet packet *p = (packet *)mem_alloc(sizeof(packet)+bytes, 1); @@ -100,13 +100,13 @@ int run(int port, NETADDR4 dest) net_udp4_send(socket, &p->send_to, p->data, p->data_size); // update lag - double flux = rand()/(double)RAND_MAX; + double flux = 0; //rand()/(double)RAND_MAX; int ms_spike = 0; - int ms_flux = 20; - int ms_ping = 20; + int ms_flux = 00; + int ms_ping = 100; current_latency = ((time_freq()*ms_ping)/1000) + (int64)(((time_freq()*ms_flux)/1000)*flux); // 50ms - if((p->id%100) == 0) + if(ms_spike && (p->id%100) == 0) current_latency += (time_freq()*ms_spike)/1000; mem_free(p); |