OBBLM - More than 12 Rounds in a Tournament

However you play online - Java, Vassal, Email, Cyanide etc - talk about it here.
This is also the place for discussing the various tools for managing leagues, teams and so on.

Moderator: TFF Mods

User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

OBBLM - More than 12 Rounds in a Tournament

Post by Vanguard »

I've got a tournament set up in OBBLM with 14 rounds.
Initially it all seemed ok, but I've now realised that there's an error in the code when I try to view any of the matches in Rounds 13 and 14.
It looks like OBBLM only expects up to 12 rounds. I've dug into it a little, and it seems that the global variable T_ROUNDS is what I'd need to change, but I can't find where this is declared. Can anyone point me in the right direction?

Reason: ''
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by Vanguard »

Ok, I've dug a little further and found $T_ROUNDS is an array declared in class_match.php. It seems to be an array of all the rounds in a tournament, with the named rounds (Final, Semi, etc) defined first and then this line:

Code: Select all

array_combine(range(1,12), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,12)))
which adds on Round1 to 12.
I changed the code to add Round 1 to 14:

Code: Select all

array_combine(range(1,12), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,12)))
This has had some success. I can now view the matches in rounds 13 and 14, although it still generates an error for the round number.

Code: Select all

Notice: Trying to get property of non-object in /home3/gravityp/public_html/obblm/lib/class_translations.php on line 64
Also, if I choose to reschedule a match there are now two blank entries below round12.
Obviously I'm still missing something...

(Also, if anyone knows how to reduce the size of the code boxes, please let me know :D )

Reason: ''
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by Vanguard »

And after some further digging, I have discovered the lang/translations.xml file. This seems to be where the round names are taken from. I'd initially thought that they were systemically generated but it looks like they're actually specified in here. Adding two more lines below Round 12 seems to have fixed the problem.

I'll let you know if it all implodes when I turn my back. :)

Reason: ''
funnyfingers
Emerging Star
Emerging Star
Posts: 418
Joined: Tue Jul 14, 2009 8:41 pm
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by funnyfingers »

Thank you for posting this. I implemented it on a league's site to fix the same problem. Would you mind creating a ticket at http://code.google.com/p/obblm?

Reason: ''
Webhosting with the latest version of OBBLM installed: OBBLM Web Hosting (be sure to choose the OBBLM tab)
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by Vanguard »

No problem, done!

Reason: ''
Bakdal
Rookie
Rookie
Posts: 18
Joined: Thu Jan 17, 2013 9:42 am
Location: Denmark

Re: OBBLM - More than 12 Rounds in a Tournament

Post by Bakdal »

Thanks for finding this and working on it. I ran into the issue in my leagues last season. I just figured I'd messed something up when I set up the tournament. My leagues next season will have 20 rounds and since I am not exactly good at coding I thought I'd ask if I got it right before I make any changes…

Code: Select all

So in "class_match.php" I am supposed to replace

array_combine(range(1,12), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,12))) 

with 

array_combine(range(1,20), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,20)))

Then in "lang/translations.xml" 

add 8 more lines below "Round 12" in 
That should fix it right? I am following it on http://code.google.com/p/obblm? but seeing as the season is starting up soon I figure I better fix what I can myself (with help from smarter guys than myself) rather than waiting for an official upgrade.

Reason: ''
funnyfingers
Emerging Star
Emerging Star
Posts: 418
Joined: Tue Jul 14, 2009 8:41 pm
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by funnyfingers »

Thanks for the reminder. I'll try to post a proper update tonight so you can just download the 2 files, but you've stated this correctly.

If you are using the Mercury VPS OBBLM hosting, I can do the work for you.

Reason: ''
Webhosting with the latest version of OBBLM installed: OBBLM Web Hosting (be sure to choose the OBBLM tab)
Bakdal
Rookie
Rookie
Posts: 18
Joined: Thu Jan 17, 2013 9:42 am
Location: Denmark

Re: OBBLM - More than 12 Rounds in a Tournament

Post by Bakdal »

funnyfingers wrote:If you are using the Mercury VPS OBBLM hosting, I can do the work for you.
I am indeed using Mercury VPS hosting services and got a email about this just moments ago. So guess I don't have to worry about this issue anymore. Awesome :D Good to know that I understood Vanguard's post correctly, even if I don't have to apply the fix myself.

Good customer service.

Reason: ''
User avatar
mzukerman
Emerging Star
Emerging Star
Posts: 396
Joined: Sun Feb 13, 2011 7:34 pm
Location: Long Island, NY
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by mzukerman »

