Skip to content
GitLab
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
f0e885b6
Commit
f0e885b6
authored
Nov 26, 2019
by
Thomas Lecluse
Browse files
Merge branch 'feature/fix/v2' into 'int/v2'
Feature/fix/v2 See merge request
!30
parents
77555add
40b175b6
Changes
14
Hide whitespace changes
Inline
Side-by-side
src/main/java/client/ClientApp.java
View file @
f0e885b6
...
...
@@ -9,7 +9,6 @@ import javafx.application.Application;
import
javafx.stage.Stage
;
import
main.java.client.data.DataCoreClient
;
import
main.java.client.game.GameCore
;
import
main.java.client.game.controller.MainGameController
;
import
main.java.client.main.controller.MainControllerFX
;
import
main.java.client.main.controller.MainCore
;
import
main.java.client.network.ComCoreClient
;
...
...
@@ -23,7 +22,7 @@ public class ClientApp extends Application {
private
static
ComCoreClient
comCoreClient
;
private
static
DataCoreClient
dataCoreClient
;
public
static
MainCore
mainCore
;
p
rivate
static
GameCore
gameCore
;
p
ublic
static
GameCore
gameCore
;
public
static
final
String
APPLICATION_NAME
=
"Othello"
;
public
static
final
int
APPLICATION_WIDTH
=
889
;
public
static
final
int
APPLICATION_HEIGHT
=
500
;
...
...
@@ -55,7 +54,7 @@ public class ClientApp extends Application {
dataCoreClient
=
new
DataCoreClient
();
// IHM Game Core
gameCore
=
new
GameCore
(
new
MainGameController
()
);
gameCore
=
new
GameCore
();
// IHM Main Core
mainCore
=
new
MainCore
(
new
MainControllerFX
());
...
...
@@ -63,9 +62,10 @@ public class ClientApp extends Application {
// Set implementations
dataCoreClient
.
setDataToCom
(
comCoreClient
.
getDataToComClientImpl
());
dataCoreClient
.
setDataToMain
(
mainCore
.
getDataToMainImpl
());
dataCoreClient
.
setDataToGame
(
gameCore
.
getDataToGame
());
comCoreClient
.
setComToDataClient
(
dataCoreClient
.
getClientComToDataImpl
());
mainCore
.
setMainToData
(
dataCoreClient
.
getMainToDataImpl
());
// TODO missing:
gameCore.setGameToData(dataCoreClient.get
DataToGame
Impl());
gameCore
.
setGameToData
(
dataCoreClient
.
get
GameToData
Impl
());
}
@Override
...
...
src/main/java/client/data/DataCoreClient.java
View file @
f0e885b6
package
main.java.client.data
;
import
main.java.common.dataModel.*
;
import
main.java.common.interfaces.client.*
;
import
java.util.List
;
import
main.java.common.dataModel.Board
;
import
main.java.common.dataModel.GameLight
;
import
main.java.common.dataModel.Move
;
import
main.java.common.dataModel.UserHeavy
;
import
main.java.common.dataModel.UserLight
;
import
main.java.common.interfaces.client.IComToData
;
import
main.java.common.interfaces.client.IDataToCom
;
import
main.java.common.interfaces.client.IDataToGame
;
import
main.java.common.interfaces.client.IDataToMain
;
import
main.java.common.interfaces.client.IMainToData
;
public
class
DataCoreClient
{
private
UserHeavy
localUserHeavy
;
private
UserLight
localUserLight
;
private
List
<
UserLight
>
listConnectedUsers
;
private
UserHeavy
localUserHeavy
;
private
UserLight
localUserLight
;
private
List
<
UserLight
>
listConnectedUsers
;
private
List
<
GameLight
>
listGameLight
;
private
List
<
GameLight
>
listGameLight
;
private
MainToDataImpl
mainToDataImpl
;
private
ComToDataClientImpl
comToDataClientImpl
;
private
GameToDataImpl
gameToDataImpl
;
private
MainToDataImpl
mainToDataImpl
;
private
ComToDataClientImpl
comToDataClientImpl
;
private
GameToDataImpl
gameToDataImpl
;
private
IDataToCom
dataToCom
;
private
IDataToMain
dataToMain
;
private
IDataToGame
dataToGame
;
private
IDataToCom
dataToCom
;
private
IDataToMain
dataToMain
;
private
IDataToGame
dataToGame
;
public
DataCoreClient
()
{
mainToDataImpl
=
new
MainToDataImpl
(
this
);
comToDataClientImpl
=
new
ComToDataClientImpl
(
this
);
gameToDataImpl
=
new
GameToDataImpl
(
this
);
}
public
DataCoreClient
()
{
mainToDataImpl
=
new
MainToDataImpl
(
this
);
comToDataClientImpl
=
new
ComToDataClientImpl
(
this
);
gameToDataImpl
=
new
GameToDataImpl
(
this
);
}
public
List
<
UserLight
>
getListConnectedUsers
()
{
return
listConnectedUsers
;
}
public
List
<
UserLight
>
getL
istConnectedUsers
(
)
{
return
listConnectedUsers
;
}
public
void
setListConnectedUsers
(
List
<
UserLight
>
l
istConnectedUsers
)
{
this
.
listConnectedUsers
=
listConnectedUsers
;
}
public
void
setListConnectedUsers
(
List
<
UserLight
>
listConnectedUsers
)
{
this
.
listConnectedUsers
=
listConnectedUsers
;
}
public
UserHeavy
getLocalUserHeavy
(
)
{
return
localUserHeavy
;
}
public
UserHeavy
getL
ocalUserHeavy
(
)
{
return
localUserHeavy
;
}
public
void
setLocalUserHeavy
(
UserHeavy
l
ocalUserHeavy
)
{
this
.
localUserHeavy
=
localUserHeavy
;
}
public
void
setLocalUser
Heavy
(
UserHeavy
localUser
Heavy
)
{
this
.
localUser
Heavy
=
localUser
Heavy
;
}
public
void
setLocalUser
Light
(
UserLight
localUser
Light
)
{
this
.
localUser
Light
=
localUser
Light
;
}
public
void
setLocalUserLight
(
UserLight
localUserLight
)
{
this
.
localUserLight
=
localUserLight
;
}
public
IComToData
getClientComToDataImpl
(
)
{
return
comToDataClientImpl
;
}
public
I
Com
ToData
get
ClientCom
ToDataImpl
()
{
return
com
ToData
Client
Impl
;
}
public
I
Main
ToData
get
Main
ToDataImpl
()
{
return
main
ToDataImpl
;
}
public
I
MainToData
getMainToDataImpl
()
{
return
mainToDataImpl
;
}
public
I
DataToCom
getDataToCom
()
{
return
dataToCom
;
}
public
IDataToCom
getD
ataToCom
(
)
{
return
dataToCom
;
}
public
void
setDataToCom
(
IDataToCom
d
ataToCom
)
{
this
.
dataToCom
=
dataToCom
;
}
public
void
set
DataToCom
(
IDataToCom
dataToCom
)
{
this
.
dataToCom
=
dataToCom
;
}
public
void
set
ListGameLight
(
List
<
GameLight
>
listGameLight
)
{
this
.
listGameLight
=
listGameLight
;
}
public
void
setListGameLight
(
List
<
GameLight
>
l
istGameLight
)
{
this
.
listGameLight
=
listGameLight
;
}
public
List
<
GameLight
>
getL
istGameLight
(
)
{
return
listGameLight
;
}
public
List
<
GameLight
>
getListGameLight
()
{
return
listGameLight
;
}
private
boolean
isMoveValid
(
Move
playerMove
,
Board
boardGame
)
{
return
false
;
}
private
boolean
isMoveValid
(
Move
playerMove
,
Board
boardGame
)
{
return
false
;
}
public
IDataToMain
getDataToMain
(
)
{
return
dataToMain
;
}
public
IDataToMain
getD
ataToMain
(
)
{
return
dataToMain
;
}
public
void
setDataToMain
(
IDataToMain
d
ataToMain
)
{
this
.
dataToMain
=
dataToMain
;
}
public
void
setDataToMain
(
IDataToMain
dataToMain
)
{
this
.
dataToMain
=
dataTo
Main
;
}
public
IDataToGame
getDataToGame
(
)
{
return
dataTo
Game
;
}
public
IDataToGame
getD
ataToGame
(
)
{
return
dataToGame
;
}
public
void
setDataToGame
(
IDataToGame
d
ataToGame
)
{
this
.
dataToGame
=
dataToGame
;
}
public
GameToDataImpl
getGameToDataImpl
()
{
return
gameToDataImpl
;
}
public
GameToDataImpl
getGameToDataImpl
()
{
return
gameToDataImpl
;
}
}
src/main/java/client/data/GameToDataImpl.java
View file @
f0e885b6
package
main.java.client.data
;
import
main.java.common.dataModel.GameLight
;
import
main.java.common.dataModel.Message
;
import
main.java.common.dataModel.UserLight
;
import
main.java.common.dataModel.UserZero
;
import
main.java.common.interfaces.client.IGameToData
;
import
java.sql.Timestamp
;
import
java.util.Date
;
import
java.util.ListIterator
;
import
java.util.UUID
;
import
main.java.common.dataModel.GameLight
;
import
main.java.common.dataModel.UserZero
;
import
main.java.common.interfaces.client.IGameToData
;
public
class
GameToDataImpl
implements
IGameToData
{
DataCoreClient
dataCoreClient
;
DataCoreClient
dataCoreClient
;
public
GameToDataImpl
(
DataCoreClient
dataCoreClient
)
{
this
.
dataCoreClient
=
dataCoreClient
;
}
public
GameToDataImpl
(
DataCoreClient
dataCoreClient
)
{
this
.
dataCoreClient
=
dataCoreClient
;
}
@Override
public
void
playMove
(
int
x
,
int
y
,
UserZero
u
)
{
@Override
public
void
playMove
(
int
x
,
int
y
,
UserZero
u
)
{
}
}
@Override
public
void
getPlayer
(
UUID
id
)
{
@Override
public
void
getPlayer
(
UUID
id
)
{
}
}
@Override
public
void
newGameAvailable
(
GameLight
gl
)
{
dataCoreClient
.
getDataToCom
().
addNewGameAvailable
(
gl
);
}
@Override
public
void
newGameAvailable
(
GameLight
gl
)
{
dataCoreClient
.
getDataToCom
().
addNewGameAvailable
(
gl
);
}
@Override
public
void
askGame
(
UUID
gameId
,
UUID
userId
)
{
@Override
public
void
askGame
(
UUID
gameId
,
UUID
userId
)
{
}
}
@Override
public
void
newMessage
(
String
m
,
UUID
pid
,
UUID
gameId
)
throws
Exception
{
dataCoreClient
.
getDataToCom
().
sendChatMessage
(
m
,
new
Timestamp
(
new
Date
().
getTime
()),
pid
,
gameId
);
}
@Override
public
void
newMessage
(
String
m
,
UUID
gameId
)
throws
Exception
{
dataCoreClient
.
getDataToCom
().
sendChatMessage
(
m
,
new
Timestamp
(
new
Date
().
getTime
()),
dataCoreClient
.
getLocalUserHeavy
().
getId
(),
gameId
);
}
}
src/main/java/client/data/MainToDataImpl.java
View file @
f0e885b6
package
main.java.client.data
;
import
main.java.common.dataModel.*
;
import
main.java.common.interfaces.client.IMainToData
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
javafx.scene.Scene
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.IOException
;
...
...
@@ -17,182 +11,209 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.UUID
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
javafx.stage.Stage
;
import
main.java.common.dataModel.GameHeavy
;
import
main.java.common.dataModel.GameLight
;
import
main.java.common.dataModel.GameStatus
;
import
main.java.common.dataModel.UserHeavy
;
import
main.java.common.dataModel.UserLight
;
import
main.java.common.interfaces.client.IMainToData
;
public
class
MainToDataImpl
implements
IMainToData
{
DataCoreClient
dataCoreClient
;
public
MainToDataImpl
(
DataCoreClient
dataCoreClient
)
{
this
.
dataCoreClient
=
dataCoreClient
;
}
public
static
void
createUser
(
UserLight
userLight
,
UserHeavy
userHeavy
)
throws
Exception
{
String
userFilePath
=
Configuration
.
SAVE_DIR
+
File
.
separator
+
userLight
.
getPseudo
()
+
".json"
;
File
userFile
=
new
File
(
userFilePath
);
if
(
userFile
.
exists
())
throw
new
Exception
(
"This user already exists on this computer"
);
JsonObject
userJson
=
new
JsonObject
();
userJson
.
addProperty
(
"id"
,
userLight
.
getId
().
toString
());
userJson
.
addProperty
(
"pseudo"
,
userLight
.
getPseudo
());
userJson
.
addProperty
(
"lastName"
,
userLight
.
getLastName
());
userJson
.
addProperty
(
"firstName"
,
userLight
.
getFirstName
());
if
(
userLight
.
getDateOfBirth
()
==
null
)
userJson
.
addProperty
(
"dateOfBirth"
,
(
String
)
null
);
else
userJson
.
addProperty
(
"dateOfBirth"
,
new
SimpleDateFormat
(
"dd-MM-yyyy"
).
format
(
userLight
.
getDateOfBirth
()));
userJson
.
addProperty
(
"avatarId"
,
userLight
.
getAvatarId
());
userJson
.
addProperty
(
"playedGames"
,
userLight
.
getPlayedGames
());
userJson
.
addProperty
(
"wonGames"
,
userLight
.
getWonGames
());
userJson
.
addProperty
(
"password"
,
userHeavy
.
getPassword
());
userJson
.
addProperty
(
"serverAddress"
,
userHeavy
.
getServerAddress
());
userJson
.
addProperty
(
"serverPort"
,
userHeavy
.
getServerPort
());
userFile
.
getParentFile
().
mkdirs
();
FileWriter
fw
=
new
FileWriter
(
userFilePath
);
fw
.
write
(
userJson
.
toString
());
fw
.
close
();
}
@Override
public
void
selectGames
(
GameLight
g
)
{
}
@Override
public
void
acceptanceAcquired
(
UUID
u_id
,
Boolean
validation
)
{
}
@Override
public
Scene
newGame
(
UserLight
ul
,
Boolean
spectatorsOk
,
Boolean
chatOk
,
Boolean
creatorPlayWhite
,
int
limitMove
,
Scene
sceneFx
)
{
GameLight
gameCreated
=
new
GameLight
(
UUID
.
randomUUID
(),
ul
,
null
,
GameStatus
.
PENDING
,
spectatorsOk
,
chatOk
,
creatorPlayWhite
,
limitMove
);
dataCoreClient
.
getDataToGame
().
getGameScreen
(
gameCreated
,
sceneFx
);
return
sceneFx
;
}
@Override
public
void
updatedProfile
(
UserLight
profile
)
{
}
@Override
public
void
requestToDataToSpecialGame
(
GameLight
game
,
UserLight
user
,
Scene
sceneFx
)
{
}
@Override
public
void
sendServerParams
(
String
ip
,
int
port
)
{
}
@Override
public
ArrayList
<
GameLight
>
displaySavedGames
(
UUID
id
)
{
return
null
;
}
@Override
public
GameHeavy
getSavedGame
(
UUID
id
)
{
return
null
;
}
@Override
public
void
sendUserInfo
(
String
pseudo
,
String
lastName
,
String
firstName
,
Date
dateOfBirth
,
int
avatarId
,
String
password
)
throws
Exception
{
if
(
lastName
==
null
||
firstName
==
null
||
password
==
null
)
throw
new
Exception
(
"One or more required field is empty"
);
UUID
id
=
UUID
.
randomUUID
();
createUser
(
new
UserLight
(
id
,
pseudo
,
lastName
,
firstName
,
dateOfBirth
,
avatarId
,
0
,
0
),
new
UserHeavy
(
id
,
pseudo
,
password
,
null
,
null
,
null
));
}
@Override
public
void
downloadUserProfile
(
String
filePath
)
{
}
@Override
public
void
updateProfile
(
UserLight
profileLight
,
UserHeavy
profileHeavy
)
throws
Exception
{
String
userFilePath
=
Configuration
.
SAVE_DIR
+
File
.
separator
+
dataCoreClient
.
getLocalUserHeavy
().
getPseudo
()
+
".json"
;
File
userFile
=
new
File
(
userFilePath
);
if
(!
userFile
.
exists
())
throw
new
Exception
(
"File for user "
+
dataCoreClient
.
getLocalUserHeavy
().
getPseudo
()
+
" not found"
);
String
oldFilePath
=
userFilePath
+
profileLight
.
getId
().
toString
();
File
oldFile
=
new
File
(
oldFilePath
);
if
(
oldFile
.
exists
())
throw
new
Exception
(
"Error while backuping old data"
);
userFile
.
renameTo
(
oldFile
);
try
{
createUser
(
profileLight
,
profileHeavy
);
//dataCoreClient.getDataToCom().notifyUpdateProfile(profileLight); TO DISCUSS WITH COM
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
oldFile
.
renameTo
(
userFile
);
}
oldFile
.
delete
();
}
@Override
public
void
identify
(
String
login
,
String
password
,
String
address
)
throws
Exception
{
//blank playername or password
if
(
login
.
isEmpty
()
||
password
.
isEmpty
())
{
throw
new
Exception
(
"Data error: due to empty login or password"
);
}
login
(
login
,
password
);
dataCoreClient
.
getDataToCom
().
connectUserOnline
(
getUserLightFromFile
(
login
),
address
);
}
public
UserLight
getUserLightFromFile
(
String
pseudo
)
throws
Exception
,
IOException
,
ParseException
{
String
path
=
Configuration
.
SAVE_DIR
+
File
.
separator
+
pseudo
+
".json"
;
File
userFile
=
new
File
(
path
);
if
(!
userFile
.
exists
())
throw
new
Exception
(
"Data error: User profile does not exist"
);
JsonParser
parser
=
new
JsonParser
();
JsonObject
userObject
=
parser
.
parse
(
new
String
(
Files
.
readAllBytes
(
Paths
.
get
(
path
)))).
getAsJsonObject
();
UserLight
userLight
=
new
UserLight
(
UUID
.
fromString
(
userObject
.
get
(
"id"
).
getAsString
()),
userObject
.
get
(
"pseudo"
).
getAsString
(),
userObject
.
get
(
"lastName"
).
getAsString
(),
userObject
.
get
(
"firstName"
).
getAsString
(),
userObject
.
get
(
"dateOfBirth"
).
isJsonNull
()
?
null
:
new
SimpleDateFormat
(
"dd-MM-yyyy"
).
parse
(
userObject
.
get
(
"dateOfBirth"
).
getAsString
()),
userObject
.
get
(
"avatarId"
).
getAsInt
(),
userObject
.
get
(
"playedGames"
).
getAsInt
(),
userObject
.
get
(
"wonGames"
).
getAsInt
());
return
userLight
;
}
public
UserHeavy
getUserHeavyFromFile
(
String
pseudo
)
throws
Exception
,
IOException
,
ParseException
{
String
path
=
Configuration
.
SAVE_DIR
+
File
.
separator
+
pseudo
+
".json"
;
File
userFile
=
new
File
(
path
);
if
(!
userFile
.
exists
())
throw
new
Exception
(
"Data error: User profile does not exist"
);
JsonParser
parser
=
new
JsonParser
();
JsonObject
userObject
=
parser
.
parse
(
new
String
(
Files
.
readAllBytes
(
Paths
.
get
(
path
)))).
getAsJsonObject
();
UserHeavy
userHeavy
=
new
UserHeavy
(
UUID
.
fromString
(
userObject
.
get
(
"id"
).
getAsString
()),
userObject
.
get
(
"pseudo"
).
getAsString
(),
userObject
.
get
(
"password"
).
getAsString
(),
userObject
.
get
(
"serverAddress"
).
toString
(),
userObject
.
get
(
"serverPort"
).
toString
(),
null
);
return
userHeavy
;
}
public
void
login
(
String
login
,
String
password
)
throws
Exception
{
String
path
=
Configuration
.
SAVE_DIR
+
File
.
separator
+
login
+
".json"
;
File
userFile
=
new
File
(
path
);
if
(!
userFile
.
exists
())
{
throw
new
Exception
(
"Data error: User profile does not exist"
);
// throw related error
}
else
{
UserLight
userLight
=
getUserLightFromFile
(
login
);
UserHeavy
userHeavy
=
getUserHeavyFromFile
(
login
);
if
(!
userHeavy
.
getPassword
().
equals
(
password
))
{
throw
new
Exception
(
"Data error: User password does not match"
);
// throw related error
}
else
{
dataCoreClient
.
setLocalUserHeavy
(
userHeavy
);
dataCoreClient
.
setLocalUserLight
(
userLight
);
dataCoreClient
.
getDataToMain
().
sendUserInfo
(
userLight
,
userHeavy
);
}
}
}
@Override
public
void
disconnect
()
{
}
DataCoreClient
dataCoreClient
;
public
MainToDataImpl
(
DataCoreClient
dataCoreClient
)
{
this
.
dataCoreClient
=
dataCoreClient
;
}
public
static
void
createUser
(
UserLight
userLight
,
UserHeavy
userHeavy
)
throws
Exception
{
String
userFilePath
=
Configuration
.
SAVE_DIR
+
File
.
separator
+
userLight
.
getPseudo
()
+
".json"
;
File
userFile
=
new
File
(
userFilePath
);
if
(
userFile
.
exists
())
{
throw
new
Exception
(
"This user already exists on this computer"
);
}
JsonObject
userJson
=
new
JsonObject
();
userJson
.
addProperty
(
"id"
,
userLight
.
getId
().
toString
());
userJson
.
addProperty
(
"pseudo"
,
userLight
.
getPseudo
());
userJson
.
addProperty
(
"lastName"
,
userLight
.
getLastName
());
userJson
.
addProperty
(
"firstName"
,
userLight
.
getFirstName
());
if
(
userLight
.
getDateOfBirth
()
==
null
)
{
userJson
.
addProperty
(
"dateOfBirth"
,
(
String
)
null
);
}
else
{
userJson
.
addProperty
(
"dateOfBirth"
,
new
SimpleDateFormat
(
"dd-MM-yyyy"
).
format
(
userLight
.
getDateOfBirth
()));
}
userJson
.
addProperty
(
"avatarId"
,
userLight
.
getAvatarId
());
userJson
.
addProperty
(
"playedGames"
,
userLight
.
getPlayedGames
());
userJson
.
addProperty
(
"wonGames"
,
userLight
.
getWonGames
());
userJson
.
addProperty
(
"password"
,
userHeavy
.
getPassword
());
userJson
.
addProperty
(
"serverAddress"
,
userHeavy
.
getServerAddress
());
userJson
.
addProperty
(
"serverPort"
,
userHeavy
.
getServerPort
());
userFile
.
getParentFile
().
mkdirs
();
FileWriter
fw
=
new
FileWriter
(
userFilePath
);
fw
.
write
(
userJson
.
toString
());
fw
.
close
();
}
@Override
public
void
selectGames
(
GameLight
g
)
{
}
@Override
public
void
acceptanceAcquired
(
UUID
u_id
,
Boolean
validation
)
{
}
@Override
public
Stage
newGame
(
UserLight
ul
,
Boolean
spectatorsOk
,
Boolean
chatOk
,
Boolean
creatorPlayWhite
,
int
limitMove
,
Stage
stageFx
)
{
GameLight
gameCreated
=
new
GameLight
(
UUID
.
randomUUID
(),
ul
,
null
,
GameStatus
.
PENDING
,
spectatorsOk
,
chatOk
,
creatorPlayWhite
,
limitMove
);
dataCoreClient
.
getDataToGame
().
getGameScreen
(
gameCreated
,
stageFx
);
return
stageFx
;
}
@Override
public
void
updatedProfile
(
UserLight
profile
)
{
}
@Override
public
void
requestToDataToSpecialGame
(
GameLight
game
,
UserLight
user
,
Stage
stageFx
)
{
}
@Override
public
void
sendServerParams
(
String
ip
,
int
port
)
{
}
@Override
public
ArrayList
<
GameLight
>
displaySavedGames
(
UUID
id
)
{
return
null
;
}
@Override
public
GameHeavy
getSavedGame
(
UUID
id
)
{
return
null
;
}
@Override
public
void
sendUserInfo
(
String
pseudo
,
String
lastName
,
String
firstName
,
Date
dateOfBirth
,
int
avatarId
,
String
password
)
throws
Exception
{
if
(
lastName
==
null
||
firstName
==
null
||
password
==
null
)
{
throw
new
Exception
(
"One or more required field is empty"
);
}
UUID
id
=
UUID
.
randomUUID
();
createUser
(
new
UserLight
(
id
,
pseudo
,
lastName
,
firstName
,
dateOfBirth
,
avatarId
,
0
,
0
),
new
UserHeavy
(
id
,
pseudo
,
password
,
null
,
null
,
null
));
}
@Override
public
void
downloadUserProfile
(
String
filePath
)
{
}
@Override
public
void
updateProfile
(