Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here
NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

You are here: Big Brother Bot ForumAdd-OnsPlugins DiscussionPlugin Releases! (Moderator: MordyT)[Urban Terror] Mapcycle rotator plugin
Pages: [1]   Go Down
  Print  
Author Topic: [Urban Terror] Mapcycle rotator plugin  (Read 1533 times) Bookmark and Share
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« on: July 28, 2011, 02:24:48 AM »

Hi!

I've been running 32 slot Urban Terror Server for over half a year, and I always found it difficult to prepare mapcycle file, so that it could be good for both 4 players, or 30 players. Moreover, my server is running different gametypes (not like CTF only server), and we have over 50 custom maps in the cycle.

The idea was, to change mapcycles according to number of people on the server. There are already two solutions for the problem. First is poweradminurt, but it can't store the previous map and gamecycle, so when the mapcycle changes it starts from the beginning (which is annoying for players, because if the mapcycle changes frequently, then they are playing the same maps over and over agan). The second solution was one plugin (I dont remember the name), but it needed special table in database and manually re-written mapcycle to it's config file, or something like that.

My solution is simple - we store the next map and the next gametype of each of mapcycles in a text file in the game directory. That way, BBB restart won't disturb the map order. Also, the mapcycles don't need to be entered manually into the config, my plugin parses the mapcycles and stores them in lists.

I tried to comment out the code, so it's clear, but I might missed something. Also the comments and english version of the plugin is a "last-minute-change", so I might have missed something.

Please note, that this is alpha release. It's been tested on my server, but there still might be some errors, thats why I'm not putting it into plugin downloads, yet.

Moddding of this plugin is of course allowed, but please post the changes and fixes here, so I can improve my plugin and eventually release it officially.

This plugin has no config file, configuration is done in the source file, so please take a look at it before using. Also keep in mind that you NEED three mapcycles stored in q3ut4 folder of your gameserver.
b3.xml line to add: <plugin name="rotator" />

Special thanks to Liliah for her help on this plugin.
« Last Edit: September 11, 2011, 01:17:48 AM by Garreth » Logged


Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 11
Offline Offline
« Reply #1 on: September 06, 2011, 04:04:15 PM »

Hi.
I have a 20 slot server but I know NOTHING about codings and stuff so would you be able to change it accordingly for me so its on small cycle when 8 or less are on, medium when 9-14 and large for 15-20 players. IT would be really appreciated or if you at least tell me what to change as I have already downloaded and looked through it but cant really find where I would need to change. Cheers
« Last Edit: September 06, 2011, 08:41:58 PM by johnnyenglish » Logged
Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 11
Offline Offline
« Reply #2 on: September 10, 2011, 03:16:52 PM »

Hi Garreth again. Unfortunately I can't send PM yet so I cant get your actual attention (I assume have to make a certain amount of posts before I can use it).
If I am able to get this it is quite urgent now.
I have looked in the python and sort of understood it. I tried changing the gamepath to suit my one and included: b3_cycle_small, med, large and the lastmap.txt file in my q3ut4 folder but still not working. I don't want to change anything else because I will probably stuff it up and it will continue not to work so your help would be greatly appreciated or anyones help that reads it if possible.
Cheers
Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #3 on: September 11, 2011, 01:38:16 AM »

Hey there!

Sorry, but I didn't notice your previous post here, e-mail notification didn't work probably. Also I wasn't aware of the restrictions on the PM system... You could always catch me at urbanterror.info forums (same nickname:) ).

I didn't follow up the versioning of the plugin, but I just updated the attachment in the first post, try it out, because few things might have changed.
At my server it at the moment works this way:
1. I have gameserver on separate server - the three mapcycles are stored in the q3ut4 folder there.
2. The BBB is on another server, and it doesn't have direct access to the mapcycles on a remote server, so I used a trick. I store mapcycles also at the BBB folder (in my case it's /home/urt/b3main/ ).

If you have gameserver and BBB on the same machine, you could just store mapcycles in q3ut4 folder only, and enter the patch in the rotator.py to e.g. /home/urt/urbanterror/q3ut4/ , or something like that.


And to switch cycles in a way you wanted use numbers like this:
Code:
    _switchcount1 = 9
    _switchcount2 = 14
    _hysteresis = 0

But I'd suggest using hysteresis=1 at least, to avoid changing cycles when one person connects/disconnects/reconnects Smiley
Logged

Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 11
Offline Offline
« Reply #4 on: September 11, 2011, 08:58:54 PM »

Hi,
I tried using it and all I changed was the numbers to what you said 9,14, and 1 for hysteresis.
For my gamepath I made sure I had the right one by checking with my host (Psybergaming) what it was. They agreed that it is C:\UserFiles\[myname]\GameServers\[stringofnumbers]\q3ut4
[myname] is obviously my name and the [stringofnumbers] is right because it is used in the b3.xml for the gamelog which is in the q3ut4 folder in the server.
However doing that and it all being right it still does not work.
In the b3 log it says
Code:
Error loading plugin: EOL while scanning single-quoted string (rotator.py, line 32)

and line 32 is the gamepath. What do YOU think.
Cheers
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #5 on: September 11, 2011, 10:29:56 PM »

I think YOU are missing a single-quote on line 32 of rotator.py Wink
Logged

Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 11
Offline Offline
« Reply #6 on: September 11, 2011, 11:08:25 PM »

Here is exactly what is on line 32 although i just * the name and server info:
Code:
  _gamepath = 'C:\UserFiles\*****\GameServers\************************\q3ut4\'

I don't see whats wrong with it?
Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #7 on: September 11, 2011, 11:52:07 PM »

Try one of these:
Code:
_gamepath = 'C:\\UserFiles\\*****\\GameServers\\************************\\q3ut4\\'
_gamepath = 'C:\UserFiles\*****\GameServers\************************\q3ut4'
Logged

Jr. Member
**
OS: Windows
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 11
Offline Offline
« Reply #8 on: September 12, 2011, 12:30:14 AM »

WONDERFUL. I had already tried the one with no \ at the end of the q3ut4 so I was skeptical about the other one. BUT! Adding two \\ there fixed it. It seems to be working (well at least the bot is) and it is not showing any problems in the log. I now have to wait for more people to go on to see that the mapcycle changes right.
Thanks so much.
Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #9 on: September 12, 2011, 04:25:04 AM »

Great!

Please post logs in case of troubles, so I could post this plugin into the download section. I don't have problems with that, but certainly I'll have to study BBB more, to introduce ftp access, the same way, that BBB get access to logs.
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #10 on: October 16, 2011, 01:18:58 AM »

I've packed the plugin, added readme file and commented out the code. No changes in the code (as far as I remember:P), but consider this as a release.

Download link: http://forum.bigbrotherbot.net/downloads/?sa=view;down=165
Logged

Tags: urt mapcycle rotator 
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal