mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-12-22 15:38:52 -05:00
Fixed bug with PacketThrottler, and made TileValues actual value objects. TileValues no longer have duplicate instances, which drastically reduces memory usage.
This commit is contained in:
parent
eb9c5f6e85
commit
dd025770c0
@ -101,8 +101,13 @@ public class PacketThrottler extends IoFilterAdapter {
|
||||
// needs to be synchronized.
|
||||
synchronized (playerToPacketCount) {
|
||||
|
||||
// If it is null, it will default to 0
|
||||
count = playerToPacketCount.get(hash) + 1;
|
||||
// If it is null, default to 0
|
||||
Integer i = playerToPacketCount.get(hash);
|
||||
if(i == null) {
|
||||
count = 1;
|
||||
} else {
|
||||
count = i + 1;
|
||||
}
|
||||
|
||||
// Update/Create entry
|
||||
playerToPacketCount.put(hash, count);
|
||||
|
@ -15,11 +15,11 @@ import org.moparscape.msc.gs.connection.PacketQueue;
|
||||
import org.moparscape.msc.gs.connection.RSCPacket;
|
||||
import org.moparscape.msc.gs.connection.filter.IPBanManager;
|
||||
import org.moparscape.msc.gs.event.DelayedEvent;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Shop;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.snapshot.Snapshot;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandlerDef;
|
||||
|
@ -1,9 +1,9 @@
|
||||
package org.moparscape.msc.gs.event;
|
||||
|
||||
import org.moparscape.msc.gs.Instance;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
|
||||
public class ObjectRemover extends DelayedEvent {
|
||||
public static final World world = Instance.getWorld();
|
||||
|
@ -10,9 +10,9 @@ import org.moparscape.msc.gs.model.InvItem;
|
||||
import org.moparscape.msc.gs.model.Item;
|
||||
import org.moparscape.msc.gs.model.Mob;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Projectile;
|
||||
import org.moparscape.msc.gs.model.landscape.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.mini.Damage;
|
||||
import org.moparscape.msc.gs.states.Action;
|
||||
import org.moparscape.msc.gs.tools.DataConversions;
|
||||
|
@ -16,9 +16,10 @@ import org.moparscape.msc.gs.external.NPCLoc;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
import org.moparscape.msc.gs.model.Item;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.Sector;
|
||||
import org.moparscape.msc.gs.model.Shop;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.MutableTileValue;
|
||||
import org.moparscape.msc.gs.model.landscape.Sector;
|
||||
import org.moparscape.msc.gs.tools.DataConversions;
|
||||
import org.moparscape.msc.gs.util.Logger;
|
||||
|
||||
@ -53,12 +54,13 @@ public class WorldLoader {
|
||||
if (!world.withinWorld(bx, by)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
world.getTileValue(bx, by).overlay = s.getTile(x, y).groundOverlay;
|
||||
world.getTileValue(bx, by).diagWallVal = s.getTile(x, y).diagonalWalls;
|
||||
world.getTileValue(bx, by).horizontalWallVal = s.getTile(x, y).horizontalWall;
|
||||
world.getTileValue(bx, by).verticalWallVal = s.getTile(x, y).verticalWall;
|
||||
world.getTileValue(bx, by).elevation = s.getTile(x, y).groundElevation;
|
||||
|
||||
MutableTileValue t = new MutableTileValue(world.getTileValue(bx, by));
|
||||
t.overlay = s.getTile(x, y).groundOverlay;
|
||||
t.diagWallVal = s.getTile(x, y).diagonalWalls;
|
||||
t.horizontalWallVal = s.getTile(x, y).horizontalWall;
|
||||
t.verticalWallVal = s.getTile(x, y).verticalWall;
|
||||
t.elevation = s.getTile(x, y).groundElevation;
|
||||
/** start of shit **/
|
||||
if ((s.getTile(x, y).groundOverlay & 0xff) == 250) {
|
||||
s.getTile(x, y).groundOverlay = (byte) 2;
|
||||
@ -68,7 +70,7 @@ public class WorldLoader {
|
||||
if (groundOverlay > 0
|
||||
&& EntityHandler.getTileDef(groundOverlay - 1)
|
||||
.getObjectType() != 0) {
|
||||
world.getTileValue(bx, by).mapValue |= 0x40; // 64
|
||||
t.mapValue |= 0x40; // 64
|
||||
}
|
||||
|
||||
int verticalWall = s.getTile(x, y).verticalWall & 0xFF;
|
||||
@ -77,8 +79,10 @@ public class WorldLoader {
|
||||
.getUnknown() == 0
|
||||
&& EntityHandler.getDoorDef(verticalWall - 1)
|
||||
.getDoorType() != 0) {
|
||||
world.getTileValue(bx, by).mapValue |= 1; // 1
|
||||
world.getTileValue(bx, by - 1).mapValue |= 4; // 4
|
||||
t.mapValue |= 1; // 1
|
||||
MutableTileValue t1 = new MutableTileValue(world.getTileValue(bx, by - 1));
|
||||
t1.mapValue |= 4; // 4
|
||||
world.setTileValue(bx, by - 1, t1.toTileValue());
|
||||
}
|
||||
|
||||
int horizontalWall = s.getTile(x, y).horizontalWall & 0xFF;
|
||||
@ -87,8 +91,10 @@ public class WorldLoader {
|
||||
.getUnknown() == 0
|
||||
&& EntityHandler.getDoorDef(horizontalWall - 1)
|
||||
.getDoorType() != 0) {
|
||||
world.getTileValue(bx, by).mapValue |= 2; // 2
|
||||
world.getTileValue(bx - 1, by).mapValue |= 8; // 8
|
||||
t.mapValue |= 2; // 2
|
||||
MutableTileValue t1 = new MutableTileValue(world.getTileValue(bx - 1, by));
|
||||
t1.mapValue |= 8;
|
||||
world.setTileValue(bx - 1, by, t1.toTileValue());
|
||||
}
|
||||
|
||||
int diagonalWalls = s.getTile(x, y).diagonalWalls;
|
||||
@ -98,7 +104,7 @@ public class WorldLoader {
|
||||
.getUnknown() == 0
|
||||
&& EntityHandler.getDoorDef(diagonalWalls - 1)
|
||||
.getDoorType() != 0) {
|
||||
world.getTileValue(bx, by).mapValue |= 0x20; // 32
|
||||
t.mapValue |= 0x20; // 32
|
||||
}
|
||||
if (diagonalWalls > 12000
|
||||
&& diagonalWalls < 24000
|
||||
@ -106,8 +112,9 @@ public class WorldLoader {
|
||||
.getUnknown() == 0
|
||||
&& EntityHandler.getDoorDef(diagonalWalls - 12001)
|
||||
.getDoorType() != 0) {
|
||||
world.getTileValue(bx, by).mapValue |= 0x10; // 16
|
||||
t.mapValue |= 0x10; // 16
|
||||
}
|
||||
world.setTileValue(bx, by, t.toTileValue());
|
||||
/** end of shit **/
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import org.moparscape.msc.gs.external.EntityHandler;
|
||||
import org.moparscape.msc.gs.external.ItemDropDef;
|
||||
import org.moparscape.msc.gs.external.NPCDef;
|
||||
import org.moparscape.msc.gs.external.NPCLoc;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.plugins.dependencies.NpcAI;
|
||||
import org.moparscape.msc.gs.states.Action;
|
||||
import org.moparscape.msc.gs.states.CombatState;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.moparscape.msc.gs.model;
|
||||
|
||||
import org.moparscape.msc.gs.Instance;
|
||||
import org.moparscape.msc.gs.model.landscape.TileValue;
|
||||
|
||||
public class PathHandler {
|
||||
/**
|
||||
|
@ -1,11 +0,0 @@
|
||||
package org.moparscape.msc.gs.model;
|
||||
|
||||
public class TileValue {
|
||||
public int diagWallVal = 0;
|
||||
public byte horizontalWallVal = 0;
|
||||
public byte mapValue = 0;
|
||||
public byte objectValue = 0;
|
||||
public byte overlay = 0;
|
||||
public byte verticalWallVal = 0;
|
||||
public byte elevation = 0;
|
||||
}
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.moparscape.msc.gs.Instance;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
|
||||
public class ViewArea {
|
||||
private static World world = Instance.getWorld();
|
||||
|
@ -19,6 +19,9 @@ import org.moparscape.msc.gs.event.SingleEvent;
|
||||
import org.moparscape.msc.gs.external.GameObjectLoc;
|
||||
import org.moparscape.msc.gs.external.NPCLoc;
|
||||
import org.moparscape.msc.gs.io.WorldLoader;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.landscape.MutableTileValue;
|
||||
import org.moparscape.msc.gs.model.landscape.TileValue;
|
||||
import org.moparscape.msc.gs.model.snapshot.Snapshot;
|
||||
import org.moparscape.msc.gs.npchandler.NpcHandler;
|
||||
import org.moparscape.msc.gs.npchandler.NpcHandlerDef;
|
||||
@ -427,7 +430,7 @@ public final class World {
|
||||
}
|
||||
TileValue t = tileType[x][y];
|
||||
if (t == null) {
|
||||
t = new TileValue();
|
||||
t = TileValue.create(0, new byte[6]);
|
||||
tileType[x][y] = t;
|
||||
}
|
||||
return t;
|
||||
@ -468,7 +471,8 @@ public final class World {
|
||||
|
||||
/**
|
||||
* Loads the npc handling classes
|
||||
* @throws Exception
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private void loadNpcHandlers() throws Exception {
|
||||
|
||||
@ -498,17 +502,23 @@ public final class World {
|
||||
}
|
||||
int dir = o.getDirection();
|
||||
int x = o.getX(), y = o.getY();
|
||||
MutableTileValue t = new MutableTileValue(getTileValue(x, y));
|
||||
if (dir == 0) {
|
||||
getTileValue(x, y).objectValue |= 1;
|
||||
getTileValue(x, y - 1).objectValue |= 4;
|
||||
t.objectValue |= 1;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x, y - 1));
|
||||
t1.objectValue |= 4;
|
||||
setTileValue(x, y - 1, t1.toTileValue());
|
||||
} else if (dir == 1) {
|
||||
getTileValue(x, y).objectValue |= 2;
|
||||
getTileValue(x - 1, y).objectValue |= 8;
|
||||
t.objectValue |= 2;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x - 1, y));
|
||||
t1.objectValue |= 8;
|
||||
setTileValue(x - 1, y, t1.toTileValue());
|
||||
} else if (dir == 2) {
|
||||
getTileValue(x, y).objectValue |= 0x10;
|
||||
t.objectValue |= 0x10;
|
||||
} else if (dir == 3) {
|
||||
getTileValue(x, y).objectValue |= 0x20;
|
||||
t.objectValue |= 0x20;
|
||||
}
|
||||
setTileValue(x, y, t.toTileValue());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -582,21 +592,31 @@ public final class World {
|
||||
}
|
||||
for (int x = o.getX(); x < o.getX() + width; x++) {
|
||||
for (int y = o.getY(); y < o.getY() + height; y++) {
|
||||
MutableTileValue t = new MutableTileValue(getTileValue(x, y));
|
||||
if (o.getGameObjectDef().getType() == 1) {
|
||||
getTileValue(x, y).objectValue |= 0x40;
|
||||
t.objectValue |= 0x40;
|
||||
} else if (dir == 0) {
|
||||
getTileValue(x, y).objectValue |= 2;
|
||||
getTileValue(x - 1, y).objectValue |= 8;
|
||||
t.objectValue |= 2;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x - 1, y));
|
||||
t1.objectValue |= 8;
|
||||
setTileValue(x - 1, y, t1.toTileValue());
|
||||
} else if (dir == 2) {
|
||||
getTileValue(x, y).objectValue |= 4;
|
||||
getTileValue(x, y + 1).objectValue |= 1;
|
||||
t.objectValue |= 4;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x, y + 1));
|
||||
t1.objectValue |= 1;
|
||||
setTileValue(x, y + 1, t1.toTileValue());
|
||||
} else if (dir == 4) {
|
||||
getTileValue(x, y).objectValue |= 8;
|
||||
getTileValue(x + 1, y).objectValue |= 2;
|
||||
t.objectValue |= 8;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x + 1, y));
|
||||
t1.objectValue |= 2;
|
||||
setTileValue(x + 1, y, t1.toTileValue());
|
||||
} else if (dir == 6) {
|
||||
getTileValue(x, y).objectValue |= 1;
|
||||
getTileValue(x, y - 1).objectValue |= 4;
|
||||
t.objectValue |= 1;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x, y - 1));
|
||||
t1.objectValue |= 4;
|
||||
setTileValue(x, y - 1, t1.toTileValue());
|
||||
}
|
||||
setTileValue(x, y, t.toTileValue());
|
||||
}
|
||||
}
|
||||
|
||||
@ -702,17 +722,24 @@ public final class World {
|
||||
}
|
||||
int dir = o.getDirection();
|
||||
int x = o.getX(), y = o.getY();
|
||||
MutableTileValue t = new MutableTileValue(getTileValue(x, y));
|
||||
|
||||
if (dir == 0) {
|
||||
getTileValue(x, y).objectValue &= 0xfffe;
|
||||
getTileValue(x, y - 1).objectValue &= 65535 - 4;
|
||||
t.objectValue &= 0xfffe;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x, y - 1));
|
||||
t1.objectValue &= 65535 - 4;
|
||||
setTileValue(x, y - 1, t1.toTileValue());
|
||||
} else if (dir == 1) {
|
||||
getTileValue(x, y).objectValue &= 0xfffd;
|
||||
getTileValue(x - 1, y).objectValue &= 65535 - 8;
|
||||
t.objectValue &= 0xfffd;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x - 1, y));
|
||||
t1.objectValue &= 65535 - 8;
|
||||
setTileValue(x - 1, y, t1.toTileValue());
|
||||
} else if (dir == 2) {
|
||||
getTileValue(x, y).objectValue &= 0xffef;
|
||||
t.objectValue &= 0xffef;
|
||||
} else if (dir == 3) {
|
||||
getTileValue(x, y).objectValue &= 0xffdf;
|
||||
t.objectValue &= 0xffdf;
|
||||
}
|
||||
setTileValue(x, y, t.toTileValue());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -768,21 +795,32 @@ public final class World {
|
||||
}
|
||||
for (int x = o.getX(); x < o.getX() + width; x++) {
|
||||
for (int y = o.getY(); y < o.getY() + height; y++) {
|
||||
MutableTileValue t = new MutableTileValue(getTileValue(x, y));
|
||||
|
||||
if (o.getGameObjectDef().getType() == 1) {
|
||||
getTileValue(x, y).objectValue &= 0xffbf;
|
||||
t.objectValue &= 0xffbf;
|
||||
} else if (dir == 0) {
|
||||
getTileValue(x, y).objectValue &= 0xfffd;
|
||||
getTileValue(x - 1, y).objectValue &= 65535 - 8;
|
||||
t.objectValue &= 0xfffd;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x - 1, y));
|
||||
t1.objectValue &= 65535 - 8;
|
||||
setTileValue(x - 1, y, t1.toTileValue());
|
||||
} else if (dir == 2) {
|
||||
getTileValue(x, y).objectValue &= 0xfffb;
|
||||
getTileValue(x, y + 1).objectValue &= 65535 - 1;
|
||||
t.objectValue &= 0xfffb;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x, y + 1));
|
||||
t1.objectValue &= 65535 - 1;
|
||||
setTileValue(x, y + 1, t1.toTileValue());
|
||||
} else if (dir == 4) {
|
||||
getTileValue(x, y).objectValue &= 0xfff7;
|
||||
getTileValue(x + 1, y).objectValue &= 65535 - 2;
|
||||
t.objectValue &= 0xfff7;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x + 1, y));
|
||||
t1.objectValue &= 65535 - 2;
|
||||
setTileValue(x + 1, y, t1.toTileValue());
|
||||
} else if (dir == 6) {
|
||||
getTileValue(x, y).objectValue &= 0xfffe;
|
||||
getTileValue(x, y - 1).objectValue &= 65535 - 4;
|
||||
t.objectValue &= 0xfffe;
|
||||
MutableTileValue t1 = new MutableTileValue(getTileValue(x, y - 1));
|
||||
t1.objectValue &= 65535 - 4;
|
||||
setTileValue(x, y - 1, t1.toTileValue());
|
||||
}
|
||||
setTileValue(x, y, t.toTileValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -812,4 +850,8 @@ public final class World {
|
||||
public boolean withinWorld(int x, int y) {
|
||||
return x >= 0 && x < MAX_WIDTH && y >= 0 && y < MAX_HEIGHT;
|
||||
}
|
||||
|
||||
public void setTileValue(int x, int y, TileValue tileValue) {
|
||||
tileType[x][y] = tileValue;
|
||||
}
|
||||
}
|
||||
|
@ -1,155 +1,162 @@
|
||||
package org.moparscape.msc.gs.model;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.moparscape.msc.config.Formulae;
|
||||
import org.moparscape.msc.gs.Instance;
|
||||
import org.moparscape.msc.gs.tools.DataConversions;
|
||||
|
||||
public class ActiveTile {
|
||||
|
||||
/**
|
||||
* World instance
|
||||
*/
|
||||
private static World world = Instance.getWorld();
|
||||
/**
|
||||
* A list of all items currently on this tile
|
||||
*/
|
||||
private List<Item> items = new LinkedList<Item>();
|
||||
/**
|
||||
* A list of all npcs currently on this tile
|
||||
*/
|
||||
private List<Npc> npcs = new LinkedList<Npc>();
|
||||
/**
|
||||
* The object currently on this tile (can only have 1 at a time)
|
||||
*/
|
||||
private GameObject object = null;
|
||||
/**
|
||||
* A list of all players currently on this tile
|
||||
*/
|
||||
private List<Player> players = new LinkedList<Player>();
|
||||
/**
|
||||
* The x and y coordinates of this tile
|
||||
*/
|
||||
private int x, y;
|
||||
|
||||
/**
|
||||
* Constructs a new tile at the given coordinates
|
||||
*/
|
||||
public ActiveTile(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public boolean remove = false;
|
||||
|
||||
/**
|
||||
* Add an entity to the tile
|
||||
*/
|
||||
public void add(Entity entity) {
|
||||
if (entity instanceof Player) {
|
||||
players.add((Player) entity);
|
||||
} else if (entity instanceof Npc) {
|
||||
npcs.add((Npc) entity);
|
||||
} else if (entity instanceof Item) {
|
||||
items.add((Item) entity);
|
||||
} else if (entity instanceof GameObject) {
|
||||
if (object != null) {
|
||||
remove = true;
|
||||
world.unregisterGameObject(object);
|
||||
remove = false;
|
||||
}
|
||||
object = (GameObject) entity;
|
||||
}
|
||||
}
|
||||
|
||||
public GameObject getGameObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
public List<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public List<Npc> getNpcs() {
|
||||
return npcs;
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
return players;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public boolean hasGameObject() {
|
||||
return object != null;
|
||||
}
|
||||
|
||||
public boolean hasItem(Item item) {
|
||||
return items.contains(item);
|
||||
}
|
||||
|
||||
public boolean hasItems() {
|
||||
return items != null && items.size() > 0;
|
||||
}
|
||||
|
||||
public boolean hasNpcs() {
|
||||
return npcs != null && npcs.size() > 0;
|
||||
}
|
||||
|
||||
public boolean hasPlayers() {
|
||||
return players != null && players.size() > 0;
|
||||
}
|
||||
|
||||
public boolean specificArea() {
|
||||
boolean t = DataConversions.inPointArray(Formulae.noremoveTiles,
|
||||
new Point(this.getX(), this.getY()));
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an entity from the tile
|
||||
*/
|
||||
public void remove(Entity entity) {
|
||||
if (entity instanceof Player) {
|
||||
players.remove(entity);
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !this.specificArea()) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
} else if (entity instanceof Npc) {
|
||||
npcs.remove(entity);
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !this.specificArea()) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
} else if (entity instanceof Item) {
|
||||
items.remove(entity);
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !this.specificArea()) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
} else if (entity instanceof GameObject) {
|
||||
object = null;
|
||||
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !remove) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanItself() {
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !this.specificArea()) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
package org.moparscape.msc.gs.model.landscape;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.moparscape.msc.config.Formulae;
|
||||
import org.moparscape.msc.gs.Instance;
|
||||
import org.moparscape.msc.gs.model.Entity;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
import org.moparscape.msc.gs.model.Item;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Point;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.tools.DataConversions;
|
||||
|
||||
public class ActiveTile {
|
||||
|
||||
/**
|
||||
* World instance
|
||||
*/
|
||||
private static World world = Instance.getWorld();
|
||||
/**
|
||||
* A list of all items currently on this tile
|
||||
*/
|
||||
private List<Item> items = new LinkedList<Item>();
|
||||
/**
|
||||
* A list of all npcs currently on this tile
|
||||
*/
|
||||
private List<Npc> npcs = new LinkedList<Npc>();
|
||||
/**
|
||||
* The object currently on this tile (can only have 1 at a time)
|
||||
*/
|
||||
private GameObject object = null;
|
||||
/**
|
||||
* A list of all players currently on this tile
|
||||
*/
|
||||
private List<Player> players = new LinkedList<Player>();
|
||||
/**
|
||||
* The x and y coordinates of this tile
|
||||
*/
|
||||
private int x, y;
|
||||
|
||||
/**
|
||||
* Constructs a new tile at the given coordinates
|
||||
*/
|
||||
public ActiveTile(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public boolean remove = false;
|
||||
|
||||
/**
|
||||
* Add an entity to the tile
|
||||
*/
|
||||
public void add(Entity entity) {
|
||||
if (entity instanceof Player) {
|
||||
players.add((Player) entity);
|
||||
} else if (entity instanceof Npc) {
|
||||
npcs.add((Npc) entity);
|
||||
} else if (entity instanceof Item) {
|
||||
items.add((Item) entity);
|
||||
} else if (entity instanceof GameObject) {
|
||||
if (object != null) {
|
||||
remove = true;
|
||||
world.unregisterGameObject(object);
|
||||
remove = false;
|
||||
}
|
||||
object = (GameObject) entity;
|
||||
}
|
||||
}
|
||||
|
||||
public GameObject getGameObject() {
|
||||
return object;
|
||||
}
|
||||
|
||||
public List<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public List<Npc> getNpcs() {
|
||||
return npcs;
|
||||
}
|
||||
|
||||
public List<Player> getPlayers() {
|
||||
return players;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public boolean hasGameObject() {
|
||||
return object != null;
|
||||
}
|
||||
|
||||
public boolean hasItem(Item item) {
|
||||
return items.contains(item);
|
||||
}
|
||||
|
||||
public boolean hasItems() {
|
||||
return items != null && items.size() > 0;
|
||||
}
|
||||
|
||||
public boolean hasNpcs() {
|
||||
return npcs != null && npcs.size() > 0;
|
||||
}
|
||||
|
||||
public boolean hasPlayers() {
|
||||
return players != null && players.size() > 0;
|
||||
}
|
||||
|
||||
public boolean specificArea() {
|
||||
boolean t = DataConversions.inPointArray(Formulae.noremoveTiles,
|
||||
new Point(this.getX(), this.getY()));
|
||||
return t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an entity from the tile
|
||||
*/
|
||||
public void remove(Entity entity) {
|
||||
if (entity instanceof Player) {
|
||||
players.remove(entity);
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !this.specificArea()) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
} else if (entity instanceof Npc) {
|
||||
npcs.remove(entity);
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !this.specificArea()) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
} else if (entity instanceof Item) {
|
||||
items.remove(entity);
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !this.specificArea()) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
} else if (entity instanceof GameObject) {
|
||||
object = null;
|
||||
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !remove) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanItself() {
|
||||
if (!this.hasGameObject() && !this.hasItems() && !this.hasNpcs()
|
||||
&& !this.hasPlayers() && !this.specificArea()) {
|
||||
Instance.getWorld().tiles[this.getX()][this.getY()] = null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package org.moparscape.msc.gs.model.landscape;
|
||||
|
||||
public class MutableTileValue {
|
||||
|
||||
public MutableTileValue(TileValue t) {
|
||||
this.diagWallVal = t.diagWallVal;
|
||||
this.horizontalWallVal = t.horizontalWallVal;
|
||||
this.mapValue = t.mapValue;
|
||||
this.objectValue = t.objectValue;
|
||||
this.verticalWallVal = t.verticalWallVal;
|
||||
this.elevation = t.elevation;
|
||||
}
|
||||
|
||||
public int diagWallVal;
|
||||
public byte horizontalWallVal;
|
||||
public byte mapValue;
|
||||
public byte objectValue;
|
||||
public byte overlay;
|
||||
public byte verticalWallVal;
|
||||
public byte elevation;
|
||||
|
||||
public TileValue toTileValue() {
|
||||
return TileValue.create(diagWallVal, new byte[] { horizontalWallVal,
|
||||
mapValue, objectValue, overlay, verticalWallVal, elevation });
|
||||
}
|
||||
}
|
@ -1,216 +1,216 @@
|
||||
package org.moparscape.msc.gs.model;
|
||||
|
||||
import org.moparscape.msc.gs.Instance;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author xEnt Class generates a path and checks if the path is valid or not.
|
||||
*/
|
||||
public class PathGenerator {
|
||||
|
||||
/**
|
||||
* If the tile has a wall on it, here is a list of the wall id's allowed to
|
||||
* shoot thru Use the landscape editor to record their ID's
|
||||
*/
|
||||
public static final int[][] ALLOWED_WALL_ID_TYPES = { { 5, 6, 42, 14 }, // VERTICAL
|
||||
// //
|
||||
// WALL
|
||||
// ID's
|
||||
{ 5, 6, 42, 14 }, // HORIZONTAL WALL ID's
|
||||
{ 229, 5 } // DIAGONAL WALL ID's
|
||||
};
|
||||
|
||||
private int destX;
|
||||
|
||||
private int destY;
|
||||
|
||||
private int ourX;
|
||||
|
||||
private int ourY;
|
||||
|
||||
private int stuckX;
|
||||
|
||||
private int stuckY;
|
||||
|
||||
public PathGenerator(int x, int y, int destx, int desty) {
|
||||
ourX = x;
|
||||
ourY = y;
|
||||
destX = destx;
|
||||
destY = desty;
|
||||
}
|
||||
|
||||
private int[] cancelCoords(int x, int y) {
|
||||
stuckX = x;
|
||||
stuckY = y;
|
||||
return new int[] { -1, -1 };
|
||||
}
|
||||
|
||||
private int[] getNextCoords(int startX, int destX, int startY, int destY) {
|
||||
try {
|
||||
int[] coords = { startX, startY };
|
||||
boolean myXBlocked = false, myYBlocked = false, newXBlocked = false, newYBlocked = false;
|
||||
if (startX > destX) {
|
||||
myXBlocked = isBlocking(startX - 1, startY, 8); // Check right
|
||||
// tiles left
|
||||
// wall
|
||||
coords[0] = startX - 1;
|
||||
} else if (startX < destX) {
|
||||
myXBlocked = isBlocking(startX + 1, startY, 2); // Check left
|
||||
// tiles right
|
||||
// wall
|
||||
coords[0] = startX + 1;
|
||||
}
|
||||
|
||||
if (startY > destY) {
|
||||
myYBlocked = isBlocking(startX, startY - 1, 4); // Check top
|
||||
// tiles bottom
|
||||
// wall
|
||||
coords[1] = startY - 1;
|
||||
} else if (startY < destY) {
|
||||
myYBlocked = isBlocking(startX, startY + 1, 1); // Check bottom
|
||||
// tiles top
|
||||
// wall
|
||||
coords[1] = startY + 1;
|
||||
}
|
||||
|
||||
// If both directions are blocked OR we are going straight and the
|
||||
// direction is blocked
|
||||
if ((myXBlocked && myYBlocked) || (myXBlocked && startY == destY)
|
||||
|| (myYBlocked && startX == destX)) {
|
||||
return cancelCoords(coords[0], coords[1]);
|
||||
}
|
||||
|
||||
if (coords[0] > startX) {
|
||||
newXBlocked = isBlocking(coords[0], coords[1], 2); // Check dest
|
||||
// tiles
|
||||
// right
|
||||
// wall
|
||||
} else if (coords[0] < startX) {
|
||||
newXBlocked = isBlocking(coords[0], coords[1], 8); // Check dest
|
||||
// tiles
|
||||
// left wall
|
||||
}
|
||||
|
||||
if (coords[1] > startY) {
|
||||
newYBlocked = isBlocking(coords[0], coords[1], 1); // Check dest
|
||||
// tiles top
|
||||
// wall
|
||||
} else if (coords[1] < startY) {
|
||||
newYBlocked = isBlocking(coords[0], coords[1], 4); // Check dest
|
||||
// tiles
|
||||
// bottom
|
||||
// wall
|
||||
}
|
||||
|
||||
// If both directions are blocked OR we are going straight and the
|
||||
// direction is blocked
|
||||
if ((newXBlocked && newYBlocked)
|
||||
|| (newXBlocked && startY == coords[1])
|
||||
|| (myYBlocked && startX == coords[0])) {
|
||||
|
||||
return cancelCoords(coords[0], coords[1]);
|
||||
}
|
||||
|
||||
// If only one direction is blocked, but it blocks both tiles
|
||||
if ((myXBlocked && newXBlocked) || (myYBlocked && newYBlocked)) {
|
||||
return cancelCoords(coords[0], coords[1]);
|
||||
}
|
||||
|
||||
return coords;
|
||||
} catch (Exception e) {
|
||||
return cancelCoords(-1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isBlocking(byte val, byte bit) {
|
||||
if ((val & bit) != 0) { // There is a wall in the way
|
||||
return true;
|
||||
}
|
||||
if ((val & 16) != 0) { // There is a diagonal wall here: \
|
||||
return true;
|
||||
}
|
||||
if ((val & 32) != 0) { // There is a diagonal wall here: /
|
||||
return true;
|
||||
}
|
||||
if ((val & 64) != 0) { // This tile is un walkable
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isBlocking(int x, int y, int bit) {
|
||||
TileValue t = Instance.getWorld().getTileValue(x, y);
|
||||
ActiveTile tile = Instance.getWorld().getTile(x, y);
|
||||
if (tile.hasGameObject()) {
|
||||
if (tile.getGameObject().getGameObjectDef().name
|
||||
.equalsIgnoreCase("tree")) {
|
||||
return true;
|
||||
}
|
||||
} else
|
||||
tile.cleanItself();
|
||||
if (t.overlay == 2 || t.overlay == 11) // water & lava
|
||||
return false;
|
||||
return isBlocking(t.mapValue, (byte) bit);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return - if the path is valid to shoot a projectile too
|
||||
*/
|
||||
public boolean isValid() {
|
||||
return !isWallInbetween();
|
||||
}
|
||||
|
||||
/**
|
||||
* I've added the wall data to TileValue, now we can allow certain walls to
|
||||
* be shot through.
|
||||
*/
|
||||
private boolean isWallAllowed(int x, int y) {
|
||||
TileValue t = Instance.getWorld().getTileValue(x, y);
|
||||
if (t != null) {
|
||||
for (int i = 0; i < ALLOWED_WALL_ID_TYPES[0].length; i++)
|
||||
if (ALLOWED_WALL_ID_TYPES[0][i] == (t.verticalWallVal & 0xff))
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < ALLOWED_WALL_ID_TYPES[1].length; i++)
|
||||
if (ALLOWED_WALL_ID_TYPES[1][i] == (t.horizontalWallVal & 0xff))
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < ALLOWED_WALL_ID_TYPES[2].length; i++)
|
||||
if (ALLOWED_WALL_ID_TYPES[2][i] == t.diagWallVal)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author xEnt Calculations to check if a wall is in between your target
|
||||
* your ranging/maging at
|
||||
*/
|
||||
private boolean isWallInbetween() {
|
||||
|
||||
int enemyX = destX;
|
||||
int enemyY = destY;
|
||||
|
||||
int newX = ourX;
|
||||
int newY = ourY;
|
||||
int[] coords;
|
||||
int count = 0;
|
||||
while (true) {
|
||||
count++;
|
||||
if (count > 30) // this should not happen
|
||||
break; // in case something goes wrong, let's not tie up the CPU
|
||||
|
||||
coords = getNextCoords(newX, enemyX, newY, enemyY);
|
||||
newX = coords[0];
|
||||
newY = coords[1];
|
||||
if (newX == -1)
|
||||
return !isWallAllowed(stuckX, stuckY);
|
||||
|
||||
if (newX == enemyX && newY == enemyY)
|
||||
return false;
|
||||
}
|
||||
return false; // should not happen.
|
||||
}
|
||||
|
||||
}
|
||||
package org.moparscape.msc.gs.model.landscape;
|
||||
|
||||
import org.moparscape.msc.gs.Instance;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author xEnt Class generates a path and checks if the path is valid or not.
|
||||
*/
|
||||
public class PathGenerator {
|
||||
|
||||
/**
|
||||
* If the tile has a wall on it, here is a list of the wall id's allowed to
|
||||
* shoot thru Use the landscape editor to record their ID's
|
||||
*/
|
||||
public static final int[][] ALLOWED_WALL_ID_TYPES = { { 5, 6, 42, 14 }, // VERTICAL
|
||||
// //
|
||||
// WALL
|
||||
// ID's
|
||||
{ 5, 6, 42, 14 }, // HORIZONTAL WALL ID's
|
||||
{ 229, 5 } // DIAGONAL WALL ID's
|
||||
};
|
||||
|
||||
private int destX;
|
||||
|
||||
private int destY;
|
||||
|
||||
private int ourX;
|
||||
|
||||
private int ourY;
|
||||
|
||||
private int stuckX;
|
||||
|
||||
private int stuckY;
|
||||
|
||||
public PathGenerator(int x, int y, int destx, int desty) {
|
||||
ourX = x;
|
||||
ourY = y;
|
||||
destX = destx;
|
||||
destY = desty;
|
||||
}
|
||||
|
||||
private int[] cancelCoords(int x, int y) {
|
||||
stuckX = x;
|
||||
stuckY = y;
|
||||
return new int[] { -1, -1 };
|
||||
}
|
||||
|
||||
private int[] getNextCoords(int startX, int destX, int startY, int destY) {
|
||||
try {
|
||||
int[] coords = { startX, startY };
|
||||
boolean myXBlocked = false, myYBlocked = false, newXBlocked = false, newYBlocked = false;
|
||||
if (startX > destX) {
|
||||
myXBlocked = isBlocking(startX - 1, startY, 8); // Check right
|
||||
// tiles left
|
||||
// wall
|
||||
coords[0] = startX - 1;
|
||||
} else if (startX < destX) {
|
||||
myXBlocked = isBlocking(startX + 1, startY, 2); // Check left
|
||||
// tiles right
|
||||
// wall
|
||||
coords[0] = startX + 1;
|
||||
}
|
||||
|
||||
if (startY > destY) {
|
||||
myYBlocked = isBlocking(startX, startY - 1, 4); // Check top
|
||||
// tiles bottom
|
||||
// wall
|
||||
coords[1] = startY - 1;
|
||||
} else if (startY < destY) {
|
||||
myYBlocked = isBlocking(startX, startY + 1, 1); // Check bottom
|
||||
// tiles top
|
||||
// wall
|
||||
coords[1] = startY + 1;
|
||||
}
|
||||
|
||||
// If both directions are blocked OR we are going straight and the
|
||||
// direction is blocked
|
||||
if ((myXBlocked && myYBlocked) || (myXBlocked && startY == destY)
|
||||
|| (myYBlocked && startX == destX)) {
|
||||
return cancelCoords(coords[0], coords[1]);
|
||||
}
|
||||
|
||||
if (coords[0] > startX) {
|
||||
newXBlocked = isBlocking(coords[0], coords[1], 2); // Check dest
|
||||
// tiles
|
||||
// right
|
||||
// wall
|
||||
} else if (coords[0] < startX) {
|
||||
newXBlocked = isBlocking(coords[0], coords[1], 8); // Check dest
|
||||
// tiles
|
||||
// left wall
|
||||
}
|
||||
|
||||
if (coords[1] > startY) {
|
||||
newYBlocked = isBlocking(coords[0], coords[1], 1); // Check dest
|
||||
// tiles top
|
||||
// wall
|
||||
} else if (coords[1] < startY) {
|
||||
newYBlocked = isBlocking(coords[0], coords[1], 4); // Check dest
|
||||
// tiles
|
||||
// bottom
|
||||
// wall
|
||||
}
|
||||
|
||||
// If both directions are blocked OR we are going straight and the
|
||||
// direction is blocked
|
||||
if ((newXBlocked && newYBlocked)
|
||||
|| (newXBlocked && startY == coords[1])
|
||||
|| (myYBlocked && startX == coords[0])) {
|
||||
|
||||
return cancelCoords(coords[0], coords[1]);
|
||||
}
|
||||
|
||||
// If only one direction is blocked, but it blocks both tiles
|
||||
if ((myXBlocked && newXBlocked) || (myYBlocked && newYBlocked)) {
|
||||
return cancelCoords(coords[0], coords[1]);
|
||||
}
|
||||
|
||||
return coords;
|
||||
} catch (Exception e) {
|
||||
return cancelCoords(-1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isBlocking(byte val, byte bit) {
|
||||
if ((val & bit) != 0) { // There is a wall in the way
|
||||
return true;
|
||||
}
|
||||
if ((val & 16) != 0) { // There is a diagonal wall here: \
|
||||
return true;
|
||||
}
|
||||
if ((val & 32) != 0) { // There is a diagonal wall here: /
|
||||
return true;
|
||||
}
|
||||
if ((val & 64) != 0) { // This tile is un walkable
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isBlocking(int x, int y, int bit) {
|
||||
TileValue t = Instance.getWorld().getTileValue(x, y);
|
||||
ActiveTile tile = Instance.getWorld().getTile(x, y);
|
||||
if (tile.hasGameObject()) {
|
||||
if (tile.getGameObject().getGameObjectDef().name
|
||||
.equalsIgnoreCase("tree")) {
|
||||
return true;
|
||||
}
|
||||
} else
|
||||
tile.cleanItself();
|
||||
if (t.overlay == 2 || t.overlay == 11) // water & lava
|
||||
return false;
|
||||
return isBlocking(t.mapValue, (byte) bit);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return - if the path is valid to shoot a projectile too
|
||||
*/
|
||||
public boolean isValid() {
|
||||
return !isWallInbetween();
|
||||
}
|
||||
|
||||
/**
|
||||
* I've added the wall data to TileValue, now we can allow certain walls to
|
||||
* be shot through.
|
||||
*/
|
||||
private boolean isWallAllowed(int x, int y) {
|
||||
TileValue t = Instance.getWorld().getTileValue(x, y);
|
||||
if (t != null) {
|
||||
for (int i = 0; i < ALLOWED_WALL_ID_TYPES[0].length; i++)
|
||||
if (ALLOWED_WALL_ID_TYPES[0][i] == (t.verticalWallVal & 0xff))
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < ALLOWED_WALL_ID_TYPES[1].length; i++)
|
||||
if (ALLOWED_WALL_ID_TYPES[1][i] == (t.horizontalWallVal & 0xff))
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < ALLOWED_WALL_ID_TYPES[2].length; i++)
|
||||
if (ALLOWED_WALL_ID_TYPES[2][i] == t.diagWallVal)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author xEnt Calculations to check if a wall is in between your target
|
||||
* your ranging/maging at
|
||||
*/
|
||||
private boolean isWallInbetween() {
|
||||
|
||||
int enemyX = destX;
|
||||
int enemyY = destY;
|
||||
|
||||
int newX = ourX;
|
||||
int newY = ourY;
|
||||
int[] coords;
|
||||
int count = 0;
|
||||
while (true) {
|
||||
count++;
|
||||
if (count > 30) // this should not happen
|
||||
break; // in case something goes wrong, let's not tie up the CPU
|
||||
|
||||
coords = getNextCoords(newX, enemyX, newY, enemyY);
|
||||
newX = coords[0];
|
||||
newY = coords[1];
|
||||
if (newX == -1)
|
||||
return !isWallAllowed(stuckX, stuckY);
|
||||
|
||||
if (newX == enemyX && newY == enemyY)
|
||||
return false;
|
||||
}
|
||||
return false; // should not happen.
|
||||
}
|
||||
|
||||
}
|
@ -1,90 +1,90 @@
|
||||
package org.moparscape.msc.gs.model;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class Sector {
|
||||
/**
|
||||
* The height of a sector
|
||||
*/
|
||||
public static final short HEIGHT = 48;
|
||||
|
||||
/**
|
||||
* The width of a sector
|
||||
*/
|
||||
public static final short WIDTH = 48;
|
||||
|
||||
/**
|
||||
* Create a new Sector from raw data packed into the given ByteBuffer
|
||||
*/
|
||||
public static Sector unpack(ByteBuffer in) throws IOException {
|
||||
int length = Sector.WIDTH * Sector.HEIGHT;
|
||||
if (in.remaining() < (10 * length)) {
|
||||
throw new IOException("Provided buffer too short");
|
||||
}
|
||||
Sector sector = new Sector();
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
sector.setTile(i, Tile.unpack(in));
|
||||
}
|
||||
|
||||
return sector;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array containing all the tiles within this Sector
|
||||
*/
|
||||
private Tile[] tiles;
|
||||
|
||||
/**
|
||||
* Creates a new Sector full of blank tiles
|
||||
*/
|
||||
public Sector() {
|
||||
tiles = new Tile[Sector.WIDTH * Sector.HEIGHT];
|
||||
for (int i = 0; i < tiles.length; i++) {
|
||||
tiles[i] = new Tile();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Tile at the given index
|
||||
*/
|
||||
public Tile getTile(int i) {
|
||||
return tiles[i];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Tile at the given coords
|
||||
*/
|
||||
public Tile getTile(int x, int y) {
|
||||
return getTile(x * Sector.WIDTH + y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the Sector raw data into a ByteBuffer
|
||||
*/
|
||||
public ByteBuffer pack() throws IOException {
|
||||
ByteBuffer out = ByteBuffer.allocate(10 * tiles.length);
|
||||
|
||||
for (int i = 0; i < tiles.length; i++) {
|
||||
out.put(tiles[i].pack());
|
||||
}
|
||||
|
||||
out.flip();
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the the Tile at the given coords
|
||||
*/
|
||||
public void setTile(int x, int y, Tile t) {
|
||||
setTile(x * Sector.WIDTH + y, t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Tile at the given index
|
||||
*/
|
||||
public void setTile(int i, Tile t) {
|
||||
tiles[i] = t;
|
||||
}
|
||||
package org.moparscape.msc.gs.model.landscape;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class Sector {
|
||||
/**
|
||||
* The height of a sector
|
||||
*/
|
||||
public static final short HEIGHT = 48;
|
||||
|
||||
/**
|
||||
* The width of a sector
|
||||
*/
|
||||
public static final short WIDTH = 48;
|
||||
|
||||
/**
|
||||
* Create a new Sector from raw data packed into the given ByteBuffer
|
||||
*/
|
||||
public static Sector unpack(ByteBuffer in) throws IOException {
|
||||
int length = Sector.WIDTH * Sector.HEIGHT;
|
||||
if (in.remaining() < (10 * length)) {
|
||||
throw new IOException("Provided buffer too short");
|
||||
}
|
||||
Sector sector = new Sector();
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
sector.setTile(i, Tile.unpack(in));
|
||||
}
|
||||
|
||||
return sector;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array containing all the tiles within this Sector
|
||||
*/
|
||||
private Tile[] tiles;
|
||||
|
||||
/**
|
||||
* Creates a new Sector full of blank tiles
|
||||
*/
|
||||
public Sector() {
|
||||
tiles = new Tile[Sector.WIDTH * Sector.HEIGHT];
|
||||
for (int i = 0; i < tiles.length; i++) {
|
||||
tiles[i] = new Tile();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Tile at the given index
|
||||
*/
|
||||
public Tile getTile(int i) {
|
||||
return tiles[i];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Tile at the given coords
|
||||
*/
|
||||
public Tile getTile(int x, int y) {
|
||||
return getTile(x * Sector.WIDTH + y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the Sector raw data into a ByteBuffer
|
||||
*/
|
||||
public ByteBuffer pack() throws IOException {
|
||||
ByteBuffer out = ByteBuffer.allocate(10 * tiles.length);
|
||||
|
||||
for (int i = 0; i < tiles.length; i++) {
|
||||
out.put(tiles[i].pack());
|
||||
}
|
||||
|
||||
out.flip();
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the the Tile at the given coords
|
||||
*/
|
||||
public void setTile(int x, int y, Tile t) {
|
||||
setTile(x * Sector.WIDTH + y, t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Tile at the given index
|
||||
*/
|
||||
public void setTile(int i, Tile t) {
|
||||
tiles[i] = t;
|
||||
}
|
||||
}
|
@ -1,83 +1,83 @@
|
||||
package org.moparscape.msc.gs.model;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
* A representation of one tile within our world map
|
||||
*/
|
||||
public class Tile {
|
||||
/**
|
||||
* Create a new tile from raw data packed into the given ByteBuffer
|
||||
*/
|
||||
public static Tile unpack(ByteBuffer in) throws IOException {
|
||||
if (in.remaining() < 10) {
|
||||
throw new IOException("Provided buffer too short");
|
||||
}
|
||||
Tile tile = new Tile();
|
||||
|
||||
tile.groundElevation = in.get();
|
||||
tile.groundTexture = in.get();
|
||||
tile.groundOverlay = in.get();
|
||||
tile.roofTexture = in.get();
|
||||
tile.horizontalWall = in.get();
|
||||
tile.verticalWall = in.get();
|
||||
tile.diagonalWalls = in.getInt();
|
||||
|
||||
return tile;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of any diagonal walls on this tile
|
||||
*/
|
||||
public int diagonalWalls = 0;
|
||||
|
||||
/**
|
||||
* The elevation of this tile
|
||||
*/
|
||||
public byte groundElevation = 0;
|
||||
|
||||
/**
|
||||
* The overlay texture ID
|
||||
*/
|
||||
public byte groundOverlay = 0;
|
||||
|
||||
/**
|
||||
* The texture ID of this tile
|
||||
*/
|
||||
public byte groundTexture = 0;
|
||||
|
||||
/**
|
||||
* The texture ID of any horizontal wall on this tile
|
||||
*/
|
||||
public byte horizontalWall = 0;
|
||||
|
||||
/**
|
||||
* The texture ID of the roof of this tile
|
||||
*/
|
||||
public byte roofTexture = 0;
|
||||
|
||||
/**
|
||||
* The texture ID of any vertical wall on this tile
|
||||
*/
|
||||
public byte verticalWall = 0;
|
||||
|
||||
/**
|
||||
* Writes the Tile raw data into a ByteBuffer
|
||||
*/
|
||||
public ByteBuffer pack() throws IOException {
|
||||
ByteBuffer out = ByteBuffer.allocate(10);
|
||||
|
||||
out.put(groundElevation);
|
||||
out.put(groundTexture);
|
||||
out.put(groundOverlay);
|
||||
out.put(roofTexture);
|
||||
|
||||
out.put(horizontalWall);
|
||||
out.put(verticalWall);
|
||||
out.putInt(diagonalWalls);
|
||||
|
||||
out.flip();
|
||||
return out;
|
||||
}
|
||||
package org.moparscape.msc.gs.model.landscape;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
* A representation of one tile within our world map
|
||||
*/
|
||||
public class Tile {
|
||||
/**
|
||||
* Create a new tile from raw data packed into the given ByteBuffer
|
||||
*/
|
||||
public static Tile unpack(ByteBuffer in) throws IOException {
|
||||
if (in.remaining() < 10) {
|
||||
throw new IOException("Provided buffer too short");
|
||||
}
|
||||
Tile tile = new Tile();
|
||||
|
||||
tile.groundElevation = in.get();
|
||||
tile.groundTexture = in.get();
|
||||
tile.groundOverlay = in.get();
|
||||
tile.roofTexture = in.get();
|
||||
tile.horizontalWall = in.get();
|
||||
tile.verticalWall = in.get();
|
||||
tile.diagonalWalls = in.getInt();
|
||||
|
||||
return tile;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of any diagonal walls on this tile
|
||||
*/
|
||||
public int diagonalWalls = 0;
|
||||
|
||||
/**
|
||||
* The elevation of this tile
|
||||
*/
|
||||
public byte groundElevation = 0;
|
||||
|
||||
/**
|
||||
* The overlay texture ID
|
||||
*/
|
||||
public byte groundOverlay = 0;
|
||||
|
||||
/**
|
||||
* The texture ID of this tile
|
||||
*/
|
||||
public byte groundTexture = 0;
|
||||
|
||||
/**
|
||||
* The texture ID of any horizontal wall on this tile
|
||||
*/
|
||||
public byte horizontalWall = 0;
|
||||
|
||||
/**
|
||||
* The texture ID of the roof of this tile
|
||||
*/
|
||||
public byte roofTexture = 0;
|
||||
|
||||
/**
|
||||
* The texture ID of any vertical wall on this tile
|
||||
*/
|
||||
public byte verticalWall = 0;
|
||||
|
||||
/**
|
||||
* Writes the Tile raw data into a ByteBuffer
|
||||
*/
|
||||
public ByteBuffer pack() throws IOException {
|
||||
ByteBuffer out = ByteBuffer.allocate(10);
|
||||
|
||||
out.put(groundElevation);
|
||||
out.put(groundTexture);
|
||||
out.put(groundOverlay);
|
||||
out.put(roofTexture);
|
||||
|
||||
out.put(horizontalWall);
|
||||
out.put(verticalWall);
|
||||
out.putInt(diagonalWalls);
|
||||
|
||||
out.flip();
|
||||
return out;
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package org.moparscape.msc.gs.model.landscape;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
public class TileValue {
|
||||
|
||||
private static final List<TileValue> tiles = new CopyOnWriteArrayList<TileValue>();
|
||||
|
||||
public static TileValue create(int diagWallVal, byte[] v) {
|
||||
TileValue curr = new TileValue(diagWallVal, v);
|
||||
int index = tiles.indexOf(curr);
|
||||
if (index == -1) {
|
||||
tiles.add(curr);
|
||||
return curr;
|
||||
}
|
||||
return tiles.get(index);
|
||||
}
|
||||
|
||||
private TileValue(int diagWallVal, byte[] v) {
|
||||
if (v.length != 6) {
|
||||
throw new IndexOutOfBoundsException("Must have a size of 6");
|
||||
}
|
||||
|
||||
this.diagWallVal = diagWallVal;
|
||||
this.horizontalWallVal = v[0];
|
||||
this.mapValue = v[1];
|
||||
this.objectValue = v[2];
|
||||
this.overlay = v[3];
|
||||
this.verticalWallVal = v[4];
|
||||
this.elevation = v[5];
|
||||
}
|
||||
|
||||
public final int diagWallVal;
|
||||
public final byte horizontalWallVal;
|
||||
public final byte mapValue;
|
||||
public final byte objectValue;
|
||||
public final byte overlay;
|
||||
public final byte verticalWallVal;
|
||||
public final byte elevation;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || !(o instanceof TileValue)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TileValue t = (TileValue) o;
|
||||
|
||||
if (this.diagWallVal == t.diagWallVal
|
||||
&& this.horizontalWallVal == t.horizontalWallVal
|
||||
&& this.mapValue == t.mapValue
|
||||
&& this.objectValue == t.objectValue
|
||||
&& this.overlay == t.overlay
|
||||
&& this.verticalWallVal == t.verticalWallVal
|
||||
&& this.elevation == t.elevation) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
@ -14,9 +14,9 @@ import org.moparscape.msc.gs.model.ChatMessage;
|
||||
import org.moparscape.msc.gs.model.InvItem;
|
||||
import org.moparscape.msc.gs.model.Mob;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.states.Action;
|
||||
|
@ -12,9 +12,9 @@ import org.moparscape.msc.gs.event.WalkToMobEvent;
|
||||
import org.moparscape.msc.gs.external.ItemDef;
|
||||
import org.moparscape.msc.gs.model.InvItem;
|
||||
import org.moparscape.msc.gs.model.Inventory;
|
||||
import org.moparscape.msc.gs.model.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.states.Action;
|
||||
|
@ -9,7 +9,6 @@ import org.moparscape.msc.gs.event.DelayedEvent;
|
||||
import org.moparscape.msc.gs.event.MiniEvent;
|
||||
import org.moparscape.msc.gs.event.SingleEvent;
|
||||
import org.moparscape.msc.gs.external.ItemUnIdentHerbDef;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.Bubble;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
import org.moparscape.msc.gs.model.InvItem;
|
||||
@ -17,6 +16,7 @@ import org.moparscape.msc.gs.model.MenuHandler;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Point;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.tools.DataConversions;
|
||||
|
@ -9,7 +9,6 @@ import org.moparscape.msc.gs.event.ShortEvent;
|
||||
import org.moparscape.msc.gs.event.WalkToPointEvent;
|
||||
import org.moparscape.msc.gs.external.EntityHandler;
|
||||
import org.moparscape.msc.gs.external.FiremakingDef;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.Bubble;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
import org.moparscape.msc.gs.model.InvItem;
|
||||
@ -17,6 +16,7 @@ import org.moparscape.msc.gs.model.Item;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Point;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.states.Action;
|
||||
|
@ -19,7 +19,6 @@ import org.moparscape.msc.gs.external.ItemSmeltingDef;
|
||||
import org.moparscape.msc.gs.external.ItemSmithingDef;
|
||||
import org.moparscape.msc.gs.external.ItemWieldableDef;
|
||||
import org.moparscape.msc.gs.external.ReqOreDef;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.Bubble;
|
||||
import org.moparscape.msc.gs.model.ChatMessage;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
@ -28,6 +27,7 @@ import org.moparscape.msc.gs.model.MenuHandler;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.plugins.quests.Dorics;
|
||||
|
@ -22,7 +22,6 @@ import org.moparscape.msc.gs.external.GameObjectDef;
|
||||
import org.moparscape.msc.gs.external.ObjectFishDef;
|
||||
import org.moparscape.msc.gs.external.ObjectFishingDef;
|
||||
import org.moparscape.msc.gs.external.ObjectWoodcuttingDef;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.Bubble;
|
||||
import org.moparscape.msc.gs.model.ChatMessage;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
@ -34,6 +33,7 @@ import org.moparscape.msc.gs.model.Path;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Point;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.plugins.extras.Thieving;
|
||||
|
@ -8,7 +8,6 @@ import org.moparscape.msc.gs.connection.Packet;
|
||||
import org.moparscape.msc.gs.db.DBConnection;
|
||||
import org.moparscape.msc.gs.event.FightEvent;
|
||||
import org.moparscape.msc.gs.event.WalkToPointEvent;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.ChatMessage;
|
||||
import org.moparscape.msc.gs.model.InvItem;
|
||||
import org.moparscape.msc.gs.model.Item;
|
||||
@ -16,6 +15,7 @@ import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Point;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.states.Action;
|
||||
|
@ -24,16 +24,16 @@ import org.moparscape.msc.gs.external.EntityHandler;
|
||||
import org.moparscape.msc.gs.external.ItemSmeltingDef;
|
||||
import org.moparscape.msc.gs.external.ReqOreDef;
|
||||
import org.moparscape.msc.gs.external.SpellDef;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
import org.moparscape.msc.gs.model.InvItem;
|
||||
import org.moparscape.msc.gs.model.Item;
|
||||
import org.moparscape.msc.gs.model.Mob;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Projectile;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.landscape.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.mini.Damage;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
|
@ -13,9 +13,9 @@ import org.moparscape.msc.gs.db.DBConnection;
|
||||
import org.moparscape.msc.gs.external.ItemDef;
|
||||
import org.moparscape.msc.gs.model.InvItem;
|
||||
import org.moparscape.msc.gs.model.Inventory;
|
||||
import org.moparscape.msc.gs.model.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.PathGenerator;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.tools.DataConversions;
|
||||
|
@ -10,13 +10,13 @@ import org.moparscape.msc.gs.event.ShortEvent;
|
||||
import org.moparscape.msc.gs.event.WalkToPointEvent;
|
||||
import org.moparscape.msc.gs.external.DoorDef;
|
||||
import org.moparscape.msc.gs.external.EntityHandler;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.ChatMessage;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Point;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.snapshot.Activity;
|
||||
import org.moparscape.msc.gs.phandler.PacketHandler;
|
||||
import org.moparscape.msc.gs.plugins.extras.Thieving;
|
||||
|
@ -9,7 +9,6 @@ import org.moparscape.msc.gs.event.MiniEvent;
|
||||
import org.moparscape.msc.gs.event.ShortEvent;
|
||||
import org.moparscape.msc.gs.event.WalkToMobEvent;
|
||||
import org.moparscape.msc.gs.external.GameObjectDef;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.Bubble;
|
||||
import org.moparscape.msc.gs.model.ChatMessage;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
@ -18,6 +17,7 @@ import org.moparscape.msc.gs.model.Mob;
|
||||
import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.states.Action;
|
||||
import org.moparscape.msc.gs.util.Logger;
|
||||
|
||||
|
@ -6,7 +6,6 @@ import java.util.Set;
|
||||
|
||||
import org.moparscape.msc.gs.core.GameEngine;
|
||||
import org.moparscape.msc.gs.event.SingleEvent;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.ChatMessage;
|
||||
import org.moparscape.msc.gs.model.GameObject;
|
||||
import org.moparscape.msc.gs.model.InvItem;
|
||||
@ -16,6 +15,7 @@ import org.moparscape.msc.gs.model.Npc;
|
||||
import org.moparscape.msc.gs.model.Player;
|
||||
import org.moparscape.msc.gs.model.Point;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.util.Logger;
|
||||
|
||||
/**
|
||||
|
@ -9,9 +9,9 @@ import javax.imageio.ImageIO;
|
||||
|
||||
import org.moparscape.msc.config.Config;
|
||||
import org.moparscape.msc.gs.Instance;
|
||||
import org.moparscape.msc.gs.model.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.TileValue;
|
||||
import org.moparscape.msc.gs.model.World;
|
||||
import org.moparscape.msc.gs.model.landscape.ActiveTile;
|
||||
import org.moparscape.msc.gs.model.landscape.TileValue;
|
||||
|
||||
public class MapGenerator {
|
||||
private static final int BLACK = new Color(0, 0, 0).getRGB();
|
||||
|
@ -0,0 +1,388 @@
|
||||
15:02:53 07-01-12: java.lang.NullPointerException
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.incrementAndGet(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.messageReceived(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:53 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.incrementAndGet(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.messageReceived(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.filter.BlacklistFilter.messageReceived(BlacklistFilter.java:160)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.incrementAndGet(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.messageReceived(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.filter.BlacklistFilter.messageReceived(BlacklistFilter.java:160)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$HeadFilter.messageReceived(AbstractIoFilterChain.java:499)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilterChain.java:293)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:228)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:485)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:53 07-01-12: at java.lang.Thread.run(Unknown Source)
|
||||
15:02:53 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: java.lang.NullPointerException
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.incrementAndGet(Unknown Source)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.messageReceived(Unknown Source)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.filter.BlacklistFilter.messageReceived(BlacklistFilter.java:160)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$HeadFilter.messageReceived(AbstractIoFilterChain.java:499)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilterChain.java:293)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:228)
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilterChain.java:293)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:228)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:485)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilterChain.java:293)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:228)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:485)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:02:54 07-01-12: at java.lang.Thread.run(Unknown Source)
|
||||
15:02:54 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: java.lang.NullPointerException
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.incrementAndGet(Unknown Source)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.messageReceived(Unknown Source)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.incrementAndGet(Unknown Source)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.messageReceived(Unknown Source)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.filter.BlacklistFilter.messageReceived(BlacklistFilter.java:160)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$HeadFilter.messageReceived(AbstractIoFilterChain.java:499)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilterChain.java:293)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:228)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:485)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:05:17 07-01-12: at java.lang.Thread.run(Unknown Source)
|
||||
15:05:17 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: java.lang.NullPointerException
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.incrementAndGet(Unknown Source)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.moparscape.msc.gs.connection.filter.PacketThrottler.messageReceived(Unknown Source)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.filter.BlacklistFilter.messageReceived(BlacklistFilter.java:160)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain$HeadFilter.messageReceived(AbstractIoFilterChain.java:499)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilterChain.java:293)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:228)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:485)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
|
||||
15:07:41 07-01-12:
|
||||
|
||||
15:07:41 07-01-12: at java.lang.Thread.run(Unknown Source)
|
||||
15:07:41 07-01-12:
|
||||
|
Loading…
Reference in New Issue
Block a user