forked from External/mage
Now players may choose avatars in Preferences Dialog.
This commit is contained in:
parent
eaf87ae950
commit
9f868daf3e
9 changed files with 1028 additions and 176 deletions
|
|
@ -151,7 +151,7 @@ public class Session {
|
|||
this.sessionId = callbackClient.getSessionId();
|
||||
boolean registerResult = false;
|
||||
if (connection.getPassword() == null) {
|
||||
UserDataView userDataView = new UserDataView(0);
|
||||
UserDataView userDataView = new UserDataView(connection.getAvatarId());
|
||||
// for backward compatibility. don't remove twice call - first one does nothing but for version checking
|
||||
registerResult = server.registerClient(connection.getUsername(), sessionId, client.getVersion());
|
||||
server.setUserData(connection.getUsername(), sessionId, userDataView);
|
||||
|
|
@ -931,6 +931,21 @@ public class Session {
|
|||
return connection.getUsername();
|
||||
}
|
||||
|
||||
public boolean updateAvatar(int avatarId) {
|
||||
try {
|
||||
if (isConnected()) {
|
||||
UserDataView userDataView = new UserDataView(avatarId);
|
||||
server.setUserData(connection.getUsername(), sessionId, userDataView);
|
||||
}
|
||||
return true;
|
||||
} catch (MageException ex) {
|
||||
handleMageException(ex);
|
||||
} catch (Throwable t) {
|
||||
handleThrowable(t);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class MageAuthenticator extends Authenticator {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue