documentation
download & extend
community & support
B3 hosting
May 24, 2012, 12:51:35 AM
Home
Features
Get Started
Supported Games
Forums
Help
Search
Tags
Groupware
Login
Register
Activation Mail
It appears you have not registered with our community. To register please click here ...
You are here:
Big Brother Bot Forum
Community Developers
Plugin Developers
Rehash client info on B3 start?
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Rehash client info on B3 start? (Read 489 times)
Leito
Beta Testers
OS: Linux
Type: Owner dedicated server(s)
Gameservers:
UrT
Posts: 80
Offline
Rehash client info on B3 start?
«
on:
October 15, 2011, 08:02:02 AM »
Hey guys! My plugin relies heavily on the accuracy of b3.team. If I have to restart B3 for maintenance, and there are players already on the server, B3 does not recognize the players on the server's teams. Is there any way I can rehash the connected players' teams on B3 start?
Thanks,
Leito
Logged
Courgette
Senior Dev.
OS: Linux
Type: Home user
Posts: 3484
Offline
Support Specialty:
B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
Re: Rehash client info on B3 start?
«
Reply #1 on:
October 15, 2011, 09:33:45 AM »
Hi Leito,
try iourt41.py v1.11.3 that you can find on my github repo :
https://github.com/courgette/big-brother-bot/raw/79fc3bc7374c4de71986f957835529efb2e80040/b3/parsers/iourt41.py
it has a better way of recoginizing teams when B3 starts and should help your plugin.
Please report any progress/issue with this new code.
Logged
Follow me :
@cucurb
.~. new
Smokin' guns official website
Courgette
Senior Dev.
OS: Linux
Type: Home user
Posts: 3484
Offline
Support Specialty:
B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
Re: Rehash client info on B3 start?
«
Reply #2 on:
October 16, 2011, 09:26:10 AM »
I've updated further the above code. See
https://github.com/courgette/big-brother-bot/blob/4748b133217b87b6e2e64cb1a01564a50b40c45f/b3/parsers/iourt41.py
for latest
Logged
Follow me :
@cucurb
.~. new
Smokin' guns official website
Leito
Beta Testers
OS: Linux
Type: Owner dedicated server(s)
Gameservers:
UrT
Posts: 80
Offline
Re: Rehash client info on B3 start?
«
Reply #3 on:
October 17, 2011, 08:19:47 AM »
Awesome thank you! It seems to be running well on my dev server. I'll move it over to the public server tomorrow and let you know how it works out. I've gotta finish this college application essay by tonight!
Unrelated: Also, should the --InitGame-- and --InitRound-- game log statements both trigger EVT_GAME_ROUND_START? It seems as if InitGame is better as a separate event, especially if you are using ROUND_START to cue rcon commands on the start of TeamSurvivor rounds. B3 sends rcon commands to clients loading the map (because InitGame triggers the ROUND_START event) and sometimes causes clients to be dropped with the 'A reliable command was cycled out' message. InitGame is the beginning of a new map. InitRound is the beginning of a Team Survivor round. I think they should be separated. Thoughts?
«
Last Edit: October 17, 2011, 08:26:40 AM by Leito
»
Logged
Garreth
Beta Testers
OS: Linux
Type: Owner dedicated server(s)
Gameservers:
UrT
Posts: 244
Offline
Re: Rehash client info on B3 start?
«
Reply #4 on:
October 17, 2011, 09:07:38 AM »
Also I'm not reporting any issues so far with the new parser.
Logged
Looking for Polish servers?
WickedShell
Dev. Team
OS: Linux
Type: Home user
Gameservers:
UrT
Posts: 198
Offline
Re: Rehash client info on B3 start?
«
Reply #5 on:
October 18, 2011, 06:36:37 AM »
I don't have a server to test this with at the moment, but when I looked at the changelog for the parser I noticed you renamed the local variable map to map_name, but then immediately do an if map: rather then if map_name:
That's only an error if map is not a global, and I'm not overly familiar with the internals of B3 python stuff, but I think that if needs to be renamed?
Logged
EchelonV2 Development;
https://github.com/WickedShell/echelon
EchelonV2 Issue Tracker;
https://github.com/WickedShell/echelon/issues
Courgette
Senior Dev.
OS: Linux
Type: Home user
Posts: 3484
Offline
Support Specialty:
B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
Re: Rehash client info on B3 start?
«
Reply #6 on:
October 18, 2011, 08:57:40 AM »
Quote from: WickedShell on October 18, 2011, 06:36:37 AM
I don't have a server to test this with at the moment, but when I looked at the changelog for the parser I noticed you renamed the local variable map to map_name, but then immediately do an if map: rather then if map_name:
Good catch! thank you for doing a code review.
Latest parser is now :
https://github.com/courgette/big-brother-bot/blob/e3f49617893ce9da38c93da9ac40cfcdc708cf80/b3/parsers/iourt41.py
Quote from: WickedShell on October 18, 2011, 06:36:37 AM
That's only an error if map is not a global, and I'm not overly familiar with the internals of B3 python stuff, but I think that if needs to be renamed?
map is a python reserved name. If you open up a python shell and type :
Code: python
type(map)
, python answers with
Code:
<type 'builtin_function_or_method'>
. So using 'map' for a local variable is bad practice as it overrides the builtin map function in the current scope. In the parser it was not actually an issue as we were not using the map() function in that scope, but one should fix bad practice when it sees it
«
Last Edit: October 18, 2011, 09:03:37 AM by Courgette
»
Logged
Follow me :
@cucurb
.~. new
Smokin' guns official website
WickedShell
Dev. Team
OS: Linux
Type: Home user
Gameservers:
UrT
Posts: 198
Offline
Re: Rehash client info on B3 start?
«
Reply #7 on:
October 18, 2011, 09:39:20 AM »
Totally forgot about map being a built in, I know just enough python to get myself into trouble.
Fixing bad practice is never a bad thing! Glad I could be of assistance.
Logged
EchelonV2 Development;
https://github.com/WickedShell/echelon
EchelonV2 Issue Tracker;
https://github.com/WickedShell/echelon/issues
Courgette
Senior Dev.
OS: Linux
Type: Home user
Posts: 3484
Offline
Support Specialty:
B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
Re: Rehash client info on B3 start?
«
Reply #8 on:
October 18, 2011, 10:04:31 AM »
Quote from: Leito on October 17, 2011, 08:19:47 AM
Unrelated: Also, should the --InitGame-- and --InitRound-- game log statements both trigger EVT_GAME_ROUND_START? It seems as if InitGame is better as a separate event, especially if you are using ROUND_START to cue rcon commands on the start of TeamSurvivor rounds. B3 sends rcon commands to clients loading the map (because InitGame triggers the ROUND_START event) and sometimes causes clients to be dropped with the 'A reliable command was cycled out' message. InitGame is the beginning of a new map. InitRound is the beginning of a Team Survivor round. I think they should be separated. Thoughts?
I guess it was made this way to accommodate game mods having no round (FFA I guess) so in such game mods plugins relying on the EVT_GAME_ROUND_START event can still know the game started.
What about modifying the OnInitgame game event handler so that it triggers a EVT_GAME_ROUND_START event only for game mods having no rounds ? (and for that we need a exhaustive list of such game mods)
Logged
Follow me :
@cucurb
.~. new
Smokin' guns official website
Tags:
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News (Read Only)
===> News Archive
===> Website News
=> General Discussion
===> Servers
=> Shared Services
-----------------------------
Support Forums
-----------------------------
=> Support Instructions
=> Installation Support
=> General Usage Support
=> Game specific Support
===> Battle Field 3
=====> BF3/B3 beta board
===> Battle Field Bad Company 2
===> Call of Duty series
=====> CoD, CoD:UO, CoD2
=====> Call of Duty 4 (Modern Warfare)
=====> Call of Duty 5 (World at War)
=====> Call of Duty 6 (Modern Warfare 2)
=====> Call of Duty 7 (Black Ops)
=======> AlterOps
===> Frontlines, Fuel of War
===> Enemy Territory
===> Homefront
===> Medal of Honor 2010
===> Open Arena
===> Red Orchestra 2
===> Smokin' Guns
===> Soldier of Fortune 2
===> Urban Terror
===> World of Padman
===> Other games
-----------------------------
Add-Ons
-----------------------------
=> Plugins Discussion
===> Plugin Releases!
===> Plugins by xlr8or
===> Plugins by Courgette
===> Plugins by Freelander
===> Plugins by Bakes
===> Plugins by Ismael
===> Plugins by flinkaflenkaflrsk
===> Plugins by Anubis
===> Plugins by Spoon
===> Plugins by PtitBigorneau
===> Plugins by BlackMamba
===> Plugins by Beber888
===> Plugins by grosbedo
=> XLRstats
===> Weaponmodifiers
=> Echelon
===> Echelon version 2
=> Configurations
=> Installers
-----------------------------
Community Developers
-----------------------------
=> Plugin Developers
=> The Code Bin
Rate this page +1 at Google Search
Web Toolbar by Wibiya
SimplePortal 2.3.1 © 2008-2009, SimplePortal