Thank you for posting this. I expect we are soon going to have the same problem, especially when there are odd numbers of teams in our leagues, requiring bye-weeks.

Reason: ''
"I reserve the right to change my predictions when they are no longer true. I am The Media." ~ Snob Costas
libloodbowl on Twitter
Long Island Blood Bowl League
Empire Cup
Image
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Post by Shteve0 »

Agree on Mercury VPS service being excellent. Cant recommend it enough

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
funnyfingers
Emerging Star
Emerging Star
Posts: 418
Joined: Tue Jul 14, 2009 8:41 pm
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by funnyfingers »

Thank you very much, Steve.

Reason: ''
Webhosting with the latest version of OBBLM installed: OBBLM Web Hosting (be sure to choose the OBBLM tab)
Aronne320
Rookie
Rookie
Posts: 32
Joined: Sun Sep 23, 2012 10:23 pm

Re: OBBLM - More than 12 Rounds in a Tournament

Post by Aronne320 »

I've changed the library as follows

$T_ROUNDS = array(
RT_FINAL => 'matches/tourmatches/roundtypes/final',
RT_3RD_PLAYOFF => 'matches/tourmatches/roundtypes/thirdPlayoff',
RT_SEMI => 'matches/tourmatches/roundtypes/semi',
RT_QUARTER => 'matches/tourmatches/roundtypes/quarter',
RT_ROUND16 => 'matches/tourmatches/roundtypes/rnd16')
+ array_combine(range(1,21), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,21)));

Cause i need a tournament with 21 rounds, but now "round 16" is overwritten with "round of 16"
How can i fix it? Maybe changing to

$T_ROUNDS = array(
RT_FINAL => 'matches/tourmatches/roundtypes/final',
RT_3RD_PLAYOFF => 'matches/tourmatches/roundtypes/thirdPlayoff',
RT_SEMI => 'matches/tourmatches/roundtypes/semi',
RT_QUARTER => 'matches/tourmatches/roundtypes/quarter',
RT_ROUND16 => 'matches/tourmatches/roundtypes/rndpre16')
+ array_combine(range(1,21), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,21)));

But i fear it could corrupt something, plz help :)

Reason: ''
funnyfingers
Emerging Star
Emerging Star
Posts: 418
Joined: Tue Jul 14, 2009 8:41 pm
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by funnyfingers »

Did you change the translations file as well?

Reason: ''
Webhosting with the latest version of OBBLM installed: OBBLM Web Hosting (be sure to choose the OBBLM tab)
Aronne320
Rookie
Rookie
Posts: 32
Joined: Sun Sep 23, 2012 10:23 pm

Re: OBBLM - More than 12 Rounds in a Tournament

Post by Aronne320 »

funnyfingers wrote:Did you change the translations file as well?
yes translation file is good

<tourmatches>
<roundtypes>
<final>Final</final>
<thirdPlayoff>3rd place playoff</thirdPlayoff>
<semi>Semi-finals</semi>
<quarter>Quarter-finals</quarter>
<rnd99>Round of 16</rnd99>
<rnd>Round</rnd>
<rnd1>Round 1</rnd1>
<rnd2>Round 2</rnd2>
<rnd3>Round 3</rnd3>
<rnd4>Round 4</rnd4>
<rnd5>Round 5</rnd5>
<rnd6>Round 6</rnd6>
<rnd7>Round 7</rnd7>
<rnd8>Round 8</rnd8>
<rnd9>Round 9</rnd9>
<rnd10>Round 10</rnd10>
<rnd11>Round 11</rnd11>
<rnd12>Round 12</rnd12>
<rnd13>Round 13</rnd13>
<rnd14>Round 14</rnd14>
<rnd15>Round 15</rnd15>
<rnd16>Round 16</rnd16>
<rnd17>Round 17</rnd17>
<rnd18>Round 18</rnd18>
<rnd19>Round 19</rnd19>
<rnd20>Round 20</rnd20>
<rnd21>Round 21</rnd21>
</roundtypes>

But somehow rnd16 still appear as round of 16

Reason: ''
funnyfingers
Emerging Star
Emerging Star
Posts: 418
Joined: Tue Jul 14, 2009 8:41 pm
Contact:

Re: OBBLM - More than 12 Rounds in a Tournament

Post by funnyfingers »

No time to elaborate at the moment, but this touches on the round 16 thing: http://code.google.com/p/obblm/issues/detail?id=629

Reason: ''
Webhosting with the latest version of OBBLM installed: OBBLM Web Hosting (be sure to choose the OBBLM tab)
Post Reply