backport some security changes
This commit is contained in:
@@ -81,8 +81,11 @@ public class SecurityCache implements ISecurityGrid {
|
||||
private void updateSecurityKey() {
|
||||
final long lastCode = this.securityKey;
|
||||
|
||||
int newOwner = -1;
|
||||
if (this.securityProvider.size() == 1) {
|
||||
this.securityKey = this.securityProvider.get(0).getSecurityKey();
|
||||
ISecurityProvider securityProvider = this.securityProvider.get(0);
|
||||
newOwner = securityProvider.getOwner();
|
||||
} else {
|
||||
this.securityKey = -1;
|
||||
}
|
||||
@@ -91,6 +94,9 @@ public class SecurityCache implements ISecurityGrid {
|
||||
this.getGrid().postEvent(new MENetworkSecurityChange());
|
||||
for (final IGridNode n : this.getGrid().getNodes()) {
|
||||
((GridNode) n).setLastSecurityKey(this.securityKey);
|
||||
if (n.getPlayerID() != newOwner) {
|
||||
n.setPlayerID(newOwner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user