|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:45:45
|
Revision: 14753
http://crossfire.svn.sourceforge.net/crossfire/?rev=14753&view=rev
Author: akirschbaum
Date: 2011-06-30 20:45:38 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Rewrite synchronization on CfMap to cause atomic updates during map2 protocol message parsing.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/gui/JXCWindowRenderer.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/map/AbstractGUIMap.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/main/JXClient.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/CfMapAnimations.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireUpdateMapListener.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/gui/JXCWindowRenderer.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/gui/JXCWindowRenderer.java 2011-06-30 20:17:21 UTC (rev 14752)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/gui/JXCWindowRenderer.java 2011-06-30 20:45:38 UTC (rev 14753)
@@ -124,13 +124,6 @@
private final MouseTracker mouseTracker;
/**
- * The semaphore used to synchronize map model updates and map view
- * redraws.
- */
- @NotNull
- private final Object redrawSemaphore;
-
- /**
* The {@link CrossfireServerConnection} to monitor.
*/
@NotNull
@@ -341,15 +334,12 @@
/**
* Creates a new instance.
* @param mouseTracker the mouse tracker instance
- * @param redrawSemaphore the semaphore used to synchronized map model
- * updates and map view redraws
* @param crossfireServerConnection the server connection to monitor
* @param debugScreen the writer to write screen debug to or
* <code>null</code>
*/
- public JXCWindowRenderer(@NotNull final MouseTracker mouseTracker, @NotNull final Object redrawSemaphore, @NotNull final CrossfireServerConnection crossfireServerConnection, @Nullable final Writer debugScreen) {
+ public JXCWindowRenderer(@NotNull final MouseTracker mouseTracker, @NotNull final CrossfireServerConnection crossfireServerConnection, @Nullable final Writer debugScreen) {
this.mouseTracker = mouseTracker;
- this.redrawSemaphore = redrawSemaphore;
this.crossfireServerConnection = crossfireServerConnection;
this.debugScreen = debugScreen;
graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
@@ -641,9 +631,7 @@
* @param g the graphics instance to paint to
*/
public void redraw(@NotNull final Graphics g) {
- synchronized (redrawSemaphore) {
- layeredPane.paint(g);
- }
+ layeredPane.paint(g);
}
/**
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/map/AbstractGUIMap.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/map/AbstractGUIMap.java 2011-06-30 20:17:21 UTC (rev 14752)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/map/AbstractGUIMap.java 2011-06-30 20:45:38 UTC (rev 14753)
@@ -201,27 +201,24 @@
@Override
public void mapChanged(@NotNull final CfMap map, @NotNull final Set<CfMapSquare> changedSquares) {
- assert !Thread.holdsLock(map);
+ assert Thread.holdsLock(map);
synchronized (bufferedImageSync) {
- //noinspection SynchronizationOnLocalVariableOrMethodParameter,NestedSynchronizedStatement
- synchronized (map) {
- final int x0 = map.getOffsetX();
- final int y0 = map.getOffsetY();
- final Graphics2D g = createBufferGraphics();
- try {
- for (final CfMapSquare mapSquare : changedSquares) {
- final int x = mapSquare.getX()+x0;
- if (displayMinX <= x && x < displayMaxX) {
- final int y = mapSquare.getY()+y0;
- if (displayMinY <= y && y < displayMaxY) {
- redrawSquare(g, mapSquare, map, x, y);
- }
+ final int x0 = map.getOffsetX();
+ final int y0 = map.getOffsetY();
+ final Graphics2D g = createBufferGraphics();
+ try {
+ for (final CfMapSquare mapSquare : changedSquares) {
+ final int x = mapSquare.getX()+x0;
+ if (displayMinX <= x && x < displayMaxX) {
+ final int y = mapSquare.getY()+y0;
+ if (displayMinY <= y && y < displayMaxY) {
+ redrawSquare(g, mapSquare, map, x, y);
}
}
- markPlayer(g, 0, 0);
- } finally {
- g.dispose();
}
+ markPlayer(g, 0, 0);
+ } finally {
+ g.dispose();
}
}
setChanged();
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/main/JXClient.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/main/JXClient.java 2011-06-30 20:17:21 UTC (rev 14752)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/main/JXClient.java 2011-06-30 20:45:38 UTC (rev 14753)
@@ -164,8 +164,7 @@
final OptionManager optionManager = new OptionManager(settings);
final MetaserverModel metaserverModel = new MetaserverModel();
final CharacterModel characterModel = new CharacterModel();
- final Object semaphoreRedraw = new Object();
- final CrossfireServerConnection server = new DefaultCrossfireServerConnection(semaphoreRedraw, debugProtocolOutputStreamWriter == null ? null : new DebugWriter(debugProtocolOutputStreamWriter), "JXClient "+buildNumber);
+ final CrossfireServerConnection server = new DefaultCrossfireServerConnection(debugProtocolOutputStreamWriter == null ? null : new DebugWriter(debugProtocolOutputStreamWriter), "JXClient "+buildNumber);
server.start();
try {
final GuiStateManager guiStateManager = new GuiStateManager(server);
@@ -189,7 +188,7 @@
}
final MouseTracker mouseTracker = new MouseTracker(options.isDebugGui());
- final JXCWindowRenderer windowRenderer = new JXCWindowRenderer(mouseTracker, semaphoreRedraw, server, debugScreenOutputStreamWriter);
+ final JXCWindowRenderer windowRenderer = new JXCWindowRenderer(mouseTracker, server, debugScreenOutputStreamWriter);
new MusicWatcher(server, soundManager);
new SoundWatcher(server, soundManager);
new StatsWatcher(stats, windowRenderer, server, soundManager);
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/CfMapAnimations.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/CfMapAnimations.java 2011-06-30 20:17:21 UTC (rev 14752)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/CfMapAnimations.java 2011-06-30 20:45:38 UTC (rev 14753)
@@ -219,11 +219,12 @@
pendingTickUpdates.clear();
animationStatesToUpdate = new ArrayList<AnimationState>(animationStates.keySet());
}
- mapUpdaterState.mapBegin();
- for (final AnimationState animationState : animationStatesToUpdate) {
- animationState.updateTickNo(tickNo);
+ synchronized (mapUpdaterState.mapBegin()) {
+ for (final AnimationState animationState : animationStatesToUpdate) {
+ animationState.updateTickNo(tickNo);
+ }
+ mapUpdaterState.mapEnd(false);
}
- mapUpdaterState.mapEnd(false);
}
/**
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 20:17:21 UTC (rev 14752)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 20:45:38 UTC (rev 14753)
@@ -212,8 +212,10 @@
/**
* {@inheritDoc}
*/
+ @NotNull
@Override
- public void mapBegin() {
+ public Object mapBegin() {
+ return map;
}
/**
@@ -221,13 +223,11 @@
*/
@Override
public void mapClear(final int x, final int y) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
visibleAnimations.remove(x, y);
outOfViewMultiFaces.clear();
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- map.clearSquare(x, y);
- }
+ map.clearSquare(x, y);
}
}
@@ -246,24 +246,22 @@
* @param clearAnimation whether an animation should be cleared
*/
public void mapFace(@NotNull final Location location, final int faceNum, final boolean clearAnimation) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- if (clearAnimation) {
- visibleAnimations.remove(location);
+ if (clearAnimation) {
+ visibleAnimations.remove(location);
+ }
+ final Face face = facesManager.getFace2(faceNum);
+ final int x = location.getX();
+ final int y = location.getY();
+ if (x >= mapWidth || y >= mapHeight) {
+ if (face == null) {
+ outOfViewMultiFaces.remove(location);
+ } else if (face.getTileWidth() > 1 || face.getTileHeight() > 1) {
+ outOfViewMultiFaces.add(location);
}
- final Face face = facesManager.getFace2(faceNum);
- final int x = location.getX();
- final int y = location.getY();
- if (x >= mapWidth || y >= mapHeight) {
- if (face == null) {
- outOfViewMultiFaces.remove(location);
- } else if (face.getTileWidth() > 1 || face.getTileHeight() > 1) {
- outOfViewMultiFaces.add(location);
- }
- }
- map.setFace(x, y, location.getLayer(), face);
}
+ map.setFace(x, y, location.getLayer(), face);
}
}
@@ -272,6 +270,7 @@
*/
@Override
public void mapAnimation(@NotNull final Location location, final int animationNum, final int animationType) {
+ assert Thread.holdsLock(map);
final Animation animation = animations.get(animationNum);
if (animation == null) {
System.err.println("unknown animation id "+animationNum+", ignoring");
@@ -279,11 +278,8 @@
}
synchronized (sync) {
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- map.setFace(location.getX(), location.getY(), location.getLayer(), null);
- visibleAnimations.add(location, animation, animationType);
- }
+ map.setFace(location.getX(), location.getY(), location.getLayer(), null);
+ visibleAnimations.add(location, animation, animationType);
}
}
@@ -292,6 +288,7 @@
*/
@Override
public void mapAnimationSpeed(@NotNull final Location location, final int animationSpeed) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
visibleAnimations.updateSpeed(location, animationSpeed);
}
@@ -302,11 +299,9 @@
*/
@Override
public void mapSmooth(@NotNull final Location location, final int smooth) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- map.setSmooth(location.getX(), location.getY(), location.getLayer(), smooth);
- }
+ map.setSmooth(location.getX(), location.getY(), location.getLayer(), smooth);
}
}
@@ -315,11 +310,9 @@
*/
@Override
public void mapDarkness(final int x, final int y, final int darkness) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- map.setDarkness(x, y, darkness);
- }
+ map.setDarkness(x, y, darkness);
}
}
@@ -328,11 +321,9 @@
*/
@Override
public void magicMap(final int x, final int y, final byte[][] data) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- map.setMagicMap(x, y, data);
- }
+ map.setMagicMap(x, y, data);
}
}
@@ -343,14 +334,11 @@
* present
*/
public void mapEnd(final boolean alwaysProcess) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
- final Set<CfMapSquare> squares;
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- squares = map.getDirtyMapSquares();
- if (!alwaysProcess && squares.isEmpty()) {
- return;
- }
+ final Set<CfMapSquare> squares = map.getDirtyMapSquares();
+ if (!alwaysProcess && squares.isEmpty()) {
+ return;
}
for (final MapListener listener : mapListeners.getListeners()) {
@@ -364,29 +352,23 @@
*/
@Override
public void mapScroll(final int dx, final int dy) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
- mapBegin();
+ for (final Location location : outOfViewMultiFaces) {
+ visibleAnimations.remove(location);
+ map.setFace(location.getX(), location.getY(), location.getLayer(), null);
+ }
+ outOfViewMultiFaces.clear();
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- for (final Location location : outOfViewMultiFaces) {
- visibleAnimations.remove(location);
- map.setFace(location.getX(), location.getY(), location.getLayer(), null);
- }
- outOfViewMultiFaces.clear();
-
- if (map.processMapScroll(dx, dy, mapWidth, mapHeight)) {
- visibleAnimations.clear();
- } else {
- visibleAnimations.scroll(dx, dy);
- }
+ if (map.processMapScroll(dx, dy, mapWidth, mapHeight)) {
+ visibleAnimations.clear();
+ } else {
+ visibleAnimations.scroll(dx, dy);
}
for (final MapScrollListener mapscrollListener : mapScrollListeners.getListeners()) {
mapscrollListener.mapScrolled(dx, dy);
}
-
- mapEnd(false);
}
}
@@ -403,15 +385,9 @@
*/
@Override
public void faceUpdated(@NotNull final Face face) {
+ assert Thread.holdsLock(map);
synchronized (sync) {
- mapBegin();
-
- //noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
- synchronized (map) {
- map.updateFace(face.getFaceNum(), mapWidth, mapHeight);
- }
-
- mapEnd(false);
+ map.updateFace(face.getFaceNum(), mapWidth, mapHeight);
}
}
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireUpdateMapListener.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireUpdateMapListener.java 2011-06-30 20:17:21 UTC (rev 14752)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireUpdateMapListener.java 2011-06-30 20:45:38 UTC (rev 14753)
@@ -56,8 +56,11 @@
/**
* Parsing of a "map2" command has been started.
+ * @return the synchronization object which must be <code>synchronized</code>
+ * while calling any other function (except <code>newMap()</code>)
*/
- void mapBegin();
+ @NotNull
+ Object mapBegin();
/**
* Part of "map2" parsing: clear a cell.
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java 2011-06-30 20:17:21 UTC (rev 14752)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java 2011-06-30 20:45:38 UTC (rev 14753)
@@ -667,13 +667,6 @@
};
/**
- * The semaphore used to synchronized map model updates and map view
- * redraws.
- */
- @NotNull
- private final Object redrawSemaphore;
-
- /**
* The version information to send when connecting to the server.
*/
@NotNull
@@ -743,17 +736,14 @@
/**
* Creates a new instance.
- * @param redrawSemaphore the semaphore used to synchronized map model
- * updates and map view redraws
* @param debugProtocol tf non-<code>null</code>, write all protocol
* commands to this writer
* @param version the version information to send to the server when
* connecting
* @throws IOException if an internal error occurs
*/
- public DefaultCrossfireServerConnection(@NotNull final Object redrawSemaphore, @Nullable final DebugWriter debugProtocol, @NotNull final String version) throws IOException {
+ public DefaultCrossfireServerConnection(@Nullable final DebugWriter debugProtocol, @NotNull final String version) throws IOException {
super(debugProtocol);
- this.redrawSemaphore = redrawSemaphore;
this.version = version;
byteBuffer.order(ByteOrder.BIG_ENDIAN);
this.debugProtocol = debugProtocol;
@@ -1964,9 +1954,8 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" clear");
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapClear(x, y);
- }
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapClear(x, y);
}
/**
@@ -1985,9 +1974,8 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" darkness="+darkness);
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapDarkness(x, y, darkness);
- }
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapDarkness(x, y, darkness);
}
/**
@@ -2009,16 +1997,14 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+location+" face="+face);
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapFace(location, face);
- }
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapFace(location, face);
} else {
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+location+" anim="+(face&Map2.ANIM_MASK)+" type="+((face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK));
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapAnimation(location, face&Map2.ANIM_MASK, (face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK);
- }
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapAnimation(location, face&Map2.ANIM_MASK, (face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK);
}
if (len == 3) {
cmdMap2CoordinateLayer3(packet, location, face);
@@ -2050,17 +2036,15 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+location+" smooth="+smooth);
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapSmooth(location, smooth);
- }
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapSmooth(location, smooth);
} else {
final int animSpeed = getInt1(packet);
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+location+" anim_speed="+animSpeed);
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapAnimationSpeed(location, animSpeed);
- }
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapAnimationSpeed(location, animSpeed);
}
}
@@ -2081,17 +2065,15 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+location+" anim_speed="+animSpeed);
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapAnimationSpeed(location, animSpeed);
- }
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapAnimationSpeed(location, animSpeed);
final int smooth = getInt1(packet);
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+location+" smooth="+smooth);
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapSmooth(location, smooth);
- }
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapSmooth(location, smooth);
}
/**
@@ -2896,19 +2878,18 @@
throw new UnknownCommandException("invalid magicmap command");
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapBegin();
- }
final byte[][] data = new byte[height][width];
for (int y = 0; y < height; y++) {
packet.get(data[y]);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.magicMap(-px+(currentMapWidth-1)/2, -py+(currentMapHeight-1)/2, data);
+ synchronized (crossfireUpdateMapListener.mapBegin()) {
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.magicMap(-px+(currentMapWidth-1)/2, -py+(currentMapHeight-1)/2, data);
+ assert crossfireUpdateMapListener != null;
+ crossfireUpdateMapListener.mapEnd();
+ }
}
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapEnd();
- }
for (final CrossfireMagicmapListener listener : magicmapListeners.getListeners()) {
listener.commandMagicmapReceived();
}
@@ -2922,47 +2903,45 @@
*/
private void processMap2(@NotNull final ByteBuffer packet) throws UnknownCommandException {
final int args = packet.position();
- synchronized (redrawSemaphore) {
- if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapBegin();
- }
- if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 begin");
- }
- while (packet.hasRemaining()) {
- final int coord = getInt2(packet);
- final int x = ((coord>>10)&0x3F)-Map2.COORD_OFFSET;
- final int y = ((coord>>4)&0x3F)-Map2.COORD_OFFSET;
- final int coordType = coord&0xF;
+ if (debugProtocol != null) {
+ debugProtocol.debugProtocolWrite("recv map2 begin");
+ }
+ if (crossfireUpdateMapListener != null) {
+ //noinspection NestedSynchronizedStatement
+ synchronized (crossfireUpdateMapListener.mapBegin()) {
+ while (packet.hasRemaining()) {
+ final int coord = getInt2(packet);
+ final int x = ((coord>>10)&0x3F)-Map2.COORD_OFFSET;
+ final int y = ((coord>>4)&0x3F)-Map2.COORD_OFFSET;
+ final int coordType = coord&0xF;
- switch (coordType) {
- case Map2.TYPE_COORDINATE:
- cmdMap2Coordinate(packet, x, y);
- break;
+ switch (coordType) {
+ case Map2.TYPE_COORDINATE:
+ cmdMap2Coordinate(packet, x, y);
+ break;
- case Map2.TYPE_SCROLL:
- if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" scroll");
- }
- if (crossfireUpdateMapListener != null) {
+ case Map2.TYPE_SCROLL:
+ if (debugProtocol != null) {
+ debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" scroll");
+ }
+ assert crossfireUpdateMapListener != null;
crossfireUpdateMapListener.mapScroll(x, y);
- }
- break;
+ break;
- default:
- if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" <invalid>");
+ default:
+ if (debugProtocol != null) {
+ debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" <invalid>");
+ }
+ throw new UnknownCommandException("map2 command contains unexpected coordinate type "+coordType);
}
- throw new UnknownCommandException("map2 command contains unexpected coordinate type "+coordType);
}
- }
- if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 end");
- }
- if (crossfireUpdateMapListener != null) {
+ assert crossfireUpdateMapListener != null;
crossfireUpdateMapListener.mapEnd();
}
}
+ if (debugProtocol != null) {
+ debugProtocol.debugProtocolWrite("recv map2 end");
+ }
notifyPacketWatcherListenersShortArray(packet, args);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|