Refactoring frontend
This commit is contained in:
parent
97c88c46bb
commit
10595f5bab
43 changed files with 1348 additions and 1120 deletions
1043
.idea/workspace.xml
generated
1043
.idea/workspace.xml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -3,6 +3,10 @@ package com.texttwist.client;
|
||||||
import com.texttwist.client.services.GameService;
|
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.services.NotificationClientService;
|
||||||
|
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.*;
|
||||||
|
|
@ -10,6 +14,16 @@ import java.awt.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.MulticastSocket;
|
||||||
|
import java.nio.channels.DatagramChannel;
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
import java.rmi.NotBoundException;
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
import java.rmi.registry.LocateRegistry;
|
||||||
|
import java.rmi.registry.Registry;
|
||||||
|
import java.rmi.server.UnicastRemoteObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: Lorenzo Iovino on 13/06/2017.
|
* Author: Lorenzo Iovino on 13/06/2017.
|
||||||
|
|
@ -17,12 +31,22 @@ import java.lang.management.ManagementFactory;
|
||||||
* Here is possible to declare services globally accessible.
|
* Here is possible to declare services globally accessible.
|
||||||
*/
|
*/
|
||||||
public class App extends JFrame {
|
public class App extends JFrame {
|
||||||
|
|
||||||
|
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;
|
public static AuthService authService;
|
||||||
public static GameService gameService;
|
public static GameService gameService;
|
||||||
public static Logger logger;
|
public static Logger logger;
|
||||||
public static Session session;
|
public static Session session;
|
||||||
public static JFrame app;
|
public static JFrame app;
|
||||||
|
|
||||||
|
public static INotificationClient notificationStub;
|
||||||
|
public static MulticastSocket clientMulticast;
|
||||||
|
public static SocketChannel clientTCP;
|
||||||
|
public static DatagramChannel clientUDP;
|
||||||
|
|
||||||
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));
|
||||||
|
|
@ -53,6 +77,54 @@ public class App extends JFrame {
|
||||||
new HomePage(this);
|
new HomePage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void registerForNotifications() throws RemoteException, NotBoundException {
|
||||||
|
|
||||||
|
Registry registry = LocateRegistry.getRegistry(Config.NotificationServerStubPort);
|
||||||
|
INotificationClient callbackObj = new NotificationClientService();
|
||||||
|
notificationStub = (INotificationClient) UnicastRemoteObject.exportObject(callbackObj, 0);
|
||||||
|
INotificationServer notificationServer = (INotificationServer) registry.lookup(Config.NotificationServerName);
|
||||||
|
notificationServer.registerForCallback(notificationStub);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void openClientTCPSocket(){
|
||||||
|
try {
|
||||||
|
clientTCP = SocketChannel.open(clientTCPSocketAddress);
|
||||||
|
clientTCP.configureBlocking(false);
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.write("APP: Can't open client TCP socket!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void openClientMulticastSocket(Integer multicastId){
|
||||||
|
try {
|
||||||
|
App.gameService.setMulticastId(multicastId);
|
||||||
|
clientMulticastSocketAddress = InetAddress.getByName(Config.ScoreMulticastServerURI);
|
||||||
|
clientMulticast = new MulticastSocket(gameService.multicastId);
|
||||||
|
clientMulticast.joinGroup(clientMulticastSocketAddress);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void closeClientMulticastSocket(){
|
||||||
|
//Leave group and close multicast socket
|
||||||
|
try {
|
||||||
|
App.clientMulticast.leaveGroup(InetAddress.getByName(Config.ScoreMulticastServerURI));
|
||||||
|
App.clientMulticast.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void openClientUDPSocket(){
|
||||||
|
try {
|
||||||
|
clientUDP = DatagramChannel.open();
|
||||||
|
clientUDP.bind(null);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Point getWindowsPosition(){
|
public static Point getWindowsPosition(){
|
||||||
return new Point(app.getX(), app.getY());
|
return new Point(app.getX(), app.getY());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,13 @@ 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;
|
||||||
import com.texttwist.client.tasks.StartGame;
|
|
||||||
import com.texttwist.client.tasks.WaitForPlayers;
|
import com.texttwist.client.tasks.WaitForPlayers;
|
||||||
import com.texttwist.client.tasks.WaitForScore;
|
import com.texttwist.client.tasks.WaitForScore;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
|
import static com.texttwist.client.App.gameService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: Lorenzo Iovino on 27/06/2017.
|
* Author: Lorenzo Iovino on 27/06/2017.
|
||||||
|
|
@ -14,26 +17,42 @@ import javax.swing.*;
|
||||||
*/
|
*/
|
||||||
public class GameController {
|
public class GameController {
|
||||||
|
|
||||||
private GamePage game;
|
private GamePage gamePage;
|
||||||
|
|
||||||
public GameController(GamePage game){
|
|
||||||
this.game = game;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SwingWorker waitForPlayers(SwingWorker callback) {
|
|
||||||
return new WaitForPlayers(callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
private SwingWorker waitForScore(SwingWorker callback){
|
private SwingWorker waitForScore(SwingWorker callback){
|
||||||
return new WaitForScore(callback);
|
return new WaitForScore(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SwingWorker sendWords(SwingWorker callback){
|
private SwingWorker sendWords(SwingWorker callback){
|
||||||
return new SendWords(App.gameService.words, waitForScore(callback));
|
return new SendWords(gameService.words, waitForScore(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SwingWorker startGame() {
|
public GameController(GamePage gamePage){
|
||||||
return new StartGame(App.gameService.letters, game);
|
this.gamePage = gamePage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SwingWorker waitForPlayers(Callable<Void> callback) {
|
||||||
|
return new WaitForPlayers(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Callable<Void> startGame = new Callable<Void>() {
|
||||||
|
@Override
|
||||||
|
public Void call() throws Exception {
|
||||||
|
App.gameService.start();
|
||||||
|
gamePage.showGameIsReadyAlert();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public DefaultListModel<String> getLetters() {
|
||||||
|
return gameService.getLetters();
|
||||||
|
}
|
||||||
|
|
||||||
|
public SwingWorker timeIsOver(SwingWorker callback) {
|
||||||
|
return sendWords(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DefaultListModel<String> getWords(){
|
||||||
|
return gameService.getWords();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
package com.texttwist.client.controllers;
|
package com.texttwist.client.controllers;
|
||||||
|
|
||||||
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.*;
|
||||||
|
import java.io.ObjectOutput;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
|
import static com.texttwist.client.App.gameService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: Lorenzo Iovino on 27/06/2017.
|
* Author: Lorenzo Iovino on 27/06/2017.
|
||||||
|
|
@ -12,18 +15,12 @@ import javax.swing.*;
|
||||||
*/
|
*/
|
||||||
public class HighscoresController {
|
public class HighscoresController {
|
||||||
|
|
||||||
private HighscoresPage highscoresPage;
|
public SwingWorker fetchHighscores(Callable<Void> callback) {
|
||||||
|
return new FetchHighscore(callback);
|
||||||
public HighscoresController(HighscoresPage highscoresPage){
|
|
||||||
this.highscoresPage = highscoresPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SwingWorker fetchHighscores () {
|
|
||||||
return new FetchHighscore(highscoresPage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultListModel<Pair<String,Integer>> getRanks(Boolean isPartialRank) {
|
public DefaultListModel<Pair<String,Integer>> getRanks(Boolean isPartialRank) {
|
||||||
return isPartialRank ? App.gameService.ranks : App.gameService.globalRanks;
|
return isPartialRank ? gameService.ranks : gameService.globalRanks;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ 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;
|
||||||
|
import static com.texttwist.client.App.authService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: Lorenzo Iovino on 20/06/2017.
|
* Author: Lorenzo Iovino on 20/06/2017.
|
||||||
|
|
@ -15,7 +16,7 @@ import java.rmi.RemoteException;
|
||||||
public class HomeController {
|
public class HomeController {
|
||||||
|
|
||||||
public Response login(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException {
|
public Response login(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException {
|
||||||
Response res = App.authService.login(userName,password);
|
Response res = authService.login(userName,password);
|
||||||
if (res.code == 200){
|
if (res.code == 200){
|
||||||
App.session = (new Session(new User(userName,password,0), res.data.get("token").toString()));
|
App.session = (new Session(new User(userName,password,0), res.data.get("token").toString()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.texttwist.client.controllers;
|
||||||
|
|
||||||
|
import com.texttwist.client.App;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author: Lorenzo Iovino on 13/072017.
|
||||||
|
* Description: Controller of the Match Request Page
|
||||||
|
*/
|
||||||
|
public class MatchRequestController {
|
||||||
|
|
||||||
|
public DefaultListModel<String> getPendingList(){
|
||||||
|
return App.gameService.pendingList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void joinMatch(String matchName){
|
||||||
|
App.gameService.joinMatch(matchName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
package com.texttwist.client.controllers;
|
package com.texttwist.client.controllers;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.IOException;
|
import static com.texttwist.client.App.gameService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: Lorenzo Iovino on 18/06/2017.
|
* Author: Lorenzo Iovino on 18/06/2017.
|
||||||
|
|
@ -10,12 +9,7 @@ import java.io.IOException;
|
||||||
*/
|
*/
|
||||||
public class MatchSetupController {
|
public class MatchSetupController {
|
||||||
|
|
||||||
public Object play(DefaultListModel<String> userNames) {
|
public void play(DefaultListModel<String> userNames) {
|
||||||
try {
|
gameService.beginMatch(userNames);
|
||||||
return App.gameService.play(userNames);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
package com.texttwist.client.controllers;
|
package com.texttwist.client.controllers;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
import com.texttwist.client.App;
|
||||||
import interfaces.INotificationClient;
|
|
||||||
import models.Response;
|
import models.Response;
|
||||||
|
import models.Session;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.rmi.NotBoundException;
|
import java.rmi.NotBoundException;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
|
import static com.texttwist.client.App.authService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: Lorenzo Iovino on 17/06/2017.
|
* Author: Lorenzo Iovino on 17/06/2017.
|
||||||
|
|
@ -13,10 +15,14 @@ import java.rmi.RemoteException;
|
||||||
*/
|
*/
|
||||||
public class MenuController {
|
public class MenuController {
|
||||||
|
|
||||||
public void logout(String userName, INotificationClient stub) throws RemoteException, NotBoundException, MalformedURLException {
|
public void logout() throws RemoteException, NotBoundException, MalformedURLException {
|
||||||
Response res = App.authService.logout(userName, stub);
|
Response res = authService.logout(App.session.account.userName, App.notificationStub);
|
||||||
if (res.code == 200){
|
if (res.code == 200){
|
||||||
App.session = null;
|
App.session = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Session getSession(){
|
||||||
|
return App.session;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.texttwist.client.controllers;
|
package com.texttwist.client.controllers;
|
||||||
|
|
||||||
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;
|
||||||
|
import static com.texttwist.client.App.authService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: Lorenzo Iovino on 17/06/2017.
|
* Author: Lorenzo Iovino on 17/06/2017.
|
||||||
|
|
@ -13,6 +13,6 @@ import java.rmi.RemoteException;
|
||||||
public class RegisterController {
|
public class RegisterController {
|
||||||
|
|
||||||
public Response register(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException {
|
public Response register(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException {
|
||||||
return App.authService.register(userName,password);
|
return authService.register(userName,password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
package com.texttwist.client.pages;
|
package com.texttwist.client.pages;
|
||||||
|
|
||||||
import com.texttwist.client.controllers.GameController;
|
import com.texttwist.client.controllers.GameController;
|
||||||
import constants.Config;
|
import constants.Config;
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
@ -8,10 +9,9 @@ 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.gameService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GamePage Page
|
* Author: Lorenzo Iovino on 27/06/2017.
|
||||||
|
* Description: Game Page
|
||||||
*/
|
*/
|
||||||
public class GamePage extends Page {
|
public class GamePage extends Page {
|
||||||
|
|
||||||
|
|
@ -19,24 +19,28 @@ public class GamePage extends Page {
|
||||||
private GameController gameController;
|
private GameController gameController;
|
||||||
public Timer timer;
|
public Timer timer;
|
||||||
|
|
||||||
/*Spawning points fixed and not modifiable*/
|
//All the spawning points
|
||||||
private final DefaultListModel<Point> letterSpawningPoints = setLetterSpawningPoint();
|
private final DefaultListModel<Point> letterSpawningPoints = setLetterSpawningPoint();
|
||||||
|
//Available spawning points
|
||||||
/*Available spawning points*/
|
|
||||||
private DefaultListModel<Point> availableLetterSpawningPoint = new DefaultListModel<>();
|
private DefaultListModel<Point> availableLetterSpawningPoint = new DefaultListModel<>();
|
||||||
|
|
||||||
public GamePage(JFrame window) throws IOException {
|
public GamePage(JFrame window) throws IOException {
|
||||||
super(window);
|
super(window);
|
||||||
gameController = new GameController(this);
|
gameController = new GameController(this);
|
||||||
|
|
||||||
|
//Reset and set spawning point for letters
|
||||||
availableLetterSpawningPoint.clear();
|
availableLetterSpawningPoint.clear();
|
||||||
availableLetterSpawningPoint = letterSpawningPoints;
|
availableLetterSpawningPoint = letterSpawningPoints;
|
||||||
gameController.waitForPlayers(gameController.startGame()).execute();
|
|
||||||
|
//Wait for players, then when all players joined start the game
|
||||||
|
gameController.waitForPlayers(gameController.startGame).execute();
|
||||||
|
|
||||||
createUIComponents();
|
createUIComponents();
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Occupy a random position of the available spawning points, if positions ends (can't happen) use position (0,0)*/
|
||||||
private Point occupyRandomPosition(){
|
private Point occupyRandomPosition(){
|
||||||
|
|
||||||
if(availableLetterSpawningPoint.size() > 1) {
|
if(availableLetterSpawningPoint.size() > 1) {
|
||||||
int index = ThreadLocalRandom.current().nextInt(0, letterSpawningPoints.size() - 1);
|
int index = ThreadLocalRandom.current().nextInt(0, letterSpawningPoints.size() - 1);
|
||||||
Point placeholder = letterSpawningPoints.get(index);
|
Point placeholder = letterSpawningPoints.get(index);
|
||||||
|
|
@ -47,18 +51,6 @@ public class GamePage extends Page {
|
||||||
return new Point(0,0);
|
return new Point(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private SwingWorker timeIsOver() {
|
|
||||||
return gameController.sendWords(new SwingWorker() {
|
|
||||||
@Override
|
|
||||||
protected Object doInBackground() throws Exception {
|
|
||||||
new HighscoresPage(window,true);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private DefaultListModel<Point> setLetterSpawningPoint(){
|
private DefaultListModel<Point> setLetterSpawningPoint(){
|
||||||
|
|
||||||
DefaultListModel<Point> l = new DefaultListModel<>();
|
DefaultListModel<Point> l = new DefaultListModel<>();
|
||||||
|
|
@ -90,7 +82,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 = gameService.getLetters();
|
DefaultListModel<String> letters = gameController.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(),
|
||||||
|
|
@ -103,6 +95,19 @@ public class GamePage extends Page {
|
||||||
window.revalidate();
|
window.revalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showGameIsReadyAlert(){
|
||||||
|
//Mostra pannello di conferma che le lettere sono tutte arrivate
|
||||||
|
new TTDialog("success", "GameService is ready. Press OK to start!",
|
||||||
|
new Callable() {
|
||||||
|
@Override
|
||||||
|
public Object call() throws Exception {
|
||||||
|
showLetters();
|
||||||
|
timer.start();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createUIComponents() throws IOException {
|
public void createUIComponents() throws IOException {
|
||||||
|
|
||||||
|
|
@ -120,7 +125,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!",
|
||||||
gameService.getWords(),
|
gameController.getWords(),
|
||||||
gameContainer
|
gameContainer
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -129,7 +134,13 @@ public class GamePage extends Page {
|
||||||
timer = addTimer(
|
timer = addTimer(
|
||||||
footer,
|
footer,
|
||||||
new Font(Palette.inputBox_font.getFontName(), Font.BOLD, 40),
|
new Font(Palette.inputBox_font.getFontName(), Font.BOLD, 40),
|
||||||
timeIsOver(),
|
gameController.timeIsOver(new SwingWorker() {
|
||||||
|
@Override
|
||||||
|
protected Object doInBackground() throws Exception {
|
||||||
|
new HighscoresPage(window,true);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}),
|
||||||
Config.timeoutGame
|
Config.timeoutGame
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ import java.io.IOException;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Highscores Page
|
* Author: Lorenzo Iovino on 22/06/2017.
|
||||||
|
* Description: Highscores Page
|
||||||
*/
|
*/
|
||||||
public class HighscoresPage extends Page{
|
public class HighscoresPage extends Page{
|
||||||
|
|
||||||
|
|
@ -18,26 +19,31 @@ public class HighscoresPage extends Page{
|
||||||
public JFrame window;
|
public JFrame window;
|
||||||
private HighscoresController highscoreController;
|
private HighscoresController highscoreController;
|
||||||
|
|
||||||
public HighscoresPage(JFrame window, Boolean isPartialScore) throws IOException {
|
HighscoresPage(JFrame window, Boolean isPartialScore) throws IOException {
|
||||||
super(window);
|
super(window);
|
||||||
this.window = window;
|
this.window = window;
|
||||||
this.isPartialScore = isPartialScore;
|
this.isPartialScore = isPartialScore;
|
||||||
highscoreController = new HighscoresController(this);
|
|
||||||
highscoreController.fetchHighscores().execute();
|
highscoreController = new HighscoresController();
|
||||||
|
highscoreController.fetchHighscores(showHighscoreList).execute();
|
||||||
createUIComponents();
|
createUIComponents();
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showHighscoreList(){
|
public Callable<Void> showHighscoreList = new Callable<Void>() {
|
||||||
new TTScrollList(
|
@Override
|
||||||
new Point(20, 60),
|
public Void call() throws Exception {
|
||||||
new Dimension(515, 142),
|
new TTScrollList(
|
||||||
highscoreController.getRanks(isPartialScore),
|
new Point(20, 60),
|
||||||
highscoreContainer
|
new Dimension(515, 142),
|
||||||
);
|
highscoreController.getRanks(isPartialScore),
|
||||||
window.revalidate();
|
highscoreContainer
|
||||||
window.repaint();
|
);
|
||||||
}
|
window.revalidate();
|
||||||
|
window.repaint();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createUIComponents() throws IOException {
|
public void createUIComponents() throws IOException {
|
||||||
|
|
@ -51,7 +57,7 @@ public class HighscoresPage extends Page{
|
||||||
root
|
root
|
||||||
);
|
);
|
||||||
|
|
||||||
TTLabel title = new TTLabel(
|
new TTLabel(
|
||||||
this.isPartialScore ? new Point(150,0) : new Point(200,0),
|
this.isPartialScore ? new Point(150,0) : new Point(200,0),
|
||||||
new Dimension(350,50),
|
new Dimension(350,50),
|
||||||
this.isPartialScore ? "Scores of the match" : "Highscores",
|
this.isPartialScore ? "Scores of the match" : "Highscores",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
package com.texttwist.client.pages;
|
package com.texttwist.client.pages;
|
||||||
|
|
||||||
import com.texttwist.client.controllers.HomeController;
|
import com.texttwist.client.controllers.HomeController;
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
import com.texttwist.client.ui.*;
|
import com.texttwist.client.ui.*;
|
||||||
|
|
@ -8,6 +9,10 @@ import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author: Lorenzo Iovino on 23/06/2017.
|
||||||
|
* Description: Home Page
|
||||||
|
*/
|
||||||
public class HomePage extends Page {
|
public class HomePage extends Page {
|
||||||
|
|
||||||
private HomeController homeController;
|
private HomeController homeController;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.texttwist.client.pages;
|
package com.texttwist.client.pages;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
import com.texttwist.client.controllers.MatchRequestController;
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
import com.texttwist.client.ui.*;
|
import com.texttwist.client.ui.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
@ -11,13 +11,16 @@ import java.io.IOException;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MatchRequest Page
|
* Author: Lorenzo Iovino on 27/06/2017.
|
||||||
|
* Description: MatchRequest Page
|
||||||
*/
|
*/
|
||||||
public class MatchRequestsPage extends Page{
|
public class MatchRequestsPage extends Page{
|
||||||
|
|
||||||
public TTContainer matchsContainer;
|
private MatchRequestController matchRequestController;
|
||||||
|
|
||||||
MatchRequestsPage(JFrame window) throws IOException {
|
MatchRequestsPage(JFrame window) throws IOException {
|
||||||
super(window);
|
super(window);
|
||||||
|
matchRequestController = new MatchRequestController();
|
||||||
createUIComponents();
|
createUIComponents();
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
@ -25,9 +28,9 @@ public class MatchRequestsPage extends Page{
|
||||||
@Override
|
@Override
|
||||||
public void createUIComponents() throws IOException {
|
public void createUIComponents() throws IOException {
|
||||||
addLogo(root);
|
addLogo(root);
|
||||||
matchsContainer = new TTContainer(
|
TTContainer matchsContainer = new TTContainer(
|
||||||
null,
|
null,
|
||||||
new Dimension(1150,220),
|
new Dimension(1150, 220),
|
||||||
Palette.root_backgroundColor,
|
Palette.root_backgroundColor,
|
||||||
-1,
|
-1,
|
||||||
root
|
root
|
||||||
|
|
@ -45,7 +48,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.gameService.pendingList,
|
matchRequestController.getPendingList(),
|
||||||
matchsContainer
|
matchsContainer
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -56,7 +59,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.gameService.joinMatch(App.gameService.pendingList.get(index));
|
matchRequestController.joinMatch(matchRequestController.getPendingList().get(index));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ import java.awt.*;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MatchSetup Page
|
* Author: Lorenzo Iovino on 27/06/2017.
|
||||||
|
* Description: MatchSetup Page
|
||||||
*/
|
*/
|
||||||
public class MatchSetupPage extends Page{
|
public class MatchSetupPage extends Page{
|
||||||
|
|
||||||
|
|
@ -56,9 +57,10 @@ public class MatchSetupPage extends Page{
|
||||||
"Play!",
|
"Play!",
|
||||||
new Callable<Object>() {
|
new Callable<Object>() {
|
||||||
@Override
|
@Override
|
||||||
public Object call() throws Exception {
|
public Void call() throws Exception {
|
||||||
//If notificationServer response ok, start play, else error
|
//If notificationServer response ok, start beginMatch, else error
|
||||||
return matchSetupController.play(searchUserBar.list);
|
matchSetupController.play(searchUserBar.list);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,25 @@
|
||||||
package com.texttwist.client.pages;
|
package com.texttwist.client.pages;
|
||||||
import com.texttwist.client.App;
|
|
||||||
import com.texttwist.client.controllers.MenuController;
|
import com.texttwist.client.controllers.MenuController;
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
import com.texttwist.client.ui.*;
|
import com.texttwist.client.ui.*;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 14/06/2017.
|
* Author: Lorenzo Iovino on 17/06/2017.
|
||||||
|
* Description: Menu Page
|
||||||
*/
|
*/
|
||||||
public class MenuPage extends Page{
|
public class MenuPage extends Page{
|
||||||
|
|
||||||
private TTContainer menuBar;
|
|
||||||
private MenuController menuController;
|
private MenuController menuController;
|
||||||
|
|
||||||
public MenuPage(JFrame window) throws IOException {
|
public MenuPage(JFrame window) throws IOException {
|
||||||
super(window);
|
super(window);
|
||||||
createUIComponents();
|
|
||||||
menuController = new MenuController();
|
menuController = new MenuController();
|
||||||
|
createUIComponents();
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,24 +27,24 @@ public class MenuPage extends Page{
|
||||||
public void createUIComponents() throws IOException {
|
public void createUIComponents() throws IOException {
|
||||||
addLogo(root);
|
addLogo(root);
|
||||||
|
|
||||||
menuBar = new TTContainer(
|
TTContainer menuBar = new TTContainer(
|
||||||
null,
|
null,
|
||||||
new Dimension(1150,280),
|
new Dimension(1150, 280),
|
||||||
Palette.root_backgroundColor,
|
Palette.root_backgroundColor,
|
||||||
-1,
|
-1,
|
||||||
root
|
root
|
||||||
);
|
);
|
||||||
|
|
||||||
TTLabel playerToSendInvite_flavourText = new TTLabel(
|
new TTLabel(
|
||||||
new Point(25,15),
|
new Point(25,15),
|
||||||
new Dimension(350,20),
|
new Dimension(350,20),
|
||||||
"Welcome back, " + App.session.account.userName + "!",
|
"Welcome back, " + menuController.getSession().account.userName + "!",
|
||||||
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 24),
|
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 24),
|
||||||
null,
|
null,
|
||||||
menuBar
|
menuBar
|
||||||
);
|
);
|
||||||
|
|
||||||
TTButton newMatch = new TTButton(
|
new TTButton(
|
||||||
new Point(25,70),
|
new Point(25,70),
|
||||||
new Dimension(250,75),
|
new Dimension(250,75),
|
||||||
"New GameService!",
|
"New GameService!",
|
||||||
|
|
@ -59,7 +58,7 @@ public class MenuPage extends Page{
|
||||||
menuBar
|
menuBar
|
||||||
);
|
);
|
||||||
|
|
||||||
TTButton matchRequests = new TTButton(
|
new TTButton(
|
||||||
new Point(290,70),
|
new Point(290,70),
|
||||||
new Dimension(250,75),
|
new Dimension(250,75),
|
||||||
"In pending",
|
"In pending",
|
||||||
|
|
@ -73,14 +72,7 @@ public class MenuPage extends Page{
|
||||||
menuBar
|
menuBar
|
||||||
);
|
);
|
||||||
|
|
||||||
TTCircleCounter circleCounter = new TTCircleCounter(
|
new TTButton(
|
||||||
new Point(290,70),
|
|
||||||
new Dimension(25,25),
|
|
||||||
menuBar.getGraphics(),
|
|
||||||
menuBar
|
|
||||||
);
|
|
||||||
|
|
||||||
TTButton highscores = new TTButton(
|
|
||||||
new Point(25, 155),
|
new Point(25, 155),
|
||||||
new Dimension(250, 75),
|
new Dimension(250, 75),
|
||||||
"Highscores",
|
"Highscores",
|
||||||
|
|
@ -93,14 +85,14 @@ public class MenuPage extends Page{
|
||||||
menuBar
|
menuBar
|
||||||
);
|
);
|
||||||
|
|
||||||
TTButton logout = new TTButton(
|
new TTButton(
|
||||||
new Point(290, 155),
|
new Point(290, 155),
|
||||||
new Dimension(250, 75),
|
new Dimension(250, 75),
|
||||||
"Logout",
|
"Logout",
|
||||||
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.gameService.notificationStub);
|
menuController.logout();
|
||||||
return new HomePage(Page.window);
|
return new HomePage(Page.window);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
package com.texttwist.client.pages;
|
package com.texttwist.client.pages;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
import com.texttwist.client.ui.*;
|
import com.texttwist.client.ui.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
@ -10,7 +11,8 @@ import java.io.IOException;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base Page
|
* Author: Lorenzo Iovino on 14/06/2017.
|
||||||
|
* Description: Controller of the Home Page
|
||||||
*/
|
*/
|
||||||
public class Page {
|
public class Page {
|
||||||
|
|
||||||
|
|
@ -38,18 +40,18 @@ public class Page {
|
||||||
|
|
||||||
public void addLogo(TTContainer parent) {
|
public void addLogo(TTContainer parent) {
|
||||||
TTContainer container = new TTContainer(
|
TTContainer container = new TTContainer(
|
||||||
null,
|
null,
|
||||||
new Dimension(1150, 150),
|
new Dimension(1150, 150),
|
||||||
Palette.root_backgroundColor,
|
Palette.root_backgroundColor,
|
||||||
-1,
|
-1,
|
||||||
parent);
|
parent);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
TTImage logoImg = new TTImage(
|
new TTImage(
|
||||||
new Point(0, 10),
|
new Point(0, 10),
|
||||||
new Dimension(1150, 150),
|
new Dimension(1150, 150),
|
||||||
new ImageIcon(new File("./Client/resources/images/logo.png").getCanonicalPath()),
|
new ImageIcon(new File("./Client/resources/images/logo.png").getCanonicalPath()),
|
||||||
container);
|
container);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
@ -78,14 +80,14 @@ public class Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addNext(TTContainer parent, String caption, Callable<Object> clickHandler) {
|
public void addNext(TTContainer parent, String caption, Callable<Object> clickHandler) {
|
||||||
TTLabelBtn next = new TTLabelBtn(
|
new TTLabelBtn(
|
||||||
new Point(500, 0),
|
new Point(500, 0),
|
||||||
new Dimension(150, 50),
|
new Dimension(150, 50),
|
||||||
caption,
|
caption,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
clickHandler,
|
clickHandler,
|
||||||
parent);
|
parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Timer addTimer(TTContainer parent, Font font, SwingWorker timerEndHandler, Integer value) {
|
public Timer addTimer(TTContainer parent, Font font, SwingWorker timerEndHandler, Integer value) {
|
||||||
|
|
|
||||||
|
|
@ -4,19 +4,19 @@ import com.texttwist.client.controllers.RegisterController;
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
import com.texttwist.client.ui.*;
|
import com.texttwist.client.ui.*;
|
||||||
import models.Response;
|
import models.Response;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 16/06/2017.
|
||||||
|
* Description: Register Page
|
||||||
*/
|
*/
|
||||||
public class RegisterPage extends Page {
|
public class RegisterPage extends Page {
|
||||||
|
|
||||||
private TTContainer registerDataContainer;
|
|
||||||
private RegisterController registerController;
|
private RegisterController registerController;
|
||||||
public RegisterPage(JFrame window) {
|
|
||||||
|
RegisterPage(JFrame window) {
|
||||||
super(window);
|
super(window);
|
||||||
createUIComponents();
|
createUIComponents();
|
||||||
registerController = new RegisterController();
|
registerController = new RegisterController();
|
||||||
|
|
@ -26,14 +26,14 @@ public class RegisterPage extends Page {
|
||||||
@Override
|
@Override
|
||||||
public void createUIComponents() {
|
public void createUIComponents() {
|
||||||
addLogo(root);
|
addLogo(root);
|
||||||
registerDataContainer = new TTContainer(
|
TTContainer registerDataContainer = new TTContainer(
|
||||||
null,
|
null,
|
||||||
new Dimension(1150,220),
|
new Dimension(1150, 220),
|
||||||
Palette.root_backgroundColor,
|
Palette.root_backgroundColor,
|
||||||
-1,
|
-1,
|
||||||
root
|
root
|
||||||
);
|
);
|
||||||
TTLabel registerText = new TTLabel(
|
new TTLabel(
|
||||||
new Point(70,35),
|
new Point(70,35),
|
||||||
new Dimension(400,40),
|
new Dimension(400,40),
|
||||||
"Insert your datas and press Register!",
|
"Insert your datas and press Register!",
|
||||||
|
|
@ -55,7 +55,7 @@ public class RegisterPage extends Page {
|
||||||
registerDataContainer
|
registerDataContainer
|
||||||
);
|
);
|
||||||
|
|
||||||
TTButton register = new TTButton(
|
new TTButton(
|
||||||
new Point(70,150),
|
new Point(70,150),
|
||||||
new Dimension(430,50),
|
new Dimension(430,50),
|
||||||
"Register!",
|
"Register!",
|
||||||
|
|
@ -95,6 +95,5 @@ public class RegisterPage extends Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
package com.texttwist.client.services;
|
package com.texttwist.client.services;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
import com.texttwist.client.App;
|
||||||
import constants.Config;
|
import constants.Config;
|
||||||
import interfaces.IAuth;
|
import interfaces.IAuth;
|
||||||
|
|
@ -8,10 +9,11 @@ import java.net.MalformedURLException;
|
||||||
import java.rmi.Naming;
|
import java.rmi.Naming;
|
||||||
import java.rmi.NotBoundException;
|
import java.rmi.NotBoundException;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.rmi.server.UnicastRemoteObject;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authentication Service
|
* Author: Lorenzo Iovino on 17/06/2017.
|
||||||
|
* Description: Auth Service.
|
||||||
|
* Provide the interface for authentication
|
||||||
*/
|
*/
|
||||||
public class AuthService {
|
public class AuthService {
|
||||||
|
|
||||||
|
|
@ -19,11 +21,9 @@ 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();
|
App.registerForNotifications();
|
||||||
App.gameService.notificationStub = (INotificationClient) UnicastRemoteObject.exportObject(callbackObj, 0);
|
|
||||||
App.gameService.notificationServer.registerForCallback(App.gameService.notificationStub);
|
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
e.printStackTrace();
|
App.logger.write("AUTH SERVICE: Can't register for notification");
|
||||||
}
|
}
|
||||||
IAuth auth = (IAuth) Naming.lookup(baseUrl);
|
IAuth auth = (IAuth) Naming.lookup(baseUrl);
|
||||||
return auth.login(userName, password);
|
return auth.login(userName, password);
|
||||||
|
|
|
||||||
|
|
@ -6,68 +6,38 @@ import com.texttwist.client.pages.MenuPage;
|
||||||
import com.texttwist.client.pages.Page;
|
import com.texttwist.client.pages.Page;
|
||||||
import com.texttwist.client.tasks.InvitePlayers;
|
import com.texttwist.client.tasks.InvitePlayers;
|
||||||
import com.texttwist.client.ui.TTDialog;
|
import com.texttwist.client.ui.TTDialog;
|
||||||
import constants.Config;
|
|
||||||
import interfaces.INotificationClient;
|
|
||||||
import interfaces.INotificationServer;
|
|
||||||
import javafx.util.Pair;
|
import javafx.util.Pair;
|
||||||
import models.Message;
|
import models.Message;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.net.MulticastSocket;
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.SocketChannel;
|
|
||||||
import java.rmi.NotBoundException;
|
|
||||||
import java.rmi.RemoteException;
|
|
||||||
import java.rmi.registry.LocateRegistry;
|
|
||||||
import java.rmi.registry.Registry;
|
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 18/06/2017.
|
* Author: Lorenzo Iovino on 18/06/2017.
|
||||||
|
* Description: GameService.
|
||||||
|
* Provide the interface for the game.
|
||||||
*/
|
*/
|
||||||
public class GameService {
|
public class GameService {
|
||||||
|
|
||||||
public Integer multicastId = 0 ;
|
public Integer multicastId = 0 ;
|
||||||
public DefaultListModel<String> pendingList = new DefaultListModel<String>();
|
public DefaultListModel<String> pendingList = new DefaultListModel<>();
|
||||||
public DefaultListModel<String> words = new DefaultListModel<String>();
|
public DefaultListModel<String> words = new DefaultListModel<>();
|
||||||
public DefaultListModel<String> letters = new DefaultListModel<String>();
|
public DefaultListModel<String> letters = new DefaultListModel<>();
|
||||||
public DefaultListModel<Pair<String,Integer>> globalRanks = new DefaultListModel<>();
|
public DefaultListModel<Pair<String,Integer>> globalRanks = new DefaultListModel<>();
|
||||||
public DefaultListModel<Pair<String,Integer>> ranks = new DefaultListModel<>();
|
public DefaultListModel<Pair<String,Integer>> ranks = new DefaultListModel<>();
|
||||||
public INotificationClient notificationStub;
|
private Boolean gameIsStarted = false;
|
||||||
public MulticastSocket multicastSocket;
|
|
||||||
public SocketChannel clientSocket;
|
|
||||||
public INotificationServer notificationServer;
|
|
||||||
public Boolean gameIsStarted = false;
|
|
||||||
|
|
||||||
private ByteBuffer buffer = ByteBuffer.allocate(1024);
|
private void addToPendingList(String username) throws IOException {
|
||||||
|
pendingList.addElement(username);
|
||||||
public GameService(){
|
|
||||||
|
|
||||||
Registry registry = null;
|
|
||||||
try {
|
|
||||||
registry = LocateRegistry.getRegistry(Config.NotificationServerStubPort);
|
|
||||||
notificationServer = (INotificationServer) registry.lookup(Config.NotificationServerName);
|
|
||||||
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NotBoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
InetSocketAddress socketAddress = new InetSocketAddress(Config.GameServerURI, Config.GameServerPort);
|
|
||||||
try {
|
|
||||||
clientSocket = SocketChannel.open(socketAddress);
|
|
||||||
clientSocket.configureBlocking(false);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GameService(){
|
||||||
|
App.openClientTCPSocket();
|
||||||
|
}
|
||||||
|
|
||||||
public void newMatch(String userName) {
|
public void newMatch(String userName) {
|
||||||
//Add to pending invitation list
|
//Add to pending invites list
|
||||||
try {
|
try {
|
||||||
this.addToPendingList(userName);
|
this.addToPendingList(userName);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
@ -75,8 +45,8 @@ public class GameService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!App.gameService.gameIsStarted) {
|
if(!App.gameService.gameIsStarted) {
|
||||||
//Show invitation popup
|
//Show invite popup
|
||||||
new TTDialog("success", "New invitation from: " + userName + "!",
|
new TTDialog("success", "New invite from: " + userName + "!",
|
||||||
new Callable() {
|
new Callable() {
|
||||||
@Override
|
@Override
|
||||||
public Object call() throws Exception {
|
public Object call() throws Exception {
|
||||||
|
|
@ -93,7 +63,6 @@ public class GameService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DefaultListModel<String> getLetters(){
|
public DefaultListModel<String> getLetters(){
|
||||||
return App.gameService.letters;
|
return App.gameService.letters;
|
||||||
}
|
}
|
||||||
|
|
@ -107,6 +76,7 @@ public class GameService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void joinMatch(String matchName) {
|
public void joinMatch(String matchName) {
|
||||||
|
|
||||||
//Clear pending invitation list and join selected match
|
//Clear pending invitation list and join selected match
|
||||||
if(!gameIsStarted) {
|
if(!gameIsStarted) {
|
||||||
this.pendingList.clear();
|
this.pendingList.clear();
|
||||||
|
|
@ -116,8 +86,8 @@ public class GameService {
|
||||||
Message message = new Message("JOIN_GAME", App.session.account.userName, App.session.token, matchNames);
|
Message message = new Message("JOIN_GAME", App.session.account.userName, App.session.token, matchNames);
|
||||||
|
|
||||||
byte[] byteMessage = message.toString().getBytes();
|
byte[] byteMessage = message.toString().getBytes();
|
||||||
buffer = ByteBuffer.wrap(byteMessage);
|
ByteBuffer buffer = ByteBuffer.wrap(byteMessage);
|
||||||
clientSocket.write(buffer);
|
App.clientTCP.write(buffer);
|
||||||
new GamePage(Page.window);
|
new GamePage(Page.window);
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
@ -126,27 +96,20 @@ public class GameService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object play(DefaultListModel<String> userNames) throws IOException {
|
//Start game and wait for other players
|
||||||
SwingWorker worker = new InvitePlayers(userNames,clientSocket);
|
public void beginMatch(DefaultListModel<String> userNames) {
|
||||||
worker.execute();
|
new InvitePlayers(userNames).execute();
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Void start(){
|
public void start(){
|
||||||
App.gameService.gameIsStarted = true;
|
gameIsStarted = true;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Void stop(){
|
public void stop(){
|
||||||
App.gameService.gameIsStarted = false;
|
gameIsStarted = false;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMulticastId(Integer multicastId){
|
public void setMulticastId(Integer multicastId){
|
||||||
this.multicastId = multicastId;
|
this.multicastId = multicastId;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addToPendingList(String username) throws IOException {
|
|
||||||
pendingList.addElement(username);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,18 @@
|
||||||
package com.texttwist.client.services;
|
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 javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 15/06/2017.
|
* Author: Lorenzo Iovino on 15/06/2017.
|
||||||
|
* Description: Provide the interface for the notifications.
|
||||||
*/
|
*/
|
||||||
public class NotificationClient implements INotificationClient {
|
public class NotificationClientService implements INotificationClient {
|
||||||
|
|
||||||
|
|
||||||
public NotificationClient() throws RemoteException {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response sendInvite(String userName, DefaultListModel<String> users) throws RemoteException {
|
public void sendInvite(String userName, DefaultListModel<String> users) throws RemoteException {
|
||||||
App.logger.write("Invoked invitation with username =" + userName + "|" + users.toString() );
|
App.logger.write("Invoked invitation with username =" + userName + "|" + users.toString() );
|
||||||
|
|
||||||
if(App.session != null) {
|
if(App.session != null) {
|
||||||
|
|
@ -27,6 +23,5 @@ public class NotificationClient implements INotificationClient {
|
||||||
App.logger.write("User " + userName + " is slogged");
|
App.logger.write("User " + userName + " is slogged");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,28 +1,24 @@
|
||||||
package com.texttwist.client.tasks;
|
package com.texttwist.client.tasks;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
import com.texttwist.client.App;
|
||||||
import com.texttwist.client.pages.HighscoresPage;
|
|
||||||
import javafx.util.Pair;
|
|
||||||
import models.Message;
|
import models.Message;
|
||||||
|
|
||||||
import javax.swing.*;
|
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.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Job: FetchHighscore
|
* Author: Lorenzo Iovino on 20/06/2017.
|
||||||
|
* Description: Task: FetchHighscore.
|
||||||
|
* Ask for highscores to server. When received it shows in highscores list
|
||||||
*/
|
*/
|
||||||
public class FetchHighscore extends SwingWorker<Void,Void> {
|
public class FetchHighscore extends SwingWorker<Void,Void> {
|
||||||
|
|
||||||
private DefaultListModel<Pair<String,Integer>> globalRanks = new DefaultListModel<>();
|
|
||||||
private SocketChannel socketChannel;
|
|
||||||
private ByteBuffer buffer = ByteBuffer.allocate(1024);
|
private ByteBuffer buffer = ByteBuffer.allocate(1024);
|
||||||
HighscoresPage highscoresPage;
|
private Callable<Void> callback;
|
||||||
|
|
||||||
public FetchHighscore(HighscoresPage highscoresPage){
|
public FetchHighscore(Callable<Void> callback){
|
||||||
this.socketChannel = App.gameService.clientSocket;
|
this.callback = callback;
|
||||||
this.highscoresPage = highscoresPage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -31,43 +27,38 @@ public class FetchHighscore extends SwingWorker<Void,Void> {
|
||||||
buffer = ByteBuffer.allocate(1024);
|
buffer = ByteBuffer.allocate(1024);
|
||||||
byte[] byteMessage = message.toString().getBytes();
|
byte[] byteMessage = message.toString().getBytes();
|
||||||
buffer = ByteBuffer.wrap(byteMessage);
|
buffer = ByteBuffer.wrap(byteMessage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
socketChannel.write(buffer);
|
App.clientTCP.write(buffer);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
App.logger.write("FETCH HIGHSCORES: Can't write on socket");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
buffer = ByteBuffer.allocate(1024);
|
buffer = ByteBuffer.allocate(1024);
|
||||||
|
while (App.clientTCP.read(buffer) != -1) {
|
||||||
while (socketChannel.read(buffer) != -1) {
|
|
||||||
|
|
||||||
String line = new String(buffer.array(), buffer.position(), buffer.remaining());
|
String line = new String(buffer.array(), buffer.position(), buffer.remaining());
|
||||||
|
|
||||||
if (line.startsWith("MESSAGE")) {
|
if (line.startsWith("MESSAGE")) {
|
||||||
Message msg = Message.toMessage(line);
|
Message msg = Message.toMessage(line);
|
||||||
if (msg.message.equals("HIGHSCORES") && msg.data != null) {
|
if (msg.message.equals("HIGHSCORES") && msg.data != null) {
|
||||||
for(int i = 0; i< msg.data.size()-1; i++){
|
App.gameService.globalRanks = utilities.Parse.score(msg.data);
|
||||||
String[] splitted = msg.data.get(i).split(":");
|
break;
|
||||||
globalRanks.addElement(new Pair<>(splitted[0],new Integer(splitted[1])));
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
App.logger.write("FETCH HIGHSCORES: Can't read from socket");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void done(){
|
public void done(){
|
||||||
App.gameService.globalRanks = globalRanks;
|
try {
|
||||||
this.highscoresPage.showHighscoreList();
|
callback.call();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,88 +5,78 @@ import com.texttwist.client.pages.GamePage;
|
||||||
import com.texttwist.client.pages.Page;
|
import com.texttwist.client.pages.Page;
|
||||||
import com.texttwist.client.ui.TTDialog;
|
import com.texttwist.client.ui.TTDialog;
|
||||||
import models.Message;
|
import models.Message;
|
||||||
|
|
||||||
import javax.swing.*;
|
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.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 25/06/2017.
|
* Author: Lorenzo Iovino on 25/06/2017.
|
||||||
|
* Description: Task: InvitePlayers
|
||||||
|
* Sends invite to all players of the match
|
||||||
*/
|
*/
|
||||||
public class InvitePlayers extends SwingWorker<Boolean,Void> {
|
public class InvitePlayers extends SwingWorker<Void,Void> {
|
||||||
|
|
||||||
ByteBuffer buffer = ByteBuffer.allocate(1024);
|
private ByteBuffer buffer = ByteBuffer.allocate(1024);
|
||||||
|
private DefaultListModel<String> userNames;
|
||||||
|
|
||||||
public DefaultListModel<String> userNames;
|
public InvitePlayers(DefaultListModel<String> userNames) {
|
||||||
public SocketChannel socketChannel;
|
|
||||||
|
|
||||||
public InvitePlayers(DefaultListModel<String> userNames, SocketChannel socketChannel) {
|
|
||||||
this.socketChannel = socketChannel;
|
|
||||||
this.userNames = userNames;
|
this.userNames = userNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean doInBackground() {
|
public Void doInBackground() {
|
||||||
buffer = ByteBuffer.allocate(1024);
|
buffer = ByteBuffer.allocate(1024);
|
||||||
Message message = new Message("START_GAME", App.session.account.userName, App.session.token, userNames);
|
Message message = new Message("START_GAME", App.session.account.userName, App.session.token, userNames);
|
||||||
|
|
||||||
byte[] byteMessage = new String(message.toString()).getBytes();
|
byte[] byteMessage = message.toString().getBytes();
|
||||||
buffer = ByteBuffer.wrap(byteMessage);
|
buffer = ByteBuffer.wrap(byteMessage);
|
||||||
try {
|
try {
|
||||||
socketChannel.write(buffer);
|
App.clientTCP.write(buffer);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (socketChannel.read(buffer) != -1) {
|
while (App.clientTCP.read(buffer) != -1) {
|
||||||
|
|
||||||
String line = new String(buffer.array(), buffer.position(), buffer.remaining());
|
String line = new String(buffer.array(), buffer.position(), buffer.remaining());
|
||||||
|
|
||||||
if (line.startsWith("MESSAGE")) {
|
if (line.startsWith("MESSAGE")) {
|
||||||
Message msg = Message.toMessage(line);
|
Message msg = Message.toMessage(line);
|
||||||
|
|
||||||
if (msg.message.equals("USER_NOT_ONLINE")) {
|
if (msg.message.equals("USER_NOT_ONLINE")) {
|
||||||
new TTDialog("alert", "Users not online!",
|
new TTDialog("alert", "Users not online!",
|
||||||
new Callable() {
|
new Callable() {
|
||||||
@Override
|
@Override
|
||||||
public Object call() throws Exception {
|
public Void call() throws Exception {
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.message.equals("INVITES_ALL_SENDED")) {
|
if (msg.message.equals("INVITES_ALL_SENDED")) {
|
||||||
// clientSocket.close();
|
|
||||||
new TTDialog("success", "Invite all sended!",
|
new TTDialog("success", "Invite all sended!",
|
||||||
new Callable() {
|
new Callable() {
|
||||||
@Override
|
@Override
|
||||||
public Object call() throws Exception {
|
public Void call() throws Exception {
|
||||||
//In attesa dei giocatori
|
//In attesa dei giocatori
|
||||||
new GamePage(Page.window);
|
new GamePage(Page.window);
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
App.logger.write("INVITE PLAYERS: Can't read from socket");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void done() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,21 @@
|
||||||
package com.texttwist.client.tasks;
|
package com.texttwist.client.tasks;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
import com.texttwist.client.App;
|
||||||
import constants.Config;
|
|
||||||
import javafx.util.Pair;
|
|
||||||
import models.Message;
|
import models.Message;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.DatagramChannel;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 29/06/2017.
|
* Author: Lorenzo Iovino on 29/06/2017.
|
||||||
|
* Description: Task: SendWords.
|
||||||
|
* Send words to server and when done it wait for score.
|
||||||
*/
|
*/
|
||||||
public class SendWords extends SwingWorker<Void,Void> {
|
public class SendWords extends SwingWorker<Void,Void> {
|
||||||
|
|
||||||
DefaultListModel<Pair<String,Integer>> ranks = new DefaultListModel<Pair<String,Integer>>();
|
private SwingWorker callback;
|
||||||
|
private DefaultListModel<String> words = new DefaultListModel<>();
|
||||||
SwingWorker callback;
|
|
||||||
DefaultListModel<String> words = new DefaultListModel<>();
|
|
||||||
|
|
||||||
public SendWords(DefaultListModel<String> words, SwingWorker callback){
|
public SendWords(DefaultListModel<String> words, SwingWorker callback){
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
|
|
@ -29,28 +25,23 @@ public class SendWords extends SwingWorker<Void,Void> {
|
||||||
@Override
|
@Override
|
||||||
public Void doInBackground() {
|
public Void doInBackground() {
|
||||||
try {
|
try {
|
||||||
System.out.println(words);
|
App.openClientUDPSocket();
|
||||||
InetSocketAddress myAddress = new InetSocketAddress(Config.WordsReceiverServerURI, Config.WordsReceiverServerPort);
|
|
||||||
DatagramChannel datagramChannel = DatagramChannel.open();
|
|
||||||
datagramChannel.bind(null);
|
|
||||||
ByteBuffer buffer = ByteBuffer.allocate(1024);
|
ByteBuffer buffer = ByteBuffer.allocate(1024);
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
System.out.println("SENDER=" + App.session.account.userName);
|
|
||||||
Message msg = new Message("WORDS", App.session.account.userName, App.session.token, words);
|
Message msg = new Message("WORDS", App.session.account.userName, App.session.token, words);
|
||||||
String sentence = msg.toString();
|
String sentence = msg.toString();
|
||||||
buffer.put(sentence.getBytes());
|
buffer.put(sentence.getBytes());
|
||||||
buffer.flip();
|
buffer.flip();
|
||||||
datagramChannel.send(buffer, myAddress);
|
|
||||||
System.out.println("WORDS INVIATE");
|
App.clientUDP.send(buffer, App.clientUDPSocketAddress);
|
||||||
System.out.println(sentence);
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
} catch (UnknownHostException e) {
|
} catch (UnknownHostException e) {
|
||||||
e.printStackTrace();
|
App.logger.write("SEND WORDS: Host address not correct");
|
||||||
} catch (SocketException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
App.logger.write("SEND WORDS: Can't write on socket");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -63,5 +54,4 @@ public class SendWords extends SwingWorker<Void,Void> {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
package com.texttwist.client.tasks;
|
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
|
||||||
import com.texttwist.client.pages.GamePage;
|
|
||||||
import com.texttwist.client.ui.TTDialog;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by loke on 25/06/2017.
|
|
||||||
*/
|
|
||||||
public class StartGame extends SwingWorker<Void,Void> {
|
|
||||||
|
|
||||||
/*Words inserted from user*/
|
|
||||||
private DefaultListModel<String> letters = new DefaultListModel<>();
|
|
||||||
private GamePage gamePage;
|
|
||||||
|
|
||||||
public StartGame(DefaultListModel<String> letters, GamePage game){
|
|
||||||
this.letters = letters;
|
|
||||||
this.gamePage = game;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Void doInBackground(){
|
|
||||||
App.gameService.start();
|
|
||||||
//Mostra pannello di conferma che le lettere sono tutte arrivate
|
|
||||||
new TTDialog("success", "GameService is ready. Press OK to start!",
|
|
||||||
new Callable() {
|
|
||||||
@Override
|
|
||||||
public Object call() throws Exception {
|
|
||||||
gamePage.showLetters();
|
|
||||||
gamePage.timer.start();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}, null);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void done(){
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -4,136 +4,99 @@ import com.texttwist.client.App;
|
||||||
import com.texttwist.client.pages.MenuPage;
|
import com.texttwist.client.pages.MenuPage;
|
||||||
import com.texttwist.client.pages.Page;
|
import com.texttwist.client.pages.Page;
|
||||||
import com.texttwist.client.ui.TTDialog;
|
import com.texttwist.client.ui.TTDialog;
|
||||||
import constants.Config;
|
|
||||||
import models.Message;
|
import models.Message;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.MulticastSocket;
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.SocketChannel;
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 25/06/2017.
|
* Author: Lorenzo Iovino on 25/06/2017.
|
||||||
|
* Description: Task: WaitForPlayers.
|
||||||
|
* Wait for players joins, when all joined then sends a message of game started to all
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public class WaitForPlayers extends SwingWorker<DefaultListModel<String>,DefaultListModel<String>> {
|
public class WaitForPlayers extends SwingWorker<Void,Void> {
|
||||||
|
|
||||||
public SocketChannel socketChannel;
|
private boolean joinTimeout = false;
|
||||||
public DefaultListModel<String> words;
|
private Callable<Void> callback;
|
||||||
public DefaultListModel<String> letters;
|
|
||||||
boolean joinTimeout = false;
|
|
||||||
ByteBuffer buffer = ByteBuffer.allocate(1024);
|
|
||||||
SwingWorker callback;
|
|
||||||
|
|
||||||
public WaitForPlayers(SwingWorker callback) {
|
public WaitForPlayers(Callable<Void> callback) {
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.words = words;
|
|
||||||
this.socketChannel = App.gameService.clientSocket;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DefaultListModel<String> doInBackground() {
|
public Void doInBackground() {
|
||||||
try {
|
try {
|
||||||
buffer = ByteBuffer.allocate(1024);
|
ByteBuffer buffer = ByteBuffer.allocate(1024);
|
||||||
String line1 = new String(buffer.array(), buffer.position(), buffer.remaining());
|
|
||||||
TTDialog loading = new TTDialog("alert", "Waiting for users joins",null,null);
|
TTDialog loading = new TTDialog("alert", "Waiting for users joins",null,null);
|
||||||
buffer.flip();
|
buffer.flip();
|
||||||
|
|
||||||
while (this.socketChannel.read(buffer) != -1) {
|
while (App.clientTCP.read(buffer) != -1) {
|
||||||
|
|
||||||
String line = new String(buffer.array(), buffer.position(), buffer.remaining());
|
String line = new String(buffer.array(), buffer.position(), buffer.remaining());
|
||||||
// String line = new String()
|
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
|
|
||||||
if (line.startsWith("MESSAGE")) {
|
if (line.startsWith("MESSAGE")) {
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
System.out.println("Mi arriva questo dal notificationServer " + line);
|
|
||||||
|
|
||||||
Message msg = Message.toMessage(line);
|
Message msg = Message.toMessage(line);
|
||||||
System.out.println(msg.message);
|
|
||||||
if (msg.message.equals("JOIN_TIMEOUT")) {
|
if (msg.message.equals("JOIN_TIMEOUT")) {
|
||||||
loading.dispose();
|
loading.dispose();
|
||||||
joinTimeout = true;
|
joinTimeout = true;
|
||||||
System.out.println("JOIN TIMEOUT ENTERED");
|
|
||||||
|
|
||||||
new TTDialog("alert", "TIMEOUT!",
|
new TTDialog("alert", "TIMEOUT!",
|
||||||
new Callable() {
|
new Callable() {
|
||||||
@Override
|
@Override
|
||||||
public Object call() throws Exception {
|
public Void call() throws Exception {
|
||||||
//socketChannel.close();
|
new MenuPage(Page.window);
|
||||||
return new MenuPage(Page.window);
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
return new DefaultListModel<String>();
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.message.equals("MATCH_NOT_AVAILABLE")) {
|
if (msg.message.equals("MATCH_NOT_AVAILABLE")) {
|
||||||
loading.dispose();
|
loading.dispose();
|
||||||
System.out.println("MATCH NOT AVAILABLE ENTERED");
|
|
||||||
|
|
||||||
joinTimeout = true;
|
joinTimeout = true;
|
||||||
new TTDialog("alert", "THE GAME IS NOT MORE AVAILABLE!",
|
|
||||||
new Callable() {
|
|
||||||
@Override
|
|
||||||
public Object call() throws Exception {
|
|
||||||
//socketChannel.close();
|
|
||||||
return new MenuPage(Page.window);
|
|
||||||
|
|
||||||
}
|
new TTDialog("alert", "THE GAME IS NOT MORE AVAILABLE!",
|
||||||
}, null);
|
new Callable() {
|
||||||
return new DefaultListModel<String>();
|
@Override
|
||||||
|
public Void call() throws Exception {
|
||||||
|
new MenuPage(Page.window);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.message.equals("GAME_STARTED")) {
|
if (msg.message.equals("GAME_STARTED")) {
|
||||||
loading.dispose();
|
loading.dispose();
|
||||||
System.out.println("GAME STARTED ENTERED");
|
|
||||||
|
|
||||||
DefaultListModel<String> data;
|
|
||||||
if(msg.data !=null ) {
|
if(msg.data !=null ) {
|
||||||
data= msg.data;
|
DefaultListModel<String> data = msg.data;
|
||||||
|
App.openClientMulticastSocket(Integer.valueOf(data.remove(data.size()-2)));
|
||||||
Integer multicastId = Integer.valueOf(data.remove(data.size()-2));
|
App.gameService.setLetters(msg.data);
|
||||||
App.gameService.setMulticastId(multicastId);
|
break;
|
||||||
|
|
||||||
App.gameService.multicastSocket = new MulticastSocket(App.gameService.multicastId);
|
|
||||||
InetAddress ia = InetAddress.getByName(Config.ScoreMulticastServerURI);
|
|
||||||
App.gameService.multicastSocket.joinGroup(ia);
|
|
||||||
letters = msg.data;
|
|
||||||
|
|
||||||
|
|
||||||
//socketChannel.close();
|
|
||||||
return words;
|
|
||||||
} else {
|
|
||||||
System.out.println("USCITO CON");
|
|
||||||
System.out.println(line);
|
|
||||||
return new DefaultListModel<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
buffer = ByteBuffer.allocate(1024);
|
buffer = ByteBuffer.allocate(1024);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
App.logger.write("WAIT FOR SCORE: Can't receive from socket");
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return new DefaultListModel<String>();
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void done(){
|
public void done(){
|
||||||
if(!joinTimeout) {
|
if(!joinTimeout) {
|
||||||
try {
|
try {
|
||||||
App.gameService.setLetters(letters);
|
this.callback.call();
|
||||||
this.callback.execute();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
package com.texttwist.client.tasks;
|
package com.texttwist.client.tasks;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
import com.texttwist.client.App;
|
||||||
import constants.Config;
|
|
||||||
import models.Message;
|
import models.Message;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.DatagramPacket;
|
import java.net.DatagramPacket;
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: Lorenzo Iovino on 27/06/2017.
|
* Author: Lorenzo Iovino on 27/06/2017.
|
||||||
* Description: This job will waits for the score of the match sent by server, at end it will execute a callback
|
* Description: Task: WaitForScore.
|
||||||
|
* This task will waits for the score of the match sent by server, at end it will execute a callback
|
||||||
* function that show the highscore pages.
|
* function that show the highscore pages.
|
||||||
*/
|
*/
|
||||||
public class WaitForScore extends SwingWorker<Void,Void> {
|
public class WaitForScore extends SwingWorker<Void,Void> {
|
||||||
|
|
@ -29,15 +28,14 @@ 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.gameService.multicastSocket.receive(receivedDatagram);
|
App.clientMulticast.receive(receivedDatagram);
|
||||||
|
|
||||||
String s = new String(receivedDatagram.getData());
|
String s = new String(receivedDatagram.getData());
|
||||||
Message msg = Message.toMessage(s);
|
Message msg = Message.toMessage(s);
|
||||||
|
|
||||||
//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.gameService.ranks.clear();
|
|
||||||
App.gameService.ranks = utilities.Parse.score(msg.data);
|
App.gameService.ranks = utilities.Parse.score(msg.data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -53,18 +51,12 @@ public class WaitForScore extends SwingWorker<Void,Void> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void done(){
|
public void done(){
|
||||||
try {
|
App.closeClientMulticastSocket();
|
||||||
//Leave group and close multicast socket
|
|
||||||
App.gameService.multicastSocket.leaveGroup(InetAddress.getByName(Config.ScoreMulticastServerURI));
|
|
||||||
App.gameService.multicastSocket.close();
|
|
||||||
|
|
||||||
//Stop gameService
|
//Stop gameService
|
||||||
App.gameService.stop();
|
App.gameService.stop();
|
||||||
|
|
||||||
//Call callback
|
//Call callback
|
||||||
this.callback.execute();
|
this.callback.execute();
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 13/06/2017.
|
||||||
|
* Description: TTContainer component
|
||||||
*/
|
*/
|
||||||
public class TTButton extends JButton{
|
public class TTButton extends JButton{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
package com.texttwist.client.ui;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.geom.Ellipse2D;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by loke on 14/06/2017.
|
|
||||||
*/
|
|
||||||
public class TTCircleCounter extends JComponent{
|
|
||||||
|
|
||||||
private Point position;
|
|
||||||
private Dimension dimension;
|
|
||||||
|
|
||||||
public TTCircleCounter(Point position, Dimension dimension, Graphics g, TTContainer parent){
|
|
||||||
this.position=position;
|
|
||||||
this.dimension=dimension;
|
|
||||||
|
|
||||||
Graphics2D g2d = (Graphics2D)g;
|
|
||||||
Ellipse2D.Double circle = new Ellipse2D.Double(position.x, position.y, dimension.width, dimension.height);
|
|
||||||
g2d.fill(circle);
|
|
||||||
g2d.setColor(Color.RED);
|
|
||||||
|
|
||||||
parent.add(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void paintComponent(Graphics g) {
|
|
||||||
super.paintComponent(g);
|
|
||||||
Graphics2D g2d = (Graphics2D)g;
|
|
||||||
Ellipse2D.Double circle = new Ellipse2D.Double(position.x, position.y, dimension.width, dimension.height);
|
|
||||||
g2d.setColor(Color.RED);
|
|
||||||
g2d.fill(circle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -6,8 +6,10 @@ import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 13/06/2017.
|
||||||
|
* Description: TTButton component
|
||||||
*/
|
*/
|
||||||
public class TTContainer extends JPanel{
|
public class TTContainer extends JPanel{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,15 @@ package com.texttwist.client.ui;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
import com.texttwist.client.App;
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 17/06/2017.
|
* Author: Lorenzo Iovino on 17/06/2017.
|
||||||
|
* Description: TTDialog component
|
||||||
*/
|
*/
|
||||||
public class TTDialog extends JFrame {
|
public class TTDialog extends JFrame {
|
||||||
|
|
||||||
|
|
@ -41,17 +42,60 @@ public class TTDialog extends JFrame {
|
||||||
}
|
}
|
||||||
add(root);
|
add(root);
|
||||||
|
|
||||||
TTLabel msg = new TTLabel(
|
new TTLabel(
|
||||||
new Point(60,20),
|
new Point(60,20),
|
||||||
new Dimension(350,50),
|
new Dimension(350,50),
|
||||||
message,
|
message,
|
||||||
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 38),
|
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 38),
|
||||||
null,
|
null,
|
||||||
root);
|
root);
|
||||||
|
|
||||||
if(okHandler != null && cancelHandler != null){
|
if(okHandler != null && cancelHandler != null){
|
||||||
TTButton okBtn = new TTButton(
|
new TTButton(
|
||||||
new Point(60,100),
|
new Point(60,100),
|
||||||
|
new Dimension(150,50),
|
||||||
|
"Ok",
|
||||||
|
new Callable<Object>() {
|
||||||
|
@Override
|
||||||
|
public Object call() throws Exception {
|
||||||
|
okHandler.call();
|
||||||
|
dispose();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
root);
|
||||||
|
new TTButton(
|
||||||
|
new Point(250,100),
|
||||||
|
new Dimension(150,50),
|
||||||
|
"Cancel",
|
||||||
|
new Callable<Object>() {
|
||||||
|
@Override
|
||||||
|
public Object call() throws Exception {
|
||||||
|
cancelHandler.call();
|
||||||
|
dispose();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
root);
|
||||||
|
} else {
|
||||||
|
if(cancelHandler != null) {
|
||||||
|
new TTButton(
|
||||||
|
new Point(150, 100),
|
||||||
|
new Dimension(150, 50),
|
||||||
|
"Cancel",
|
||||||
|
new Callable<Object>() {
|
||||||
|
@Override
|
||||||
|
public Object call() throws Exception {
|
||||||
|
cancelHandler.call();
|
||||||
|
dispose();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
root);
|
||||||
|
}
|
||||||
|
if(okHandler != null) {
|
||||||
|
new TTButton(
|
||||||
|
new Point(150,100),
|
||||||
new Dimension(150,50),
|
new Dimension(150,50),
|
||||||
"Ok",
|
"Ok",
|
||||||
new Callable<Object>() {
|
new Callable<Object>() {
|
||||||
|
|
@ -63,51 +107,8 @@ public class TTDialog extends JFrame {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
root);
|
root);
|
||||||
TTButton cancelBtn = new TTButton(
|
|
||||||
new Point(250,100),
|
|
||||||
new Dimension(150,50),
|
|
||||||
"Cancel",
|
|
||||||
new Callable<Object>() {
|
|
||||||
@Override
|
|
||||||
public Object call() throws Exception {
|
|
||||||
cancelHandler.call();
|
|
||||||
dispose();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
root);
|
|
||||||
} else {
|
|
||||||
if(cancelHandler != null) {
|
|
||||||
TTButton cancelBtn = new TTButton(
|
|
||||||
new Point(150, 100),
|
|
||||||
new Dimension(150, 50),
|
|
||||||
"Cancel",
|
|
||||||
new Callable<Object>() {
|
|
||||||
@Override
|
|
||||||
public Object call() throws Exception {
|
|
||||||
cancelHandler.call();
|
|
||||||
dispose();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
root);
|
|
||||||
}
|
}
|
||||||
if(okHandler != null) {
|
}
|
||||||
TTButton okBtn = new TTButton(
|
|
||||||
new Point(150,100),
|
|
||||||
new Dimension(150,50),
|
|
||||||
"Ok",
|
|
||||||
new Callable<Object>() {
|
|
||||||
@Override
|
|
||||||
public Object call() throws Exception {
|
|
||||||
okHandler.call();
|
|
||||||
dispose();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
root);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
@ -135,5 +136,4 @@ public class TTDialog extends JFrame {
|
||||||
g2d.dispose();
|
g2d.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,25 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.KeyAdapter;
|
import java.awt.event.KeyAdapter;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 14/06/2017.
|
* Author: Lorenzo Iovino on 14/06/2017.
|
||||||
|
* Description: TTGameBox component
|
||||||
*/
|
*/
|
||||||
public class TTGameBox extends TTInputField{
|
public class TTGameBox extends TTInputField{
|
||||||
|
|
||||||
public TTGameBox(Point position,
|
public TTGameBox(Point position,
|
||||||
Dimension dimension,
|
Dimension dimension,
|
||||||
String placeholer,
|
String placeholder,
|
||||||
DefaultListModel<String> list,
|
DefaultListModel<String> list,
|
||||||
TTContainer parent){
|
TTContainer parent){
|
||||||
|
|
||||||
super(position, dimension, placeholer, parent);
|
super(position, dimension, placeholder, parent);
|
||||||
setBackground(Palette.scrollPanel_backgroundColor);
|
setBackground(Palette.scrollPanel_backgroundColor);
|
||||||
setFont(Palette.inputBox_font);
|
setFont(Palette.inputBox_font);
|
||||||
setBounds(position.x, position.y, dimension.width, dimension.height);
|
setBounds(position.x, position.y, dimension.width, dimension.height);
|
||||||
|
|
@ -29,16 +30,16 @@ public class TTGameBox extends TTInputField{
|
||||||
addKeyListener(new KeyAdapter() {
|
addKeyListener(new KeyAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void keyPressed(KeyEvent e) {
|
public void keyPressed(KeyEvent e) {
|
||||||
super.keyPressed(e);
|
super.keyPressed(e);
|
||||||
if(e.getKeyCode() == 10){
|
if(e.getKeyCode() == 10){
|
||||||
try {
|
try {
|
||||||
list.addElement(getText());
|
list.addElement(getText());
|
||||||
setText("");
|
setText("");
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//Every time i press a key, execute a search of users
|
}
|
||||||
|
//Every time i press a key, execute a search of users
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@ import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 13/06/2017.
|
||||||
|
* Description: TTImage component
|
||||||
*/
|
*/
|
||||||
public class TTImage extends JLabel{
|
public class TTImage extends JLabel{
|
||||||
|
|
||||||
|
|
@ -16,6 +18,5 @@ public class TTImage extends JLabel{
|
||||||
setIcon(image);
|
setIcon(image);
|
||||||
|
|
||||||
parent.add(this);
|
parent.add(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
|
|
@ -10,7 +9,8 @@ import java.io.IOException;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 14/06/2017.
|
* Author: Lorenzo Iovino on 14/06/2017.
|
||||||
|
* Description: TTImageBtn component
|
||||||
*/
|
*/
|
||||||
public class TTImageBtn extends TTImage {
|
public class TTImageBtn extends TTImage {
|
||||||
public TTImageBtn(Point position, Dimension dimension, ImageIcon image, Callable<Object> clickHandler, JPanel parent) throws IOException {
|
public TTImageBtn(Point position, Dimension dimension, ImageIcon image, Callable<Object> clickHandler, JPanel parent) throws IOException {
|
||||||
|
|
@ -19,13 +19,13 @@ public class TTImageBtn extends TTImage {
|
||||||
addMouseListener(new MouseAdapter() {
|
addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseReleased(MouseEvent e) {
|
public void mouseReleased(MouseEvent e) {
|
||||||
super.mouseClicked(e);
|
super.mouseClicked(e);
|
||||||
setForeground(Palette.registerLblBtn_color);
|
setForeground(Palette.registerLblBtn_color);
|
||||||
try {
|
try {
|
||||||
clickHandler.call();
|
clickHandler.call();
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,14 @@ package com.texttwist.client.ui;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 13/06/2017.
|
||||||
|
* Description: TTInputBox component
|
||||||
*/
|
*/
|
||||||
public class TTInputBox extends JTextField {
|
public class TTInputBox extends JTextField {
|
||||||
|
|
||||||
public String placeholder;
|
public String placeholder;
|
||||||
|
|
||||||
public void setPlaceholder(final String s) {
|
public void setPlaceholder(final String s) {
|
||||||
placeholder = s;
|
placeholder = s;
|
||||||
}
|
}
|
||||||
|
|
@ -29,6 +30,5 @@ public class TTInputBox extends JTextField {
|
||||||
g.setColor(getDisabledTextColor());
|
g.setColor(getDisabledTextColor());
|
||||||
g.drawString(placeholder, getInsets().left, pG.getFontMetrics()
|
g.drawString(placeholder, getInsets().left, pG.getFontMetrics()
|
||||||
.getMaxAscent() + getInsets().top);
|
.getMaxAscent() + getInsets().top);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 13/06/2017.
|
||||||
|
* Description: TTInputField component
|
||||||
*/
|
*/
|
||||||
public class TTInputField extends TTInputBox{
|
public class TTInputField extends TTInputBox{
|
||||||
|
|
||||||
|
|
@ -19,10 +19,6 @@ public class TTInputField extends TTInputBox{
|
||||||
setPreferredSize(dimension);
|
setPreferredSize(dimension);
|
||||||
setForeground(Palette.fontColor);
|
setForeground(Palette.fontColor);
|
||||||
setPlaceholder(placeholder);
|
setPlaceholder(placeholder);
|
||||||
|
|
||||||
parent.add(this);
|
parent.add(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 13/06/2017.
|
||||||
|
* Description: TTLabel component
|
||||||
*/
|
*/
|
||||||
public class TTLabel extends JLabel{
|
public class TTLabel extends JLabel{
|
||||||
|
|
||||||
|
|
@ -30,8 +30,6 @@ public class TTLabel extends JLabel{
|
||||||
} else {
|
} else {
|
||||||
setForeground(fontColor);
|
setForeground(fontColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent.add(this);
|
parent.add(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
|
|
@ -9,7 +8,8 @@ import java.awt.event.MouseEvent;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 14/06/2017.
|
||||||
|
* Description: TTLabelBtn component
|
||||||
*/
|
*/
|
||||||
public class TTLabelBtn extends TTLabel{
|
public class TTLabelBtn extends TTLabel{
|
||||||
|
|
||||||
|
|
@ -23,6 +23,7 @@ public class TTLabelBtn extends TTLabel{
|
||||||
super.mouseClicked(e);
|
super.mouseClicked(e);
|
||||||
setForeground(Palette.registerLblBtn_onmouseclick_color);
|
setForeground(Palette.registerLblBtn_onmouseclick_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseReleased(MouseEvent e) {
|
public void mouseReleased(MouseEvent e) {
|
||||||
super.mouseClicked(e);
|
super.mouseClicked(e);
|
||||||
|
|
@ -38,7 +39,6 @@ public class TTLabelBtn extends TTLabel{
|
||||||
public void mouseEntered(MouseEvent e) {
|
public void mouseEntered(MouseEvent e) {
|
||||||
super.mouseClicked(e);
|
super.mouseClicked(e);
|
||||||
setForeground(Palette.registerLblBtn_onmouseover_color);
|
setForeground(Palette.registerLblBtn_onmouseover_color);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -48,6 +48,5 @@ public class TTLabelBtn extends TTLabel{
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,22 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 14/06/2017.
|
* Author: Lorenzo Iovino on 14/06/2017.
|
||||||
|
* Description: TTLetter component
|
||||||
*/
|
*/
|
||||||
public class TTLetter extends TTLabel{
|
public class TTLetter extends TTLabel{
|
||||||
public TTLetter(Point position, String caption, JPanel parent) {
|
public TTLetter(Point position, String caption, JPanel parent) {
|
||||||
super(position,
|
super(position,
|
||||||
new Dimension(50,50),
|
new Dimension(50,50),
|
||||||
caption,
|
caption,
|
||||||
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 20),
|
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 20),
|
||||||
Palette.fontColor,
|
Palette.fontColor,
|
||||||
parent);
|
parent);
|
||||||
parent.add(this);
|
parent.add(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 13/06/2017.
|
* Author: Lorenzo Iovino on 13/06/2017.
|
||||||
|
* Description: TTPasswordField component
|
||||||
*/
|
*/
|
||||||
public class TTPasswordField extends JPasswordField{
|
public class TTPasswordField extends JPasswordField{
|
||||||
|
|
||||||
|
|
@ -21,8 +22,6 @@ public class TTPasswordField extends JPasswordField{
|
||||||
setPreferredSize(dimension);
|
setPreferredSize(dimension);
|
||||||
setForeground(Palette.fontColor);
|
setForeground(Palette.fontColor);
|
||||||
setText(placeholder);
|
setText(placeholder);
|
||||||
|
|
||||||
parent.add(this);
|
parent.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 14/06/2017.
|
* Author: Lorenzo Iovino on 14/06/2017.
|
||||||
|
* Description: TTScrollList component
|
||||||
*/
|
*/
|
||||||
public class TTScrollList extends JList {
|
public class TTScrollList extends JList {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.texttwist.client.ui;
|
package com.texttwist.client.ui;
|
||||||
|
|
||||||
import com.texttwist.client.App;
|
import com.texttwist.client.App;
|
||||||
import constants.Palette;
|
import constants.Palette;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.KeyAdapter;
|
import java.awt.event.KeyAdapter;
|
||||||
|
|
@ -12,11 +12,11 @@ import java.util.concurrent.Callable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by loke on 14/06/2017.
|
* Author: Lorenzo Iovino on 14/06/2017.
|
||||||
|
* Description: TTSearchBar component
|
||||||
*/
|
*/
|
||||||
public class TTSearchBar extends TTContainer{
|
public class TTSearchBar extends TTContainer{
|
||||||
|
|
||||||
private DefaultListModel matchedUsers = new DefaultListModel();
|
|
||||||
public DefaultListModel<String> list = new DefaultListModel<String>();
|
public DefaultListModel<String> list = new DefaultListModel<String>();
|
||||||
|
|
||||||
private Callable<Object> add(TTInputField ctx){
|
private Callable<Object> add(TTInputField ctx){
|
||||||
|
|
@ -33,7 +33,6 @@ public class TTSearchBar extends TTContainer{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public TTSearchBar(Point position,
|
public TTSearchBar(Point position,
|
||||||
Dimension dimension,
|
Dimension dimension,
|
||||||
String placeholder,
|
String placeholder,
|
||||||
|
|
@ -46,76 +45,65 @@ public class TTSearchBar extends TTContainer{
|
||||||
setPreferredSize(dimension);
|
setPreferredSize(dimension);
|
||||||
setForeground(Palette.fontColor);
|
setForeground(Palette.fontColor);
|
||||||
|
|
||||||
TTLabel playerFinder_flavourText = new TTLabel(
|
new TTLabel(
|
||||||
new Point(20,40),
|
new Point(20,40),
|
||||||
new Dimension(350,50),
|
new Dimension(350,50),
|
||||||
"<html>Add player</html>",
|
"Add player",
|
||||||
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 18),
|
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 18),
|
||||||
null,
|
null,
|
||||||
parent);
|
parent);
|
||||||
|
|
||||||
TTInputField usernameField = new TTInputField(
|
TTInputField usernameField = new TTInputField(
|
||||||
new Point(20,80),
|
new Point(20,80),
|
||||||
new Dimension(250,45),
|
new Dimension(250,45),
|
||||||
placeholder,
|
placeholder,
|
||||||
parent);
|
parent);
|
||||||
|
|
||||||
/*TTScrollList userList = new TTScrollList(
|
new TTButton(
|
||||||
new Point(20,120),
|
new Point(70,140),
|
||||||
new Dimension(250,95),
|
new Dimension(150,50),
|
||||||
matchedUsers,
|
"Add!",
|
||||||
parent
|
add(usernameField),
|
||||||
);*/
|
parent);
|
||||||
|
|
||||||
TTButton addUser = new TTButton(
|
new TTLabel(
|
||||||
new Point(70,140),
|
new Point(305,40),
|
||||||
new Dimension(150,50),
|
new Dimension(350,50),
|
||||||
"Add!",
|
"Double-Click on item for remove",
|
||||||
add(usernameField),
|
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 18),
|
||||||
parent);
|
null,
|
||||||
|
parent);
|
||||||
|
|
||||||
TTLabel playerToSendInvite_flavourText = new TTLabel(
|
|
||||||
new Point(305,40),
|
|
||||||
new Dimension(350,50),
|
|
||||||
"Double-Click on item for remove",
|
|
||||||
new Font(Palette.inputBox_font.getFontName(), Font.ITALIC, 18),
|
|
||||||
null,
|
|
||||||
parent);
|
|
||||||
|
|
||||||
TTScrollList playerToSendInvite = new TTScrollList(
|
TTScrollList playerToSendInvite = new TTScrollList(
|
||||||
new Point(305, 80),
|
new Point(305, 80),
|
||||||
new Dimension(232, 135),
|
new Dimension(232, 135),
|
||||||
list,
|
list,
|
||||||
parent);
|
parent);
|
||||||
|
|
||||||
|
|
||||||
playerToSendInvite.addMouseListener(new MouseAdapter() {
|
playerToSendInvite.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mouseClicked(MouseEvent evt) {
|
public void mouseClicked(MouseEvent evt) {
|
||||||
super.mouseClicked(evt);
|
super.mouseClicked(evt);
|
||||||
JList thisList = (JList)evt.getSource();
|
JList thisList = (JList)evt.getSource();
|
||||||
if (evt.getClickCount() == 2) {
|
if (evt.getClickCount() == 2) {
|
||||||
|
int index = thisList.locationToIndex(evt.getPoint());
|
||||||
// Double-click detected
|
list.remove(index);
|
||||||
int index = thisList.locationToIndex(evt.getPoint());
|
}
|
||||||
list.remove(index);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
usernameField.addKeyListener(new KeyAdapter() {
|
usernameField.addKeyListener(new KeyAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void keyPressed(KeyEvent e) {
|
public void keyPressed(KeyEvent e) {
|
||||||
super.keyPressed(e);
|
super.keyPressed(e);
|
||||||
if(e.getKeyCode() == 10){
|
if(e.getKeyCode() == 10){
|
||||||
try {
|
try {
|
||||||
add(usernameField).call();
|
add(usernameField).call();
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
parent.add(this);
|
parent.add(this);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package interfaces;
|
package interfaces;
|
||||||
|
|
||||||
import models.Response;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.rmi.Remote;
|
import java.rmi.Remote;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
|
|
@ -10,6 +8,5 @@ import java.rmi.RemoteException;
|
||||||
* Created by loke on 19/06/2017.
|
* Created by loke on 19/06/2017.
|
||||||
*/
|
*/
|
||||||
public interface INotificationClient extends Remote{
|
public interface INotificationClient extends Remote{
|
||||||
|
void sendInvite(String userName, DefaultListModel<String> users) throws RemoteException;
|
||||||
Response sendInvite(String userName, DefaultListModel<String> users) throws RemoteException;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -889,3 +889,223 @@ 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 - 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
|
||||||
LOGGER (Server): Wed Jul 12 17:55:55 CEST 2017 - Logout successfull (but something gone wrong)
|
LOGGER (Server): Wed Jul 12 17:55:55 CEST 2017 - Logout successfull (but something gone wrong)
|
||||||
|
LOGGER (Server): Thu Jul 13 00:00:41 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:00:41 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:00:41 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 00:00:41 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:00:47 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 00:00:47 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 00:00:52 CEST 2017 - Invoked login with username=asd AND password=asd
|
||||||
|
LOGGER (Server): Thu Jul 13 00:00:52 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 00:33:30 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:33:30 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:33:30 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 00:33:30 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:33:34 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 00:33:34 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 00:33:40 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 00:33:40 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 00:48:19 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:48:19 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:48:19 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:48:19 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 00:50:56 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:50:56 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:50:56 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 00:50:56 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:51:28 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:51:29 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:51:29 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 00:51:29 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:14 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:14 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:15 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:15 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:18 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:18 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:22 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:22 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:42 CEST 2017 - Invoked logout with username=b AND token=f3769fgmn2aq7bp0uvpi8ac905
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:42 CEST 2017 - Logout successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:42 CEST 2017 - Logout successfull (but something gone wrong)
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:45 CEST 2017 - Invoked login with username=asd AND password=asd
|
||||||
|
LOGGER (Server): Thu Jul 13 00:52:45 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:12:14 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:12:14 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:12:14 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:12:14 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:12:19 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:12:19 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:08 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:08 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:08 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:08 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:12 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:12 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:54 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:55 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:55 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:55 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:59 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:13:59 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:14:35 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:14:35 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:14:35 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:14:35 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:14:38 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:14:38 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:15:34 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:15:34 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:15:34 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:15:34 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:15:37 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:15:37 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:07 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:07 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:07 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:07 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:10 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:10 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:36 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:36 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:36 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:36 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:39 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:39 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:43 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 01:16:43 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:25:24 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:25:24 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:25:24 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:25:24 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:25:28 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:25:28 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:25:32 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 01:25:32 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:26:08 CEST 2017 - Invoked register with username=ds AND password=ds
|
||||||
|
LOGGER (Server): Thu Jul 13 01:26:08 CEST 2017 - Registration successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:26:11 CEST 2017 - Invoked login with username=ds AND password=ds
|
||||||
|
LOGGER (Server): Thu Jul 13 01:26:11 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:29:20 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:29:20 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:29:20 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:29:20 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:29:25 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:29:25 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:29:29 CEST 2017 - Invoked login with username=asd AND password=asd
|
||||||
|
LOGGER (Server): Thu Jul 13 01:29:29 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:55:40 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:55:40 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:55:40 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:55:40 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:55:43 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:55:43 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:55:48 CEST 2017 - Invoked login with username=asd AND password=asd
|
||||||
|
LOGGER (Server): Thu Jul 13 01:55:48 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:34 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:35 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:35 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:35 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:40 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:40 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:48 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:48 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:48 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:48 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:52 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:56:52 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:57:00 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 01:57:00 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:57:41 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:57:41 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:57:41 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:57:41 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:57:44 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:57:44 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 01:59:03 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:59:03 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:59:03 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 01:59:03 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 01:59:08 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 01:59:08 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:00:01 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:00:01 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:00:01 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:00:01 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:00:05 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:00:05 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:02:34 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:02:35 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:02:35 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:02:35 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:02:38 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:02:38 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:02:44 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 02:02:44 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:21 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:21 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:21 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:21 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:27 CEST 2017 - Invoked login with username=a AND password=
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:27 CEST 2017 - Login unsuccessfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:29 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:29 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:35 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:35 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:49 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:50 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:50 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:50 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:58 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:25:58 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:26:02 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 02:26:02 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:26:38 CEST 2017 - Invoked login with username=asd AND password=asd
|
||||||
|
LOGGER (Server): Thu Jul 13 02:26:38 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:26:47 CEST 2017 - Invoked login with username=dd AND password=dd
|
||||||
|
LOGGER (Server): Thu Jul 13 02:26:47 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:38:42 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:38:42 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:38:43 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:38:43 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:38:46 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:38:46 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:38:51 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 02:38:51 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:39:55 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:39:55 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:39:55 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:39:55 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:40:01 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:40:01 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:40:11 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 02:40:11 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:22 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:22 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:22 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:22 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:27 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:27 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:32 CEST 2017 - Invoked login with username=b AND password=h
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:32 CEST 2017 - Login unsuccessfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:36 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 02:41:36 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:42:24 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:42:24 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:42:24 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:42:24 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:42:35 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:42:35 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:42:39 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 02:42:39 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:46:27 CEST 2017 - Server starting ...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:46:27 CEST 2017 - Auth Service running at 9999 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:46:27 CEST 2017 - Server started
|
||||||
|
LOGGER (Server): Thu Jul 13 02:46:27 CEST 2017 - GameService Service is running at 10000 port...
|
||||||
|
LOGGER (Server): Thu Jul 13 02:46:32 CEST 2017 - Invoked login with username=a AND password=a
|
||||||
|
LOGGER (Server): Thu Jul 13 02:46:32 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:46:35 CEST 2017 - Invoked login with username=b AND password=b
|
||||||
|
LOGGER (Server): Thu Jul 13 02:46:35 CEST 2017 - Login successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:47:30 CEST 2017 - Invoked logout with username=a AND token=arlci4cv3ct54q7jh5ddaog8q0
|
||||||
|
LOGGER (Server): Thu Jul 13 02:47:30 CEST 2017 - Logout successfull
|
||||||
|
LOGGER (Server): Thu Jul 13 02:47:30 CEST 2017 - Logout successfull (but something gone wrong)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue