Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alexandre Ducarne
ai12-othello
Commits
4911dd33
Commit
4911dd33
authored
Dec 01, 2019
by
William Sha
Browse files
Merge branch 'fix/v2/userListsOnLogin' into 'int/v2'
Fix display users List on login See merge request
!55
parents
c38886df
fee799a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/client/data/ComToDataClientImpl.java
View file @
4911dd33
...
...
@@ -4,6 +4,7 @@ import common.dataModel.*;
import
common.interfaces.client.IComToData
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.UUID
;
...
...
@@ -87,6 +88,14 @@ public class ComToDataClientImpl implements IComToData {
public
void
receivePlayersnGames
(
List
<
UserLight
>
players
,
List
<
GameLight
>
gamesAvailable
)
{
dataCoreClient
.
setListConnectedUsers
(
players
);
dataCoreClient
.
setListGameLight
(
gamesAvailable
);
// the current user will not be sent to the model view
Iterator
<
UserLight
>
iterator
=
players
.
iterator
();
while
(
iterator
.
hasNext
())
{
UserLight
user
=
iterator
.
next
();
if
(
dataCoreClient
.
getLocalUserLight
().
getId
().
equals
(
user
.
getId
()))
{
iterator
.
remove
();
}
}
dataCoreClient
.
getDataToMain
().
sendLists
(
players
,
gamesAvailable
);
}
...
...
src/main/java/client/main/controller/FXConnection.java
View file @
4911dd33
...
...
@@ -134,20 +134,8 @@ public class FXConnection {
// identification attempt
ClientApp
.
mainCore
.
getMainToData
().
identify
(
this
.
loginTextFieldIdentifier
.
getText
(),
this
.
loginPasswordFieldPassword
.
getText
(),
hostname
);
// wait for response
do
{
Thread
.
sleep
(
500
);
}
while
(
this
.
getModel
().
getUserLight
()
==
null
&&
System
.
currentTimeMillis
()
-
start
<
30000
);
// if the model has been filled by data layer
if
(
this
.
getModel
().
getUserLight
()
!=
null
)
{
FXHome
fxHome
=
new
FXHome
();
fxHome
.
initialize
(
"../fxml/home.fxml"
,
this
.
stage
);
}
else
{
this
.
loginTextConnectionError
.
setVisible
(
true
);
throw
new
TimeoutException
(
"Cannot resolve the process. Please retry later."
);
}
FXHome
fxHome
=
new
FXHome
();
fxHome
.
initialize
(
"../fxml/home.fxml"
,
this
.
stage
);
}
catch
(
TimeoutException
exception
)
{
System
.
out
.
println
(
"TimeoutException caught: "
+
exception
.
getMessage
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment