Pages: [1]
  Print  
Author Topic: Server rejecting me for high ping without having an actual high ping  (Read 12732 times)
davidd
Half-Nub


Cakes 6
Posts: 99


[Z] server maintainer


« on: August 21, 2009, 11:13:48 AM »

I downloaded a map in about 3 seconds and server has problems keeping up i think. The server has the setting that a client is disconnected while downloading maps.

I am both client 3 and client 2 is my guess. client 2 before i downloaded the map, client 3 my reconnect after i downloaded the map.

Here is what the server said, you see it does not seem to reset the ping counter. Every challenge i send is seen as a higher ping anwser to the first server packet.

Code:
Client 3 connecting with 50 challenge ping
ClientConnect: 2
ClientUserinfoChanged: 2 n\^1[Z]^2Dav^4idd\t\2\model\sarge/red\hmodel\sarge/red\g_redteam\\g_blueteam\\c1\5\c2\5\hc\100\w\0\l\0\tt\0\tl\0
broadcast: print "^1[Z]^2Dav^4idd^7 connected\n"
Sending heartbeat to dpmaster.deathmask.net
broadcast: print "^1[Z]^2Dav^4idd^7 disconnected\n"
ClientDisconnect: 2
Sending heartbeat to dpmaster.deathmask.net
Client 3 connecting with 3000 challenge ping
Client 3 connecting with 6050 challenge ping
Client 3 connecting with 9000 challenge ping
Client 3 connecting with 12000 challenge ping
Client 3 connecting with 15000 challenge ping
Client 3 connecting with 18050 challenge ping
Client 3 connecting with 21050 challenge ping
Client 3 connecting with 24050 challenge ping
Client 3 connecting with 27050 challenge ping
Client 3 connecting with 30050 challenge ping
]sv_maxPing
"sv_maxPing" is:"150^7" default:"0^7"
Logged

Openarena, the freedom to contribute and extend.
Falkland
Member


Cakes 6
Posts: 590


« Reply #1 on: August 21, 2009, 11:32:11 AM »

I was thinking on this bug also in the case of the crash of your server.

Anyway this should be related to the use/reuse of the same challenge.

A tremfusion developer made a patch for this. The patch adds a check in the server side code for discovereing if a challenge is already in use :

Code:
Index: src/server/sv_client.c
===================================================================
--- src/server/sv_client.c (revision 1043)
+++ src/server/sv_client.c (working copy)
@@ -69,7 +69,6 @@
  // this is the first time this client has asked for a challenge
  challenge = &svs.challenges[oldest];
 
- challenge->challenge = ( (rand() << 16) ^ rand() ) ^ svs.time;
  challenge->adr = from;
  challenge->firstTime = svs.time;
  challenge->time = svs.time;
@@ -78,7 +77,11 @@
  }
 
  // send the challengeResponse
- challenge->pingTime = svs.time;
+ if ( !challenge->inuse ) {
+ challenge->pingTime = svs.time;
+ challenge->challenge = ( (rand() << 16) ^ rand() ) ^ svs.time;
+ challenge->inuse = qtrue;
+ }
  NET_OutOfBandPrint( NS_SERVER, from, "challengeResponse %i", challenge->challenge );
 }
 
@@ -341,6 +344,7 @@
  for (i = 0 ; i < MAX_CHALLENGES ; i++, challenge++) {
  if ( NET_CompareAdr( drop->netchan.remoteAddress, challenge->adr ) ) {
  challenge->connected = qfalse;
+ challenge->inuse = qfalse;
  break;
  }
  }
Index: src/server/server.h
===================================================================
--- src/server/server.h (revision 1043)
+++ src/server/server.h (working copy)
@@ -189,6 +189,7 @@
  int pingTime; // time the challenge response was sent to client
  int firstTime; // time the adr was first used, for authorize timeout checks
  qboolean connected;
+ qboolean inuse;
 } challenge_t;
 
 
Index: src/server/sv_main.c
===================================================================
--- src/server/sv_main.c (revision 1043)
+++ src/server/sv_main.c (working copy)
@@ -542,7 +542,13 @@
  } else if (!Q_stricmp(c, "getchallenge")) {
  SV_GetChallenge( from );
  } else if (!Q_stricmp(c, "connect")) {
+ int i;
  SV_DirectConnect( from );
+ for (i=0 ; i<MAX_CHALLENGES ; i++) {
+ if (NET_CompareAdr(from, svs.challenges[i].adr)) {
+ svs.challenges[i].inuse = qfalse;
+ }
+ }
  } else if (!Q_stricmp(c, "rcon")) {
  SVC_RemoteCommand( from, msg );
  } else if (!Q_stricmp(c, "disconnect")) {

unfortunately the tremfusion site is down atm , so i can't check the related proper description.
Logged
davidd
Half-Nub


Cakes 6
Posts: 99


[Z] server maintainer


« Reply #2 on: August 21, 2009, 01:56:49 PM »


Code:
[halfleven@lood ~/source/081/openarena-engine-0.8.1]$ patch < challengecheck.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|
|Index: src/server/sv_client.c
|===================================================================
|--- src/server/sv_client.c     (revision 1043)
|+++ src/server/sv_client.c     (working copy)
--------------------------
File to patch: ^C[halfleven@lood ~/source/081/openarena-engine-0.8.1]$ ls
BUGS                            challengecheck.patch
COPYING.txt                     code
ChangeLog                       cross-make-mingw.sh
Makefile                        id-readme.txt
Makefile.local                  make-macosx-ub.sh
Makefile.orig                   md4-readme.txt
NOTTODO                         misc
README                          patch-code_qcommon_net_ip_c
TODO                            ui
build                           voip-readme.txt
[halfleven@lood ~/source/081/openarena-engine-0.8.1]$ cd code/
[halfleven@lood ~/source/081/openarena-engine-0.8.1/code]$ ls
AL              cgame           libcurl         q3_ui           server
SDL12           client          libs            qcommon         sys
asm             game            libspeex        renderer        ui
botlib          jpeg-6          null            sdl
[halfleven@lood ~/source/081/openarena-engine-0.8.1/code]$     
[halfleven@lood ~/source/081/openarena-engine-0.8.1/code]$ cd ..
[halfleven@lood ~/source/081/openarena-engine-0.8.1]$ ln -s code src
[halfleven@lood ~/source/081/openarena-engine-0.8.1]$ patch < challengecheck.pat
ch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|
|Index: src/server/sv_client.c
|===================================================================
|--- src/server/sv_client.c     (revision 1043)
|+++ src/server/sv_client.c     (working copy)
--------------------------
Patching file src/server/sv_client.c using Plan A...
Hunk #1 succeeded at 73 (offset 4 lines).
Hunk #2 failed at 81.
Hunk #3 failed at 348.
2 out of 3 hunks failed--saving rejects to src/server/sv_client.c.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: src/server/server.h
|===================================================================
|--- src/server/server.h        (revision 1043)
|+++ src/server/server.h        (working copy)
--------------------------
Patching file src/server/server.h using Plan A...
Hunk #1 succeeded at 208 (offset 19 lines).
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: src/server/sv_main.c
|===================================================================
|--- src/server/sv_main.c       (revision 1043)
|+++ src/server/sv_main.c       (working copy)
--------------------------
Patching file src/server/sv_main.c using Plan A...
Hunk #1 failed at 542.
1 out of 1 hunks failed--saving rejects to src/server/sv_main.c.rej
done
[halfleven@lood ~/source/081/openarena-engine-0.8.1]$





manualy changed the code to this:
Code:
                SV_GetChallenge( from );
        } else if (!Q_stricmp(c, "connect")) {
                int i;
                SV_DirectConnect( from );
                for (i=0 ; i<MAX_CHALLENGES ; i++) {
                        if (NET_CompareAdr(from, svs.challenges[i].adr)) {
                                svs.challenges[i].inuse = qfalse;
                        }
                }
#ifndef STANDALONE
sv_client.c I wonder i have STANDALONE defined. I think i do.
Code:
#ifdef STANDALONE
        //if(Cvar_VariableIntegerValue("com_standalone"))
        //{
                //challenge->pingTime = svs.time;
                if ( !challenge->inuse ) {
                        challenge->pingTime = svs.time;
                        challenge->challenge = ( (rand() << 16) ^ rand() ) ^ svs
.time;
                        challenge->inuse = qtrue;
                }
                NET_OutOfBandPrint( NS_SERVER, from, "challengeResponse %i", cha
llenge->challenge );
        //}
#else
Logged

Openarena, the freedom to contribute and extend.
davidd
Half-Nub


Cakes 6
Posts: 99


[Z] server maintainer


« Reply #3 on: August 21, 2009, 02:08:14 PM »

Well i added simular code in the other spots where the variable 'pingtime' was set
Code:
src/server/sv_client.c: 1949 lines, 56123 characters.
[halfleven@lood ~/source/081/openarena-engine-0.8.1]$ gmake
gmake[1]: Entering directory `/usr/home/halfleven/source/081/openarena-engine-0.8.1'

Building openarena in build/release-freebsd-i386:
  PLATFORM: freebsd
  ARCH: i386
  VERSION: 1.35
  COMPILE_PLATFORM: freebsd
  COMPILE_ARCH: i386
  CC: cc

  CFLAGS:
    -MMD
    -Wall
    -fno-strict-aliasing
    -Wimplicit
    -Wstrict-prototypes
    -DUSE_ICON
    -I/usr/local/include/SDL
    -I/usr/local/include
    -D_GNU_SOURCE=1
    -D_REENTRANT
    -DUSE_OPENAL
    -DUSE_OPENAL_DLOPEN
    -DUSE_CODEC_VORBIS
    -DUSE_MUMBLE
    -DUSE_VOIP
    -DFLOATING_POINT
    -DUSE_ALLOCA
    -Icode/libspeex/include
    -DUSE_LOCAL_HEADERS
    -DSTANDALONE
    -DPRODUCT_VERSION="1.35"
    -DNDEBUG
    -O3
    -mtune=pentiumpro
    -march=pentium
    -fomit-frame-pointer
    -pipe
    -ffast-math
    -falign-loops=2
    -falign-jumps=2
    -falign-functions=2
    -funroll-loops
    -fstrength-reduce

  LDFLAGS:
    -lm

  Output:
    build/release-freebsd-i386/oa_ded.i386
    build/release-freebsd-i386/openarena.i386

gmake[2]: Entering directory `/usr/home/halfleven/source/081/openarena-engine-0.8.1'
DED_CC code/server/sv_bot.c
DED_CC code/server/sv_client.c
DED_CC code/server/sv_ccmds.c
DED_CC code/server/sv_game.c
DED_CC code/server/sv_init.c
DED_CC code/server/sv_main.c
DED_CC code/server/sv_net_chan.c
DED_CC code/server/sv_snapshot.c
DED_CC code/server/sv_world.c
LD build/release-freebsd-i386/oa_ded.i386
CC code/server/sv_bot.c
CC code/server/sv_ccmds.c
CC code/server/sv_client.c
CC code/server/sv_game.c
CC code/server/sv_init.c
CC code/server/sv_main.c
CC code/server/sv_net_chan.c
CC code/server/sv_snapshot.c
CC code/server/sv_world.c
LD build/release-freebsd-i386/openarena.i386
gmake[2]: Leaving directory `/usr/home/halfleven/source/081/openarena-engine-0.8.1'
gmake[1]: Leaving directory `/usr/home/halfleven/source/081/openarena-engine-0.8.1'
[halfleven@lood ~/source/081/openarena-engine-0.8.1]$
copied it to the server, now running but i dont have a client right here
(i am doing this from a club)
Logged

Openarena, the freedom to contribute and extend.
Falkland
Member


Cakes 6
Posts: 590


« Reply #4 on: August 21, 2009, 02:44:58 PM »

Well i added simular code in the other spots where the variable 'pingtime' was set

I was going to suggest the same thing. Anyway that code section is cleaner in the latest ioquake3 revision , so applying that patch should be easier.
Logged
davidd
Half-Nub


Cakes 6
Posts: 99


[Z] server maintainer


« Reply #5 on: August 21, 2009, 04:48:27 PM »

[ignore this]http://pastebin.com/d7f04040b[/ignore this]

This is just the server restarting afterwards

Code:
Kill: 7 4 7: Dark killed Tanisha by MOD_ROCKET_SPLASH
Award: 7 1: Dark gained the EXCELLENT award!
********************
ERROR: G_Alloc: failed on allocation of 9088 bytes

********************
----- Server Shutdown (Server crashed: G_Alloc: failed on allocation of 9088 bytes
) -----
Sending heartbeat to dpmaster.deathmask.net
Sending heartbeat to dpmaster.deathmask.net
==== ShutdownGame ====
ShutdownGame:
------------------------------------------------------------
AAS shutdown.
recursive error after: G_Alloc: failed on allocation of 9088 bytes

I was running it with lots of bots, and it crashed on out of mem.

crashlog.txt attached.

I guess it is prolly some ulimits, since there is 2.9 G of mem unused
Logged

Openarena, the freedom to contribute and extend.
Falkland
Member


Cakes 6
Posts: 590


« Reply #6 on: August 21, 2009, 05:22:15 PM »


I guess it is prolly some ulimits, since there is 2.9 G of mem unused

Try to increase com_hunkMegs ( eg adding +set com_hunkMegs 256 or 512 )
Logged
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #7 on: August 22, 2009, 01:15:10 AM »

recursive error after: G_Alloc: failed on allocation of 9088 bytes
G_Alloc has only a limited amount of memory available this is hardcoded. Every time a bot join it will use a little of this memory, the memory will be freed upon map restart and the game will crash if it runs out before.
Logged

There are nothing offending in my posts.
davidd
Half-Nub


Cakes 6
Posts: 99


[Z] server maintainer


« Reply #8 on: August 25, 2009, 07:42:13 AM »

Ha, i almost fixed the modSDK build on freebsd (primrose could not do this either on netbsd)

in the directory code/tools/ there is a subdir asm. If the build of q3asm fails, it copies a linux binary that is allready there.
mv code/tools/asm/q3asm code/tools/asm/linux.q3asm

After that it will try to compile it. But it fails because -Werror and some warning about "if (qcode)" is always true.

removing the -Werror makes the q3asm compile and output lots more stuff with gmake.

It might be possible to do something like -Wno-strict-true-checking, but i am too lazy to find out which one it is precisely.

Logged

Openarena, the freedom to contribute and extend.
davidd
Half-Nub


Cakes 6
Posts: 99


[Z] server maintainer


« Reply #9 on: August 25, 2009, 07:45:58 AM »

Sorry non primrose people for the last post:

com_hunkmegs does not help for lots of players, that memory is allocated somewhere else. (modsdk/code/game/cg_mem.c POOLSIZE)
but requires a recompile.

only somethings awry with compiling.

Logged

Openarena, the freedom to contribute and extend.
Falkland
Member


Cakes 6
Posts: 590


« Reply #10 on: August 25, 2009, 07:49:58 AM »

...
But it fails because -Werror
...

technically it fails because the -Werror switch forces the compiler to treat every warning as an error.
 
EDIT : anyway there were some cleaner commits in the ioquake3 tree about the challenge bug

- http://svn.icculus.org/quake3?view=rev&revision=1566

Quote
Make servers echo challenge codes from client getchallenge commands

- http://svn.icculus.org/quake3?view=rev&revision=1567

Quote
Make client send a random challenge number in getchallenge requests

maybe it could be useful to have a new stability and security fixes engine _ONLY_ update , because the current OA081 engine suffers also of the callvote bug ( as now only the RN network and few other servers are running a patched/ an updated engine )
« Last Edit: August 25, 2009, 08:49:32 AM by Falkland » Logged
Falkland
Member


Cakes 6
Posts: 590


« Reply #11 on: August 25, 2009, 10:21:13 AM »


com_hunkmegs does not help for lots of players, that memory is allocated somewhere else. (modsdk/code/game/cg_mem.c POOLSIZE)
but requires a recompile.


I see , POOLSIZE is actually 256K ... maybe it could be doubled in OAX since nowadays machine are common to have at least 1GB or more.

anyway I suggest to not install a new VM because OA081 users will not able to join your servers. U can use an updated engine but not an updated VM on a public server ( unless u will produce the new VM in a pk3 file which name doesn't start with pak prefix so it to be downloadable )
Logged
davidd
Half-Nub


Cakes 6
Posts: 99


[Z] server maintainer


« Reply #12 on: August 25, 2009, 01:45:03 PM »

I see , POOLSIZE is actually 256K ... maybe it could be doubled in OAX since nowadays machine are common to have at least 1GB or more.
Upgrade it to half of a MB? i think we have a bit more memory to spare. It takes about 26 bots to go out of mem.
I would love to try 64 players on really big maps. I think it would be hilarious.
maybe just make it 1 or 2 MB?
Quote
anyway I suggest to not install a new VM because OA081 users will not able to join your servers. U can use an updated engine but not an updated VM on a public server ( unless u will produce the new VM in a pk3 file which name doesn't start with pak prefix so it to be downloadable )
Yes i understand, as primrose aptly put it : "you would be running a mod"
The trouble is, on my amd64 machine, i run interpreted, /vminfo told me. If this could fix that, than i am willing to consider "running a mod", at least on one of the servers. (the brightskins server is in fact already a mod)

But getting sidetracked here. I think it would be good for oa to have some of these bugfixes.

I have one other bug that is really annoying too. Maybe something for a new topic. If i am as stupid as to make a typingmistake in the mapcycle, and nextmap lets the server try to change to some map that does not exist, the players all remain in the final score screen, bots join the game because of bot_minplayers, and it takes a reconnect to join the game again. (very costly typo's). Quite often in this case, the server crashes at the following nextmap. (a console prompt without rcon crash)
Logged

Openarena, the freedom to contribute and extend.
Falkland
Member


Cakes 6
Posts: 590


« Reply #13 on: August 25, 2009, 03:11:52 PM »

I see , POOLSIZE is actually 256K ... maybe it could be doubled in OAX since nowadays machine are common to have at least 1GB or more.
Upgrade it to half of a MB? i think we have a bit more memory to spare. It takes about 26 bots to go out of mem.
I would love to try 64 players on really big maps. I think it would be hilarious.
maybe just make it 1 or 2 MB?
Quote
anyway I suggest to not install a new VM because OA081 users will not able to join your servers. U can use an updated engine but not an updated VM on a public server ( unless u will produce the new VM in a pk3 file which name doesn't start with pak prefix so it to be downloadable )
Yes i understand, as primrose aptly put it : "you would be running a mod"
The trouble is, on my amd64 machine, i run interpreted, /vminfo told me. If this could fix that, than i am willing to consider "running a mod", at least on one of the servers. (the brightskins server is in fact already a mod)

But getting sidetracked here. I think it would be good for oa to have some of these bugfixes.

I have one other bug that is really annoying too. Maybe something for a new topic. If i am as stupid as to make a typingmistake in the mapcycle, and nextmap lets the server try to change to some map that does not exist, the players all remain in the final score screen, bots join the game because of bot_minplayers, and it takes a reconnect to join the game again. (very costly typo's). Quite often in this case, the server crashes at the following nextmap. (a console prompt without rcon crash)

Well I have in my engine some expanded buffers ( eg console text buffer expanded from 16K to 1M ) but try to understand that the engine was originally coded when having more than 128MB was like having an out of this world machine and that it was not revisioned in that aspect since ages.

BTW maybe I was wrong : changing POOLSIZE doesn't affect physics , so the client should be able to join and play even if they don't have the relative pk3 ... eg u can recompile the entire VM , putting all in a pak7-patch.pk3 so the changes to be server-side only , where they are strictly needed.

For the rotation bug we could implement a parser that checks all the legal map names ( the files *.bsp ) before the nextmap command is executed : if the map is in the list the nextmap command will be executed , if not the nextmap will be executed with the first map on the list ... or we could parse the map rotation list at server startup/server restart : if a map is not available , the server will not start and a mex will appear ( eg ... ERROR : map <illegal mapname> doesnt exist ; pls check your cfg )

Anyway , I'm ok with a security fixes/stability engine update ... I am running myself an engine based on the latest ioq3 rev ( 1582 ) plus OA specific changes + some other patches (not strictly security patches ; all tracked and reported in the development thread ) ... I was the only one reporting the callvote bug to the RN admin when I knew it and he was the only one that backported the changes quite immidiately and set his server up and running with the new recompiled engine just the day after.

The security fixes/stability update should be periodical or as needed and it should contain only the bug fixes and the OA specific engine changes , no other new/ experimental features which should be available with test binaries and/or with major update/a new version
« Last Edit: August 27, 2009, 08:17:07 AM by Falkland » Logged
Pages: [1]
  Print  
 
Jump to: