struct-by-lightning/wpi-suite — pull request #395 by ajthompson (2014-05-02 15:15:55+00:00)
Title: Alec's Big Pack Of Bugfixes!

So I ran into a plethora of bugs when trying to track down the ClassNotFoundException when we started up. And for most of them, I have no idea why they are only showing up now, because they should have been happening for a while.

1. The ClassNotFoundException occurs when a game has passed its deadline and you open the tree for the first time. Now, the ConfigManager is apparently not accessible from the server, so when the mailer tries to add the usernames to the email, it fails. Of course, I realized that as the same email goes out to everyone, I should never have even put the username in there. So I took that out. Alec 1 : bugs 0

2. Now, another ClassNotFoundException popped up, this time about RequestObserver. It appears we were trying to send a NetworkRequest for the requirements in Mailer. Which again, doesn't work on the server and really should have shown up by now. So I overloaded the constructor to take an array of requirements, which we can retrieve in the entity manager, and pass to the Mailer. This fixed that problem.

3. We weren't checking if a game had closed clientside when refreshing the tree, meaning that if it closed serverside, it won't have updated the status clientside. I implemented the same fix I used for the popup, which is if the game is open clientside and is past its deadline, go and refresh the tree again. To make this efficient, I changed RefreshGameTree to return an int, and it normally returns 1 at the end. If it needs to double-refresh to account for a game past its deadline, it will call RefreshGameTree, and then return 0, as it has already been correctly refreshed, so it doesn't need to complete itself. Alec 3:bugs 0

4. Now, we were getting an exception, because apparently it didn't want to find RefreshGameTree from within other classes, when it was immediately before removeClosableTab. So I took it out, which still works fine because it seems removeClosableTab calls refreshGameTree itself.

Committed by: ajthompson