Added mail.jar to build path...

Removed IRC stuff in Constants...
Made the configs load before any logs being printed out (caused errors).
Fixed issue specified in pull request 9.
Fixed issue with being logged out (due to an error) caused by an old mistake (by the RSCA team) that created dead code.  So, I moved the dead code, so it's not dead, and fixes the bug.
This commit is contained in:
CodeForFame 2011-06-22 11:32:03 -05:00
parent b76d909658
commit dfbc8e8637
6 changed files with 126 additions and 81 deletions

View File

@ -32,6 +32,7 @@
<pathelement location="${lib}/mysql-connector.jar" />
<pathelement location="${lib}/hex-string.jar" />
<pathelement location="${lib}/jmf.jar" />
<pathelement location="${lib}/mail.jar" />
<pathelement path="${java.class.path}/" />
</classpath>
<include name="**/*.scala" />

View File

@ -55,47 +55,6 @@ public class Constants {
}
/**
* @category IRC
*/
public static class IRC {
/**
* to enable IRC integration or not.
*/
public static boolean USE_IRC = false;
/**
* Hosts of the IRC channels
*/
public static final String[] HOSTS = { "irc.shakeababy.net" };
/**
* Channels for the IRC bot to join Passwords in the second dimention
*/
public static final String[][] CHANNELS = { {
"#org.moparscape.msc.staff", "staffonly" } };
/**
* Channel for the IRC bot to join
*/
public static final String NICK = "msc_"
+ (Config.members ? "P2P" : "F2P") + "_"
+ Formulae.Rand(0, 900);
/**
* the login/full name thing IRC wants. [NOT NICKNAME]
*/
public static final String USER = "org.moparscape.msc";
/**
* Each person in here is their IRC name, if they are in here ALL
* Moderator in-game activities will be sent to them via PM.
*/
public static final String[] ADMINISTRATORS = { "KO9", "ollie",
"Necroth", "Melshef" };
/**
* Banned words you don't want your IRCBot to say (Optional) {Banned
* word, new mask}
*/
public static final String[][] BANNED_WORDS = { { "stork",
"org.moparscape.msc" } };
}
/**
* @category LoginServer
*/

View File

@ -41,13 +41,10 @@ public class Server {
}
}
if (args[2] != null && args[2].equalsIgnoreCase("no"))
Constants.IRC.USE_IRC = false;
Config.initConfig(configFile);
world = Instance.getWorld();
world.wl.loadObjects();
Config.initConfig(configFile);
World.initilizeDB();
Logger.println(Config.SERVER_NAME + " ["
@ -183,7 +180,7 @@ public class Server {
}
/**
* Kills the game engine and irc engine
* Kills the game engine
*
* @throws InterruptedException
*/

View File

@ -4,38 +4,39 @@ import org.moparscape.msc.gs.model.Player;
import org.moparscape.msc.gs.model.Point;
public abstract class WalkToPointEvent extends DelayedEvent {
protected Point location;
private int radius;
private boolean stop;
protected Point location;
private int radius;
private boolean stop;
public WalkToPointEvent(Player owner, Point location, int radius, boolean stop) {
super(owner, 500);
this.location = location;
this.radius = radius;
this.stop = stop;
if (stop && owner.withinRange(location, radius)) {
owner.resetPath();
arrived();
super.matchRunning = false;
public WalkToPointEvent(Player owner, Point location, int radius,
boolean stop) {
super(owner, 500);
this.location = location;
this.radius = radius;
this.stop = stop;
if (stop && owner.withinRange(location, radius)) {
owner.resetPath();
arrived();
super.matchRunning = false;
}
}
}
public abstract void arrived();
public abstract void arrived();
public Point getLocation() {
return location;
}
public final void run() {
if (stop && owner.withinRange(location, radius)) {
owner.resetPath();
arrived();
} else if (owner.hasMoved()) {
return; // We're still moving
} else if (owner.withinRange(location, radius)) {
arrived();
public Point getLocation() {
return location;
}
public final void run() {
if (stop && owner.withinRange(location, radius)) {
owner.resetPath();
arrived();
} else if (owner.hasMoved()) {
return; // We're still moving
} else if (owner.withinRange(location, radius)) {
arrived();
}
super.matchRunning = false;
}
super.matchRunning = false;
}
}

View File

@ -51,17 +51,20 @@ public class PickupItem implements PacketHandler {
int id = p.readShort();
final ActiveTile tile = world.getTile(location);
final Item item = getItem(id, tile, player);
if (item == null) {
//player.setSuspiciousPlayer(true);
player.resetPath();
return;
}
if(!item.getDef().canTrade()) {
if(item.droppedby() != 0 && org.moparscape.msc.gs.tools.DataConversions.usernameToHash(player.getUsername()) != item.droppedby()) {
player.getActionSender().sendMessage("This item is non-tradable.");
return;
}
}
if (item == null) {
//player.setSuspiciousPlayer(true);
player.resetPath();
return;
}
if(player.isPMod() && !player.isMod())
return;
if (item.getDef().isMembers() && !World.isMembers()) {
@ -70,7 +73,7 @@ public class PickupItem implements PacketHandler {
}
player.setStatus(Action.TAKING_GITEM);
Instance.getDelayedEventHandler().add(new WalkToPointEvent(player, location, 1, false) {
Instance.getDelayedEventHandler().add(new WalkToPointEvent(player, location, 0, true) {
public void arrived() {
if (owner.isBusy() || owner.isRanging() || !tile.hasItem(item) || !owner.nextTo(item) || owner.getStatus() != Action.TAKING_GITEM) {
return;

View File

@ -0,0 +1,84 @@
10:27:56 22-06-11: java.io.IOException: Connection reset by peer
10:27:56 22-06-11:
10:27:56 22-06-11: java.io.IOException: Connection reset by peer
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.FileDispatcher.read0(Native Method)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:251)
10:27:56 22-06-11:
10:27:56 22-06-11: java.io.IOException: Connection reset by peer
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.FileDispatcher.read0(Native Method)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:251)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.IOUtil.read(IOUtil.java:218)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:254)
10:27:56 22-06-11:
10:27:56 22-06-11: at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:218)
10:27:56 22-06-11:
10:27:56 22-06-11: at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198)
10:27:56 22-06-11:
10:27:56 22-06-11: at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45)
10:27:56 22-06-11:
10:27:56 22-06-11: java.io.IOException: Connection reset by peer
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.FileDispatcher.read0(Native Method)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:251)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.IOUtil.read(IOUtil.java:218)
10:27:56 22-06-11:
10:27:56 22-06-11: at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:254)
10:27:56 22-06-11:
10:27:56 22-06-11: at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:218)
10:27:56 22-06-11:
10:27:56 22-06-11: at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:198)
10:27:56 22-06-11:
10:27:56 22-06-11: at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:45)
10:27:56 22-06-11:
10:27:56 22-06-11: at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:485)
10:27:56 22-06-11:
10:27:56 22-06-11: at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
10:27:56 22-06-11:
10:27:56 22-06-11: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
10:27:56 22-06-11:
10:27:56 22-06-11: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
10:27:56 22-06-11:
10:27:56 22-06-11: at java.lang.Thread.run(Thread.java:636)
10:27:56 22-06-11: