Commit [564bd9] Maximize Restore History

re-designed game-invitations

- fixed bug: showing correct state of invitation and dispute-difference for all combinations of inviting- & invited-user, disputed or original invitation with reversed handicap-type dependent on current-user
- re-design with clearer structures was necessary to support bug-fixes for game-invitations messing up state of invitation: who sent it?, who views it?, what's the handicap-type for black/white-fix-color and fair-komi-divide&choose for current user? Determination of this variables sucked big with string-encoded game-setup and storing of users for game on INVITED-status.
- added GameInvitation-table to store changeable game-settings for invitations replacing old GameSetup-invitation-handling parsing a one-string text-field for both users
- replaced Games.ToMove_ID holding handicap-type-encoding with players-id that last sent game-invitation- or game-dispute-message
- stored initially inviting user in Games.Black_ID and invited user in Games.White_ID
- GameInvitation-entries are kept till game is finished, then they are deleted
- added migration-script 'scripts/updates/fix_game_invitations-1_0_16.php' to migrate old 1.0.15-style game-invitations
- added cleanup of GameInvitation-table for deleted or cleaned up invitations

- additional refactoring for re-designed game-invitations:
-- adjusted and simplified GameSetup-encoding for invitations to only store game-settings of last sent invitation/dispute from one user in preparation for accepting and starting invitation-game
-- moved deprecated functions and constants into 'include/deprecated_functions.php' to be used for migration-scripts and potential later disposal: GameSetup.build_invitation_game_setup, ~.parse_invitation_game_setup, ~.parse_jigo_mode_from_game_setup, ~.determine_handicaptype, get_invite_handicaptype, get_handicaptype_for_invite
-- refactored and simplified GameSettingsCalculator to use GameSetup instead of game-row to calculate probable game-settings for pivot-user
-- renamed GameSetup- and GameSettings-fields: AdjustHandicap/Komi -> AdjHandicap/Komi
-- avoid clashes with other encode()-functions: renamed GameSetup.encode() -> GameSetup.encode_game_setup(), ProfileTemplate.encode() -> ProfileTemplate.encode_template()
-- renamed GameSetup.new_from_game_row() -> GameSetup.new_from_waitingroom_game_row()
-- cleanup: added safety-checks on vars (status) for some use-cases

- added my-rating in game-info-table on viewing own or opponents game-settings

- added docu about Moves-table in 'specs/db/table-Games.txt'

Jens-Uwe Gaspar Jens-Uwe Gaspar 2013-07-21

1 2 > >> (Page 1 of 2)
added include/db/game_invitation.php
added include/deprecated_functions.php
added scripts/tests/DeprecatedGameSetupTest.php
changed daily_cron.php
changed game_players.php
changed include
changed include/db
changed include/game_functions.php
changed include/make_game.php
changed include/message_functions.php
changed include/quick
changed include/quick/quick_message.php
changed include/wroom_control.php
changed message.php
changed new_game.php
changed scripts
changed scripts/ChangeLog
changed scripts/data_export.php
changed scripts/game_consistency.php
changed scripts/index.php
changed scripts/tests
changed scripts/tests/AllTests.php
changed scripts/tests/GameSetupTest.php
changed scripts/updates
changed scripts/updates/database_changes_1_0_15_to_1_0_16.mysql
include/db/game_invitation.php Diff Switch to side-by-side view
Loading...
include/deprecated_functions.php Diff Switch to side-by-side view
Loading...
scripts/tests/DeprecatedGameSetupTest.php Diff Switch to side-by-side view
Loading...
daily_cron.php Diff Switch to side-by-side view
Loading...
game_players.php Diff Switch to side-by-side view
Loading...
include
Directory.
include/db
Directory.
include/game_functions.php Diff Switch to side-by-side view
Loading...
include/make_game.php Diff Switch to side-by-side view
Loading...
include/message_functions.php Diff Switch to side-by-side view
Loading...
include/quick
Directory.
include/quick/quick_message.php Diff Switch to side-by-side view
Loading...
include/wroom_control.php Diff Switch to side-by-side view
Loading...
message.php Diff Switch to side-by-side view
Loading...
new_game.php Diff Switch to side-by-side view
Loading...
scripts
Directory.
scripts/ChangeLog Diff Switch to side-by-side view
Loading...
scripts/data_export.php Diff Switch to side-by-side view
Loading...
scripts/game_consistency.php Diff Switch to side-by-side view
Loading...
scripts/index.php Diff Switch to side-by-side view
Loading...
scripts/tests
Directory.
scripts/tests/AllTests.php Diff Switch to side-by-side view
Loading...
scripts/tests/GameSetupTest.php Diff Switch to side-by-side view
Loading...
scripts/updates
Directory.
scripts/updates/database_changes_1_0_15_to_1_0_16.mysql Diff Switch to side-by-side view
Loading...
1 2 > >> (Page 1 of 2)