Refactoring App

This commit is contained in:
Lorenzo Iovino 2017-07-12 17:57:33 +02:00
parent e2070cf597
commit 97c88c46bb
24 changed files with 517 additions and 442 deletions

3
.gitignore vendored
View file

@ -1,2 +1,3 @@
log log
out/ out/
*.log

698
.idea/workspace.xml generated
View file

@ -10,22 +10,29 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="eb36c2e9-c6c6-48da-b007-cd41eccd9e5a" name="Default" comment=""> <list default="true" id="eb36c2e9-c6c6-48da-b007-cd41eccd9e5a" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Commons/src/utilities/Parse.java" /> <change type="MOVED" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/models/Game.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/services/GameService.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/App.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/App.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/App.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/App.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/Main.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/Main.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/Main.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/Main.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/models/Game.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/models/Game.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HighscoresController.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HighscoresController.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HomeController.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HomeController.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MatchSetupController.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MatchSetupController.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MenuController.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MenuController.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/RegisterController.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/RegisterController.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/GamePage.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/GamePage.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MatchRequestsPage.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MatchRequestsPage.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MenuPage.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MenuPage.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/services/AuthService.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/services/AuthService.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/services/NotificationClient.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/services/NotificationClient.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/services/NotificationClient.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/services/NotificationClient.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/SendWords.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/SendWords.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/FetchHighscore.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/FetchHighscore.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/StartGame.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/StartGame.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/StartGame.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/StartGame.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForPlayers.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForPlayers.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTGameBox.java" afterPath="$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTGameBox.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Commons/src/models/Session.java" afterPath="$PROJECT_DIR$/Commons/src/models/Session.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Commons/src/utilities/Logger.java" afterPath="$PROJECT_DIR$/Commons/src/utilities/Logger.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Server/src/com/texttwist/server/components/AccountsManager.java" afterPath="$PROJECT_DIR$/Server/src/com/texttwist/server/components/AccountsManager.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Server/src/com/texttwist/server/Server.java" afterPath="$PROJECT_DIR$/Server/src/com/texttwist/server/Server.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Server/src/com/texttwist/server/components/Auth.java" afterPath="$PROJECT_DIR$/Server/src/com/texttwist/server/components/Auth.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java" afterPath="$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java" afterPath="$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/client_1.log" afterPath="$PROJECT_DIR$/client_1.log" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/notificationServer.log" afterPath="$PROJECT_DIR$/notificationServer.log" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/notificationServer.log" afterPath="$PROJECT_DIR$/notificationServer.log" />
</list> </list>
<ignored path="$PROJECT_DIR$/out/" /> <ignored path="$PROJECT_DIR$/out/" />
@ -48,11 +55,11 @@
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="375"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
<file leaf-file-name="Server.java" pinned="false" current-in-tab="false"> <file leaf-file-name="WaitForScore.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/Server.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="703"> <state relative-caret-position="399">
<caret line="46" column="41" lean-forward="false" selection-start-line="46" selection-start-column="41" selection-end-line="46" selection-end-column="41" /> <caret line="30" column="40" lean-forward="false" selection-start-line="30" selection-start-column="40" selection-end-line="30" selection-end-column="40" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
@ -60,11 +67,11 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="SendWords.java" pinned="false" current-in-tab="false"> <file leaf-file-name="WaitForPlayers.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/SendWords.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForPlayers.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="294"> <state relative-caret-position="-336">
<caret line="23" column="18" lean-forward="false" selection-start-line="23" selection-start-column="18" selection-end-line="23" selection-end-column="18" /> <caret line="18" column="10" lean-forward="false" selection-start-line="18" selection-start-column="10" selection-end-line="18" selection-end-column="10" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -73,91 +80,96 @@
<file leaf-file-name="GameController.java" pinned="false" current-in-tab="false"> <file leaf-file-name="GameController.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="462"> <state relative-caret-position="399">
<caret line="28" column="29" lean-forward="false" selection-start-line="28" selection-start-column="29" selection-end-line="28" selection-end-column="29" /> <caret line="21" column="0" lean-forward="false" selection-start-line="21" selection-start-column="0" selection-end-line="21" selection-end-column="0" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#773#774#0" expanded="true" /> <element signature="e#623#624#0" expanded="true" />
<element signature="e#849#850#0" expanded="true" /> <element signature="e#674#675#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="Game.java" pinned="false" current-in-tab="false"> <file leaf-file-name="HighscoresController.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/models/Game.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HighscoresController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="327"> <state relative-caret-position="420">
<caret line="101" column="30" lean-forward="true" selection-start-line="101" selection-start-column="30" selection-end-line="101" selection-end-column="30" /> <caret line="24" column="27" lean-forward="false" selection-start-line="24" selection-start-column="27" selection-end-line="24" selection-end-column="27" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#3331#3332#0" expanded="true" />
<element signature="e#3368#3369#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="HomeController.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HomeController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="20" column="9" lean-forward="false" selection-start-line="20" selection-start-column="9" selection-end-line="20" selection-end-column="9" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="MatchSetupController.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MatchSetupController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="12" column="58" lean-forward="false" selection-start-line="12" selection-start-column="58" selection-end-line="12" selection-end-column="58" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="MenuController.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MenuController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="231">
<caret line="11" column="38" lean-forward="false" selection-start-line="11" selection-start-column="38" selection-end-line="11" selection-end-column="38" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="RegisterController.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/RegisterController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="378">
<caret line="18" column="0" lean-forward="false" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="42">
<caret line="2" column="5" lean-forward="false" selection-start-line="2" selection-start-column="5" selection-end-line="2" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="GamePage.java" pinned="false" current-in-tab="false"> <file leaf-file-name="GamePage.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/GamePage.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/GamePage.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="346"> <state relative-caret-position="588">
<caret line="118" column="18" lean-forward="false" selection-start-line="118" selection-start-column="18" selection-end-line="118" selection-end-column="18" /> <caret line="28" column="22" lean-forward="false" selection-start-line="28" selection-start-column="22" selection-end-line="28" selection-end-column="22" />
<folding>
<element signature="e#1615#1835#0" expanded="true" />
<element signature="e#1834#1835#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="TTGameBox.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTGameBox.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="399">
<caret line="24" column="36" lean-forward="true" selection-start-line="24" selection-start-column="36" selection-end-line="24" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Main.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="8" column="0" lean-forward="true" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="GameServer.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="745">
<caret line="70" column="9" lean-forward="true" selection-start-line="70" selection-start-column="9" selection-end-line="70" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Auth.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/components/Auth.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-609">
<caret line="4" column="38" lean-forward="true" selection-start-line="4" selection-start-column="38" selection-end-line="4" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="WaitForScore.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="336">
<caret line="27" column="52" lean-forward="true" selection-start-line="27" selection-start-column="52" selection-end-line="27" selection-end-column="52" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
<element signature="e#1622#1842#0" expanded="true" />
<element signature="e#1841#1842#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -174,36 +186,36 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>App.game.st</find>
<find>log</find>
<find>logger</find>
<find>Logger</find>
<find>Logge</find>
<find>Logg</find>
<find>Logger.writ</find>
<find>Logger.write</find>
<find>L</find>
<find>Logger.</find>
<find>Logger.w</find>
<find>App.g</find>
<find>App.game.</find>
<find>App.game.wo</find>
<find>App.game.wor</find>
<find>App.game.words</find>
<find>App.game.word</find>
<find>game.words</find>
<find>f</find>
<find>word</find>
<find>g</find>
<find>game.wo</find>
<find>game.wor</find>
<find>game.word</find>
<find>wo</find>
<find>rank</find>
<find>Server</find>
<find>ge</find>
<find>getWords</find> <find>getWords</find>
<find>words</find> <find>ge</find>
<find>getWindow</find>
<find>getWindows</find>
<find>getWindowsP</find>
<find>getWindowsPo</find>
<find>getWindowsPos</find>
<find>getWindowsPosi</find>
<find>A</find>
<find>App.app</find>
<find>App.ap</find>
<find>ap</find>
<find>app</find>
<find>Wai</find>
<find>Waito</find>
<find>Wait</find>
<find>WaitF</find>
<find>WaitFor</find>
<find>WaitForP</find>
<find>WaitForPla</find>
<find>waitForP</find>
<find>waitForPl</find>
<find>waitForPla</find>
<find>w</find>
<find>waitForS</find>
<find>waitForSc</find>
<find>waitForScor</find>
<find>waitForScore</find>
<find>waitFor</find>
<find>rank</find>
</findStrings> </findStrings>
<dirStrings> <dirStrings>
<dir>C:\Users\loke\TextTwist\out\production</dir> <dir>C:\Users\loke\TextTwist\out\production</dir>
@ -342,18 +354,10 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/tasks/JoinMatch.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/InvitePlayers.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/models/Match.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/tasks/SendInvitations.java" />
<option value="$PROJECT_DIR$/Commons/src/models/Session.java" />
<option value="$PROJECT_DIR$/Commons/src/interfaces/IAuth.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MenuPage.java" />
<option value="$PROJECT_DIR$/Commons/src/constants/Palette.java" /> <option value="$PROJECT_DIR$/Commons/src/constants/Palette.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTLetter.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTLetter.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForPlayers.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForPlayers.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTScrollList.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTScrollList.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HighscoresController.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/FetchHighscore.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/FetchHighscore.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/components/SessionsManager.java" /> <option value="$PROJECT_DIR$/Server/src/com/texttwist/server/components/SessionsManager.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/tasks/TokenInvalid.java" /> <option value="$PROJECT_DIR$/Server/src/com/texttwist/server/tasks/TokenInvalid.java" />
@ -365,7 +369,6 @@
<option value="$PROJECT_DIR$/Commons/src/constants/Config.java" /> <option value="$PROJECT_DIR$/Commons/src/constants/Config.java" />
<option value="$PROJECT_DIR$/docker-compose.yml" /> <option value="$PROJECT_DIR$/docker-compose.yml" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/HomePage.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/HomePage.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MenuController.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/GamePage.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/GamePage.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/HighscoresPage.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/HighscoresPage.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MatchRequestsPage.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MatchRequestsPage.java" />
@ -373,18 +376,14 @@
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/RegisterPage.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/pages/RegisterPage.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/services/AuthService.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/services/AuthService.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/services/HighscoresService.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/services/HighscoresService.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/components/AccountsManager.java" />
<option value="$PROJECT_DIR$/Commons/src/models/User.java" /> <option value="$PROJECT_DIR$/Commons/src/models/User.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/tasks/ComputeScore.java" /> <option value="$PROJECT_DIR$/Server/src/com/texttwist/server/tasks/ComputeScore.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/tasks/ComputeHighscores.java" /> <option value="$PROJECT_DIR$/Server/src/com/texttwist/server/tasks/ComputeHighscores.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/components/JedisService.java" /> <option value="$PROJECT_DIR$/Server/src/com/texttwist/server/components/JedisService.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/Main.java" />
<option value="$PROJECT_DIR$/Commons/src/utilities/ParseScore.java" /> <option value="$PROJECT_DIR$/Commons/src/utilities/ParseScore.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/StartGame.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/StartGame.java" />
<option value="$PROJECT_DIR$/Commons/src/utilities/Parse.java" /> <option value="$PROJECT_DIR$/Commons/src/utilities/Parse.java" />
<option value="$PROJECT_DIR$/Commons/src/utilities/Logger.java" /> <option value="$PROJECT_DIR$/Commons/src/utilities/Logger.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/App.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/services/NotificationClient.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/services/NotificationClient.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/Server.java" /> <option value="$PROJECT_DIR$/Server/src/com/texttwist/server/Server.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java" /> <option value="$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java" />
@ -393,6 +392,19 @@
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/SendWords.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/SendWords.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTGameBox.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTGameBox.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java" /> <option value="$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/models/GameService.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/services/GameService.java" />
<option value="$PROJECT_DIR$/Commons/src/models/Session.java" />
<option value="$PROJECT_DIR$/Server/src/com/texttwist/server/components/AccountsManager.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/App.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/Main.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HighscoresController.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HomeController.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MatchSetupController.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MenuController.java" />
<option value="$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/RegisterController.java" />
<option value="$PROJECT_DIR$/.gitignore" />
</list> </list>
</option> </option>
</component> </component>
@ -619,6 +631,28 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TextTwist" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="TextTwist" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Commons" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="models" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="TextTwist" /> <option name="myItemId" value="TextTwist" />
@ -773,32 +807,6 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TextTwist" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="TextTwist" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Client" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="client" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="models" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="TextTwist" /> <option name="myItemId" value="TextTwist" />
@ -1439,12 +1447,12 @@
<workItem from="1499765614451" duration="11181000" /> <workItem from="1499765614451" duration="11181000" />
<workItem from="1499779709819" duration="5113000" /> <workItem from="1499779709819" duration="5113000" />
<workItem from="1499786096995" duration="7592000" /> <workItem from="1499786096995" duration="7592000" />
<workItem from="1499865254521" duration="6734000" /> <workItem from="1499865254521" duration="9421000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="411828000" /> <option name="totallyTimeSpent" value="414515000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-9" y="-9" width="1938" height="1048" extended-state="6" /> <frame x="-9" y="-9" width="1938" height="1048" extended-state="6" />
@ -1460,7 +1468,7 @@
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39949432" sideWeight="0.5164706" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39949432" sideWeight="0.5164706" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="WINDOWED" visible="false" show_stripe_button="true" weight="0.4215148" sideWeight="0.6982353" order="2" side_tool="false" content_ui="tabs" x="1000" y="164" width="852" height="313" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="WINDOWED" visible="true" show_stripe_button="true" weight="0.4215148" sideWeight="0.6982353" order="2" side_tool="false" content_ui="tabs" x="1000" y="164" width="852" height="313" />
<window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
@ -1499,39 +1507,7 @@
<option name="FILTER_TARGETS" value="false" /> <option name="FILTER_TARGETS" value="false" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/Server/Server.iml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="5" column="73" lean-forward="false" selection-start-line="5" selection-start-column="73" selection-end-line="5" selection-end-column="73" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Server/resources/dictionary">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="188">
<caret line="42777" column="8" lean-forward="false" selection-start-line="42777" selection-start-column="8" selection-end-line="42777" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/models/Dictionary.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="273">
<caret line="22" column="76" lean-forward="false" selection-start-line="22" selection-start-column="76" selection-end-line="22" selection-end-column="76" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dockerfiles/JavaDockerfile" />
<entry file="file://$PROJECT_DIR$/dockerfiles/MongoDockerfile" /> <entry file="file://$PROJECT_DIR$/dockerfiles/MongoDockerfile" />
<entry file="file://$PROJECT_DIR$/Commons/src/models/Response.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="231">
<caret line="12" column="11" lean-forward="false" selection-start-line="12" selection-start-column="11" selection-end-line="12" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Commons/src/interfaces/INotificationServer.java"> <entry file="file://$PROJECT_DIR$/Commons/src/interfaces/INotificationServer.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="189"> <state relative-caret-position="189">
@ -1570,38 +1546,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HighscoresController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="294">
<caret line="23" column="27" lean-forward="false" selection-start-line="23" selection-start-column="11" selection-end-line="23" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HomeController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="84">
<caret line="11" column="31" lean-forward="true" selection-start-line="11" selection-start-column="31" selection-end-line="11" selection-end-column="31" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MatchSetupController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="147">
<caret line="10" column="13" lean-forward="false" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MenuController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="231">
<caret line="17" column="29" lean-forward="true" selection-start-line="17" selection-start-column="29" selection-end-line="17" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/HomePage.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/HomePage.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1071"> <state relative-caret-position="1071">
@ -1627,16 +1571,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MenuPage.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="14" column="13" lean-forward="false" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
<folding>
<element signature="imports" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/Page.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/Page.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210"> <state relative-caret-position="210">
@ -1656,14 +1590,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/RegisterController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="273">
<caret line="18" column="0" lean-forward="false" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/notificationServer.log"> <entry file="file://$PROJECT_DIR$/notificationServer.log">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="462"> <state relative-caret-position="462">
@ -1679,16 +1605,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/services/AuthService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="451">
<caret line="28" column="0" lean-forward="false" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://C:/Program Files/Java/jdk1.8.0_131/src.zip!/java/lang/String.java"> <entry file="jar://C:/Program Files/Java/jdk1.8.0_131/src.zip!/java/lang/String.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="49770"> <state relative-caret-position="49770">
@ -1713,17 +1629,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/components/AccountsManager.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="672">
<caret line="36" column="54" lean-forward="false" selection-start-line="36" selection-start-column="54" selection-end-line="36" selection-end-column="54" />
<folding>
<element signature="e#2066#2067#0" expanded="false" />
<element signature="e#2101#2102#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/HighscoresPage.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/HighscoresPage.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420"> <state relative-caret-position="420">
@ -1750,14 +1655,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="168">
<caret line="10" column="0" lean-forward="true" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Commons/src/models/User.java"> <entry file="file://$PROJECT_DIR$/Commons/src/models/User.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357"> <state relative-caret-position="357">
@ -1784,24 +1681,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/App.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="514">
<caret line="49" column="23" lean-forward="true" selection-start-line="49" selection-start-column="23" selection-end-line="49" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Commons/src/utilities/Parse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="5" column="0" lean-forward="false" selection-start-line="5" selection-start-column="0" selection-end-line="8" selection-end-column="3" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/services/NotificationClient.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/services/NotificationClient.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="441"> <state relative-caret-position="441">
@ -1826,24 +1705,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="745">
<caret line="70" column="9" lean-forward="true" selection-start-line="70" selection-start-column="9" selection-end-line="70" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/Server.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="703">
<caret line="46" column="41" lean-forward="false" selection-start-line="46" selection-start-column="41" selection-end-line="46" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/SendWords.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/SendWords.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="294"> <state relative-caret-position="294">
@ -1852,41 +1713,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="462">
<caret line="28" column="29" lean-forward="false" selection-start-line="28" selection-start-column="29" selection-end-line="28" selection-end-column="29" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#773#774#0" expanded="true" />
<element signature="e#849#850#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/models/Game.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="327">
<caret line="101" column="30" lean-forward="true" selection-start-line="101" selection-start-column="30" selection-end-line="101" selection-end-column="30" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#3331#3332#0" expanded="true" />
<element signature="e#3368#3369#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/GamePage.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="346">
<caret line="118" column="18" lean-forward="false" selection-start-line="118" selection-start-column="18" selection-end-line="118" selection-end-column="18" />
<folding>
<element signature="e#1615#1835#0" expanded="true" />
<element signature="e#1834#1835#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTGameBox.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/ui/TTGameBox.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="399"> <state relative-caret-position="399">
@ -1895,16 +1721,214 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java"> <entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/services/AuthService.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="336"> <state relative-caret-position="252">
<caret line="27" column="52" lean-forward="true" selection-start-line="27" selection-start-column="52" selection-end-line="27" selection-end-column="52" /> <caret line="12" column="3" lean-forward="true" selection-start-line="12" selection-start-column="3" selection-end-line="12" selection-end-column="3" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/services/GameService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="29" column="13" lean-forward="false" selection-start-line="29" selection-start-column="13" selection-end-line="29" selection-end-column="13" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#3368#3369#0" expanded="true" />
<element signature="e#3412#3413#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Commons/src/models/Response.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="231">
<caret line="12" column="11" lean-forward="false" selection-start-line="12" selection-start-column="11" selection-end-line="12" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Commons/src/models/Session.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="12" column="31" lean-forward="true" selection-start-line="12" selection-start-column="31" selection-end-line="12" selection-end-column="31" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/MenuPage.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="14" column="13" lean-forward="false" selection-start-line="14" selection-start-column="13" selection-end-line="14" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Commons/src/utilities/Parse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="5" column="0" lean-forward="false" selection-start-line="5" selection-start-column="0" selection-end-line="8" selection-end-column="3" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/components/GameServer.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="346">
<caret line="51" column="9" lean-forward="true" selection-start-line="51" selection-start-column="9" selection-end-line="51" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/client_main.log">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/components/AccountsManager.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="535">
<caret line="32" column="44" lean-forward="true" selection-start-line="32" selection-start-column="44" selection-end-line="32" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Server/src/com/texttwist/server/Server.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="651">
<caret line="46" column="41" lean-forward="false" selection-start-line="46" selection-start-column="41" selection-end-line="46" selection-end-column="41" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/Main.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="63">
<caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/App.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="756">
<caret line="36" column="0" lean-forward="true" selection-start-line="36" selection-start-column="0" selection-end-line="36" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/pages/GamePage.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="588">
<caret line="28" column="22" lean-forward="false" selection-start-line="28" selection-start-column="22" selection-end-line="28" selection-end-column="22" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1622#1842#0" expanded="true" />
<element signature="e#1841#1842#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForScore.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="399">
<caret line="30" column="40" lean-forward="false" selection-start-line="30" selection-start-column="40" selection-end-line="30" selection-end-column="40" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/tasks/WaitForPlayers.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-336">
<caret line="18" column="10" lean-forward="false" selection-start-line="18" selection-start-column="10" selection-end-line="18" selection-end-column="10" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HomeController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="20" column="9" lean-forward="false" selection-start-line="20" selection-start-column="9" selection-end-line="20" selection-end-column="9" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/GameController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="399">
<caret line="21" column="0" lean-forward="false" selection-start-line="21" selection-start-column="0" selection-end-line="21" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#623#624#0" expanded="true" />
<element signature="e#674#675#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/HighscoresController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="24" column="27" lean-forward="false" selection-start-line="24" selection-start-column="27" selection-end-line="24" selection-end-column="27" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MatchSetupController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="252">
<caret line="12" column="58" lean-forward="false" selection-start-line="12" selection-start-column="58" selection-end-line="12" selection-end-column="58" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/MenuController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="231">
<caret line="11" column="38" lean-forward="false" selection-start-line="11" selection-start-column="38" selection-end-line="11" selection-end-column="38" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Client/src/com/texttwist/client/controllers/RegisterController.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="378">
<caret line="18" column="0" lean-forward="false" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="42">
<caret line="2" column="5" lean-forward="false" selection-start-line="2" selection-start-column="5" selection-end-line="2" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
</component> </component>
<component name="masterDetails"> <component name="masterDetails">
<states> <states>

View file

@ -1,53 +1,51 @@
package com.texttwist.client; package com.texttwist.client;
import com.texttwist.client.services.GameService;
import com.texttwist.client.services.AuthService; import com.texttwist.client.services.AuthService;
import com.texttwist.client.pages.HomePage; import com.texttwist.client.pages.HomePage;
import com.texttwist.client.models.Game;
import com.texttwist.client.services.NotificationClient;
import constants.Config;
import interfaces.INotificationClient;
import interfaces.INotificationServer;
import models.Session; import models.Session;
import utilities.Logger; import utilities.Logger;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException; import java.lang.management.ManagementFactory;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
/** /**
* Created by loke on 13/06/2017. * Author: Lorenzo Iovino on 13/06/2017.
* Description: The App entrypoint.
* Here is possible to declare services globally accessible.
*/ */
public class App extends JFrame { public class App extends JFrame {
public static AuthService authService; public static AuthService authService;
public static Session session; public static GameService gameService;
public static Game game;
public static JFrame app;
public static Logger logger; public static Logger logger;
public static Session session;
public static JFrame app;
public App() throws IOException { public App() throws IOException {
setPreferredSize( new Dimension( 640, 480 )); setPreferredSize( new Dimension( 640, 480 ));
setSize(new Dimension(640,480)); setSize(new Dimension(640,480));
setLocation(100,100); setLocation(100,100);
setResizable( false ); setResizable( false );
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
long id = Thread.currentThread().getId(); /*Setup logger*/
String id = ManagementFactory.getRuntimeMXBean().getName();
logger = new Logger(new File("./client_"+id+".log"), "Client"+id, true); logger = new Logger(new File("./client_"+id+".log"), "Client"+id, true);
logger.write("Client starting ..."); logger.write("Client starting ...");
//Init models /*Load fonts*/
game = new Game(); try {
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
graphicsEnvironment.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(
new File("./Client/resources/fonts/DK Trained Monkey.otf").getCanonicalPath())));
} catch (IOException|FontFormatException e) {
logger.write("APP: Font not found!");
}
//Init services /*Services*/
gameService = new GameService();
authService = new AuthService(); authService = new AuthService();
app = this; app = this;

View file

@ -1,24 +1,14 @@
package com.texttwist.client; package com.texttwist.client;
import java.awt.*;
import java.io.File;
import java.io.IOException; import java.io.IOException;
/**
* Author: Lorenzo Iovino on 13/06/2017.
* Description: Main
*/
public class Main { public class Main {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
System.out.println("Client started"); new App();
//Load fonts
try {
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
graphicsEnvironment.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(
new File("./Client/resources/fonts/DK Trained Monkey.otf").getCanonicalPath())));
} catch (IOException|FontFormatException e) {
System.out.println("ERROR: Font not found!");
}
App entrypoint = new App();
} }
} }

