Commit 69b86eff authored by helene ortiz's avatar helene ortiz
Browse files

Add log messages in token state change.

parent 8e3845b7
......@@ -7,6 +7,7 @@
* Fix bug: delete of an unknown command box in the launch pad did not delete it on server side.
* Keep arrow down and up for combo boxes, add CTRL key to move down/up among command boxes.
* Fix bug: in settings commandbox, combos were not cleared before refresh + (root) directory was not correctly initialised.
* Add log messages in token state change.
4.0.60 26/08/2020
------
......
......@@ -145,10 +145,12 @@ public class TokenManager implements TokenEventListener {
boolean ownedByMe = SessionManager.getInstance(CommandZoneWrapper.SERVER_ID).getClientId() == event.getOwnerClientID();
log("2. getTokenStateMessage = " + getTokenStateMessage + " getClientID " + SessionManager.getInstance(CommandZoneWrapper.SERVER_ID).getClientId() + " OwnerID " + event.getOwnerClientID() + " ownedByMe " + ownedByMe);
log(" TOKEN STATE IS : " + tokenState);
if (RemoteControlManager.getInstance().isDisabled() && ConfigManager.getInstance().isRemoteClient()) {
tokenStateChanged = !tokenState.isDisabled();
tokenState.setDisabled();
tokenState.setOwner(null);
} else if (getTokenStateMessage && event.getState() == TokenServerState.FREE) {
if (ownedByMe) {
// that changes nothing, as long as token is free, client keeps it but it is available on server side
......@@ -157,20 +159,24 @@ public class TokenManager implements TokenEventListener {
} else {
tokenStateChanged = !tokenState.isFree();
tokenState.setFree();
tokenState.setOwner(null);
chatMessage = ConfigManager.getInstance().getString("tokenIsFreeMessage");
}
} else if (getTokenStateMessage && event.getState() == TokenServerState.OWNED) {
if (ownedByMe) {
tokenStateChanged = !tokenState.isOwnedByMe();
tokenState.setOwnedByMe();
tokenState.setOwner(event.getUser());
chatMessage = ConfigManager.getInstance().getString("tokenIsOwnedByMe");
} else {
tokenStateChanged = !tokenState.isOwnedByOther();
tokenState.setOwnedByOther();
tokenState.setOwner(event.getUser());
chatMessage = event.getUser() + " " + ConfigManager.getInstance().getString("tokenIsOwnedByOtherMessage");
}
}
log(" AFTER BIG IF : " + tokenState + " tokenStateChanged " + tokenStateChanged);
if (tokenStateChanged || getTokenStateMessage) {
// Manage enability of menu items
MainWindowPeer.getInstance().manageMenuItemsEnability();
......@@ -254,4 +260,8 @@ public class TokenManager implements TokenEventListener {
}
}
}
public Object getOwner() {
return tokenState.getOwner();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment