Author Topic: Problem with game password  (Read 2002 times)

nicel

  • PGP
  • Posts: 5
Problem with game password
« on: November 21, 2007, 05:26:07 AM »
Hello,

I have some problem with server this game on linux.

On my server.cfg I have:
set public "0"  // set to 0 if you don't want this on the public server list
set password "qwe123" // Password required to connect

Albo with start command I'd add +set public "0" .
Server is without pass :/ HLSW always said that server is without pass.
What I must do to have game pass ?

Thanks for help.

Sonny

  • 68 Carbine
  • Posts: 380
Re: Problem with game password
« Reply #1 on: November 21, 2007, 05:32:16 AM »
connect ur server. Login, and do cvar_set password qwe123

XtremeBain

  • Developer
  • Autococker
  • Posts: 1470
Re: Problem with game password
« Reply #2 on: November 21, 2007, 06:17:18 AM »
There is a password on the server, but none of the servers broadcast their password status to the server browsers.  If you try connecting to that server, it should give you 'bad password' messages until the player types 'password qwe123' in the console.

nicel

  • PGP
  • Posts: 5
Re: Problem with game password
« Reply #3 on: November 21, 2007, 02:27:58 PM »
Then server have pass but game monitor doesn't see this pass ?
I have game hosting in Poland.
I have public and private slots and monitor for checking that somebody turn off pass at private server. Monitor always say that server is without pass. Can I something do with this ?


jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Problem with game password
« Reply #4 on: November 21, 2007, 07:29:01 PM »
Make sure "passwordtimeout" and "match_timeout" are set to "0".

nicel

  • PGP
  • Posts: 5
Re: Problem with game password
« Reply #5 on: November 22, 2007, 06:12:33 AM »
In server.cfg ? Or in my game monitor ?

I have game monitor for this game from Q2.
Little bit of code:

Quote
        // get the info strings from server info stream
        $srv_rules['hostname']    = $this->getvalue('hostname',   $this->g_info);
        $srv_rules['gametype']    = $this->getvalue('gamename',   $this->g_info);
        $srv_rules['version']     = $this->getvalue('version',    $this->g_info);
        $srv_rules['mapname']     = $this->getvalue('mapname',    $this->g_info);
        $srv_rules['needpass']    = $this->getvalue('needpass',   $this->g_info);
        $srv_rules['maxplayers']  = $this->getvalue('maxclients', $this->g_info);

Next:

Quote
  if ($srv_rules['needpass'] == 1)
        {
            $srv_rules['pass'] .= $sets['pass'];
        }
        if ($srv_rules['needpass'] == 0)
        {
            $srv_rules['pass'] .= 'Nie';
        }

XtremeBain

  • Developer
  • Autococker
  • Posts: 1470
Re: Problem with game password
« Reply #6 on: November 22, 2007, 06:53:27 AM »
Don't use 'needpass' since it doesn't automatically get set when a password is required, at least in pball.  What you may want to try doing in this case is add the line 'set needpass "1" s' to your server config, and that monitor script should be able to pick it up.

If that's all that it takes to get server browsers to show the little padlock beside the server, I'll probably hack something into the engine code and maybe commit it for B20.

nicel

  • PGP
  • Posts: 5
Re: Problem with game password
« Reply #7 on: November 22, 2007, 07:17:30 AM »
I'd add set needpass "1" to server.cfg and nothing :/

For simple. I have this config in Q2 v3.20 and everything is fine with monitor:
Quote
set deathmatch "1"
set dmflags "16"
set timelimit "30"
set fraglimit "100"
set allow_download "1"
set allow_download_players "0"
set allow_download_models "1"
set allow_download_sounds "1"
set allow_download_maps "1"
set password "pass"
set rcon_password "rcon"
set spectator_password ""
set maxspectators "0"
set flood_waitdelay "10"
set flood_persecond "4"
set flood_msgs "4"
set sv_gravity "800"
set public "0"
set sv_noreload "0"
set sv_enforcetime "0"
set paused "0"
set coop "0"
set zombietime "2"
set timeout "125"
set logfile "0"
set log_stats "0"
set fixedtime "0"
set msg "1"
set filterban "1"
set rate "25000"
set sv_allow_map "1"
set allow_download_maps "1"
set allow_download_sounds "1"
set allow_download_models "0"
set allow_download_players "0"
set allow_download "1"
set dmflags "1072"
set deathmatch "1"
set ud_time "3"


XtremeBain

  • Developer
  • Autococker
  • Posts: 1470
Re: Problem with game password
« Reply #8 on: November 22, 2007, 07:21:10 AM »
Edit: totally mis-read your post.

I think the 'needpass' gets set by the game binary, and not the engine.  That's why it has always worked with certain mods, and never with paintball (even when it was still a Q2 mod running on the Q2 server/client).  It wouldn't hurt to try the 'set needpass "1" s' workaround in your server config.

Like 5th edit, it's too early for me....

Make sure you add the s after the value of the cvar.
set needpass "1" s

This will add it to the other variables that are automatically or have been specified to get sent when a server browser or monitor sends the server a status request.  Be careful not to add the 's' to too many cvars since it will start truncating the response when it reaches a certain number of bytes.

nicel

  • PGP
  • Posts: 5
Re: Problem with game password
« Reply #9 on: November 22, 2007, 08:14:56 AM »
Forget about 's' :)
Monitor see pass.
Thanks for help.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Problem with game password
« Reply #10 on: November 26, 2007, 12:32:31 PM »
Interesting - I always wondered how the server browsers knew if q2 games were passworded.  That should be easy enough to hack into either the game or the engine.