שלום לכולם,
אני מנסה להוסיף כמה פקודות לVIP שבשרת שלי.
מחקתי את הפקודה !maxskills ושמתי !vipshop ו !vipsay
שאני מקמפל זה עושה לי שגיאה בפקודה !connected ...
הינה המסמך:
package net.sf.odinms.client.messages.commands;
import java.rmi.RemoteException;
import net.sf.odinms.client.MapleCharacter;
import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.messages.Command;
import net.sf.odinms.client.messages.MessageCallback;
import net.sf.odinms.net.channel.ChannelServer;
import java.util.HashMap;
import java.util.Collection;
import java.util.Map;
import net.sf.odinms.client.MapleCharacterUtil;
import net.sf.odinms.client.messages.CommandDefinition;
public class Donator implements Command {
@Override
public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception {
splitted[0] = splitted[0].toLowerCase();
ChannelServer cserv = c.getChannelServer();
Collection<ChannelServer> cservs = ChannelServer.getAllInstances();
MapleCharacter player = c.getPlayer();
if (splitted[0].equalsIgnoreCase("!online")) {
int i = 0;
for (ChannelServer cs : ChannelServer.getAllInstances()) {
if (cs.getPlayerStorage().getAllCharacters().size() > 0) {
StringBuilder sb = new StringBuilder();
mc.dropMessage("Channel " + cs.getChannel() + ":");
for (MapleCharacter chr : cs.getPlayerStorage().getAllCharacters()) {
i++;
if (sb.length() > 150) { // Chars per line. Could be more or less
mc.dropMessage(sb.toString());
sb = new StringBuilder();
}
sb.append(MapleCharacterUtil.makeMapleReadable(chr.getName() + " "));
}
mc.dropMessage(sb.toString());
}
}
} else if (splitted[0].equalsIgnoreCase("!vipshop")) {
MapleShopFactory.getInstance().getShop(1338).sendShop(c);
} else if (splitted[0].equalsIgnoreCase("!vipsay")) {
if (splitted.length > 1) {
try {
cserv.getWorldInterface().broadcastMessage(player.getName(), MaplePacketCreator.serverNotice(6, "[" + player.getName() + "] " + StringUtil.joinStringFrom(splitted, 1)).getBytes());
} catch (RemoteException e) {
cserv.reconnectWorld();
}
} else {
mc.dropMessage("Error, try this command: !vipsay <message>");
} else if (splitted[0].equalsIgnoreCase("!connected")) {
try {
Map<Integer, Integer> connected = cserv.getWorldInterface().getConnected();
StringBuilder conStr = new StringBuilder();
mc.dropMessage("Connected Clients: ");
for (int i : connected.keySet()) {
if (i == 0) {
conStr.append("Total: "); // I HAVE NO CLUE WHY.
conStr.append(connected.get(i));
} else {
conStr.append(", Channel ");
conStr.append(i);
conStr.append(": ");
conStr.append(connected.get(i));
}
}
mc.dropMessage(conStr.toString());
} catch (RemoteException e) {
cserv.reconnectWorld();
}
} else if (splitted[0].equalsIgnoreCase("!goto")) {
Map<String, Integer> maps = new HashMap<String, Integer>();
if(player.getGMLevel() > 3)
maps.put("gmmap", 180000000);
maps.put("southperry", 60000);
maps.put("amherst", 1010000);
maps.put("henesys", 100000000);
maps.put("ellinia", 101000000);
maps.put("perion", 102000000);
maps.put("kerning", 103000000);
maps.put("lith", 104000000);
maps.put("sleepywood", 105040300);
maps.put("florina", 110000000);
maps.put("orbis", 200000000);
maps.put("happy", 209000000);
maps.put("elnath", 211000000);
maps.put("ludi", 220000000);
maps.put("aqua", 230000000);
maps.put("leafre", 240000000);
maps.put("mulung", 250000000);
maps.put("herb", 251000000);
maps.put("omega", 221000000);
maps.put("korean", 222000000);
maps.put("nlc", 600000000);
maps.put("excavation", 990000000);
maps.put("pianus", 230040420);
maps.put("horntail", 240060200);
maps.put("mushmom", 100000005);
maps.put("griffey", 240020101);
maps.put("manon", 240020401);
maps.put("headless", 682000001);
maps.put("balrog", 105090900);
maps.put("zakum", 280030000);
maps.put("papu", 220080001);
maps.put("showa", 801000000);
maps.put("guild", 200000301);
maps.put("shrine", 800000000);
maps.put("fm", 910000000);
maps.put("skelegon", 240040511);
maps.put("ariant", 260000100);
maps.put("amoria", 680000000);
//Function
if (splitted.length < 2) { //If no arguments, list options.
mc.dropMessage("Syntax: !goto <mapname> <optional_target>, where target is char name and mapname is one of:");
StringBuilder builder = new StringBuilder();
int i = 0;
for (String mapss : maps.keySet()) {
if (1 % 10 == 0) {// 10 maps per line
mc.dropMessage(builder.toString());
} else {
builder.append(mapss + ", ");
}
}
mc.dropMessage(builder.toString());
} else {
String message = splitted[1];
if (maps.containsKey(message)) {
if (splitted.length == 2) { //If no target name, continue
player.changeMap(maps.get(message));
} else if (splitted.length == 3) { //If target name, new target
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[2]);
victim.changeMap(maps.get(message));
}
mc.dropMessage("Please feel free to suggest any more locations, Use the @gms commands or post suggestions on the forum.");
} else {
mc.dropMessage("Could not find map");
}
}
maps.clear();
}
}
@Override
public CommandDefinition[] getDefinition() {
return new CommandDefinition[]{
new CommandDefinition("online", 1),
new CommandDefinition("vipshop", 1),
new CommandDefinition("connected", 1),
new CommandDefinition("goto", 1),
new CommandDefinition("vipsay", 1)
};
}
}
איפה יש טעות?
ואם אין מה לעשות?



?
ציטוט ההודעה



