• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[HELP] Game Commands not updating

Newbie Spellweaver
Joined
Jan 14, 2010
Messages
25
Reaction score
0
[Solved]

So I just created a new private server and I'm messing around with it still. I added new commands to my AdminCommands, GMCommands, etc. I compiled with netbeans then placed the jar file into my MoopleDEV\dist then started up the server. I went into the game and see no change in the commands. Help?

Heres the CommandProccessor.java

package client.command;

import client.MapleCharacter;
import client.MapleClient;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import java.rmi.RemoteException;
import java.sql.SQLException;
import java.util.List;
import provider.MapleData;
import provider.MapleDataProvider;
import provider.MapleDataProviderFactory;
import provider.MapleDataTool;
import tools.Pair;
import java.util.ArrayList;
import java.util.LinkedList;
import java.io.File;
import server.TimerManager;
import server.life.MapleLifeFactory;
import tools.DatabaseConnection;

public final class CommandProcessor {

private static Runnable persister;
private static List<Pair<MapleCharacter, String>> gmlog = new LinkedList<Pair<MapleCharacter, String>>();

public static final boolean processCommand(final MapleClient c, final String s) throws SQLException, RemoteException, IllegalCommandSyntaxException {
if (s.charAt(0) == '!' && c.getPlayer().isGM()) {
String[] sp = s.split(" ");
sp[0] = sp[0].toLowerCase().substring(1);
c.getPlayer().addCommandToList(s);

if (c.getPlayer().gmLevel() >= 1) {
if (JrGMCommands.execute(c, sp, '!')) {
return true;
}
}
if (c.getPlayer().gmLevel() >= 2) {
if (DonorCommands.execute(c, sp, '!')) {
return true;
}
}
if (c.getPlayer().gmLevel() >= 3) {
if (GMCommands.execute(c, sp, '!')) {
return true;
}
}
if (c.getPlayer().gmLevel() >= 4) {
if (AdminCommands.execute(c, sp, '!')) {
return true;
}
}
if (c.getPlayer().gmLevel() >= 5) {
if (SGMCommands.execute(c, sp, '!')) {
return true;
}
}
//working
return false;
}
if (s.charAt(0) == '@') {
String[] sp = s.split(" ");
sp[0] = sp[0].toLowerCase().substring(1);
PlayerCommands.execute(c, sp, '@');
return true;
}
return false;
}

public static void forcePersisting() {
persister.run();
}

static {
persister = new PersistingTask();
TimerManager.getInstance().register(persister, 62000);
}

public static class PersistingTask implements Runnable {

@Override
public void run() {
synchronized (gmlog) {
Connection con = (Connection) DatabaseConnection.getConnection();
try {
PreparedStatement ps = (PreparedStatement) con.prepareStatement("INSERT INTO gmlog (cid, command) VALUES (?, ?)");
for (Pair<MapleCharacter, String> logentry : gmlog) {
ps.setInt(1, logentry.getLeft().getId());
ps.setString(2, logentry.getRight());
ps.executeUpdate();
}
ps.close();
} catch (SQLException e) {
System.out.println("Error persisting cheatlog" + e);
}
gmlog.clear();
}
}
}



public static ArrayList<Pair<Integer, String>> getMobsIDsFromName(String search) {
MapleDataProvider dataProvider = MapleDataProviderFactory.getDataProvider(new File("wz/String.wz"));
ArrayList<Pair<Integer, String>> retMobs = new ArrayList<Pair<Integer, String>>();
MapleData data = dataProvider.getData("Mob.img");
List<Pair<Integer, String>> mobPairList = new LinkedList<Pair<Integer, String>>();
for (MapleData mobIdData : data.getChildren()) {
int mobIdFromData = Integer.parseInt(mobIdData.getName());
String mobNameFromData = MapleDataTool.getString(mobIdData.getChildByPath("name"), "NO-NAME");
mobPairList.add(new Pair<Integer, String>(mobIdFromData, mobNameFromData));
}
for (Pair<Integer, String> mobPair : mobPairList) {
if (mobPair.getRight().toLowerCase().contains(search.toLowerCase())) {
retMobs.add(mobPair);
}
}
return retMobs;
}

public static String getMobNameFromID(int id) {
try {
return MapleLifeFactory.getMonster(id).getName();
} catch (Exception e) {
return null; //nonexistant mob
}
}
}
 
Last edited:
Mythic Archon
Joined
Dec 25, 2011
Messages
723
Reaction score
97
I had no idea MoopleDEV used CommandProcessor and had separate command files.
 
Upvote 0
Newbie Spellweaver
Joined
Jan 14, 2010
Messages
25
Reaction score
0
[Solved]
Btw I was fusing it with another repacks command files so its kind of like a fused MoopleDEV. Sorry please CLOSE
 
Upvote 0
Back
Top