diff --git a/.idea/artifacts/Client_jar.xml b/.idea/artifacts/Client_jar.xml
deleted file mode 100644
index bca276c..0000000
--- a/.idea/artifacts/Client_jar.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- $PROJECT_DIR$/out/artifacts/Client_jar
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/artifacts/Server_jar.xml b/.idea/artifacts/Server_jar.xml
deleted file mode 100644
index a0b38e8..0000000
--- a/.idea/artifacts/Server_jar.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- $PROJECT_DIR$/out/artifacts/Server_jar
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 62626a3..a46aec0 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,14 +2,38 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -20,7 +44,7 @@
-
+
com.texttwist.client.*
@@ -31,11 +55,21 @@
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -43,61 +77,73 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -105,36 +151,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -146,36 +162,36 @@
- multicast
- multicastID
- us
- users
- users"
- "users"
- m
- matchT
- matchTi
- matchTime
- matchTimeo
- matchTimeou
- matchTimeout
- A
- AP
- APP not
- APP no
- APP n
- APP
- APP
- APP:
- APP: A
- APP:
- no
- notifica
- notificationS
- notificationSEr
- notificationSErv
- notificationSErver
- notificationSErver.
+ Registration
+ Registration uns
+ R
+ regisr
+ regis
+ registration
+ registration unsu
+ registration unsuc
+ registration unsucce
+ registration unsuccess
+ G
+ GameService is
+ T
+ TIMEO
+ TIMEOUT
+ Inse
+ Insert
+ Insert w
+ Insert wo
+ ga
+ game is rea
+ game is read
+ le
+ letters
+ 120
+ 5
+ 5000
+ 500
+ 4
+ 4000
C:\Users\loke\TextTwist\out\production
@@ -314,57 +330,57 @@
@@ -384,10 +400,9 @@
-
-
-
-
+
+
+
@@ -419,318 +434,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -813,12 +516,298 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Client/resources/images/logout.png b/Client/resources/images/logout.png
new file mode 100644
index 0000000..6093b84
Binary files /dev/null and b/Client/resources/images/logout.png differ
diff --git a/Client/resources/images/scores.png b/Client/resources/images/scores.png
new file mode 100644
index 0000000..d07dfe8
Binary files /dev/null and b/Client/resources/images/scores.png differ
diff --git a/Client/src/META-INF/MANIFEST.MF b/Client/src/META-INF/MANIFEST.MF
deleted file mode 100644
index 4b258d3..0000000
--- a/Client/src/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: com.texttwist.client.Main
-
diff --git a/Client/src/com/texttwist/client/App.java b/Client/src/com/texttwist/client/App.java
index 9008c50..de9185d 100644
--- a/Client/src/com/texttwist/client/App.java
+++ b/Client/src/com/texttwist/client/App.java
@@ -32,8 +32,8 @@ import java.rmi.server.UnicastRemoteObject;
*/
public class App extends JFrame {
- private static InetSocketAddress clientTCPSocketAddress = new InetSocketAddress(Config.MessageServiceURI, Config.MessageServicePort);
- public static InetSocketAddress clientUDPSocketAddress = new InetSocketAddress(Config.WordsReceiverServiceURI, Config.WordsReceiverServicePort);
+ private static InetSocketAddress clientTCPSocketAddress = new InetSocketAddress(Config.GameServerURI, Config.GameServerPort);
+ public static InetSocketAddress clientUDPSocketAddress = new InetSocketAddress(Config.WordsReceiverServerURI, Config.WordsReceiverServerPort);
private static InetAddress clientMulticastSocketAddress;
public static AuthService authService;
@@ -68,7 +68,7 @@ public class App extends JFrame {
logger.write("APP: Font not found!");
}
- /*services*/
+ /*Services*/
gameService = new GameService();
authService = new AuthService();
@@ -79,10 +79,10 @@ public class App extends JFrame {
public static void registerForNotifications() throws RemoteException, NotBoundException {
- Registry registry = LocateRegistry.getRegistry(Config.NotificationServiceStubPort);
+ Registry registry = LocateRegistry.getRegistry(Config.NotificationServerStubPort);
INotificationClient callbackObj = new NotificationClientService();
notificationStub = (INotificationClient) UnicastRemoteObject.exportObject(callbackObj, 0);
- INotificationServer notificationServer = (INotificationServer) registry.lookup(Config.NotificationServiceName);
+ INotificationServer notificationServer = (INotificationServer) registry.lookup(Config.NotificationServerName);
notificationServer.registerForCallback(notificationStub);
}
@@ -98,7 +98,7 @@ public class App extends JFrame {
public static void openClientMulticastSocket(Integer multicastId){
try {
App.gameService.setMulticastId(multicastId);
- clientMulticastSocketAddress = InetAddress.getByName(Config.ScoreMulticastServiceURI);
+ clientMulticastSocketAddress = InetAddress.getByName(Config.ScoreMulticastServerURI);
clientMulticast = new MulticastSocket(gameService.multicastId);
clientMulticast.joinGroup(clientMulticastSocketAddress);
} catch (IOException e) {
@@ -109,7 +109,7 @@ public class App extends JFrame {
public static void closeClientMulticastSocket(){
//Leave group and close multicast socket
try {
- App.clientMulticast.leaveGroup(InetAddress.getByName(Config.ScoreMulticastServiceURI));
+ App.clientMulticast.leaveGroup(InetAddress.getByName(Config.ScoreMulticastServerURI));
App.clientMulticast.close();
} catch (IOException e) {
e.printStackTrace();
diff --git a/Client/src/com/texttwist/client/controllers/HomeController.java b/Client/src/com/texttwist/client/controllers/HomeController.java
index 30faf9c..2197bbd 100644
--- a/Client/src/com/texttwist/client/controllers/HomeController.java
+++ b/Client/src/com/texttwist/client/controllers/HomeController.java
@@ -18,11 +18,6 @@ public class HomeController {
public Response login(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException {
Response res = authService.login(userName,password);
if (res.code == 200){
- try {
- App.registerForNotifications();
- } catch (RemoteException e) {
- App.logger.write("AUTH SERVICE: Can't register for notification");
- }
App.session = (new Session(new User(userName,password,0), res.data.get("token").toString()));
}
return res;
diff --git a/Client/src/com/texttwist/client/controllers/MatchRequestController.java b/Client/src/com/texttwist/client/controllers/MatchRequestController.java
index 1343a7d..f2d797a 100644
--- a/Client/src/com/texttwist/client/controllers/MatchRequestController.java
+++ b/Client/src/com/texttwist/client/controllers/MatchRequestController.java
@@ -1,8 +1,6 @@
package com.texttwist.client.controllers;
import com.texttwist.client.App;
-import com.texttwist.client.tasks.JoinMatch;
-
import javax.swing.*;
/**
@@ -16,6 +14,6 @@ public class MatchRequestController {
}
public void joinMatch(String matchName){
- new JoinMatch(matchName).execute();
+ App.gameService.joinMatch(matchName);
}
}
diff --git a/Client/src/com/texttwist/client/controllers/MatchSetupController.java b/Client/src/com/texttwist/client/controllers/MatchSetupController.java
index 98b3dd5..bf47bb0 100644
--- a/Client/src/com/texttwist/client/controllers/MatchSetupController.java
+++ b/Client/src/com/texttwist/client/controllers/MatchSetupController.java
@@ -1,7 +1,5 @@
package com.texttwist.client.controllers;
-import com.texttwist.client.tasks.InvitePlayers;
-
import javax.swing.*;
import static com.texttwist.client.App.gameService;
@@ -12,7 +10,6 @@ import static com.texttwist.client.App.gameService;
public class MatchSetupController {
public void play(DefaultListModel userNames) {
- new InvitePlayers(userNames).execute();
-
+ gameService.beginMatch(userNames);
}
}
diff --git a/Client/src/com/texttwist/client/pages/MatchSetupPage.java b/Client/src/com/texttwist/client/pages/MatchSetupPage.java
index 94202bc..64f7672 100644
--- a/Client/src/com/texttwist/client/pages/MatchSetupPage.java
+++ b/Client/src/com/texttwist/client/pages/MatchSetupPage.java
@@ -58,7 +58,7 @@ public class MatchSetupPage extends Page{
new Callable