UP
This commit is contained in:
parent
71ff3c4820
commit
e1622dfaa1
17 changed files with 463 additions and 561 deletions
|
|
@ -18,6 +18,11 @@ public class HomeController {
|
|||
public Response login(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException {
|
||||
Response res = authService.login(userName,password);
|
||||
if (res.code == 200){
|
||||
try {
|
||||
App.registerForNotifications();
|
||||
} catch (RemoteException e) {
|
||||
App.logger.write("AUTH SERVICE: Can't register for notification");
|
||||
}
|
||||
App.session = (new Session(new User(userName,password,0), res.data.get("token").toString()));
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -20,11 +20,6 @@ public class AuthService {
|
|||
private String baseUrl = Config.getAuthServerURI().concat("/auth");
|
||||
|
||||
public Response login(String userName, String password) throws RemoteException, NotBoundException, MalformedURLException {
|
||||
try {
|
||||
App.registerForNotifications();
|
||||
} catch (RemoteException e) {
|
||||
App.logger.write("AUTH SERVICE: Can't register for notification");
|
||||
}
|
||||
IAuth auth = (IAuth) Naming.lookup(baseUrl);
|
||||
return auth.login(userName, password);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ public class SendWords extends SwingWorker<Void,Void> {
|
|||
buffer.flip();
|
||||
|
||||
App.clientUDP.send(buffer, App.clientUDPSocketAddress);
|
||||
System.out.println("SENDED" + sentence);
|
||||
} catch (UnknownHostException e) {
|
||||
App.logger.write("SEND WORDS: Host address not correct");
|
||||
} catch (IOException e) {
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ public class WaitForPlayers extends SwingWorker<Void,Void> {
|
|||
while (App.clientTCP.read(buffer) != -1) {
|
||||
String line = new String(buffer.array(), buffer.position(), buffer.remaining());
|
||||
buffer.clear();
|
||||
System.out.println("ASPETTO GAM_STARTED");
|
||||
System.out.println(line);
|
||||
|
||||
if (line.startsWith("MESSAGE")) {
|
||||
buffer.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue