mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Merge branch 'network-play-fixes' into 'master'
Network play fixes See merge request core-developers/forge!2582
This commit is contained in:
@@ -100,17 +100,21 @@ public class TrackableTypes {
|
|||||||
if (newCollection != null) {
|
if (newCollection != null) {
|
||||||
//swap in objects in old collection for objects in new collection
|
//swap in objects in old collection for objects in new collection
|
||||||
for (int i = 0; i < newCollection.size(); i++) {
|
for (int i = 0; i < newCollection.size(); i++) {
|
||||||
T newObj = newCollection.get(i);
|
try {
|
||||||
if (newObj != null) {
|
T newObj = newCollection.get(i);
|
||||||
T existingObj = from.getTracker().getObj(itemType, newObj.getId());
|
if (newObj != null) {
|
||||||
if (existingObj != null) { //if object exists already, update its changed properties
|
T existingObj = from.getTracker().getObj(itemType, newObj.getId());
|
||||||
existingObj.copyChangedProps(newObj);
|
if (existingObj != null) { //if object exists already, update its changed properties
|
||||||
newCollection.remove(i);
|
existingObj.copyChangedProps(newObj);
|
||||||
newCollection.add(i, existingObj);
|
newCollection.remove(i);
|
||||||
}
|
newCollection.add(i, existingObj);
|
||||||
else { //if object is new, cache in object lookup
|
}
|
||||||
from.getTracker().putObj(itemType, newObj.getId(), newObj);
|
else { //if object is new, cache in object lookup
|
||||||
|
from.getTracker().putObj(itemType, newObj.getId(), newObj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
System.err.println("got an IndexOutOfBoundsException, trying to continue ...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public enum ProtocolMethod {
|
|||||||
clearSelectables (Mode.SERVER),
|
clearSelectables (Mode.SERVER),
|
||||||
refreshField (Mode.SERVER),
|
refreshField (Mode.SERVER),
|
||||||
// TODO case "setPlayerAvatar":
|
// TODO case "setPlayerAvatar":
|
||||||
openZones (Mode.SERVER, PlayerZoneUpdates.class, Collection/*ZoneType*/.class, Map/*PlayerView,Object*/.class),
|
openZones (Mode.SERVER, PlayerZoneUpdates.class, PlayerView.class, Collection/*ZoneType*/.class, Map/*PlayerView,Object*/.class),
|
||||||
restoreOldZones (Mode.SERVER, Void.TYPE, PlayerView.class, PlayerZoneUpdates.class),
|
restoreOldZones (Mode.SERVER, Void.TYPE, PlayerView.class, PlayerZoneUpdates.class),
|
||||||
isUiSetToSkipPhase (Mode.SERVER, Boolean.TYPE, PlayerView.class, PhaseType.class),
|
isUiSetToSkipPhase (Mode.SERVER, Boolean.TYPE, PlayerView.class, PhaseType.class),
|
||||||
setRememberedActions(Mode.SERVER, Void.TYPE),
|
setRememberedActions(Mode.SERVER, Void.TYPE),
|
||||||
|
|||||||
Reference in New Issue
Block a user