View file

@ -1,4 +1,5 @@
package com.texttwist.client.controllers; package com.texttwist.client.controllers;
import com.texttwist.client.App; import com.texttwist.client.App;
import com.texttwist.client.pages.GamePage; import com.texttwist.client.pages.GamePage;
import com.texttwist.client.tasks.SendWords; import com.texttwist.client.tasks.SendWords;
@ -8,7 +9,8 @@ import com.texttwist.client.tasks.WaitForScore;
import javax.swing.*; import javax.swing.*;
/** /**
* GamePage Controller * Author: Lorenzo Iovino on 27/06/2017.
* Description: Controller of the Game Page
*/ */
public class GameController { public class GameController {
@ -27,11 +29,11 @@ public class GameController {
} }
public SwingWorker sendWords(SwingWorker callback){ public SwingWorker sendWords(SwingWorker callback){
return new SendWords(App.game.words, waitForScore(callback)); return new SendWords(App.gameService.words, waitForScore(callback));
} }
public SwingWorker startGame() { public SwingWorker startGame() {
return new StartGame(App.game.letters, game); return new StartGame(App.gameService.letters, game);
} }
} }

View file

@ -1,13 +1,14 @@
package com.texttwist.client.controllers; package com.texttwist.client.controllers;
import com.texttwist.client.App; import com.texttwist.client.App;
import com.texttwist.client.pages.HighscoresPage; import com.texttwist.client.pages.HighscoresPage;
import com.texttwist.client.tasks.FetchHighscore; import com.texttwist.client.tasks.FetchHighscore;
import javafx.util.Pair; import javafx.util.Pair;
import javax.swing.*; import javax.swing.*;
/** /**
* Highscores Controller * Author: Lorenzo Iovino on 27/06/2017.
* Description: Controller of the Highscore Page
*/ */
public class HighscoresController { public class HighscoresController {
@ -22,7 +23,7 @@ public class HighscoresController {
} }
public DefaultListModel<Pair<String,Integer>> getRanks(Boolean isPartialRank) { public DefaultListModel<Pair<String,Integer>> getRanks(Boolean isPartialRank) {
return isPartialRank ? App.game.ranks : App.game.globalRanks; return isPartialRank ? App.gameService.ranks : App.gameService.globalRanks;
} }
} }

View file

@ -1,15 +1,16 @@
package com.texttwist.client.controllers; package com.texttwist.client.controllers;
import com.texttwist.client.App; import com.texttwist.client.App;
import models.Response; import models.Response;
import models.Session; import models.Session;
import models.User; import models.User;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.rmi.NotBoundException; import java.rmi.NotBoundException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
/** /**
* Created by loke on 15/06/2017. * Author: Lorenzo Iovino on 20/06/2017.
* Description: Controller of the Home Page
*/ */
public class HomeController { public class HomeController {

View file

@ -1,22 +1,21 @@
package com.texttwist.client.controllers; package com.texttwist.client.controllers;
import com.texttwist.client.App; import com.texttwist.client.App;
import javax.swing.*; import javax.swing.*;
import java.io.IOException; import java.io.IOException;
/** /**
* Created by loke on 18/06/2017. * Author: Lorenzo Iovino on 18/06/2017.
* Description: Controller of the Match Setup Page
*/ */
public class MatchSetupController { public class MatchSetupController {
public Object play(DefaultListModel<String> userNames) { public Object play(DefaultListModel<String> userNames) {
try { try {
return App.game.play(userNames); return App.gameService.play(userNames);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
} }
} }

View file

@ -3,21 +3,20 @@ package com.texttwist.client.controllers;
import com.texttwist.client.App; import com.texttwist.client.App;
import interfaces.INotificationClient; import interfaces.INotificationClient;
import models.Response; import models.Response;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.rmi.NotBoundException; import java.rmi.NotBoundException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
/** /**
* Created by loke on 17/06/2017. * Author: Lorenzo Iovino on 17/06/2017.
* Description: Controller of the Menu Page
*/ */
public class MenuController { public class MenuController {
public Response logout(String userName, INotificationClient stub) throws RemoteException, NotBoundException, MalformedURLException { public void logout(String userName, INotificationClient stub) throws RemoteException, NotBoundException, MalformedURLException {
Response res = App.authService.logout(userName, stub); Response res = App.authService.logout(userName, stub);
if (res.code == 200){ if (res.code == 200){
App.session = null; App.session = null;
} }
return res;
} }
} }

View file

@ -2,13 +2,13 @@ package com.texttwist.client.controllers;
import com.texttwist.client.App; import com.texttwist.client.App;
import models.Response; import models.Response;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.rmi.NotBoundException; import java.rmi.NotBoundException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
/** /**
* Created by loke on 17/06/2017. * Author: Lorenzo Iovino on 17/06/2017.
* Description: Controller of the Register Page
*/ */
public class RegisterController { public class RegisterController {

View file

@ -8,7 +8,7 @@ import java.awt.*;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.*; import java.util.concurrent.*;
import static com.texttwist.client.App.game; import static com.texttwist.client.App.gameService;
/** /**
* GamePage Page * GamePage Page
@ -90,7 +90,7 @@ public class GamePage extends Page {
public void showLetters(){ public void showLetters(){
/* Place letters in an available random spawning point */ /* Place letters in an available random spawning point */
DefaultListModel<String> letters = game.getLetters(); DefaultListModel<String> letters = gameService.getLetters();
for(int i = 0; i < letters.size()-1; i++){ for(int i = 0; i < letters.size()-1; i++){
new TTLetter( new TTLetter(
occupyRandomPosition(), occupyRandomPosition(),
@ -120,7 +120,7 @@ public class GamePage extends Page {
new Point(150, 90), new Point(150, 90),
new Dimension(250, 40), new Dimension(250, 40),
"Insert word and Press ENTER!", "Insert word and Press ENTER!",
game.getWords(), gameService.getWords(),
gameContainer gameContainer
); );

View file

@ -45,7 +45,7 @@ public class MatchRequestsPage extends Page{
TTScrollList pendingMatches = new TTScrollList( TTScrollList pendingMatches = new TTScrollList(
new Point(20, 60), new Point(20, 60),
new Dimension(520, 142), new Dimension(520, 142),
App.game.pendingList, App.gameService.pendingList,
matchsContainer matchsContainer
); );
@ -56,7 +56,7 @@ public class MatchRequestsPage extends Page{
JList thisList = (JList)evt.getSource(); JList thisList = (JList)evt.getSource();
if (evt.getClickCount() == 2) { if (evt.getClickCount() == 2) {
int index = thisList.locationToIndex(evt.getPoint()); int index = thisList.locationToIndex(evt.getPoint());
App.game.joinMatch(App.game.pendingList.get(index)); App.gameService.joinMatch(App.gameService.pendingList.get(index));
} }
} }
}); });

View file

@ -48,7 +48,7 @@ public class MenuPage extends Page{
TTButton newMatch = new TTButton( TTButton newMatch = new TTButton(
new Point(25,70), new Point(25,70),
new Dimension(250,75), new Dimension(250,75),
"New Game!", "New GameService!",
new Callable<Object>() { new Callable<Object>() {
@Override @Override
public Object call() throws Exception { public Object call() throws Exception {
@ -100,7 +100,7 @@ public class MenuPage extends Page{
new Callable<Object>() { new Callable<Object>() {
@Override @Override
public Object call() throws Exception { public Object call() throws Exception {
menuController.logout(App.session.account.userName, App.game.notificationStub); menuController.logout(App.session.account.userName, App.gameService.notificationStub);
return new HomePage(Page.window); return new HomePage(Page.window);
} }
}, },

View file

@ -20,8 +20,8 @@ public class AuthService {
public Response login(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException { public Response login(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException {
try { try {
INotificationClient callbackObj = new NotificationClient(); INotificationClient callbackObj = new NotificationClient();
App.game.notificationStub = (INotificationClient) UnicastRemoteObject.exportObject(callbackObj, 0); App.gameService.notificationStub = (INotificationClient) UnicastRemoteObject.exportObject(callbackObj, 0);
App.game.notificationServer.registerForCallback(App.game.notificationStub); App.gameService.notificationServer.registerForCallback(App.gameService.notificationStub);
} catch (RemoteException e) { } catch (RemoteException e) {
e.printStackTrace(); e.printStackTrace();
} }

View file

@ -1,4 +1,4 @@
package com.texttwist.client.models; package com.texttwist.client.services;
import com.texttwist.client.App; import com.texttwist.client.App;
import com.texttwist.client.pages.GamePage; import com.texttwist.client.pages.GamePage;
@ -27,7 +27,7 @@ import java.util.concurrent.*;
/** /**
* Created by loke on 18/06/2017. * Created by loke on 18/06/2017.
*/ */
public class Game { public class GameService {
public Integer multicastId = 0 ; public Integer multicastId = 0 ;
public DefaultListModel<String> pendingList = new DefaultListModel<String>(); public DefaultListModel<String> pendingList = new DefaultListModel<String>();
@ -43,7 +43,7 @@ public class Game {
private ByteBuffer buffer = ByteBuffer.allocate(1024); private ByteBuffer buffer = ByteBuffer.allocate(1024);
public Game(){ public GameService(){
Registry registry = null; Registry registry = null;
try { try {
@ -74,13 +74,13 @@ public class Game {
e.printStackTrace(); e.printStackTrace();
} }
if(!App.game.gameIsStarted) { if(!App.gameService.gameIsStarted) {
//Show invitation popup //Show invitation popup
new TTDialog("success", "New invitation from: " + userName + "!", new TTDialog("success", "New invitation from: " + userName + "!",
new Callable() { new Callable() {
@Override @Override
public Object call() throws Exception { public Object call() throws Exception {
App.game.joinMatch(userName); App.gameService.joinMatch(userName);
return null; return null;
} }
}, },
@ -95,11 +95,11 @@ public class Game {
public DefaultListModel<String> getLetters(){ public DefaultListModel<String> getLetters(){
return App.game.letters; return App.gameService.letters;
} }
public DefaultListModel<String> getWords() { public DefaultListModel<String> getWords() {
return App.game.words; return App.gameService.words;
} }
public void setLetters(DefaultListModel<String> letters){ public void setLetters(DefaultListModel<String> letters){
@ -133,12 +133,12 @@ public class Game {
} }
public Void start(){ public Void start(){
App.game.gameIsStarted = true; App.gameService.gameIsStarted = true;
return null; return null;
} }
public Void stop(){ public Void stop(){
App.game.gameIsStarted = false; App.gameService.gameIsStarted = false;
return null; return null;
} }

View file

@ -2,7 +2,6 @@ package com.texttwist.client.services;
import com.texttwist.client.App; import com.texttwist.client.App;
import interfaces.INotificationClient; import interfaces.INotificationClient;
import models.Response; import models.Response;
import utilities.Logger;
import javax.swing.*; import javax.swing.*;
import java.rmi.RemoteException; import java.rmi.RemoteException;
@ -23,7 +22,7 @@ public class NotificationClient implements INotificationClient {
if(App.session != null) { if(App.session != null) {
if (users.contains(App.session.account.userName)) { if (users.contains(App.session.account.userName)) {
App.logger.write(userName + " send a invitation!"); App.logger.write(userName + " send a invitation!");
App.game.newMatch(userName); App.gameService.newMatch(userName);
} else { } else {
App.logger.write("User " + userName + " is slogged"); App.logger.write("User " + userName + " is slogged");
} }

View file

@ -9,7 +9,6 @@ import javax.swing.*;
import java.io.IOException; import java.io.IOException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel; import java.nio.channels.SocketChannel;
import java.util.*;
/** /**
* Job: FetchHighscore * Job: FetchHighscore
@ -22,7 +21,7 @@ public class FetchHighscore extends SwingWorker<Void,Void> {
HighscoresPage highscoresPage; HighscoresPage highscoresPage;
public FetchHighscore(HighscoresPage highscoresPage){ public FetchHighscore(HighscoresPage highscoresPage){
this.socketChannel = App.game.clientSocket; this.socketChannel = App.gameService.clientSocket;
this.highscoresPage = highscoresPage; this.highscoresPage = highscoresPage;
} }
@ -67,7 +66,7 @@ public class FetchHighscore extends SwingWorker<Void,Void> {
} }
public void done(){ public void done(){
App.game.globalRanks = globalRanks; App.gameService.globalRanks = globalRanks;
this.highscoresPage.showHighscoreList(); this.highscoresPage.showHighscoreList();
} }
} }

View file

@ -23,9 +23,9 @@ public class StartGame extends SwingWorker<Void,Void> {
@Override @Override
public Void doInBackground(){ public Void doInBackground(){
App.game.start(); App.gameService.start();
//Mostra pannello di conferma che le lettere sono tutte arrivate //Mostra pannello di conferma che le lettere sono tutte arrivate
new TTDialog("success", "Game is ready. Press OK to start!", new TTDialog("success", "GameService is ready. Press OK to start!",
new Callable() { new Callable() {
@Override @Override
public Object call() throws Exception { public Object call() throws Exception {

View file

@ -6,7 +6,6 @@ import com.texttwist.client.pages.Page;
import com.texttwist.client.ui.TTDialog; import com.texttwist.client.ui.TTDialog;
import constants.Config; import constants.Config;
import models.Message; import models.Message;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;
import javax.swing.*; import javax.swing.*;
import java.io.IOException; import java.io.IOException;
@ -31,7 +30,7 @@ public class WaitForPlayers extends SwingWorker<DefaultListModel<String>,Default
public WaitForPlayers(SwingWorker callback) { public WaitForPlayers(SwingWorker callback) {
this.callback = callback; this.callback = callback;
this.words = words; this.words = words;
this.socketChannel = App.game.clientSocket; this.socketChannel = App.gameService.clientSocket;
} }
@Override @Override
@ -97,11 +96,11 @@ public class WaitForPlayers extends SwingWorker<DefaultListModel<String>,Default
data= msg.data; data= msg.data;
Integer multicastId = Integer.valueOf(data.remove(data.size()-2)); Integer multicastId = Integer.valueOf(data.remove(data.size()-2));
App.game.setMulticastId(multicastId); App.gameService.setMulticastId(multicastId);
App.game.multicastSocket = new MulticastSocket(App.game.multicastId); App.gameService.multicastSocket = new MulticastSocket(App.gameService.multicastId);
InetAddress ia = InetAddress.getByName(Config.ScoreMulticastServerURI); InetAddress ia = InetAddress.getByName(Config.ScoreMulticastServerURI);
App.game.multicastSocket.joinGroup(ia); App.gameService.multicastSocket.joinGroup(ia);
letters = msg.data; letters = msg.data;
@ -129,7 +128,7 @@ public class WaitForPlayers extends SwingWorker<DefaultListModel<String>,Default
public void done(){ public void done(){
if(!joinTimeout) { if(!joinTimeout) {
try { try {
App.game.setLetters(letters); App.gameService.setLetters(letters);
this.callback.execute(); this.callback.execute();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View file

@ -29,7 +29,7 @@ public class WaitForScore extends SwingWorker<Void,Void> {
while(true) { while(true) {
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
DatagramPacket receivedDatagram = new DatagramPacket(buf, buf.length); DatagramPacket receivedDatagram = new DatagramPacket(buf, buf.length);
App.game.multicastSocket.receive(receivedDatagram); App.gameService.multicastSocket.receive(receivedDatagram);
String s = new String(receivedDatagram.getData()); String s = new String(receivedDatagram.getData());
Message msg = Message.toMessage(s); Message msg = Message.toMessage(s);
@ -37,8 +37,8 @@ public class WaitForScore extends SwingWorker<Void,Void> {
//When arrive a message with message=FINALSCORE popolate ranks //When arrive a message with message=FINALSCORE popolate ranks
if(msg.message.equals("FINALSCORE")){ if(msg.message.equals("FINALSCORE")){
if(msg.data != null) { if(msg.data != null) {
App.game.ranks.clear(); App.gameService.ranks.clear();
App.game.ranks = utilities.Parse.score(msg.data); App.gameService.ranks = utilities.Parse.score(msg.data);
} }
break; break;
} }
@ -55,11 +55,11 @@ public class WaitForScore extends SwingWorker<Void,Void> {
public void done(){ public void done(){
try { try {
//Leave group and close multicast socket //Leave group and close multicast socket
App.game.multicastSocket.leaveGroup(InetAddress.getByName(Config.ScoreMulticastServerURI)); App.gameService.multicastSocket.leaveGroup(InetAddress.getByName(Config.ScoreMulticastServerURI));
App.game.multicastSocket.close(); App.gameService.multicastSocket.close();
//Stop game //Stop gameService
App.game.stop(); App.gameService.stop();
//Call callback //Call callback
this.callback.execute(); this.callback.execute();

View file

@ -1,7 +1,5 @@
package models; package models;
import interfaces.INotificationClient;
/** /**
* Created by loke on 17/06/2017. * Created by loke on 17/06/2017.
*/ */
@ -9,7 +7,6 @@ public class Session {
public String token; public String token;
public User account; public User account;
public INotificationClient clientInterface;
public Session(User account, String token){ public Session(User account, String token){
this.token = token; this.token = token;

View file

@ -21,11 +21,6 @@ public class AccountsManager {
} }
private AccountsManager(){ private AccountsManager(){
users.add(new User("a","a",0));
users.add(new User("b","b",0));
users.add(new User("c","c",0));
users.add(new User("d","d",0));
List<Serializable> l = JedisService.get("users"); List<Serializable> l = JedisService.get("users");
for(int i=0; i<l.size(); i++) { for(int i=0; i<l.size(); i++) {
users.add((User) l.get(i)); users.add((User) l.get(i));

View file

@ -61,7 +61,7 @@ public class GameServer implements Runnable{
datagramChannel = DatagramChannel.open(); datagramChannel = DatagramChannel.open();
datagramChannel.configureBlocking(true); datagramChannel.configureBlocking(true);
datagramChannel.connect(address); datagramChannel.connect(address);
Server.logger.write("Game Service is running at "+this.serverPort+" port..."); Server.logger.write("GameService Service is running at "+this.serverPort+" port...");
wordsReceiver = new ReceiveWords(datagramChannel, bufferWords, bufferMessages, client); wordsReceiver = new ReceiveWords(datagramChannel, bufferWords, bufferMessages, client);
threadPool.submit(wordsReceiver); threadPool.submit(wordsReceiver);

View file

@ -818,3 +818,74 @@ LOGGER (Server): Wed Jul 12 17:01:13 CEST 2017 - Invoked login with username=a A
LOGGER (Server): Wed Jul 12 17:01:13 CEST 2017 - Login successfull LOGGER (Server): Wed Jul 12 17:01:13 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:01:16 CEST 2017 - Invoked login with username=b AND password=b LOGGER (Server): Wed Jul 12 17:01:16 CEST 2017 - Invoked login with username=b AND password=b
LOGGER (Server): Wed Jul 12 17:01:16 CEST 2017 - Login successfull LOGGER (Server): Wed Jul 12 17:01:16 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:34:39 CEST 2017 - Server starting ...
LOGGER (Server): Wed Jul 12 17:34:39 CEST 2017 - Auth Service running at 9999 port...
LOGGER (Server): Wed Jul 12 17:34:39 CEST 2017 - Server started
LOGGER (Server): Wed Jul 12 17:34:39 CEST 2017 - GameService Service is running at 10000 port...
LOGGER (Server): Wed Jul 12 17:35:17 CEST 2017 - Invoked login with username=a AND password=a
LOGGER (Server): Wed Jul 12 17:35:17 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:35:20 CEST 2017 - Invoked login with username=b AND password=b
LOGGER (Server): Wed Jul 12 17:35:20 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:36:23 CEST 2017 - Server starting ...
LOGGER (Server): Wed Jul 12 17:36:23 CEST 2017 - Auth Service running at 9999 port...
LOGGER (Server): Wed Jul 12 17:36:23 CEST 2017 - GameService Service is running at 10000 port...
LOGGER (Server): Wed Jul 12 17:36:23 CEST 2017 - Server started
LOGGER (Server): Wed Jul 12 17:36:27 CEST 2017 - Invoked login with username=a AND password=a
LOGGER (Server): Wed Jul 12 17:36:27 CEST 2017 - Login unsuccessfull
LOGGER (Server): Wed Jul 12 17:36:31 CEST 2017 - Invoked register with username=a AND password=a
LOGGER (Server): Wed Jul 12 17:36:31 CEST 2017 - Registration successfull
LOGGER (Server): Wed Jul 12 17:36:33 CEST 2017 - Invoked login with username=a AND password=a
LOGGER (Server): Wed Jul 12 17:36:33 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:36:42 CEST 2017 - Invoked register with username=b AND password=b
LOGGER (Server): Wed Jul 12 17:36:42 CEST 2017 - Registration successfull
LOGGER (Server): Wed Jul 12 17:36:44 CEST 2017 - Invoked login with username=b AND password=b
LOGGER (Server): Wed Jul 12 17:36:44 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:37:00 CEST 2017 - Server starting ...
LOGGER (Server): Wed Jul 12 17:37:00 CEST 2017 - Auth Service running at 9999 port...
LOGGER (Server): Wed Jul 12 17:37:00 CEST 2017 - GameService Service is running at 10000 port...
LOGGER (Server): Wed Jul 12 17:37:00 CEST 2017 - Server started
LOGGER (Server): Wed Jul 12 17:37:04 CEST 2017 - Invoked login with username=a AND password=a
LOGGER (Server): Wed Jul 12 17:37:04 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:37:08 CEST 2017 - Invoked login with username=b AND password=b
LOGGER (Server): Wed Jul 12 17:37:08 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:37:29 CEST 2017 - Invoked logout with username=b AND token=b2mtfkaf4cn9pr63pefpapr6v5
LOGGER (Server): Wed Jul 12 17:37:29 CEST 2017 - Logout successfull
LOGGER (Server): Wed Jul 12 17:37:29 CEST 2017 - Logout successfull (but something gone wrong)
LOGGER (Server): Wed Jul 12 17:37:32 CEST 2017 - Invoked register with username=asd AND password=asd
LOGGER (Server): Wed Jul 12 17:37:32 CEST 2017 - Registration successfull
LOGGER (Server): Wed Jul 12 17:37:35 CEST 2017 - Invoked login with username=asd AND password=asd
LOGGER (Server): Wed Jul 12 17:37:35 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:38:02 CEST 2017 - Server starting ...
LOGGER (Server): Wed Jul 12 17:38:02 CEST 2017 - Auth Service running at 9999 port...
LOGGER (Server): Wed Jul 12 17:38:02 CEST 2017 - Server started
LOGGER (Server): Wed Jul 12 17:38:02 CEST 2017 - GameService Service is running at 10000 port...
LOGGER (Server): Wed Jul 12 17:38:11 CEST 2017 - Invoked login with username=asd AND password=asd
LOGGER (Server): Wed Jul 12 17:38:11 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:38:32 CEST 2017 - Invoked login with username=a AND password=a
LOGGER (Server): Wed Jul 12 17:38:32 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:38:56 CEST 2017 - Invoked logout with username=asd AND token=726cclo6htn68o6hl1kv9dit68
LOGGER (Server): Wed Jul 12 17:38:56 CEST 2017 - Logout successfull
LOGGER (Server): Wed Jul 12 17:38:56 CEST 2017 - Logout successfull (but something gone wrong)
LOGGER (Server): Wed Jul 12 17:38:59 CEST 2017 - Invoked register with username=dd AND password=dd
LOGGER (Server): Wed Jul 12 17:38:59 CEST 2017 - Registration successfull
LOGGER (Server): Wed Jul 12 17:39:01 CEST 2017 - Invoked login with username=dd AND password=dd
LOGGER (Server): Wed Jul 12 17:39:01 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:43:48 CEST 2017 - Server starting ...
LOGGER (Server): Wed Jul 12 17:43:49 CEST 2017 - Auth Service running at 9999 port...
LOGGER (Server): Wed Jul 12 17:43:49 CEST 2017 - Server started
LOGGER (Server): Wed Jul 12 17:43:49 CEST 2017 - GameService Service is running at 10000 port...
LOGGER (Server): Wed Jul 12 17:44:00 CEST 2017 - Invoked login with username=a AND password=a
LOGGER (Server): Wed Jul 12 17:44:00 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:55:12 CEST 2017 - Server starting ...
LOGGER (Server): Wed Jul 12 17:55:12 CEST 2017 - Auth Service running at 9999 port...
LOGGER (Server): Wed Jul 12 17:55:12 CEST 2017 - Server started
LOGGER (Server): Wed Jul 12 17:55:12 CEST 2017 - GameService Service is running at 10000 port...
LOGGER (Server): Wed Jul 12 17:55:15 CEST 2017 - Invoked login with username=a AND password=a
LOGGER (Server): Wed Jul 12 17:55:15 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:55:18 CEST 2017 - Invoked login with username=asd AND password=asd
LOGGER (Server): Wed Jul 12 17:55:18 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:55:22 CEST 2017 - Invoked login with username=b AND password=b
LOGGER (Server): Wed Jul 12 17:55:22 CEST 2017 - Login successfull
LOGGER (Server): Wed Jul 12 17:55:55 CEST 2017 - Invoked logout with username=b AND token=c7gnsjibk6rgfbrkefoqi36ii8
LOGGER (Server): Wed Jul 12 17:55:55 CEST 2017 - Logout successfull
LOGGER (Server): Wed Jul 12 17:55:55 CEST 2017 - Logout successfull (but something gone wrong)