Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: TestClients

  1. #11
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    Quote Originally Posted by Tally View Post
    No, I believe the problem is that the bots aren't given their notifications as they pass through the menus. They notify first for team, then for team weapons. If you don't do them, they wont spawn.
    They are spawning (self thread maps\mp\gametypes\_zom::spawnPlayer(); ) but one weird thing is, they have still connecting status icon, even i changed it to "" ( self.statusicon = ""; ) Btw, scripts wont work correctly on bots, because script are still waiting for connected player... (stuck on self waittill("begin") )
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  2. #12
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by RobsoN View Post
    (stuck on self waittill("begin") )
    just use the default callback_playerconnected() procedure (or the slightly modified one below)

    Code:
    Callback_PlayerConnect()
    {
    	self endon( "disconnect" );
    
    	self thread notifyConnecting();
    
    	self.statusicon = "hud_status_connecting";
    
    	self waittill( "begin" );
    
    	self.statusicon = "";
    	
    	waittillframeend;
    //...do your callback catching stuff here, AFTER everything went fine
    }
    
    notifyConnecting()
    {
    	self endon( "disconnect" );
    	self endon( "begin" );
    
    	waittillframeend;
    
    	if( isDefined( self ) )
    	{
    		level notify( "connecting" , self );
    	}
    }
    add a shitload of debug-iprintln()'s in combination with getTime() to see where it stucks and why

  3. The Following User Says Thank You to serthy For This Useful Post:

    RobsoN (15th October 2013)

  4. #13
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    Wow, really respect dude. It's working well now. Thank you so much!
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  5. #14
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    What about on map change?

    I tried adding test clients using addTestClient() (which, I think, is a stock function). The bot connects, gets to the spectators team, has a 999 ping, no problem there, since I have the rest of the functions to spawn it and make it play the game.
    On map change, they just have the connecting status (with -1 ping). I can kick them, but they won't join, and I can't access them (they are not included in the list of players anymore). Can I do something here to access them? I'm thinking about kicking and re-adding them on every map start if there's no better solution.
    set logfile 2

  6. #15
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Map change is done (in bot-mods without libcod) tis way:

    - kick all player, but let them /reconnect automatically after a few seconds (execClientCommand()-hack)
    - kill the server (removes the bots)
    - retsart the server with your new map
    - now the players start to reconnect

    you can have a peek on cod2/cod4 bot mods for this
    iirc here is likely a thread abut this already

  7. The Following User Says Thank You to serthy For This Useful Post:

    guiismiti (21st March 2017)

  8. #16
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Or use the kickbot libcod function?

  9. #17
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Appending to serthys answer, write logPrint("QUIT"); and let B3 register this and send "quit" via rcon, while the server.sh start script is in an infinite loop.

    But I don't know if that is what you want, guiismiti, since two years ago we had same topic (even started by you ).

    http://killtube.org/showthread.php?1...Command-Adding!
    http://killtube.org/showthread.php?1...ot-%28CoD-2%29
    timescale 0.01

  10. #18
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Yea, the kill method worked well.
    Without libcod, I had to give a player rcon access to execute the kill.cfg (doesn't look exploitable).
    Now I'm thinking about
    - writing a file with the number of the name of the bots;
    - changing the map without killing;
    - kicking the spectator bots.
    The advantage is, players won't need to reconnect.
    set logfile 2

  11. #19
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Kick bots before you change map so you still know which players are the bots.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  12. #20
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I don't know what I missed last time I dealed with bots....

    I just used the kick command while they were connected, and they got kicked successfully... I remember having a lot of trouble last time (over a year ago).
    set logfile 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •