Twilight Guild Forum

Tech Support => Website Fixes and Changes => Topic started by: Tony on August 23, 2010, 07:33:32 PM

Title: Calender Bug
Post by: Tony on August 23, 2010, 07:33:32 PM
I signed up for a few raids this week. The symbol on the calender says I am in que, but when I click on the event, I don't see any of my characters.
Title: Re: Calender Bug
Post by: Shadowwolf on August 23, 2010, 07:34:36 PM
Koth's working on it. We're doing some upgrades to the signup system this week in addition to what ive been doing with the forum.
Title: Re: Calender Bug
Post by: Tony on August 23, 2010, 07:35:23 PM
Ah, okay :)
Title: Re: Calender Bug
Post by: Shadowwolf on August 23, 2010, 07:35:38 PM
If anyone sees a problem with signups this week in any way when you use the system, please report it to us asap so we can address it.
Title: Re: Calender Bug
Post by: Kothnok on August 23, 2010, 09:23:52 PM
After following many leads to a dead end and wading through many red herrings, I finally just went through the code by hand, line by line looking for anything not just wrong, but just "not quite how I would write it".

STATUS: Fixed.

Tech detail:

... probably no one will get it anyway since even the original dev missed it ...

let me just say that when you do:


theDatabase->getSqlData(theSQLtext);
while ( theDatabase->getNextRow() ) {
    ... do a crap load of stuff ...
}


that this will FAIL eventually.  Why?  Oh there's nothing wrong with it, per se...

But if somewhere down the line inside all that crap load of stuff, you ask the database for something else, lets say a small list of characters you might own, when you get back to the "while" part, it now gets the wrong data row... because of lazy programming.

All that was needed was to save off the result given in the first line and use it in the next.  No question now which row will be returned and everything will be right as rain no matter how many nested database calls you put inside the loop.


theQueryResult = theDatabase->getSqlData(theSQLtext);
while ( theDatabase->getNextRow(theQueryResult) ) {
    ... do a crap load of stuff...
}


.
Title: Re: Calender Bug
Post by: Tony on August 24, 2010, 05:50:23 AM
Koth, you are a god among programming men (and women).

Thank you Shadow and Koth, for your efforts on providing us all with a way to communicate, making an already great guild, even better!