-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixup exceptions in playcontroller #191
Commits on Jun 8, 2014
-
add end_play_signal type and visitors
This commit adds an "end_play_signal" type. It is meant to be used in play_controller classes to prevent crashes due to bad exception handling / collisions, and should help us to make assumptions more easily about when networking operations will happen It also adds some macros to avoid the proliferation of unreadable try catch blocks. It is expected that many of these can be expanded and simplified after the refactor.
Configuration menu - View commit details
-
Copy full SHA for 67e7f4c - Browse repository at this point
Copy the full SHA 67e7f4cView commit details -
push end_play exceptions down one level in playsingle_controller
This uses the macros introduced to handle game end exceptions. It should be a strict refactor. Rebased to accomodate conflict here: 516206a Still a strict refactor. Note: If end_turn_exception propogates to the top of playsingle_controller, there is no handler beyond that and the program will terminate. If an end turn signal gets there, we also will terminate. This commit adds an assertion failure with a message clarifying what happened.
Configuration menu - View commit details
-
Copy full SHA for c11088c - Browse repository at this point
Copy the full SHA c11088cView commit details -
push end_play_exceptions one down in call stack, at "play_turn()"
Continues trend of previous commit. play_turn becomes no throw with respect to these exceptions, and so we can switch calls to it to use the "PROPOGATE_END_PLAY_SIGNAL" instead of "HANDLE_...". It looks like by progressively doing this and unit testing at each step, we will be able to successfully convert all of the functions in play_controller to use PROPOGATE, which is a cheap if else and not an exception handler, and increase the stability of the engine by avoiding the use of exceptions for control flow. If we continue this way, we could push all the throws into the event handler and the replay module. Perhaps could continue from there, but likely at some point the exceptions might be the simpler solution esp. for breaking recursion in WML / lua or things like this.
Configuration menu - View commit details
-
Copy full SHA for b7c18c8 - Browse repository at this point
Copy the full SHA b7c18c8View commit details -
remove unnecessary handler macro from events::raise_draw_event
After discussion on irc, it seems that this function doesn't throw end level or end turn exceptions, and some play testing suggests that removing the handler macros here is alright.
Configuration menu - View commit details
-
Copy full SHA for 554af4b - Browse repository at this point
Copy the full SHA 554af4bView commit details -
Configuration menu - View commit details
-
Copy full SHA for cb9a84b - Browse repository at this point
Copy the full SHA cb9a84bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 570e0a4 - Browse repository at this point
Copy the full SHA 570e0a4View commit details -
remove handler from finish_side_done
This function won't throw end level or end turn. game_event pump will not throw these, although the SDL event pump may throw them in response to keyboard / menu events.
Configuration menu - View commit details
-
Copy full SHA for 7c20ca5 - Browse repository at this point
Copy the full SHA 7c20ca5View commit details -
push end play exceptions out of replay controller top level
This commit starts the process for replay_controller at the play_replay_level function.
Configuration menu - View commit details
-
Copy full SHA for 22ee9bc - Browse repository at this point
Copy the full SHA 22ee9bcView commit details -
push end play exceptions out of replay_controller::play_replay
Returns a "possible_end_play_signal" now instead. This also required changes to the header in hotkey/command_executor. This seems pretty minor, and could perhaps be refactored later.
Configuration menu - View commit details
-
Copy full SHA for 6eb71ad - Browse repository at this point
Copy the full SHA 6eb71adView commit details -
remove unnecessary pure virtual function definition
This is overrided differently in playsingle, playmp, and replay controllers, and never is it called abstractly, which is what this virtual declaration would suggest.
Configuration menu - View commit details
-
Copy full SHA for fed87a9 - Browse repository at this point
Copy the full SHA fed87a9View commit details -
push end play exceptions out of play_side()
This changes both the playsingle and playmp implementations, but not the replay_controller implementation which is separate. ( squashed: fixup an oversight in replay_controller::play_side )
Configuration menu - View commit details
-
Copy full SHA for 051b204 - Browse repository at this point
Copy the full SHA 051b204View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34d294e - Browse repository at this point
Copy the full SHA 34d294eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ccbe0b5 - Browse repository at this point
Copy the full SHA ccbe0b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 08edc77 - Browse repository at this point
Copy the full SHA 08edc77View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2034f06 - Browse repository at this point
Copy the full SHA 2034f06View commit details -
Configuration menu - View commit details
-
Copy full SHA for de026e6 - Browse repository at this point
Copy the full SHA de026e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 154f3db - Browse repository at this point
Copy the full SHA 154f3dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 13f5b27 - Browse repository at this point
Copy the full SHA 13f5b27View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29ad76c - Browse repository at this point
Copy the full SHA 29ad76cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e0f420 - Browse repository at this point
Copy the full SHA 5e0f420View commit details