debugging
This commit is contained in:
parent
092e58b11d
commit
a58fd656b5
1 changed files with 7 additions and 2 deletions
|
@ -29,6 +29,8 @@ public class ProfileSettings implements Response{
|
|||
public void exec(Matcher matcher, Context context, HttpReader reader, HttpWriter writer) throws Exception {
|
||||
JsonMap json = reader.readJson();
|
||||
|
||||
System.out.println("received "+json);
|
||||
|
||||
String pseudo = json.get("pseudo");
|
||||
String email = json.get("email");
|
||||
String firstname = json.get("firstname");
|
||||
|
@ -36,21 +38,24 @@ public class ProfileSettings implements Response{
|
|||
Player player = repo.getPlayer(context.<PeerAtUser>getUser().getId());
|
||||
|
||||
if(!player.getPseudo().equals(pseudo)){
|
||||
System.out.println("custom pseudp");
|
||||
if(!repo.updatePseudo(context.<PeerAtUser>getUser().getId(), player, pseudo)){
|
||||
context.response(400);
|
||||
return;
|
||||
}
|
||||
System.out.println("pseudo changed");
|
||||
player.setPseudo(pseudo);
|
||||
}
|
||||
|
||||
if(!player.getEmail().equals(email)){
|
||||
|
||||
System.out.println("another email");
|
||||
}
|
||||
|
||||
if((!player.getFirstname().equals(firstname)) || (!player.getLastname().equals(lastname))){
|
||||
repo.updateProfile(context.<PeerAtUser>getUser().getId(), player, lastname, firstname);
|
||||
}
|
||||
|
||||
|
||||
System.out.println("200");
|
||||
context.response(200);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue