You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(187) |
Dec
(318) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(268) |
Feb
(231) |
Mar
(251) |
Apr
(372) |
May
(258) |
Jun
(197) |
Jul
(85) |
Aug
(175) |
Sep
(77) |
Oct
(213) |
Nov
(108) |
Dec
(53) |
| 2002 |
Jan
(38) |
Feb
(50) |
Mar
(32) |
Apr
(30) |
May
(34) |
Jun
(24) |
Jul
(42) |
Aug
(29) |
Sep
(58) |
Oct
(57) |
Nov
(73) |
Dec
(51) |
| 2003 |
Jan
(98) |
Feb
(64) |
Mar
(39) |
Apr
(38) |
May
(67) |
Jun
(39) |
Jul
(80) |
Aug
(21) |
Sep
(82) |
Oct
(85) |
Nov
(48) |
Dec
(30) |
| 2004 |
Jan
(29) |
Feb
(82) |
Mar
(43) |
Apr
(54) |
May
(60) |
Jun
(41) |
Jul
(23) |
Aug
(35) |
Sep
(55) |
Oct
(53) |
Nov
(18) |
Dec
(22) |
| 2005 |
Jan
(49) |
Feb
(28) |
Mar
(112) |
Apr
(60) |
May
(120) |
Jun
(67) |
Jul
(129) |
Aug
(67) |
Sep
(173) |
Oct
(221) |
Nov
(126) |
Dec
(198) |
| 2006 |
Jan
(172) |
Feb
(141) |
Mar
(54) |
Apr
(15) |
May
(60) |
Jun
(50) |
Jul
(79) |
Aug
(118) |
Sep
(114) |
Oct
(78) |
Nov
(56) |
Dec
(106) |
| 2007 |
Jan
(80) |
Feb
(268) |
Mar
(238) |
Apr
(222) |
May
(198) |
Jun
(178) |
Jul
(114) |
Aug
(234) |
Sep
(202) |
Oct
(141) |
Nov
(182) |
Dec
(446) |
| 2008 |
Jan
(260) |
Feb
(143) |
Mar
(210) |
Apr
(158) |
May
(342) |
Jun
(195) |
Jul
(309) |
Aug
(99) |
Sep
(154) |
Oct
(279) |
Nov
(555) |
Dec
(327) |
| 2009 |
Jan
(182) |
Feb
(289) |
Mar
(30) |
Apr
(51) |
May
(59) |
Jun
(304) |
Jul
(95) |
Aug
(50) |
Sep
(16) |
Oct
(44) |
Nov
(57) |
Dec
(27) |
| 2010 |
Jan
(59) |
Feb
(178) |
Mar
(220) |
Apr
(272) |
May
(297) |
Jun
(75) |
Jul
(104) |
Aug
(157) |
Sep
(247) |
Oct
(105) |
Nov
(100) |
Dec
(75) |
| 2011 |
Jan
(61) |
Feb
(32) |
Mar
(47) |
Apr
(79) |
May
(68) |
Jun
(247) |
Jul
(174) |
Aug
(98) |
Sep
(127) |
Oct
(198) |
Nov
(627) |
Dec
(421) |
| 2012 |
Jan
(521) |
Feb
(372) |
Mar
(489) |
Apr
(256) |
May
(143) |
Jun
(132) |
Jul
(74) |
Aug
(38) |
Sep
(42) |
Oct
(18) |
Nov
(58) |
Dec
(21) |
| 2013 |
Jan
(10) |
Feb
(10) |
Mar
(68) |
Apr
(50) |
May
(33) |
Jun
(17) |
Jul
(100) |
Aug
(111) |
Sep
(107) |
Oct
(21) |
Nov
(63) |
Dec
(53) |
| 2014 |
Jan
(29) |
Feb
(20) |
Mar
(39) |
Apr
(86) |
May
(122) |
Jun
(87) |
Jul
(7) |
Aug
(35) |
Sep
(40) |
Oct
(39) |
Nov
(21) |
Dec
(18) |
| 2015 |
Jan
(6) |
Feb
(56) |
Mar
(67) |
Apr
(24) |
May
(86) |
Jun
(5) |
Jul
(2) |
Aug
(17) |
Sep
(2) |
Oct
(14) |
Nov
(80) |
Dec
(97) |
| 2016 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
(2) |
May
(45) |
Jun
(9) |
Jul
(5) |
Aug
(21) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(2) |
| 2017 |
Jan
(9) |
Feb
|
Mar
(7) |
Apr
|
May
(24) |
Jun
(35) |
Jul
(60) |
Aug
(44) |
Sep
(22) |
Oct
(1) |
Nov
(2) |
Dec
(2) |
| 2018 |
Jan
(21) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
(11) |
Jun
(2) |
Jul
(1) |
Aug
(5) |
Sep
(11) |
Oct
(15) |
Nov
(4) |
Dec
(55) |
| 2019 |
Jan
(41) |
Feb
(9) |
Mar
(23) |
Apr
(25) |
May
(55) |
Jun
(82) |
Jul
(19) |
Aug
(81) |
Sep
(15) |
Oct
(11) |
Nov
(12) |
Dec
(37) |
| 2020 |
Jan
(11) |
Feb
(34) |
Mar
(77) |
Apr
(24) |
May
(6) |
Jun
(14) |
Jul
(4) |
Aug
(76) |
Sep
(141) |
Oct
(62) |
Nov
(46) |
Dec
(116) |
| 2021 |
Jan
(188) |
Feb
(134) |
Mar
(38) |
Apr
(55) |
May
(12) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(1) |
2
|
3
|
4
(1) |
|
5
(6) |
6
(2) |
7
(8) |
8
|
9
(11) |
10
|
11
(1) |
|
12
(25) |
13
(3) |
14
(17) |
15
(50) |
16
(7) |
17
(4) |
18
(17) |
|
19
(8) |
20
|
21
(9) |
22
(6) |
23
(8) |
24
|
25
(11) |
|
26
(22) |
27
(1) |
28
(8) |
29
(3) |
30
(18) |
|
|
|
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.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:17:28
|
Revision: 14752
http://crossfire.svn.sourceforge.net/crossfire/?rev=14752&view=rev
Author: akirschbaum
Date: 2011-06-30 20:17:21 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Whitespace changes.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUILabel.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUIMultiLineLabel.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUIOneLineLabel.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/log/Fonts.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/shortcuts/ShortcutSpell.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/timeouts/Timeouts.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/util/EventListenerList2.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/window/KeybindingsManager.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUILabel.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUILabel.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUILabel.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -53,8 +53,7 @@
* @param tooltipManager the tooltip manager to update
* @param elementListener the element listener to notify
* @param name the name of this element
- * @param picture the background image; <code>null</code> for no
- * background
+ * @param picture the background image; <code>null</code> for no background
* @param text the text
* @param textFont the font for rendering the label text
* @param textColor the font color
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUIMultiLineLabel.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUIMultiLineLabel.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUIMultiLineLabel.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -63,8 +63,7 @@
* @param tooltipManager the tooltip manager to update
* @param elementListener the element listener to notify
* @param name the name of this element
- * @param picture the background image; <code>null</code> for no
- * background
+ * @param picture the background image; <code>null</code> for no background
* @param font the font for rendering the label text
* @param color the font color
* @param backgroundColor the background color
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUIOneLineLabel.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUIOneLineLabel.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/label/GUIOneLineLabel.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -49,8 +49,7 @@
* @param tooltipManager the tooltip manager to update
* @param elementListener the window renderer to notify
* @param name the name of this element
- * @param picture the background image; <code>null</code> for no
- * background
+ * @param picture the background image; <code>null</code> for no background
* @param font the font for rendering the label text
* @param color the font color
* @param backgroundColor the background color
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/log/Fonts.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/log/Fonts.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/log/Fonts.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -72,8 +72,8 @@
}
/**
- * Returns the font to use for {@link FontID#PRINT}, {@link FontID#HAND}, and
- * {@link FontID#STRANGE} text.
+ * Returns the font to use for {@link FontID#PRINT}, {@link FontID#HAND},
+ * and {@link FontID#STRANGE} text.
* @return the font
*/
@NotNull
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/shortcuts/ShortcutSpell.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/shortcuts/ShortcutSpell.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/shortcuts/ShortcutSpell.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -98,8 +98,7 @@
/**
* Returns whether the spell should be "cast" or "invoked".
- * @return <code>true</code> for "cast", or <code>false</code> for
- * "invoke"
+ * @return <code>true</code> for "cast", or <code>false</code> for "invoke"
*/
public boolean isCast() {
return command == CAST;
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -140,8 +140,8 @@
};
/**
- * The {@link CrossfireAccountListener} for detecting character change
- * and clear spell information.
+ * The {@link CrossfireAccountListener} for detecting character change and
+ * clear spell information.
*/
@NotNull
private final CrossfireAccountListener crossfireAccountListener = new CrossfireAccountListener() {
@@ -175,6 +175,7 @@
public void selectCharacter(@NotNull final String accountName, @NotNull final String characterName) {
spells.clear();
}
+
};
/**
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/timeouts/Timeouts.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/timeouts/Timeouts.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/timeouts/Timeouts.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -104,8 +104,8 @@
}
/**
- * Sets the timeout value for a given event. If the event is not yet pending,
- * it is added.
+ * Sets the timeout value for a given event. If the event is not yet
+ * pending, it is added.
* @param timeout the new timeout in milliseconds
* @param timeoutEvent the timeout event to execute
*/
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/util/EventListenerList2.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/util/EventListenerList2.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/util/EventListenerList2.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -57,7 +57,7 @@
//here since class literals do not work for parametrized types.
@SuppressWarnings("unchecked")
public EventListenerList2(@NotNull final Class<? extends EventListener> t) {
- this.t = (Class<T>) t;
+ this.t = (Class<T>)t;
}
/**
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/window/KeybindingsManager.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/window/KeybindingsManager.java 2011-06-30 20:13:57 UTC (rev 14751)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/window/KeybindingsManager.java 2011-06-30 20:17:21 UTC (rev 14752)
@@ -304,7 +304,8 @@
}
/**
- * Searches bindings having a command text starting with the specified value.
+ * Searches bindings having a command text starting with the specified
+ * value.
* @param commandStart the start of the text to search for
* @return the matching bindings
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:14:03
|
Revision: 14751
http://crossfire.svn.sourceforge.net/crossfire/?rev=14751&view=rev
Author: akirschbaum
Date: 2011-06-30 20:13:57 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Fix HTML issue.
Modified Paths:
--------------
jxclient/trunk/doc/skin.html
Modified: jxclient/trunk/doc/skin.html
===================================================================
--- jxclient/trunk/doc/skin.html 2011-06-30 20:12:16 UTC (rev 14750)
+++ jxclient/trunk/doc/skin.html 2011-06-30 20:13:57 UTC (rev 14751)
@@ -235,7 +235,7 @@
receives the focus.
</li>
<li>In <code>account_login.skin</code>, the
- <a href="#text"><code>text</code>, <code>command_text</code>, or <code>query_text</code></code>
+ <a href="#text"><code>text</code>, <code>command_text</code>, or <code>query_text</code>
</a> with name "account_password" is cleared and receives the
focus is an incorrect password is entered.
</li>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:12:22
|
Revision: 14750
http://crossfire.svn.sourceforge.net/crossfire/?rev=14750&view=rev
Author: akirschbaum
Date: 2011-06-30 20:12:16 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Fix typo.
Modified Paths:
--------------
jxclient/trunk/ChangeLog
Modified: jxclient/trunk/ChangeLog
===================================================================
--- jxclient/trunk/ChangeLog 2011-06-30 20:11:34 UTC (rev 14749)
+++ jxclient/trunk/ChangeLog 2011-06-30 20:12:16 UTC (rev 14750)
@@ -23,7 +23,7 @@
* Reliably update ground view.
- * Fix map updates not ocurring reliably.
+ * Fix map updates not occurring reliably.
* Suppress map view blanking when changing maps.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:11:40
|
Revision: 14749
http://crossfire.svn.sourceforge.net/crossfire/?rev=14749&view=rev
Author: akirschbaum
Date: 2011-06-30 20:11:34 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Add missing @NotNull annotations.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java 2011-06-30 20:10:16 UTC (rev 14748)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java 2011-06-30 20:11:34 UTC (rev 14749)
@@ -152,12 +152,12 @@
}
@Override
- public void startAccountList(final String accountName) {
+ public void startAccountList(@NotNull final String accountName) {
// ignore
}
@Override
- public void addAccount(final String name, final String characterClass, final String race, final String face, final String party, final String map, final int level, final int faceNumber) {
+ public void addAccount(@NotNull final String name, @NotNull final String characterClass, @NotNull final String race, @NotNull final String face, @NotNull final String party, @NotNull final String map, final int level, final int faceNumber) {
// ignore
}
@@ -172,7 +172,7 @@
}
@Override
- public void selectCharacter(final String accountName, final String characterName) {
+ public void selectCharacter(@NotNull final String accountName, @NotNull final String characterName) {
spells.clear();
}
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:10:23
|
Revision: 14748
http://crossfire.svn.sourceforge.net/crossfire/?rev=14748&view=rev
Author: akirschbaum
Date: 2011-06-30 20:10:16 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Add final modifiers.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java 2011-06-30 20:09:12 UTC (rev 14747)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java 2011-06-30 20:10:16 UTC (rev 14748)
@@ -144,7 +144,7 @@
* and clear spell information.
*/
@NotNull
- private CrossfireAccountListener crossfireAccountListener = new CrossfireAccountListener() {
+ private final CrossfireAccountListener crossfireAccountListener = new CrossfireAccountListener() {
@Override
public void manageAccount() {
@@ -152,12 +152,12 @@
}
@Override
- public void startAccountList(String accountName) {
+ public void startAccountList(final String accountName) {
// ignore
}
@Override
- public void addAccount(String name, String characterClass, String race, String face, String party, String map, int level, int faceNumber) {
+ public void addAccount(final String name, final String characterClass, final String race, final String face, final String party, final String map, final int level, final int faceNumber) {
// ignore
}
@@ -172,7 +172,7 @@
}
@Override
- public void selectCharacter(String accountName, String characterName) {
+ public void selectCharacter(final String accountName, final String characterName) {
spells.clear();
}
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:09:19
|
Revision: 14747
http://crossfire.svn.sourceforge.net/crossfire/?rev=14747&view=rev
Author: akirschbaum
Date: 2011-06-30 20:09:12 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Add missing @Override annotations.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java 2011-06-30 20:06:15 UTC (rev 14746)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/spells/SpellsManager.java 2011-06-30 20:09:12 UTC (rev 14747)
@@ -146,26 +146,32 @@
@NotNull
private CrossfireAccountListener crossfireAccountListener = new CrossfireAccountListener() {
+ @Override
public void manageAccount() {
// ignore
}
+ @Override
public void startAccountList(String accountName) {
// ignore
}
+ @Override
public void addAccount(String name, String characterClass, String race, String face, String party, String map, int level, int faceNumber) {
// ignore
}
+ @Override
public void endAccountList() {
// ignore
}
+ @Override
public void startPlaying() {
// ignore
}
+ @Override
public void selectCharacter(String accountName, String characterName) {
spells.clear();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:06:21
|
Revision: 14746
http://crossfire.svn.sourceforge.net/crossfire/?rev=14746&view=rev
Author: akirschbaum
Date: 2011-06-30 20:06:15 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Add missing @Override annotations.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java
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:04:46 UTC (rev 14745)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 20:06:15 UTC (rev 14746)
@@ -399,9 +399,9 @@
}
/**
- * Processes an updated face image.
- * @param face the face that has changed
+ * {@inheritDoc}
*/
+ @Override
public void faceUpdated(@NotNull final Face face) {
synchronized (sync) {
mapBegin();
@@ -490,9 +490,9 @@
}
/**
- * Processes a tick command.
- * @param tickNo the current tick number
+ * {@inheritDoc}
*/
+ @Override
public void tick(final int tickNo) {
visibleAnimations.tick(tickNo);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:04:52
|
Revision: 14745
http://crossfire.svn.sourceforge.net/crossfire/?rev=14745&view=rev
Author: akirschbaum
Date: 2011-06-30 20:04:46 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Simplify CfMapUpdater.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 20:00:51 UTC (rev 14744)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 20:04:46 UTC (rev 14745)
@@ -21,9 +21,7 @@
package com.realtime.crossfire.jxclient.mapupdater;
-import com.realtime.crossfire.jxclient.faces.Face;
import com.realtime.crossfire.jxclient.faces.FacesManager;
-import com.realtime.crossfire.jxclient.faces.FacesManagerListener;
import com.realtime.crossfire.jxclient.guistate.GuiStateListener;
import com.realtime.crossfire.jxclient.guistate.GuiStateManager;
import com.realtime.crossfire.jxclient.map.CfMap;
@@ -44,19 +42,6 @@
private final MapUpdaterState mapUpdaterState;
/**
- * The listener to detect updated faces.
- */
- @NotNull
- private final FacesManagerListener facesManagerListener = new FacesManagerListener() {
-
- @Override
- public void faceUpdated(@NotNull final Face face) {
- mapUpdaterState.faceUpdated(face.getFaceNum());
- }
-
- };
-
- /**
* The {@link GuiStateListener} for detecting established or dropped
* connections.
*/
@@ -109,7 +94,7 @@
*/
public CfMapUpdater(@NotNull final MapUpdaterState mapUpdaterState, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final FacesManager facesManager, @NotNull final GuiStateManager guiStateManager) {
this.mapUpdaterState = mapUpdaterState;
- facesManager.addFacesManagerListener(facesManagerListener);
+ facesManager.addFacesManagerListener(mapUpdaterState);
crossfireServerConnection.setCrossfireUpdateMapListener(mapUpdaterState);
guiStateManager.addGuiStateListener(guiStateListener);
crossfireServerConnection.addCrossfireTickListener(mapUpdaterState);
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:00:51 UTC (rev 14744)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 20:04:46 UTC (rev 14745)
@@ -25,6 +25,7 @@
import com.realtime.crossfire.jxclient.animations.Animations;
import com.realtime.crossfire.jxclient.faces.Face;
import com.realtime.crossfire.jxclient.faces.FacesManager;
+import com.realtime.crossfire.jxclient.faces.FacesManagerListener;
import com.realtime.crossfire.jxclient.guistate.GuiStateManager;
import com.realtime.crossfire.jxclient.map.CfMap;
import com.realtime.crossfire.jxclient.map.CfMapAnimations;
@@ -50,7 +51,7 @@
* applies to the whole map model {@link #map}.
* @author Andreas Kirschbaum
*/
-public class MapUpdaterState implements CrossfireTickListener, CrossfireUpdateMapListener {
+public class MapUpdaterState implements CrossfireTickListener, CrossfireUpdateMapListener, FacesManagerListener {
/**
* The object used for synchronization.
@@ -399,15 +400,15 @@
/**
* Processes an updated face image.
- * @param faceNum the face that has changed
+ * @param face the face that has changed
*/
- public void faceUpdated(final int faceNum) {
+ public void faceUpdated(@NotNull final Face face) {
synchronized (sync) {
mapBegin();
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
- map.updateFace(faceNum, mapWidth, mapHeight);
+ map.updateFace(face.getFaceNum(), mapWidth, mapHeight);
}
mapEnd(false);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 20:00:57
|
Revision: 14744
http://crossfire.svn.sourceforge.net/crossfire/?rev=14744&view=rev
Author: akirschbaum
Date: 2011-06-30 20:00:51 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Rename function name.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:59:26 UTC (rev 14743)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 20:00:51 UTC (rev 14744)
@@ -51,7 +51,7 @@
@Override
public void faceUpdated(@NotNull final Face face) {
- mapUpdaterState.updateFace(face.getFaceNum());
+ mapUpdaterState.faceUpdated(face.getFaceNum());
}
};
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 19:59:26 UTC (rev 14743)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 20:00:51 UTC (rev 14744)
@@ -401,7 +401,7 @@
* Processes an updated face image.
* @param faceNum the face that has changed
*/
- public void updateFace(final int faceNum) {
+ public void faceUpdated(final int faceNum) {
synchronized (sync) {
mapBegin();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 19:59:32
|
Revision: 14743
http://crossfire.svn.sourceforge.net/crossfire/?rev=14743&view=rev
Author: akirschbaum
Date: 2011-06-30 19:59:26 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Simplify CfMapUpdater.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:53:19 UTC (rev 14742)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:59:26 UTC (rev 14743)
@@ -28,7 +28,6 @@
import com.realtime.crossfire.jxclient.guistate.GuiStateManager;
import com.realtime.crossfire.jxclient.map.CfMap;
import com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection;
-import com.realtime.crossfire.jxclient.server.crossfire.CrossfireTickListener;
import com.realtime.crossfire.jxclient.server.socket.ClientSocketState;
import org.jetbrains.annotations.NotNull;
@@ -102,19 +101,6 @@
};
/**
- * The listener for receiving "tick" commands.
- */
- @NotNull
- private final CrossfireTickListener crossfireTickListener = new CrossfireTickListener() {
-
- @Override
- public void tick(final int tickNo) {
- mapUpdaterState.tick(tickNo);
- }
-
- };
-
- /**
* Creates a new instance.
* @param mapUpdaterState the map updater state to update
* @param crossfireServerConnection the connection to monitor
@@ -126,7 +112,7 @@
facesManager.addFacesManagerListener(facesManagerListener);
crossfireServerConnection.setCrossfireUpdateMapListener(mapUpdaterState);
guiStateManager.addGuiStateListener(guiStateListener);
- crossfireServerConnection.addCrossfireTickListener(crossfireTickListener);
+ crossfireServerConnection.addCrossfireTickListener(mapUpdaterState);
}
}
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 19:53:19 UTC (rev 14742)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 19:59:26 UTC (rev 14743)
@@ -30,6 +30,7 @@
import com.realtime.crossfire.jxclient.map.CfMapAnimations;
import com.realtime.crossfire.jxclient.map.CfMapSquare;
import com.realtime.crossfire.jxclient.map.Location;
+import com.realtime.crossfire.jxclient.server.crossfire.CrossfireTickListener;
import com.realtime.crossfire.jxclient.server.crossfire.CrossfireUpdateMapListener;
import com.realtime.crossfire.jxclient.server.crossfire.MapSizeListener;
import com.realtime.crossfire.jxclient.util.EventListenerList2;
@@ -49,7 +50,7 @@
* applies to the whole map model {@link #map}.
* @author Andreas Kirschbaum
*/
-public class MapUpdaterState implements CrossfireUpdateMapListener {
+public class MapUpdaterState implements CrossfireTickListener, CrossfireUpdateMapListener {
/**
* The object used for synchronization.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 19:53:25
|
Revision: 14742
http://crossfire.svn.sourceforge.net/crossfire/?rev=14742&view=rev
Author: akirschbaum
Date: 2011-06-30 19:53:19 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Simplify CfMapUpdater.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:47:22 UTC (rev 14741)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:53:19 UTC (rev 14742)
@@ -27,10 +27,8 @@
import com.realtime.crossfire.jxclient.guistate.GuiStateListener;
import com.realtime.crossfire.jxclient.guistate.GuiStateManager;
import com.realtime.crossfire.jxclient.map.CfMap;
-import com.realtime.crossfire.jxclient.map.Location;
import com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection;
import com.realtime.crossfire.jxclient.server.crossfire.CrossfireTickListener;
-import com.realtime.crossfire.jxclient.server.crossfire.CrossfireUpdateMapListener;
import com.realtime.crossfire.jxclient.server.socket.ClientSocketState;
import org.jetbrains.annotations.NotNull;
@@ -60,74 +58,6 @@
};
/**
- * The listener to detect map model changes.
- */
- @NotNull
- private final CrossfireUpdateMapListener crossfireUpdateMapListener = new CrossfireUpdateMapListener() {
-
- @Override
- public void newMap(final int mapWidth, final int mapHeight) {
- mapUpdaterState.newMap(mapWidth, mapHeight);
- }
-
- @Override
- public void mapBegin() {
- mapUpdaterState.mapBegin();
- }
-
- @Override
- public void mapClear(final int x, final int y) {
- mapUpdaterState.mapClear(x, y);
- }
-
- @Override
- public void mapDarkness(final int x, final int y, final int darkness) {
- mapUpdaterState.mapDarkness(x, y, darkness);
- }
-
- @Override
- public void mapFace(@NotNull final Location location, final int faceNum) {
- mapUpdaterState.mapFace(location, faceNum, true);
- }
-
- @Override
- public void mapAnimation(@NotNull final Location location, final int animationNum, final int animationType) {
- mapUpdaterState.mapAnimation(location, animationNum, animationType);
- }
-
- @Override
- public void mapAnimationSpeed(@NotNull final Location location, final int animationSpeed) {
- mapUpdaterState.mapAnimationSpeed(location, animationSpeed);
- }
-
- @Override
- public void mapSmooth(@NotNull final Location location, final int smooth) {
- mapUpdaterState.mapSmooth(location, smooth);
- }
-
- @Override
- public void mapScroll(final int dx, final int dy) {
- mapUpdaterState.mapScroll(dx, dy);
- }
-
- @Override
- public void magicMap(final int x, final int y, final byte[][] data) {
- mapUpdaterState.magicMap(x, y, data);
- }
-
- @Override
- public void mapEnd() {
- mapUpdaterState.mapEnd(true);
- }
-
- @Override
- public void addAnimation(final int animation, final int flags, @NotNull final int[] faces) {
- mapUpdaterState.addAnimation(animation, flags, faces);
- }
-
- };
-
- /**
* The {@link GuiStateListener} for detecting established or dropped
* connections.
*/
@@ -194,7 +124,7 @@
public CfMapUpdater(@NotNull final MapUpdaterState mapUpdaterState, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final FacesManager facesManager, @NotNull final GuiStateManager guiStateManager) {
this.mapUpdaterState = mapUpdaterState;
facesManager.addFacesManagerListener(facesManagerListener);
- crossfireServerConnection.setCrossfireUpdateMapListener(crossfireUpdateMapListener);
+ crossfireServerConnection.setCrossfireUpdateMapListener(mapUpdaterState);
guiStateManager.addGuiStateListener(guiStateListener);
crossfireServerConnection.addCrossfireTickListener(crossfireTickListener);
}
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 19:47:22 UTC (rev 14741)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 19:53:19 UTC (rev 14742)
@@ -30,6 +30,7 @@
import com.realtime.crossfire.jxclient.map.CfMapAnimations;
import com.realtime.crossfire.jxclient.map.CfMapSquare;
import com.realtime.crossfire.jxclient.map.Location;
+import com.realtime.crossfire.jxclient.server.crossfire.CrossfireUpdateMapListener;
import com.realtime.crossfire.jxclient.server.crossfire.MapSizeListener;
import com.realtime.crossfire.jxclient.util.EventListenerList2;
import java.util.Collection;
@@ -48,7 +49,7 @@
* applies to the whole map model {@link #map}.
* @author Andreas Kirschbaum
*/
-public class MapUpdaterState {
+public class MapUpdaterState implements CrossfireUpdateMapListener {
/**
* The object used for synchronization.
@@ -207,16 +208,16 @@
}
/**
- * Starts processing of a set of map square changes.
+ * {@inheritDoc}
*/
+ @Override
public void mapBegin() {
}
/**
- * Updates a map square by clearing it.
- * @param x the x-coordinate of the square
- * @param y the y-coordinate of the square
+ * {@inheritDoc}
*/
+ @Override
public void mapClear(final int x, final int y) {
synchronized (sync) {
visibleAnimations.remove(x, y);
@@ -229,6 +230,14 @@
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ public void mapFace(@NotNull final Location location, final int faceNum) {
+ mapFace(location, faceNum, true);
+ }
+
+ /**
* Updates a map square by changing a face.
* @param location the location to update
* @param faceNum the face to set; <code>0</code> clears the square
@@ -257,11 +266,9 @@
}
/**
- * Updates a map square by changing an animation.
- * @param location the location
- * @param animationNum the animation number to set
- * @param animationType the animation type
+ * {@inheritDoc}
*/
+ @Override
public void mapAnimation(@NotNull final Location location, final int animationNum, final int animationType) {
final Animation animation = animations.get(animationNum);
if (animation == null) {
@@ -279,10 +286,9 @@
}
/**
- * Updates a map square by changing the animation speed.
- * @param location the location
- * @param animationSpeed the animation speed to set
+ * {@inheritDoc}
*/
+ @Override
public void mapAnimationSpeed(@NotNull final Location location, final int animationSpeed) {
synchronized (sync) {
visibleAnimations.updateSpeed(location, animationSpeed);
@@ -290,10 +296,9 @@
}
/**
- * Updates a map square by changing the smooth value.
- * @param location the location
- * @param smooth the smooth value to set
+ * {@inheritDoc}
*/
+ @Override
public void mapSmooth(@NotNull final Location location, final int smooth) {
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
@@ -304,11 +309,9 @@
}
/**
- * Updates a map square by changing the darkness value.
- * @param x the x-coordinate of the square
- * @param y the y-coordinate of the square
- * @param darkness the darkness value to set
+ * {@inheritDoc}
*/
+ @Override
public void mapDarkness(final int x, final int y, final int darkness) {
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
@@ -319,12 +322,9 @@
}
/**
- * Finishes processing of a set of map square changes. Notifies listeners
- * about changes. present
- * @param x the x-coordinate of the square
- * @param y the y-coordinate of the square
- * @param data the magic map data (y, x); will not be changed
+ * {@inheritDoc}
*/
+ @Override
public void magicMap(final int x, final int y, final byte[][] data) {
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
@@ -358,10 +358,9 @@
}
/**
- * Processes a map scroll command.
- * @param dx the distance to scroll in x-direction in squares
- * @param dy the distance to scroll in y-direction in squares
+ * {@inheritDoc}
*/
+ @Override
public void mapScroll(final int dx, final int dy) {
synchronized (sync) {
mapBegin();
@@ -390,6 +389,14 @@
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ public void mapEnd() {
+ mapEnd(true);
+ }
+
+ /**
* Processes an updated face image.
* @param faceNum the face that has changed
*/
@@ -407,10 +414,9 @@
}
/**
- * Processes a newmap command. This clears the map state.
- * @param mapWidth the width of the visible map area
- * @param mapHeight the height of the visible map area
+ * {@inheritDoc}
*/
+ @Override
public void newMap(final int mapWidth, final int mapHeight) {
synchronized (sync) {
final boolean changed = this.mapWidth != mapWidth || this.mapHeight != mapHeight;
@@ -474,11 +480,9 @@
}
/**
- * Adds a new animation to the map.
- * @param animation the ID f the animation to add
- * @param flags the animation flags
- * @param faces the animation's faces
+ * {@inheritDoc}
*/
+ @Override
public void addAnimation(final int animation, final int flags, @NotNull final int[] faces) {
animations.addAnimation(animation, flags, faces);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 19:47:28
|
Revision: 14741
http://crossfire.svn.sourceforge.net/crossfire/?rev=14741&view=rev
Author: akirschbaum
Date: 2011-06-30 19:47:22 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Rename function name.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.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/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:45:11 UTC (rev 14740)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:47:22 UTC (rev 14741)
@@ -111,7 +111,7 @@
}
@Override
- public void mapMagicMap(final int x, final int y, final byte[][] data) {
+ public void magicMap(final int x, final int y, final byte[][] data) {
mapUpdaterState.magicMap(x, y, data);
}
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 19:45:11 UTC (rev 14740)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireUpdateMapListener.java 2011-06-30 19:47:22 UTC (rev 14741)
@@ -116,7 +116,7 @@
* @param y the y-coordinate
* @param data the magic map data (y, x); must not be changed
*/
- void mapMagicMap(int x, int y, byte[][] data);
+ void magicMap(int x, int y, byte[][] data);
/**
* Parsing of "map2" has been finished.
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 19:45:11 UTC (rev 14740)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java 2011-06-30 19:47:22 UTC (rev 14741)
@@ -2904,7 +2904,7 @@
packet.get(data[y]);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapMagicMap(-px+(currentMapWidth-1)/2, -py+(currentMapHeight-1)/2, data);
+ crossfireUpdateMapListener.magicMap(-px+(currentMapWidth-1)/2, -py+(currentMapHeight-1)/2, data);
}
if (crossfireUpdateMapListener != null) {
crossfireUpdateMapListener.mapEnd();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 19:45:18
|
Revision: 14740
http://crossfire.svn.sourceforge.net/crossfire/?rev=14740&view=rev
Author: akirschbaum
Date: 2011-06-30 19:45:11 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Remove comment.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:43:01 UTC (rev 14739)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:45:11 UTC (rev 14740)
@@ -105,9 +105,6 @@
mapUpdaterState.mapSmooth(location, smooth);
}
- /**
- * {@inheritDoc}
- */
@Override
public void mapScroll(final int dx, final int dy) {
mapUpdaterState.mapScroll(dx, dy);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 19:43:08
|
Revision: 14739
http://crossfire.svn.sourceforge.net/crossfire/?rev=14739&view=rev
Author: akirschbaum
Date: 2011-06-30 19:43:01 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Simplify code.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.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/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:27:35 UTC (rev 14738)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:43:01 UTC (rev 14739)
@@ -86,23 +86,23 @@
}
@Override
- public void mapFace(final int x, final int y, final int layer, final int faceNum) {
- mapUpdaterState.mapFace(new Location(x, y, layer), faceNum, true);
+ public void mapFace(@NotNull final Location location, final int faceNum) {
+ mapUpdaterState.mapFace(location, faceNum, true);
}
@Override
- public void mapAnimation(final int x, final int y, final int layer, final int animationNum, final int animationType) {
- mapUpdaterState.mapAnimation(x, y, layer, animationNum, animationType);
+ public void mapAnimation(@NotNull final Location location, final int animationNum, final int animationType) {
+ mapUpdaterState.mapAnimation(location, animationNum, animationType);
}
@Override
- public void mapAnimationSpeed(final int x, final int y, final int layer, final int animationSpeed) {
- mapUpdaterState.mapAnimationSpeed(x, y, layer, animationSpeed);
+ public void mapAnimationSpeed(@NotNull final Location location, final int animationSpeed) {
+ mapUpdaterState.mapAnimationSpeed(location, animationSpeed);
}
@Override
- public void mapSmooth(final int x, final int y, final int layer, final int smooth) {
- mapUpdaterState.mapSmooth(x, y, layer, smooth);
+ public void mapSmooth(@NotNull final Location location, final int smooth) {
+ mapUpdaterState.mapSmooth(location, smooth);
}
/**
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 19:27:35 UTC (rev 14738)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 19:43:01 UTC (rev 14739)
@@ -258,13 +258,11 @@
/**
* Updates a map square by changing an animation.
- * @param x the x-coordinate of the square
- * @param y the y-coordinate of the square
- * @param layer the layer to update
+ * @param location the location
* @param animationNum the animation number to set
* @param animationType the animation type
*/
- public void mapAnimation(final int x, final int y, final int layer, final int animationNum, final int animationType) {
+ public void mapAnimation(@NotNull final Location location, final int animationNum, final int animationType) {
final Animation animation = animations.get(animationNum);
if (animation == null) {
System.err.println("unknown animation id "+animationNum+", ignoring");
@@ -274,8 +272,7 @@
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
- map.setFace(x, y, layer, null);
- final Location location = new Location(x, y, layer);
+ map.setFace(location.getX(), location.getY(), location.getLayer(), null);
visibleAnimations.add(location, animation, animationType);
}
}
@@ -283,30 +280,25 @@
/**
* Updates a map square by changing the animation speed.
- * @param x the x-coordinate of the square
- * @param y the y-coordinate of the square
- * @param layer the layer to update
+ * @param location the location
* @param animationSpeed the animation speed to set
*/
- public void mapAnimationSpeed(final int x, final int y, final int layer, final int animationSpeed) {
+ public void mapAnimationSpeed(@NotNull final Location location, final int animationSpeed) {
synchronized (sync) {
- final Location location = new Location(x, y, layer);
visibleAnimations.updateSpeed(location, animationSpeed);
}
}
/**
* Updates a map square by changing the smooth value.
- * @param x the x-coordinate of the square
- * @param y the y-coordinate of the square
- * @param layer the layer to update
+ * @param location the location
* @param smooth the smooth value to set
*/
- public void mapSmooth(final int x, final int y, final int layer, final int smooth) {
+ public void mapSmooth(@NotNull final Location location, final int smooth) {
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
- map.setSmooth(x, y, layer, smooth);
+ map.setSmooth(location.getX(), location.getY(), location.getLayer(), smooth);
}
}
}
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 19:27:35 UTC (rev 14738)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireUpdateMapListener.java 2011-06-30 19:43:01 UTC (rev 14739)
@@ -76,40 +76,32 @@
/**
* Part of "map2" parsing: set the face of a cell.
- * @param x the x-coordinate
- * @param y the y-coordinate
- * @param layer the layer
+ * @param location the location
* @param faceNum the face ID
*/
- void mapFace(int x, int y, int layer, int faceNum);
+ void mapFace(@NotNull Location location, int faceNum);
/**
* Part of "map2" parsing: set the animation of a cell.
- * @param x the x-coordinate
- * @param y the y-coordinate
- * @param layer the layer
+ * @param location the location
* @param animationNum the animation ID
* @param animationType the animation type
*/
- void mapAnimation(int x, int y, int layer, int animationNum, int animationType);
+ void mapAnimation(@NotNull Location location, int animationNum, int animationType);
/**
* Part of "map2" parsing: set the animation speed.
- * @param x the x-coordinate
- * @param y the y-coordinate
- * @param layer the layer
+ * @param location the location
* @param animationSpeed the animation speed
*/
- void mapAnimationSpeed(int x, int y, int layer, int animationSpeed);
+ void mapAnimationSpeed(@NotNull Location location, int animationSpeed);
/**
* Part of "map2" parsing: set the smooth level.
- * @param x the x-coordinate
- * @param y the y-coordinate
- * @param layer the layer
+ * @param location the location
* @param smooth the smooth value
*/
- void mapSmooth(int x, int y, int layer, int smooth);
+ void mapSmooth(@NotNull Location location, int smooth);
/**
* Part of "map2" parsing: scroll the map view.
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 19:27:35 UTC (rev 14738)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java 2011-06-30 19:43:01 UTC (rev 14739)
@@ -21,6 +21,7 @@
package com.realtime.crossfire.jxclient.server.crossfire;
+import com.realtime.crossfire.jxclient.map.Location;
import com.realtime.crossfire.jxclient.server.crossfire.messages.Map2;
import com.realtime.crossfire.jxclient.server.crossfire.messages.UpdItem;
import com.realtime.crossfire.jxclient.server.server.DefaultServerConnection;
@@ -2002,26 +2003,27 @@
if (len < 2) {
throw new UnknownCommandException("map2 command contains image command with length "+len);
}
+ final Location location = new Location(x, y, layer);
final int face = getInt2(packet);
if ((face&Map2.FACE_ANIMATION) == 0) {
if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" face="+face);
+ debugProtocol.debugProtocolWrite("recv map2 "+location+" face="+face);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapFace(x, y, layer, face);
+ crossfireUpdateMapListener.mapFace(location, face);
}
} else {
if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" anim="+(face&Map2.ANIM_MASK)+" type="+((face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK));
+ 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(x, y, layer, face&Map2.ANIM_MASK, (face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK);
+ crossfireUpdateMapListener.mapAnimation(location, face&Map2.ANIM_MASK, (face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK);
}
}
if (len == 3) {
- cmdMap2CoordinateLayer3(packet, x, y, layer, face);
+ cmdMap2CoordinateLayer3(packet, location, face);
} else if (len == 4) {
- cmdMap2CoordinateLayer4(packet, x, y, layer, face);
+ cmdMap2CoordinateLayer4(packet, location, face);
} else if (len != 2) {
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" <invalid>");
@@ -2034,13 +2036,11 @@
* Processes the additional payload data for a map2 coordinate "layer"
* sub-command having 4 bytes payload.
* @param packet the packet contents
+ * @param location the location
* @param face the face number
- * @param x the x-coordinate of the currently processed square
- * @param y the y-coordinate of the currently processed square
- * @param layer the layer to update
* @throws UnknownCommandException if the command cannot be parsed
*/
- private void cmdMap2CoordinateLayer3(@NotNull final ByteBuffer packet, final int x, final int y, final int layer, final int face) throws UnknownCommandException {
+ private void cmdMap2CoordinateLayer3(@NotNull final ByteBuffer packet, @NotNull final Location location, final int face) throws UnknownCommandException {
if (face == 0) {
throw new UnknownCommandException("map2 command contains smoothing or animation information for empty face");
}
@@ -2048,18 +2048,18 @@
if ((face&Map2.FACE_ANIMATION) == 0) {
final int smooth = getInt1(packet);
if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" smooth="+smooth);
+ debugProtocol.debugProtocolWrite("recv map2 "+location+" smooth="+smooth);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapSmooth(x, y, layer, smooth);
+ crossfireUpdateMapListener.mapSmooth(location, smooth);
}
} else {
final int animSpeed = getInt1(packet);
if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" anim_speed="+animSpeed);
+ debugProtocol.debugProtocolWrite("recv map2 "+location+" anim_speed="+animSpeed);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapAnimationSpeed(x, y, layer, animSpeed);
+ crossfireUpdateMapListener.mapAnimationSpeed(location, animSpeed);
}
}
}
@@ -2068,31 +2068,29 @@
* Processes the additional payload data for a map2 coordinate "layer"
* sub-command having 4 bytes payload.
* @param packet the packet contents
+ * @param location the location
* @param face the face number
- * @param x the x-coordinate of the currently processed square
- * @param y the y-coordinate of the currently processed square
- * @param layer the layer to update
* @throws UnknownCommandException if the command cannot be parsed
*/
- private void cmdMap2CoordinateLayer4(@NotNull final ByteBuffer packet, final int x, final int y, final int layer, final int face) throws UnknownCommandException {
+ private void cmdMap2CoordinateLayer4(@NotNull final ByteBuffer packet, @NotNull final Location location, final int face) throws UnknownCommandException {
if (face == 0) {
throw new UnknownCommandException("map2 command contains smoothing or animation information for empty face");
}
final int animSpeed = getInt1(packet);
if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" anim_speed="+animSpeed);
+ debugProtocol.debugProtocolWrite("recv map2 "+location+" anim_speed="+animSpeed);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapAnimationSpeed(x, y, layer, animSpeed);
+ crossfireUpdateMapListener.mapAnimationSpeed(location, animSpeed);
}
final int smooth = getInt1(packet);
if (debugProtocol != null) {
- debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" smooth="+smooth);
+ debugProtocol.debugProtocolWrite("recv map2 "+location+" smooth="+smooth);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapSmooth(x, y, layer, smooth);
+ crossfireUpdateMapListener.mapSmooth(location, smooth);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 19:27:46
|
Revision: 14738
http://crossfire.svn.sourceforge.net/crossfire/?rev=14738&view=rev
Author: akirschbaum
Date: 2011-06-30 19:27:35 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Rename identifiers.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/map/AbstractGUIMap.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/AnimationState.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/CfMapAnimations.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/scripts/DefaultScriptProcess.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
jxclient/trunk/src/test/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterStateTest.java
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 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/gui/map/AbstractGUIMap.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -313,7 +313,7 @@
this.mapUpdaterState.addCrossfireMapListener(mapListener);
this.mapUpdaterState.addCrossfireNewmapListener(newmapListener);
this.mapUpdaterState.addCrossfireMapScrollListener(mapscrollListener);
- setMapSize(this.mapUpdaterState.getWidth(), this.mapUpdaterState.getHeight());
+ setMapSize(this.mapUpdaterState.getMapWidth(), this.mapUpdaterState.getMapHeight());
}
/**
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/AnimationState.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/AnimationState.java 2011-06-30 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/AnimationState.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -136,7 +136,7 @@
}
lastFace = face;
for (final Location location : locations) {
- mapUpdaterState.processMapFace(location, face, false);
+ mapUpdaterState.mapFace(location, face, false);
}
}
@@ -149,7 +149,7 @@
throw new IllegalArgumentException();
}
if (lastFace != -1) {
- mapUpdaterState.processMapFace(location, lastFace, false);
+ mapUpdaterState.mapFace(location, lastFace, false);
}
}
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 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/map/CfMapAnimations.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -219,11 +219,11 @@
pendingTickUpdates.clear();
animationStatesToUpdate = new ArrayList<AnimationState>(animationStates.keySet());
}
- mapUpdaterState.processMapBegin();
+ mapUpdaterState.mapBegin();
for (final AnimationState animationState : animationStatesToUpdate) {
animationState.updateTickNo(tickNo);
}
- mapUpdaterState.processMapEnd(false);
+ mapUpdaterState.mapEnd(false);
}
/**
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -67,60 +67,60 @@
@Override
public void newMap(final int mapWidth, final int mapHeight) {
- mapUpdaterState.processNewMap(mapWidth, mapHeight);
+ mapUpdaterState.newMap(mapWidth, mapHeight);
}
@Override
public void mapBegin() {
- mapUpdaterState.processMapBegin();
+ mapUpdaterState.mapBegin();
}
@Override
public void mapClear(final int x, final int y) {
- mapUpdaterState.processMapClear(x, y);
+ mapUpdaterState.mapClear(x, y);
}
@Override
public void mapDarkness(final int x, final int y, final int darkness) {
- mapUpdaterState.processMapDarkness(x, y, darkness);
+ mapUpdaterState.mapDarkness(x, y, darkness);
}
@Override
public void mapFace(final int x, final int y, final int layer, final int faceNum) {
- mapUpdaterState.processMapFace(new Location(x, y, layer), faceNum, true);
+ mapUpdaterState.mapFace(new Location(x, y, layer), faceNum, true);
}
@Override
public void mapAnimation(final int x, final int y, final int layer, final int animationNum, final int animationType) {
- mapUpdaterState.processMapAnimation(x, y, layer, animationNum, animationType);
+ mapUpdaterState.mapAnimation(x, y, layer, animationNum, animationType);
}
@Override
- public void mapAnimationSpeed(final int x, final int y, final int layer, final int animSpeed) {
- mapUpdaterState.processMapAnimationSpeed(x, y, layer, animSpeed);
+ public void mapAnimationSpeed(final int x, final int y, final int layer, final int animationSpeed) {
+ mapUpdaterState.mapAnimationSpeed(x, y, layer, animationSpeed);
}
@Override
public void mapSmooth(final int x, final int y, final int layer, final int smooth) {
- mapUpdaterState.processMapSmooth(x, y, layer, smooth);
+ mapUpdaterState.mapSmooth(x, y, layer, smooth);
}
/**
* {@inheritDoc}
*/
@Override
- public void scroll(final int dx, final int dy) {
- mapUpdaterState.processMapScroll(dx, dy);
+ public void mapScroll(final int dx, final int dy) {
+ mapUpdaterState.mapScroll(dx, dy);
}
@Override
public void mapMagicMap(final int x, final int y, final byte[][] data) {
- mapUpdaterState.processMagicMap(x, y, data);
+ mapUpdaterState.magicMap(x, y, data);
}
@Override
public void mapEnd() {
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapEnd(true);
}
@Override
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 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterState.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -71,12 +71,12 @@
/**
* The width of the visible map area.
*/
- private int width = 0;
+ private int mapWidth = 0;
/**
* The height of the visible map area.
*/
- private int height = 0;
+ private int mapHeight = 0;
/**
* The current {@link CfMap} instance.
@@ -202,14 +202,14 @@
*/
public void reset() {
synchronized (sync) {
- processNewMap(width, height);
+ newMap(mapWidth, mapHeight);
}
}
/**
* Starts processing of a set of map square changes.
*/
- public void processMapBegin() {
+ public void mapBegin() {
}
/**
@@ -217,7 +217,7 @@
* @param x the x-coordinate of the square
* @param y the y-coordinate of the square
*/
- public void processMapClear(final int x, final int y) {
+ public void mapClear(final int x, final int y) {
synchronized (sync) {
visibleAnimations.remove(x, y);
outOfViewMultiFaces.clear();
@@ -234,7 +234,7 @@
* @param faceNum the face to set; <code>0</code> clears the square
* @param clearAnimation whether an animation should be cleared
*/
- public void processMapFace(@NotNull final Location location, final int faceNum, final boolean clearAnimation) {
+ public void mapFace(@NotNull final Location location, final int faceNum, final boolean clearAnimation) {
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
@@ -244,7 +244,7 @@
final Face face = facesManager.getFace2(faceNum);
final int x = location.getX();
final int y = location.getY();
- if (x >= width || y >= height) {
+ if (x >= mapWidth || y >= mapHeight) {
if (face == null) {
outOfViewMultiFaces.remove(location);
} else if (face.getTileWidth() > 1 || face.getTileHeight() > 1) {
@@ -262,9 +262,9 @@
* @param y the y-coordinate of the square
* @param layer the layer to update
* @param animationNum the animation number to set
- * @param type the animation type
+ * @param animationType the animation type
*/
- public void processMapAnimation(final int x, final int y, final int layer, final int animationNum, final int type) {
+ public void mapAnimation(final int x, final int y, final int layer, final int animationNum, final int animationType) {
final Animation animation = animations.get(animationNum);
if (animation == null) {
System.err.println("unknown animation id "+animationNum+", ignoring");
@@ -276,7 +276,7 @@
synchronized (map) {
map.setFace(x, y, layer, null);
final Location location = new Location(x, y, layer);
- visibleAnimations.add(location, animation, type);
+ visibleAnimations.add(location, animation, animationType);
}
}
}
@@ -288,7 +288,7 @@
* @param layer the layer to update
* @param animationSpeed the animation speed to set
*/
- public void processMapAnimationSpeed(final int x, final int y, final int layer, final int animationSpeed) {
+ public void mapAnimationSpeed(final int x, final int y, final int layer, final int animationSpeed) {
synchronized (sync) {
final Location location = new Location(x, y, layer);
visibleAnimations.updateSpeed(location, animationSpeed);
@@ -302,7 +302,7 @@
* @param layer the layer to update
* @param smooth the smooth value to set
*/
- public void processMapSmooth(final int x, final int y, final int layer, final int smooth) {
+ public void mapSmooth(final int x, final int y, final int layer, final int smooth) {
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
@@ -317,7 +317,7 @@
* @param y the y-coordinate of the square
* @param darkness the darkness value to set
*/
- public void processMapDarkness(final int x, final int y, final int darkness) {
+ public void mapDarkness(final int x, final int y, final int darkness) {
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
@@ -333,7 +333,7 @@
* @param y the y-coordinate of the square
* @param data the magic map data (y, x); will not be changed
*/
- public void processMagicMap(final int x, final int y, final byte[][] data) {
+ public void magicMap(final int x, final int y, final byte[][] data) {
synchronized (sync) {
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
@@ -348,7 +348,7 @@
* @param alwaysProcess if set, notify listeners even if no changes are
* present
*/
- public void processMapEnd(final boolean alwaysProcess) {
+ public void mapEnd(final boolean alwaysProcess) {
synchronized (sync) {
final Set<CfMapSquare> squares;
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
@@ -370,9 +370,9 @@
* @param dx the distance to scroll in x-direction in squares
* @param dy the distance to scroll in y-direction in squares
*/
- public void processMapScroll(final int dx, final int dy) {
+ public void mapScroll(final int dx, final int dy) {
synchronized (sync) {
- processMapBegin();
+ mapBegin();
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
@@ -382,7 +382,7 @@
}
outOfViewMultiFaces.clear();
- if (map.processMapScroll(dx, dy, width, height)) {
+ if (map.processMapScroll(dx, dy, mapWidth, mapHeight)) {
visibleAnimations.clear();
} else {
visibleAnimations.scroll(dx, dy);
@@ -393,7 +393,7 @@
mapscrollListener.mapScrolled(dx, dy);
}
- processMapEnd(false);
+ mapEnd(false);
}
}
@@ -403,41 +403,41 @@
*/
public void updateFace(final int faceNum) {
synchronized (sync) {
- processMapBegin();
+ mapBegin();
//noinspection NestedSynchronizedStatement,SynchronizeOnNonFinalField
synchronized (map) {
- map.updateFace(faceNum, width, height);
+ map.updateFace(faceNum, mapWidth, mapHeight);
}
- processMapEnd(false);
+ mapEnd(false);
}
}
/**
* Processes a newmap command. This clears the map state.
- * @param width the width of the visible map area
- * @param height the height of the visible map area
+ * @param mapWidth the width of the visible map area
+ * @param mapHeight the height of the visible map area
*/
- public void processNewMap(final int width, final int height) {
+ public void newMap(final int mapWidth, final int mapHeight) {
synchronized (sync) {
- final boolean changed = this.width != width || this.height != height;
- this.width = width;
- this.height = height;
+ final boolean changed = this.mapWidth != mapWidth || this.mapHeight != mapHeight;
+ this.mapWidth = mapWidth;
+ this.mapHeight = mapHeight;
final CfMap tmp = new CfMap();
//noinspection NestedSynchronizedStatement,SynchronizationOnLocalVariableOrMethodParameter
synchronized (tmp) {
// force dirty flags to be set for the visible map region
tmp.clearSquare(0, 0);
- tmp.clearSquare(width-1, height-1);
+ tmp.clearSquare(mapWidth-1, mapHeight-1);
}
map = tmp;
- visibleAnimations.setMapSize(width, height);
+ visibleAnimations.setMapSize(mapWidth, mapHeight);
if (changed) {
for (final MapSizeListener listener : mapSizeListeners.getListeners()) {
- listener.mapSizeChanged(width, height);
+ listener.mapSizeChanged(mapWidth, mapHeight);
}
}
@@ -460,16 +460,16 @@
* Returns the width of the visible map area.
* @return the width of the visible map area
*/
- public int getWidth() {
- return width;
+ public int getMapWidth() {
+ return mapWidth;
}
/**
* Returns the height of the visible map area.
* @return the height of the visible map area
*/
- public int getHeight() {
- return height;
+ public int getMapHeight() {
+ return mapHeight;
}
/**
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/scripts/DefaultScriptProcess.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/scripts/DefaultScriptProcess.java 2011-06-30 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/scripts/DefaultScriptProcess.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -476,11 +476,11 @@
}
commandSent("request items cont end");
} else if (params.equals("map pos")) {
- commandSent("request map pos "+mapUpdaterState.getWidth()/2+" "+mapUpdaterState.getHeight()/2);
+ commandSent("request map pos "+mapUpdaterState.getMapWidth()/2+" "+mapUpdaterState.getMapHeight()/2);
} else if (params.equals("map near")) {
final CfMap map = mapUpdaterState.getMap();
- final int centerX = mapUpdaterState.getWidth()/2;
- final int centerY = mapUpdaterState.getHeight()/2;
+ final int centerX = mapUpdaterState.getMapWidth()/2;
+ final int centerY = mapUpdaterState.getMapHeight()/2;
for (int y = -1; y <= +1; y++) {
for (int x = -1; x <= +1; x++) {
commandSentMap(map, centerX+x, centerY+y);
@@ -488,8 +488,8 @@
}
} else if (params.equals("map all")) {
final CfMap map = mapUpdaterState.getMap();
- final int width = mapUpdaterState.getWidth()/2;
- final int height = mapUpdaterState.getHeight()/2;
+ final int width = mapUpdaterState.getMapWidth()/2;
+ final int height = mapUpdaterState.getMapHeight()/2;
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
commandSentMap(map, x, y);
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 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireUpdateMapListener.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -21,6 +21,7 @@
package com.realtime.crossfire.jxclient.server.crossfire;
+import com.realtime.crossfire.jxclient.map.Location;
import java.util.EventListener;
import org.jetbrains.annotations.NotNull;
@@ -97,9 +98,9 @@
* @param x the x-coordinate
* @param y the y-coordinate
* @param layer the layer
- * @param animSpeed the animation speed
+ * @param animationSpeed the animation speed
*/
- void mapAnimationSpeed(int x, int y, int layer, int animSpeed);
+ void mapAnimationSpeed(int x, int y, int layer, int animationSpeed);
/**
* Part of "map2" parsing: set the smooth level.
@@ -115,7 +116,7 @@
* @param dx the x-distance
* @param dy the y-distance
*/
- void scroll(int dx, int dy);
+ void mapScroll(int dx, int dy);
/**
* Part of "magicmap" parsing: set the magic map color.
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 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -2051,7 +2051,7 @@
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" smooth="+smooth);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapSmooth(x, y, layer, smooth);
+ crossfireUpdateMapListener.mapSmooth(x, y, layer, smooth);
}
} else {
final int animSpeed = getInt1(packet);
@@ -2059,7 +2059,7 @@
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" anim_speed="+animSpeed);
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapAnimationSpeed(x, y, layer, animSpeed);
+ crossfireUpdateMapListener.mapAnimationSpeed(x, y, layer, animSpeed);
}
}
}
@@ -2926,7 +2926,7 @@
final int args = packet.position();
synchronized (redrawSemaphore) {
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapBegin();
+ crossfireUpdateMapListener.mapBegin();
}
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 begin");
@@ -2947,7 +2947,7 @@
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" scroll");
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.scroll(x, y);
+ crossfireUpdateMapListener.mapScroll(x, y);
}
break;
@@ -2962,7 +2962,7 @@
debugProtocol.debugProtocolWrite("recv map2 end");
}
if (crossfireUpdateMapListener != null) {
- crossfireUpdateMapListener.mapEnd();
+ crossfireUpdateMapListener.mapEnd();
}
}
notifyPacketWatcherListenersShortArray(packet, args);
Modified: jxclient/trunk/src/test/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterStateTest.java
===================================================================
--- jxclient/trunk/src/test/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterStateTest.java 2011-06-30 18:59:04 UTC (rev 14737)
+++ jxclient/trunk/src/test/com/realtime/crossfire/jxclient/mapupdater/MapUpdaterStateTest.java 2011-06-30 19:27:35 UTC (rev 14738)
@@ -503,24 +503,24 @@
final MapUpdaterState mapUpdaterState = new MapUpdaterState(facesManager, null);
- mapUpdaterState.processNewMap(5, 5);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(0, 0, 0), 2, true);
- mapUpdaterState.processMapFace(new Location(1, 0, 0), 2, true);
- mapUpdaterState.processMapFace(new Location(0, 1, 0), 2, true);
- mapUpdaterState.processMapFace(new Location(1, 1, 0), 2, true);
- mapUpdaterState.processMapFace(new Location(1, 1, 6), 1, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.newMap(5, 5);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(0, 0, 0), 2, true);
+ mapUpdaterState.mapFace(new Location(1, 0, 0), 2, true);
+ mapUpdaterState.mapFace(new Location(0, 1, 0), 2, true);
+ mapUpdaterState.mapFace(new Location(1, 1, 0), 2, true);
+ mapUpdaterState.mapFace(new Location(1, 1, 6), 1, true);
+ mapUpdaterState.mapEnd(true);
Assert.assertEquals(""+"[H0=_,T6=M][H0=_,T6=M]\n"+"[H0=_,T6=M][H0=_,H6=M]\n", toString(mapUpdaterState.getMap(), 0, 0, 2, 2));
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapClear(1, 0);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapClear(1, 0);
+ mapUpdaterState.mapEnd(true);
Assert.assertEquals(""+"[H0=_,T6=M][#,H0=_,T6=M]\n"+"[H0=_,T6=M][H0=_,H6=M]\n", toString(mapUpdaterState.getMap(), 0, 0, 2, 2));
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapClear(1, 1);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapClear(1, 1);
+ mapUpdaterState.mapEnd(true);
Assert.assertEquals(""+"[H0=_][#,H0=_,T6=M]\n"+"[H0=_][#,H0=_,H6=M]\n", toString(mapUpdaterState.getMap(), 0, 0, 2, 2));
}
@@ -542,65 +542,65 @@
final MapUpdaterState mapUpdaterState = new MapUpdaterState(facesManager, null);
- mapUpdaterState.processNewMap(10, 10);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(7, 8, 0), 4607, true);
- mapUpdaterState.processMapFace(new Location(8, 8, 0), 4607, true);
- mapUpdaterState.processMapFace(new Location(9, 8, 0), 4607, true);
- mapUpdaterState.processMapFace(new Location(7, 9, 0), 4607, true);
- mapUpdaterState.processMapFace(new Location(8, 9, 0), 4607, true);
- mapUpdaterState.processMapFace(new Location(9, 9, 0), 4607, true);
- mapUpdaterState.processMapFace(new Location(9, 9, 6), 312, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.newMap(10, 10);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(7, 8, 0), 4607, true);
+ mapUpdaterState.mapFace(new Location(8, 8, 0), 4607, true);
+ mapUpdaterState.mapFace(new Location(9, 8, 0), 4607, true);
+ mapUpdaterState.mapFace(new Location(7, 9, 0), 4607, true);
+ mapUpdaterState.mapFace(new Location(8, 9, 0), 4607, true);
+ mapUpdaterState.mapFace(new Location(9, 9, 0), 4607, true);
+ mapUpdaterState.mapFace(new Location(9, 9, 6), 312, true);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(26);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(9, 9, 6), 307, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(9, 9, 6), 307, true);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(27);
mapUpdaterState.getMapAnimations().tick(28);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(9, 9, 6), 308, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(9, 9, 6), 308, true);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(29);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(0, 5, 6), 0, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(0, 5, 6), 0, true);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(30);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(9, 9, 6), 309, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(9, 9, 6), 309, true);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(31);
mapUpdaterState.getMapAnimations().tick(32);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(9, 9, 6), 308, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(9, 9, 6), 308, true);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(33);
mapUpdaterState.getMapAnimations().tick(34);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(9, 9, 6), 0, true);
- mapUpdaterState.processMapFace(new Location(10, 9, 6), 307, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(9, 9, 6), 0, true);
+ mapUpdaterState.mapFace(new Location(10, 9, 6), 307, true);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(35);
mapUpdaterState.getMapAnimations().tick(36);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(0, 6, 6), 932, true);
- mapUpdaterState.processMapFace(new Location(9, 9, 6), 312, true);
- mapUpdaterState.processMapClear(10, 9);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(0, 6, 6), 932, true);
+ mapUpdaterState.mapFace(new Location(9, 9, 6), 312, true);
+ mapUpdaterState.mapClear(10, 9);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(37);
mapUpdaterState.getMapAnimations().tick(38);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(8, 9, 6), 310, true);
- mapUpdaterState.processMapFace(new Location(9, 9, 6), 0, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(8, 9, 6), 310, true);
+ mapUpdaterState.mapFace(new Location(9, 9, 6), 0, true);
+ mapUpdaterState.mapEnd(true);
mapUpdaterState.getMapAnimations().tick(39);
@@ -620,15 +620,15 @@
final MapUpdaterState mapUpdaterState = new MapUpdaterState(facesManager, null);
- mapUpdaterState.processNewMap(10, 10);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(5, 10, 6), 7, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.newMap(10, 10);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(5, 10, 6), 7, true);
+ mapUpdaterState.mapEnd(true);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(4, 10, 6), 8, true);
- mapUpdaterState.processMapClear(5, 10);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(4, 10, 6), 8, true);
+ mapUpdaterState.mapClear(5, 10);
+ mapUpdaterState.mapEnd(true);
Assert.assertEquals(""+"[T6=b.x12][T6=b.x12][]\n"+"[T6=b.x12][H6=b.x12][#,H6=a.x11]\n", toString(mapUpdaterState.getMap(), 3, 9, 3, 2));
}
@@ -643,42 +643,42 @@
final FacesManager facesManager = new TestFacesManager(faceCache);
final MapUpdaterState mapUpdaterState = new MapUpdaterState(facesManager, null);
- mapUpdaterState.processNewMap(23, 16);
+ mapUpdaterState.newMap(23, 16);
defineFace(faceCache, 1316, "demon_lord.x11", PNG128X256);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapFace(new Location(4, 17, 6), 1316, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapFace(new Location(4, 17, 6), 1316, true);
+ mapUpdaterState.mapEnd(true);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapScroll(-1, 0);
- mapUpdaterState.processMapFace(new Location(5, 17, 6), 1316, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapScroll(-1, 0);
+ mapUpdaterState.mapFace(new Location(5, 17, 6), 1316, true);
+ mapUpdaterState.mapEnd(true);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapClear(5, 17);
- mapUpdaterState.processMapFace(new Location(6, 17, 6), 1316, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapClear(5, 17);
+ mapUpdaterState.mapFace(new Location(6, 17, 6), 1316, true);
+ mapUpdaterState.mapEnd(true);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapScroll(-1, 0);
- mapUpdaterState.processMapFace(new Location(7, 17, 6), 1316, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapScroll(-1, 0);
+ mapUpdaterState.mapFace(new Location(7, 17, 6), 1316, true);
+ mapUpdaterState.mapEnd(true);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapScroll(-1, 0);
- mapUpdaterState.processMapFace(new Location(8, 17, 6), 1316, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapScroll(-1, 0);
+ mapUpdaterState.mapFace(new Location(8, 17, 6), 1316, true);
+ mapUpdaterState.mapEnd(true);
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapScroll(-1, 0);
- mapUpdaterState.processMapFace(new Location(9, 17, 6), 1316, true);
- mapUpdaterState.processMapEnd(true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapScroll(-1, 0);
+ mapUpdaterState.mapFace(new Location(9, 17, 6), 1316, true);
+ mapUpdaterState.mapEnd(true);
Assert.assertEquals(""+"[][T6=demon_lord.x11][T6=demon_lord.x11][T6=demon_lord.x11][T6=demon_lord.x11][][][][]\n", toString(mapUpdaterState.getMap(), 5, 10, 9, 1));
- mapUpdaterState.processMapBegin();
- mapUpdaterState.processMapScroll(-1, 0);
- mapUpdaterState.processMapFace(new Location(11, 17, 6), 1316, true);
+ mapUpdaterState.mapBegin();
+ mapUpdaterState.mapScroll(-1, 0);
+ mapUpdaterState.mapFace(new Location(11, 17, 6), 1316, true);
Assert.assertEquals(""+"[][][][T6=demon_lord.x11][T6=demon_lord.x11][T6=demon_lord.x11][T6=demon_lord.x11][][]\n", toString(mapUpdaterState.getMap(), 5, 10, 9, 1));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 18:59:11
|
Revision: 14737
http://crossfire.svn.sourceforge.net/crossfire/?rev=14737&view=rev
Author: akirschbaum
Date: 2011-06-30 18:59:04 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Allow unsetting the listener.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java
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 18:56:45 UTC (rev 14736)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java 2011-06-30 18:59:04 UTC (rev 14737)
@@ -868,7 +868,7 @@
*/
@Override
public void setCrossfireUpdateMapListener(@Nullable final CrossfireUpdateMapListener listener) {
- if (crossfireUpdateMapListener != null) {
+ if (listener != null && crossfireUpdateMapListener != null) {
throw new IllegalStateException();
}
crossfireUpdateMapListener = listener;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-30 18:56:52
|
Revision: 14736
http://crossfire.svn.sourceforge.net/crossfire/?rev=14736&view=rev
Author: akirschbaum
Date: 2011-06-30 18:56:45 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Restrict DefaultCrossfireServerConnection to at most one CrossfireUpdateMapListener.
Modified Paths:
--------------
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireServerConnection.java
jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java
jxclient/trunk/src/test/com/realtime/crossfire/jxclient/test/TestCrossfireServerConnection.java
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-29 17:32:48 UTC (rev 14735)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/mapupdater/CfMapUpdater.java 2011-06-30 18:56:45 UTC (rev 14736)
@@ -197,7 +197,7 @@
public CfMapUpdater(@NotNull final MapUpdaterState mapUpdaterState, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final FacesManager facesManager, @NotNull final GuiStateManager guiStateManager) {
this.mapUpdaterState = mapUpdaterState;
facesManager.addFacesManagerListener(facesManagerListener);
- crossfireServerConnection.addCrossfireUpdateMapListener(crossfireUpdateMapListener);
+ crossfireServerConnection.setCrossfireUpdateMapListener(crossfireUpdateMapListener);
guiStateManager.addGuiStateListener(guiStateListener);
crossfireServerConnection.addCrossfireTickListener(crossfireTickListener);
}
Modified: jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireServerConnection.java
===================================================================
--- jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireServerConnection.java 2011-06-29 17:32:48 UTC (rev 14735)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/CrossfireServerConnection.java 2011-06-30 18:56:45 UTC (rev 14736)
@@ -128,10 +128,11 @@
void removeCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener);
/**
- * Adds a listener to be notified about map changes.
- * @param listener the listener to add
+ * Sets a listener to be notified about map changes. At most one such
+ * listener may be set.
+ * @param listener the listener to set or <code>null</code> to unset it
*/
- void addCrossfireUpdateMapListener(@NotNull CrossfireUpdateMapListener listener);
+ void setCrossfireUpdateMapListener(@Nullable CrossfireUpdateMapListener listener);
/**
* Adds a listener to be notified about tick changes.
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-29 17:32:48 UTC (rev 14735)
+++ jxclient/trunk/src/jxclient/com/realtime/crossfire/jxclient/server/crossfire/DefaultCrossfireServerConnection.java 2011-06-30 18:56:45 UTC (rev 14736)
@@ -227,11 +227,11 @@
private final EventListenerList2<CrossfireUpdateItemListener> crossfireUpdateItemListeners = new EventListenerList2<CrossfireUpdateItemListener>(CrossfireUpdateItemListener.class);
/**
- * The {@link CrossfireUpdateMapListener CrossfireUpdateMapListeners} to be
- * notified.
+ * The {@link CrossfireUpdateMapListener} to be notified. Set to
+ * <code>null</code> if unset.
*/
- @NotNull
- private final EventListenerList2<CrossfireUpdateMapListener> crossfireUpdateMapListeners = new EventListenerList2<CrossfireUpdateMapListener>(CrossfireUpdateMapListener.class);
+ @Nullable
+ private CrossfireUpdateMapListener crossfireUpdateMapListener;
/**
* The {@link CrossfireTickListener CrossfireTickListeners} to be notified.
@@ -867,8 +867,11 @@
* {@inheritDoc}
*/
@Override
- public void addCrossfireUpdateMapListener(@NotNull final CrossfireUpdateMapListener listener) {
- crossfireUpdateMapListeners.add(listener);
+ public void setCrossfireUpdateMapListener(@Nullable final CrossfireUpdateMapListener listener) {
+ if (crossfireUpdateMapListener != null) {
+ throw new IllegalStateException();
+ }
+ crossfireUpdateMapListener = listener;
}
/**
@@ -1960,8 +1963,8 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" clear");
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapClear(x, y);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapClear(x, y);
}
}
@@ -1981,8 +1984,8 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" darkness="+darkness);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapDarkness(x, y, darkness);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapDarkness(x, y, darkness);
}
}
@@ -2004,15 +2007,15 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" face="+face);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapFace(x, y, layer, face);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapFace(x, y, layer, face);
}
} else {
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" anim="+(face&Map2.ANIM_MASK)+" type="+((face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK));
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapAnimation(x, y, layer, face&Map2.ANIM_MASK, (face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapAnimation(x, y, layer, face&Map2.ANIM_MASK, (face>>Map2.ANIM_TYPE_SHIFT)&Map2.ANIM_TYPE_MASK);
}
}
if (len == 3) {
@@ -2047,16 +2050,16 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" smooth="+smooth);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapSmooth(x, y, layer, smooth);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapSmooth(x, y, layer, smooth);
}
} else {
final int animSpeed = getInt1(packet);
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" anim_speed="+animSpeed);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapAnimationSpeed(x, y, layer, animSpeed);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapAnimationSpeed(x, y, layer, animSpeed);
}
}
}
@@ -2080,16 +2083,16 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" anim_speed="+animSpeed);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapAnimationSpeed(x, y, layer, animSpeed);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapAnimationSpeed(x, y, layer, animSpeed);
}
final int smooth = getInt1(packet);
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+"/"+layer+" smooth="+smooth);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapSmooth(x, y, layer, smooth);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapSmooth(x, y, layer, smooth);
}
}
@@ -2502,8 +2505,8 @@
if ((num&~0x1FFF) != 0) {
throw new UnknownCommandException("invalid animation id "+num);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.addAnimation(num&0x1FFF, flags, faces);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.addAnimation(num&0x1FFF, flags, faces);
}
notifyPacketWatcherListenersShortArray(packet, args);
}
@@ -2895,18 +2898,18 @@
throw new UnknownCommandException("invalid magicmap command");
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapBegin();
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapBegin();
}
final byte[][] data = new byte[height][width];
for (int y = 0; y < height; y++) {
packet.get(data[y]);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapMagicMap(-px+(currentMapWidth-1)/2, -py+(currentMapHeight-1)/2, data);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapMagicMap(-px+(currentMapWidth-1)/2, -py+(currentMapHeight-1)/2, data);
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapEnd();
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapEnd();
}
for (final CrossfireMagicmapListener listener : magicmapListeners.getListeners()) {
listener.commandMagicmapReceived();
@@ -2922,8 +2925,8 @@
private void processMap2(@NotNull final ByteBuffer packet) throws UnknownCommandException {
final int args = packet.position();
synchronized (redrawSemaphore) {
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapBegin();
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapBegin();
}
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 begin");
@@ -2943,8 +2946,8 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 "+x+"/"+y+" scroll");
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.scroll(x, y);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.scroll(x, y);
}
break;
@@ -2958,8 +2961,8 @@
if (debugProtocol != null) {
debugProtocol.debugProtocolWrite("recv map2 end");
}
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.mapEnd();
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.mapEnd();
}
}
notifyPacketWatcherListenersShortArray(packet, args);
@@ -3996,8 +3999,8 @@
* Notifies all listeners that a "newmap" command has been received.
*/
private void fireNewMap() {
- for (final CrossfireUpdateMapListener listener : crossfireUpdateMapListeners.getListeners()) {
- listener.newMap(currentMapWidth, currentMapHeight);
+ if (crossfireUpdateMapListener != null) {
+ crossfireUpdateMapListener.newMap(currentMapWidth, currentMapHeight);
}
}
Modified: jxclient/trunk/src/test/com/realtime/crossfire/jxclient/test/TestCrossfireServerConnection.java
===================================================================
--- jxclient/trunk/src/test/com/realtime/crossfire/jxclient/test/TestCrossfireServerConnection.java 2011-06-29 17:32:48 UTC (rev 14735)
+++ jxclient/trunk/src/test/com/realtime/crossfire/jxclient/test/TestCrossfireServerConnection.java 2011-06-30 18:56:45 UTC (rev 14736)
@@ -182,7 +182,7 @@
* {@inheritDoc}
*/
@Override
- public void addCrossfireUpdateMapListener(@NotNull final CrossfireUpdateMapListener listener) {
+ public void setCrossfireUpdateMapListener(@Nullable final CrossfireUpdateMapListener listener) {
Assert.fail();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-29 17:32:55
|
Revision: 14735
http://crossfire.svn.sourceforge.net/crossfire/?rev=14735&view=rev
Author: ryo_saeba
Date: 2011-06-29 17:32:48 +0000 (Wed, 29 Jun 2011)
Log Message:
-----------
Remove unused material fields.
Modified Paths:
--------------
server/trunk/include/material.h
server/trunk/lib/materials
server/trunk/server/init.c
Modified: server/trunk/include/material.h
===================================================================
--- server/trunk/include/material.h 2011-06-29 17:18:42 UTC (rev 14734)
+++ server/trunk/include/material.h 2011-06-29 17:32:48 UTC (rev 14735)
@@ -65,15 +65,6 @@
int material;
sint8 save[NROFATTACKS];
sint8 mod[NROFATTACKS];
- sint8 chance;
- sint8 difficulty;
- sint8 magic;
- sint8 damage;
- sint8 wc;
- sint8 ac;
- sint8 sp;
- int weight;
- int value;
struct _materialtype *next;
} materialtype_t;
Modified: server/trunk/lib/materials
===================================================================
--- server/trunk/lib/materials 2011-06-29 17:18:42 UTC (rev 14734)
+++ server/trunk/lib/materials 2011-06-29 17:32:48 UTC (rev 14735)
@@ -4,14 +4,6 @@
# material the material type this corresponds to. see materials.h
# saves savingthrows for each of the 25 attacktypes
# mods modifications to resistances for the 25 atttypes.
-# chance chance for appearance. similar to artifact gen.
-# diff difficulty, similar to artifact generation.
-# magic minimum magic. 0 can be on anything. similar to artifacts
-# damage bonus/negative to damage
-# wc bonus/negative to wc
-# ac bonus/negative to ac
-# weight weight modifer. similar to artifacts
-# value value modifier. similar to artifacts.
# anything left unspecified in this file will default to zero.
#
# NOTE
@@ -24,162 +16,60 @@
material 1
saves 15,10,17,9,5,7,13,0,20,15,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name iron
material 2
saves 2,12,3,12,2,10,7,0,20,15,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name glass
material 4
saves 14,11,8,3,10,5,1,0,20,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name leather
material 8
saves 5,10,10, 3, 3,10,10, 0,20,15, 0,0,0,0,0,12,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name pine
material 16
saves 10,11,13, 2, 2,10, 9, 0,20,15, 0,0,0,0,0,12,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name organics
description organic
material 32
saves 3,12,9,11,3,10,9,0,20,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name granite
material 64
saves 2,5,2,2,2,2,1,0,20,15,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name cloth
description cotton
material 128
saves 14,11,13,4,4,5,10,0,20,15,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name adamant
material 256
saves 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name liquid
material 512
saves 0,8,9,6,17,0,15,0,20,15,12,0,0,0,0,11,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name tin
material 1024
saves 6,12,6,14,2,10,1,0,20,15,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name bone
material 2048
saves 10,9,4,5,3,10,10,0,20,15,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
name ice
material 4096
saves 14,11,16,5,0,5,6,0,20,15,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0
mods 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-chance 100
-diff 0
-magic 0
-damage 0
-wc 0
-ac 0
-weight 100
-value 100
#
# NEW NON BASIC TYPES START HERE
+# Those are unused from 2011/06/29 on, left in case someone feels like using that.
#
# BEGIN iron
name gold
Modified: server/trunk/server/init.c
===================================================================
--- server/trunk/server/init.c 2011-06-29 17:18:42 UTC (rev 14734)
+++ server/trunk/server/init.c 2011-06-29 17:32:48 UTC (rev 14735)
@@ -365,15 +365,6 @@
mt->save[i] = 0;
mt->mod[i] = 0;
}
- mt->chance = 0;
- mt->difficulty = 0;
- mt->magic = 0;
- mt->damage = 0;
- mt->wc = 0;
- mt->ac = 0;
- mt->sp = 0;
- mt->weight = 100;
- mt->value = 100;
mt->next = NULL;
return mt;
}
@@ -446,24 +437,6 @@
mt->mod[i] = (sint8)value;
cp = next;
}
- } else if (sscanf(cp, "chance %d\n", &value)) {
- mt->chance = (sint8)value;
- } else if (sscanf(cp, "diff %d\n", &value)) {
- mt->difficulty = (sint8)value;
- } else if (sscanf(cp, "magic %d\n", &value)) {
- mt->magic = (sint8)value;
- } else if (sscanf(cp, "damage %d\n", &value)) {
- mt->damage = (sint8)value;
- } else if (sscanf(cp, "wc %d\n", &value)) {
- mt->wc = (sint8)value;
- } else if (sscanf(cp, "ac %d\n", &value)) {
- mt->ac = (sint8)value;
- } else if (sscanf(cp, "sp %d\n", &value)) {
- mt->sp = (sint8)value;
- } else if (sscanf(cp, "weight %d\n", &value)) {
- mt->weight = value;
- } else if (sscanf(cp, "value %d\n", &value)) {
- mt->value = value;
}
}
free(mt->next);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-29 17:18:49
|
Revision: 14734
http://crossfire.svn.sourceforge.net/crossfire/?rev=14734&view=rev
Author: ryo_saeba
Date: 2011-06-29 17:18:42 +0000 (Wed, 29 Jun 2011)
Log Message:
-----------
Clean function call.
Modified Paths:
--------------
server/trunk/common/loader.l
server/trunk/common/treasure.c
server/trunk/common/utils.c
server/trunk/include/libproto.h
server/trunk/test/bugs/bugtrack/check_1727944.c
Modified: server/trunk/common/loader.l
===================================================================
--- server/trunk/common/loader.l 2011-06-29 17:13:23 UTC (rev 14733)
+++ server/trunk/common/loader.l 2011-06-29 17:18:42 UTC (rev 14734)
@@ -383,10 +383,7 @@
/* objects now have a materialname. try to patch it in */
if (!(IS_WEAPON(op) && op->level > 0)) {
- if (op->map != NULL)
- set_materialname(op, op->map->difficulty, NULL);
- else
- set_materialname(op, 5, NULL);
+ set_materialname(op);
}
/* only do these when program is first run - a bit
* excessive to do this at every run - most of this is
Modified: server/trunk/common/treasure.c
===================================================================
--- server/trunk/common/treasure.c 2011-06-29 17:13:23 UTC (rev 14733)
+++ server/trunk/common/treasure.c 2011-06-29 17:18:42 UTC (rev 14734)
@@ -1133,9 +1133,8 @@
}
/* materialtype modifications. Note we allow this on artifacts. */
+ set_materialname(op);
- set_materialname(op, difficulty, NULL);
-
if (flags>_MINIMAL) {
if (op->type == POTION)
/* Handle healing and magic power potions */
Modified: server/trunk/common/utils.c
===================================================================
--- server/trunk/common/utils.c 2011-06-29 17:13:23 UTC (rev 14733)
+++ server/trunk/common/utils.c 2011-06-29 17:18:42 UTC (rev 14734)
@@ -303,28 +303,23 @@
}
/**
- * Set the materialname and type for an item
+ * Set the material name and type for an item, if not set.
+ * @param op item to set the material for.
*/
-void set_materialname(object *op, int difficulty, materialtype_t *nmt) {
- materialtype_t *mt, *lmt;
+void set_materialname(object *op) {
+ materialtype_t *mt;
if (op->materialname != NULL)
return;
- if (nmt == NULL) {
- lmt = NULL;
- for (mt = materialt; mt != NULL && mt->next != NULL; mt = mt->next) {
- if (op->material&mt->material) {
- lmt = mt;
- break;
- }
+ for (mt = materialt; mt != NULL && mt->next != NULL; mt = mt->next) {
+ if (op->material&mt->material) {
+ break;
}
- } else {
- lmt = nmt;
}
- if (lmt != NULL) {
- op->materialname = add_string(lmt->name);
+ if (mt != NULL) {
+ op->materialname = add_string(mt->name);
return;
}
}
Modified: server/trunk/include/libproto.h
===================================================================
--- server/trunk/include/libproto.h 2011-06-29 17:13:23 UTC (rev 14733)
+++ server/trunk/include/libproto.h 2011-06-29 17:18:42 UTC (rev 14734)
@@ -417,7 +417,7 @@
extern void decay_objects(mapstruct *m);
extern materialtype_t *name_to_material(const char *name);
extern void transmute_materialname(object *op, const object *change);
-extern void set_materialname(object *op, int difficulty, materialtype_t *nmt);
+extern void set_materialname(object *op);
extern const char *strrstr(const char *haystack, const char *needle);
extern void strip_endline(char *buf);
extern void replace(const char *src, const char *key, const char *replacement, char *result, size_t resultsize);
Modified: server/trunk/test/bugs/bugtrack/check_1727944.c
===================================================================
--- server/trunk/test/bugs/bugtrack/check_1727944.c 2011-06-29 17:13:23 UTC (rev 14733)
+++ server/trunk/test/bugs/bugtrack/check_1727944.c 2011-06-29 17:18:42 UTC (rev 14734)
@@ -212,10 +212,7 @@
/* objects now have a materialname. try to patch it in */
if (!(IS_WEAPON(op) && op->level > 0)) {
- if (op->map != NULL)
- set_materialname(op, op->map->difficulty, NULL);
- else
- set_materialname(op, 5, NULL);
+ set_materialname(op);
}
/* only do these when program is first run - a bit
* excessive to do this at every run - most of this is
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-29 17:13:29
|
Revision: 14733
http://crossfire.svn.sourceforge.net/crossfire/?rev=14733&view=rev
Author: ryo_saeba
Date: 2011-06-29 17:13:23 +0000 (Wed, 29 Jun 2011)
Log Message:
-----------
Remove NEW_MATERIAL_CODE support.
Modified Paths:
--------------
server/trunk/ChangeLog
server/trunk/common/item.c
server/trunk/common/utils.c
server/trunk/include/config.h
Modified: server/trunk/ChangeLog
===================================================================
--- server/trunk/ChangeLog 2011-06-28 20:23:11 UTC (rev 14732)
+++ server/trunk/ChangeLog 2011-06-29 17:13:23 UTC (rev 14733)
@@ -14,6 +14,9 @@
else. With this, include the file(s) that you changed.
------------------------------------------------------------------------------
+Remove NEW_MATERIAL_CODE support.
+Nicolas Weeger 2011-06-29
+
Fix crash with detect monster on custom monsters.
Reference count wasn't uptodate, thus archetype would be freed.
Nicolas Weeger 2011-06-28
Modified: server/trunk/common/item.c
===================================================================
--- server/trunk/common/item.c 2011-06-28 20:23:11 UTC (rev 14732)
+++ server/trunk/common/item.c 2011-06-29 17:13:23 UTC (rev 14733)
@@ -615,22 +615,9 @@
*/
void query_name(const object *op, char *buf, size_t size) {
size_t len = 0;
-#ifdef NEW_MATERIAL_CODE
- materialtype_t *mt;
-#endif
buf[0] = '\0';
-#ifdef NEW_MATERIAL_CODE
- if ((IS_ARMOR(op) || IS_WEAPON(op) || IS_SHIELD(op)) && op->materialname) {
- mt = name_to_material(op->materialname);
- if (mt) {
- safe_strcat(buf, mt->description, &len, size);
- safe_strcat(buf, " ", &len, size);
- }
- }
-#endif
-
query_short_name(op, buf+len, size-len);
len += strlen(buf+len);
@@ -718,9 +705,6 @@
*/
void query_base_name(const object *op, int plural, char *buf, size_t size) {
size_t len;
-#ifdef NEW_MATERIAL_CODE
- materialtype_t *mt;
-#endif
if ((!plural && !op->name)
|| (plural && !op->name_pl)) {
@@ -735,27 +719,9 @@
buf[0] = '\0';
-#ifdef NEW_MATERIAL_CODE
- if ((IS_ARMOR(op) || IS_WEAPON(op)) && op->materialname)
- mt = name_to_material(op->materialname);
- else
- mt = NULL;
+ snprintf(buf, size, "%s", plural ? op->name_pl : op->name);
+ len = strlen(buf);
- if (mt
- && op->arch->clone.materialname != mt->name
- && !(op->material&M_SPECIAL)) {
- snprintf(buf, size, "%s", mt->description);
- len = strlen(buf);
- safe_strcat(buf, " ", &len, size);
- safe_strcat(buf, plural ? op->name_pl : op->name, &len, size);
- } else {
-#endif
- snprintf(buf, size, "%s", plural ? op->name_pl : op->name);
- len = strlen(buf);
-#ifdef NEW_MATERIAL_CODE
- }
-#endif
-
if (op->title && QUERY_FLAG(op, FLAG_IDENTIFIED)) {
safe_strcat(buf, " ", &len, size);
safe_strcat(buf, op->title, &len, size);
Modified: server/trunk/common/utils.c
===================================================================
--- server/trunk/common/utils.c 2011-06-28 20:23:11 UTC (rev 14732)
+++ server/trunk/common/utils.c 2011-06-29 17:13:23 UTC (rev 14733)
@@ -313,65 +313,19 @@
if (nmt == NULL) {
lmt = NULL;
-#ifndef NEW_MATERIAL_CODE
for (mt = materialt; mt != NULL && mt->next != NULL; mt = mt->next) {
if (op->material&mt->material) {
lmt = mt;
break;
}
}
-#else
- for (mt = materialt; mt != NULL && mt->next != NULL; mt = mt->next) {
- if (op->material&mt->material
- && rndm(1, 100) <= mt->chance
- && difficulty >= mt->difficulty
- && (op->magic >= mt->magic || mt->magic == 0)) {
- lmt = mt;
- if (!(IS_WEAPON(op) || IS_ARMOR(op) || IS_SHIELD(op) || op->type == GIRDLE || op->type == GLOVES || op->type == CLOAK))
- break;
- }
- }
-#endif
} else {
lmt = nmt;
}
if (lmt != NULL) {
-#ifndef NEW_MATERIAL_CODE
op->materialname = add_string(lmt->name);
return;
-#else
-
- if (op->stats.dam && IS_WEAPON(op)) {
- op->stats.dam += lmt->damage;
- if (op->stats.dam < 1)
- op->stats.dam = 1;
- }
- if (op->stats.sp && op->type == BOW)
- op->stats.sp += lmt->sp;
- if (op->stats.wc && IS_WEAPON(op))
- op->stats.wc += lmt->wc;
- if (IS_ARMOR(op) || IS_SHIELD(op) || op->type == GIRDLE || op->type == GLOVES || op->type == CLOAK) {
- int j;
-
- if (op->stats.ac)
- op->stats.ac += lmt->ac;
- for (j = 0; j < NROFATTACKS; j++)
- if (op->resist[j] != 0) {
- op->resist[j] += lmt->mod[j];
- if (op->resist[j] > 100)
- op->resist[j] = 100;
- if (op->resist[j] < -100)
- op->resist[j] = -100;
- }
- }
- op->materialname = add_string(lmt->name);
- /* dont make it unstackable if it doesn't need to be */
- if (IS_WEAPON(op) || IS_ARMOR(op) || IS_SHIELD(op) || op->type == GIRDLE || op->type == GLOVES || op->type == CLOAK) {
- op->weight = (op->weight*lmt->weight)/100;
- op->value = (op->value*lmt->value)/100;
- }
-#endif
}
}
Modified: server/trunk/include/config.h
===================================================================
--- server/trunk/include/config.h 2011-06-28 20:23:11 UTC (rev 14732)
+++ server/trunk/include/config.h 2011-06-29 17:13:23 UTC (rev 14733)
@@ -327,17 +327,6 @@
#endif
-/**
- * Enable the new material code - it needs some work. You can
- * enable this, and things will work, just you'll see a whole
- * bunch more materials show up, and thus a whole bunch more materials
- * in your inventory, and the sorting for them isn't really good.
- */
-
-/*
-#define NEW_MATERIAL_CODE
-*/
-
/***********************************************************************
* SECTION 2 - Machine/Compiler specific stuff.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-28 20:23:17
|
Revision: 14732
http://crossfire.svn.sourceforge.net/crossfire/?rev=14732&view=rev
Author: ryo_saeba
Date: 2011-06-28 20:23:11 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
Fix crash with detect monster on custom monsters.
Modified Paths:
--------------
server/trunk/ChangeLog
server/trunk/server/spell_effect.c
Modified: server/trunk/ChangeLog
===================================================================
--- server/trunk/ChangeLog 2011-06-28 19:32:49 UTC (rev 14731)
+++ server/trunk/ChangeLog 2011-06-28 20:23:11 UTC (rev 14732)
@@ -14,6 +14,10 @@
else. With this, include the file(s) that you changed.
------------------------------------------------------------------------------
+Fix crash with detect monster on custom monsters.
+Reference count wasn't uptodate, thus archetype would be freed.
+Nicolas Weeger 2011-06-28
+
Rewrite picture loading logic to not be dependant on picture number
in the various bmaps and crossfire.x files.
Remove picture number in crossfire.x files.
Modified: server/trunk/server/spell_effect.c
===================================================================
--- server/trunk/server/spell_effect.c 2011-06-28 19:32:49 UTC (rev 14731)
+++ server/trunk/server/spell_effect.c 2011-06-28 20:23:11 UTC (rev 14732)
@@ -2593,9 +2593,11 @@
dx = HEAD(detect)->x;
dy = HEAD(detect)->y;
-
+
detect_ob = object_create_arch(HEAD(detect)->arch);
for (part = detect_ob; part != NULL; part = part->more) {
+ if (part->arch->reference_count > 0)
+ part->arch->reference_count++;
part->last_anim = 0;
part->type = spell->other_arch->clone.type;
for (flag = 0; flag < 4; flag++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-28 19:32:55
|
Revision: 14731
http://crossfire.svn.sourceforge.net/crossfire/?rev=14731&view=rev
Author: akirschbaum
Date: 2011-06-28 19:32:49 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
Ignore more non-map files in MapValidator script.
Modified Paths:
--------------
maps/trunk/editor/scripts/MapValidator
Modified: maps/trunk/editor/scripts/MapValidator
===================================================================
--- maps/trunk/editor/scripts/MapValidator 2011-06-28 19:32:05 UTC (rev 14730)
+++ maps/trunk/editor/scripts/MapValidator 2011-06-28 19:32:49 UTC (rev 14731)
@@ -103,17 +103,21 @@
if (file.isFile()
&& path.startsWith(rootDirectory)
&& !name.equalsIgnoreCase("README")
+ && !name.endsWith(".animation")
&& !name.endsWith(".msg")
- && !name.endsWith(".py")
&& !name.endsWith(".png")
&& !name.endsWith(".ppm")
+ && !name.endsWith(".py")
+ && !name.endsWith(".pyc")
&& !name.endsWith(".quests")
- && !name.endsWith(".animation")
+ && !name.endsWith(".txt")
+ && !name.endsWith(".zip")
&& !name.equals("pshop_copier")
&& !name.equals("pshops_changelog")
&& !name.equals(".emergency")
&& !name.equals("ChangeLog")
&& !name.equals("COPYING")
+ && !name.equals("TODO")
&& !path.contains("/Info/")
&& !path.contains("/editor/scripts/")) {
checkMap(file, file.getPath().substring(mapDefaultFolder.length()));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-28 19:32:12
|
Revision: 14730
http://crossfire.svn.sourceforge.net/crossfire/?rev=14730&view=rev
Author: akirschbaum
Date: 2011-06-28 19:32:05 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
Remove traps from floor inventories. Places them directly on the ground.
Modified Paths:
--------------
maps/trunk/quests/peterm/FireTemple/FifthFloor
maps/trunk/quests/peterm/FireTemple/FourthFloor
Modified: maps/trunk/quests/peterm/FireTemple/FifthFloor
===================================================================
--- maps/trunk/quests/peterm/FireTemple/FifthFloor 2011-06-28 19:30:37 UTC (rev 14729)
+++ maps/trunk/quests/peterm/FireTemple/FifthFloor 2011-06-28 19:32:05 UTC (rev 14730)
@@ -8,7 +8,7 @@
enter_y 9
msg
Created: 1997-05-23 PeterM (pe...@so...)
-Modified: 2008-12-21 Rick Tanner
+Modified: 2011-06-28 Andreas Kirschbaum
endmsg
end
arch cobblestones
@@ -7364,11 +7364,13 @@
arch cobblestones
x 26
y 9
+end
arch rune_large_fireball
Cha 30
+x 26
+y 9
level 20
end
-end
arch cobblestones
x 26
y 10
Modified: maps/trunk/quests/peterm/FireTemple/FourthFloor
===================================================================
--- maps/trunk/quests/peterm/FireTemple/FourthFloor 2011-06-28 19:30:37 UTC (rev 14729)
+++ maps/trunk/quests/peterm/FireTemple/FourthFloor 2011-06-28 19:32:05 UTC (rev 14730)
@@ -8,7 +8,7 @@
enter_y 10
msg
Created: 1997-05-23 PeterM (pe...@so...)
-Modified: 2008-12-21 Rick Tanner
+Modified: 2011-06-28 Andreas Kirschbaum
endmsg
end
arch cobblestones
@@ -7405,11 +7405,13 @@
arch cobblestones
x 26
y 9
+end
arch rune_large_fireball
Cha 30
+x 26
+y 9
level 20
end
-end
arch cobblestones
x 26
y 10
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Crossfire C. r. messages.
<cro...@li...> - 2011-06-28 19:30:43
|
Revision: 14729
http://crossfire.svn.sourceforge.net/crossfire/?rev=14729&view=rev
Author: akirschbaum
Date: 2011-06-28 19:30:37 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
Remove stray gate from an inventory checker's inventory.
Modified Paths:
--------------
maps/trunk/dragonisland/advguild
Modified: maps/trunk/dragonisland/advguild
===================================================================
--- maps/trunk/dragonisland/advguild 2011-06-28 19:29:19 UTC (rev 14728)
+++ maps/trunk/dragonisland/advguild 2011-06-28 19:30:37 UTC (rev 14729)
@@ -10,7 +10,7 @@
enter_y 31
msg
Created: 1997-07-10 Viola Krings
-Modified: 2008-12-21 Rick Tanner
+Modified: 2011-06-28 Andreas Kirschbaum
endmsg
end
arch woodfloor
@@ -1257,9 +1257,7 @@
x 6
y 4
connected 102
-arch igate_closed_1
end
-end
arch woodfloor
x 6
y 5
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|