The best v75 Source

Page 16 of 18 FirstFirst ... 689101112131415161718 LastLast
Results 376 to 400 of 447
  1. #376
    Apprentice Theory is offline
    MemberRank
    Dec 2009 Join Date
    Look behind youLocation
    7Posts

    Re: The best v75 Source

    After seeing this thread, I need to go change my pants.

  2. #377
    Account Upgraded | Title Enabled! dani627 is offline
    MemberRank
    Jun 2008 Join Date
    israelLocation
    368Posts

    Re: The best v75 Source

    missing files in dist folder or i am blind ?

  3. #378
    offonline King Grub is offline
    MemberRank
    Aug 2009 Join Date
    Spring fieldLocation
    3,303Posts

    Re: The best v75 Source

    Quote Originally Posted by dani627 View Post
    missing files in dist folder or i am blind ?
    It should be 7 jars in total.

  4. #379
    Account Upgraded | Title Enabled! dani627 is offline
    MemberRank
    Jun 2008 Join Date
    israelLocation
    368Posts

    Re: The best v75 Source

    Quote Originally Posted by PirateOwh View Post
    It should be 7 jars in total.
    umm can i have names of jars should be there?

  5. #380
    Account Upgraded | Title Enabled! Buya is offline
    MemberRank
    Oct 2008 Join Date
    1,303Posts

    Re: The best v75 Source

    dude why bother using this?

  6. #381
    Apprentice scien0802 is offline
    MemberRank
    Sep 2009 Join Date
    6Posts

    Re: The best v75 Source

    well... I'll check it now.

  7. #382
    warp(california, "home"); LameJacob is offline
    MemberRank
    Sep 2008 Join Date
    CaliforniaLocation
    537Posts

    Re: The best v75 Source

    Quote Originally Posted by buya View Post
    dude why bother using this?
    Maybe because it's decent source for beginners or people to work off, okay?

  8. #383
    Apprentice vinn3240 is offline
    MemberRank
    Dec 2009 Join Date
    6Posts

    Re: The best v75 Source

    there is bug with tamed monster... monster rider doenst work

  9. #384
    Inactive xRayne is offline
    MemberRank
    Aug 2008 Join Date
    391Posts

    Re: The best v75 Source

    Quote Originally Posted by RaptorJesus View Post
    What?
    The premier v75 source is now at your sweaty greasy finger tips.
    Why?
    Because I felt like its time for those who want to create a v75 server now can, also because I dislike the current owners of the v75 servers other than Anujan.


    A little background information:
    Remember everyone's favorite E-Hero Shadow` of DestinyMs? Well it seems like DestinyMS is shut down till they get their 1500 Euro balance paid off, the best part is that he is getting himself in debt to save those precious little pixels and to try to STICK IT TO THE MAN! It makes him look stupid. I try to explain to his players on their forums that he was either being ripped off by his host or he has terrible money management skills, so their mods ban me and Shadow + Mic write how Im a scammer and a bad man :[. The best part is that the players who donated to my server got their items, when my server was shut down by Nexon i didn't try to deny refunds when they were requested, but Shadow is dutch and morality does not apply to him, so he spews bull. Either way buddy, i have the last laugh, you are in debt, you fired Codykins who was a great mod in my opinion, you lost your dev team for the most part and I walk away from this laughing.

    Here you go, no exploits, no problems.
    Enjoy.
    http://www.mediafire.com/?rjjdd2kmmfx

    Cute.

  10. #385
    Enthusiast damankin6 is offline
    MemberRank
    Dec 2008 Join Date
    40Posts

    Re: The best v75 Source

    im missing 6 .jar files. can any1 upload them for me?

    exttools.jar
    jpcap.jar
    mina-core.jar
    mysql-connector-java-bin.jar
    slf4j-apl.jar
    slf4j-jdk14.jar

    please either PM or post here :(

  11. #386
    Proficient Member AznDud333 is offline
    MemberRank
    Jul 2007 Join Date
    158Posts

    Re: The best v75 Source

    no player/gm commands.

  12. #387
    You've got my respect! Traitor is offline
    MemberRank
    Apr 2008 Join Date
    Portland,OregonLocation
    959Posts

    Re: The best v75 Source

    Quote Originally Posted by AznDud333 View Post
    no player/gm commands.
    it's funny cause you're wrong.
    it's also funny that people are still posting in this thread.

  13. #388
    Apprentice jisuss is offline
    MemberRank
    Nov 2008 Join Date
    17Posts

    Re: The best v75 Source

    guys i ned some help with this source...

    when i open the launch_world.bat i got an error:Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/odinms/net/wor
    ld/WorldServer
    Caused by: java.lang.ClassNotFoundException: net.sf.odinms.net.world.WorldServer

    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: net.sf.odinms.net.world.WorldServer. Program wil
    l exit.
    Press any Key to Continue.....

    help me pleasee!!!!


    thanks for sreading :) and i hope u can help me....
    Last edited by jisuss; 10-12-09 at 06:12 AM.

  14. #389
    Enthusiast ermelious is offline
    MemberRank
    Sep 2008 Join Date
    27Posts

    Re: The best v75 Source

    this repack doesn't have rebirth? player commands are missing too, i tried adding my own player commands but failed badly =.=|||

  15. #390
    offonline King Grub is offline
    MemberRank
    Aug 2009 Join Date
    Spring fieldLocation
    3,303Posts

    Re: The best v75 Source

    Quote Originally Posted by ermelious View Post
    this repack doesn't have rebirth? player commands are missing too, i tried adding my own player commands but failed badly =.=|||
    You'll need to add playercommand rank in the commandproccesor.

  16. #391
    Enthusiast ermelious is offline
    MemberRank
    Sep 2008 Join Date
    27Posts

    Re: The best v75 Source

    Quote Originally Posted by PirateOwh View Post
    You'll need to add playercommand rank in the commandproccesor.
    dude do you mind giving me the playercommand rank code?
    this is the playercommand.java that i've added in, with no compiling errors.

    but in game, the commands doesn't work, i get "invalid command"
    Code:
    /*
    	MyMaple Maplestory Source Coded in Java
    		Copyright (C) 2008-2009 MyMaple
    	(johnlth93) Johnny Lee <johnlth93@live.com>
    
    	This program is free software. You may not however, redistribute it and/or
    	modify it without the sole, written consent of MyMaple Team.
    
    	This program is distributed in the hope that it will be useful to those of
    	the MyMaple Community, and those who have consent to redistribute this.
    
    	Upon reading this, you agree to follow and maintain the mutual balance
    	between the Author and the Community at hand.
    */
    
    package net.sf.odinms.client.messages.commands;
    
    import java.util.ArrayList;
    import java.util.List;
    import java.util.HashMap;
    import net.sf.odinms.client.messages.Command;
    import net.sf.odinms.client.messages.CommandDefinition;
    import net.sf.odinms.client.messages.IllegalCommandSyntaxException;
    import net.sf.odinms.client.messages.MessageCallback;
    import net.sf.odinms.client.MapleCharacter;
    import net.sf.odinms.client.MapleClient;
    import net.sf.odinms.client.MapleStat;
    import net.sf.odinms.net.channel.ChannelServer;
    import net.sf.odinms.scripting.npc.NPCScriptManager;
    import net.sf.odinms.tools.Pair;
    import net.sf.odinms.tools.MaplePacketCreator;
    
    public class PlayerCommands implements Command {
    	@Override
    	public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception,
    																					IllegalCommandSyntaxException {
    	MapleCharacter player = c.getPlayer();
            if (splitted[0].equals("@dojob")) {
    		NPCScriptManager npc = NPCScriptManager.getInstance();
    		npc.start(c, 9001001);
    	} else if(splitted[0].equals("@spinel")) {
    		NPCScriptManager npc = NPCScriptManager.getInstance();
    		npc.start(c, 9000020);
            } else if (splitted[0].equals("@str") || splitted[0].equals("@int") || splitted[0].equals("@luk") || splitted[0].equals("@dex")) {
                int amount = Integer.parseInt(splitted[1]);
    		boolean str = splitted[0].equals("@str");
    		boolean Int = splitted[0].equals("@int");
    		boolean luk = splitted[0].equals("@luk");
    		boolean dex = splitted[0].equals("@dex");
              if(amount > 0 && amount <= player.getRemainingAp() && amount <= 32763 || amount < 0 && amount >= -32763 && Math.abs(amount) + player.getRemainingAp() <= 32767) {
    		if (str && amount + player.getStr() <= 32767 && amount + player.getStr() >= 4) {
    		player.setStr(player.getStr() + amount);
    		player.updateSingleStat(MapleStat.STR, player.getStr());
    		player.setRemainingAp(player.getRemainingAp() - amount);
    		player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
    	} else if (Int && amount + player.getInt() <= 32767 && amount + player.getInt() >= 4) {
    		player.setInt(player.getInt() + amount);
    		player.updateSingleStat(MapleStat.INT, player.getInt());
    		player.setRemainingAp(player.getRemainingAp() - amount);
    		player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
    	} else if (luk && amount + player.getLuk() <= 32767 && amount + player.getLuk() >= 4) {
    		player.setLuk(player.getLuk() + amount);
    		player.updateSingleStat(MapleStat.LUK, player.getLuk());
    		player.setRemainingAp(player.getRemainingAp() - amount);
    		player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
    	} else if (dex && amount + player.getDex() <= 32767 && amount + player.getDex() >= 4) {
    		player.setDex(player.getDex() + amount);
    		player.updateSingleStat(MapleStat.DEX, player.getDex());
    		player.setRemainingAp(player.getRemainingAp() - amount);
    		player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
    	} else {
    	mc.dropMessage("Please make sure the stat you are trying to raise is not over ***767 or under 4.");
    	}
    		} else {
    			mc.dropMessage("Please make sure your AP is not over ***767 and you have enough to distribute.");
    		}
    	} else if (splitted[0].equals("@emo")) {
    		player.setHp(0);
    		player.updateSingleStat(MapleStat.HP, 0);
    	} else if (splitted[0].equals("@expfix")) {
                    player.setExp(0);
                    player.updateSingleStat(MapleStat.EXP, player.getExp());
    		mc.dropMessage("Your exp has been fixed~!");
    	} else if (splitted[0].equals("@myap")){
    		mc.dropMessage("You currently have " + c.getPlayer().getStr() + " STR, " + c.getPlayer().getDex() + " DEX, " + c.getPlayer().getLuk() + " LUK, " + c.getPlayer().getInt() + " INT.");
    		mc.dropMessage("You currently have " + c.getPlayer().getRemainingAp() + " Ability Points.");
    	} else if (splitted[0].equals("@commands")) {
    		mc.dropMessage("The player Commands are:");
    		mc.dropMessage("@str, @int, @dex, @achievements, @luk, @save, @dojob, @expfix, @myap, @emno, @rebirth, @apreset, @dispose, @goto, @starterpack");
    	} else if (splitted[0].equals("@rebirth")) {
                    if (player.getLevel() >= 200) {
                        int totalrebirth = c.getPlayer().getReborns()+1;
                        mc.dropMessage("You have been reborned. For a total of " + totalrebirth + " times.");
                        player.doReborn();
                    } else {
                        mc.dropMessage("You are not level 200 yet!");
                    }
            } else if (splitted[0].equals("@dispose")) {
                        NPCScriptManager.getInstance().dispose(c);
                        c.getSession().write(MaplePacketCreator.enableActions());
                        mc.dropMessage("Done.");
            } else if (splitted[0].equals("@apreset")) {
                        if (player.getMeso() >= 5000000) {
    			int str = c.getPlayer().getStr();
    			int dex = c.getPlayer().getDex();
    			int int_ = c.getPlayer().getInt();
    			int luk = c.getPlayer().getLuk();
    			int newap = c.getPlayer().getRemainingAp() + (str - 4) + (dex - 4) + (int_ - 4) + (luk - 4);
    			c.getPlayer().setStr(4);
    			c.getPlayer().setDex(4);
    			c.getPlayer().setInt(4);
    			c.getPlayer().setLuk(4);
    			c.getPlayer().setRemainingAp(newap);
    			List<Pair<MapleStat, Integer>> stats = new ArrayList<Pair<MapleStat, Integer>>();
    			stats.add(new Pair<MapleStat, Integer>(MapleStat.STR, Integer.valueOf(str)));
    			stats.add(new Pair<MapleStat, Integer>(MapleStat.DEX, Integer.valueOf(dex)));
    			stats.add(new Pair<MapleStat, Integer>(MapleStat.INT, Integer.valueOf(int_)));
    			stats.add(new Pair<MapleStat, Integer>(MapleStat.LUK, Integer.valueOf(luk)));
    			stats.add(new Pair<MapleStat, Integer>(MapleStat.AVAILABLEAP, Integer.valueOf(newap)));
    			c.getSession().write(MaplePacketCreator.updatePlayerStats(stats));
                            mc.dropMessage("Your ap has been reseted. Please CC or Relogin to apply the changes");
                        } else {
                            mc.dropMessage("Not enough mesos. You need 5mill to apreset");
                        }
            } else if (splitted[0].equals("@goto")) {
                        ChannelServer cserv = c.getChannelServer();
                        HashMap<String, Integer> maps = new HashMap<String, Integer>();
                        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("omega", 221000000);
                        maps.put("korean", 222000000);
                        maps.put("aqua", 230000000);
                        maps.put("leafre", 240000000);
                        maps.put("mulung", 250000000);
                        maps.put("herb", 251000000);
                        maps.put("nlc", 600000000);
                        maps.put("shrine", 800000000);
                        maps.put("showa", 801000000);
                        maps.put("fm", 910000000);
                        if (maps.containsKey(splitted[1])) {
                            player.changeMap(cserv.getMapFactory().getMap(maps.get(splitted[1])), cserv.getMapFactory().getMap(maps.get(splitted[1])).getPortal(0));
                        }else{
                            mc.dropMessage("No map enetered do @goto  <henesys|ellinia|perion|kerning|lith|sleepywood|florina|orbis|happy|elnath|ludi|omega|korean|aqua|leafre|mulung|herb|nlc|shrine|showa|fm>");
                        }
                    }
    	}
    
    	@Override
    	public CommandDefinition[] getDefinition() {
    		return new CommandDefinition[] {
                        new CommandDefinition("myap", "", "See myap from anywhere", 0),
                        new CommandDefinition("buff", "", "Get buff from anywhere", 0),
                        new CommandDefinition("dojob", "", "Get job from anywhere", 0),
                        new CommandDefinition("emo", "", "Self Killing", 0),
                        new CommandDefinition("expfix", "", "Fixed negative exp", 0),
                        new CommandDefinition("commands", "", "Does Sexual Commands", 0),
                        new CommandDefinition("save", "", "S3xual So S3xual Saves UR ACC", 0),
                        new CommandDefinition("str", "<amount>", "Sets your strength to a higher amount if you have enough AP or takes it away if you aren't over 32767 AP.", 0),
                        new CommandDefinition("int", "<amount>", "Sets your intelligence to a higher amount if you have enough AP or takes it away if you aren't over 32767 AP.", 0),
                        new CommandDefinition("luk", "<amount>", "Sets your luck to a higher amount if you have enough AP or takes it away if you aren't over 32767 AP.", 0),
                        new CommandDefinition("dex", "<amount>", "Sets your dexterity to a higher amount if you have enough AP or takes it away if you aren't over 32767 AP.", 0),
                        new CommandDefinition("goto", "", "Warps you to s3xual places", 0),
                        new CommandDefinition("apreset", "", "Resets your ap", 0),
                        new CommandDefinition("dispose", "", "Stuck", 0),
                        new CommandDefinition("rebirth", "", "Guess", 0),
                        new CommandDefinition("achievements", "", "Shows the achievements you have finished so far", 0),
                        new CommandDefinition("spinel", "", "Spinel is pregnant", 0),
    		};
    	}
    
        }

  17. #392
    offonline King Grub is offline
    MemberRank
    Aug 2009 Join Date
    Spring fieldLocation
    3,303Posts

    Re: The best v75 Source

    Commandproccesor
    Code:
    package client.command;
    
    import client.MapleClient;
    
    public final class CommandProcessor {
    
    public static boolean processCommand(final MapleClient c, final String s) {
          String[] sp = s.split(" ");
            sp[0] = sp[0].toLowerCase();
    
    	        if (s.charAt(0) == '/' && c.getPlayer().gmLevel() > 0) {
    	            c.getPlayer().addCommandToList(s);
    	            if (GMCommand.execute(c, sp, '/'))
    	                return true;
    	            else if (c.getPlayer().gmLevel() > 1)
    	             AdminCommand.execute(c, sp, '/');
    	            return true;
    	        } else if (s.charAt(0) == '@' && c.getPlayer().gmLevel() >= 0) {
    	            PlayerCommands.execute(c, sp, '@');
    	            return true;
    	        }
    	        return false;
    	    }
    }
    That one includes Admin,GM and playercommand ranks.

  18. #393
    Enthusiast ermelious is offline
    MemberRank
    Sep 2008 Join Date
    27Posts

    Re: The best v75 Source

    Quote Originally Posted by PirateOwh View Post
    Commandproccesor
    Code:
    package client.command;
    
    import client.MapleClient;
    
    public final class CommandProcessor {
    
    public static boolean processCommand(final MapleClient c, final String s) {
          String[] sp = s.split(" ");
            sp[0] = sp[0].toLowerCase();
    
    	        if (s.charAt(0) == '/' && c.getPlayer().gmLevel() > 0) {
    	            c.getPlayer().addCommandToList(s);
    	            if (GMCommand.execute(c, sp, '/'))
    	                return true;
    	            else if (c.getPlayer().gmLevel() > 1)
    	             AdminCommand.execute(c, sp, '/');
    	            return true;
    	        } else if (s.charAt(0) == '@' && c.getPlayer().gmLevel() >= 0) {
    	            PlayerCommands.execute(c, sp, '@');
    	            return true;
    	        }
    	        return false;
    	    }
    }
    That one includes Admin,GM and playercommand ranks.
    Thanks but I receive compiling errors when I add the codes in, this my CommandProcessor.java

    Code:
    /*
    	This file is part of the OdinMS Maple Story Server
        Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> 
                           Matthias Butz <matze@odinms.de>
                           Jan Christian Meyer <vimes@odinms.de>
    
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU Affero General Public License version 3
        as published by the Free Software Foundation. You may not use, modify
        or distribute this program under any other version of the
        GNU Affero General Public License.
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU Affero General Public License for more details.
    
        You should have received a copy of the GNU Affero General Public License
        along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */
    
    package net.sf.odinms.client.messages;
    
    import java.io.File;
    import java.io.FileReader;
    import java.io.IOException;
    import java.lang.management.ManagementFactory;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.LinkedHashMap;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.Map;
    
    import javax.management.MBeanServer;
    import javax.management.ObjectName;
    import javax.script.Compilable;
    import javax.script.CompiledScript;
    import javax.script.Invocable;
    import javax.script.ScriptEngine;
    import javax.script.ScriptEngineFactory;
    import javax.script.ScriptEngineManager;
    import javax.script.ScriptException;
    
    import net.sf.odinms.client.MapleCharacter;
    import net.sf.odinms.client.MapleClient;
    import net.sf.odinms.client.SkillFactory;
    import net.sf.odinms.client.messages.commands.HelpCommand;
    import net.sf.odinms.database.DatabaseConnection;
    import net.sf.odinms.net.channel.ChannelServer;
    import net.sf.odinms.net.channel.handler.GeneralchatHandler;
    import net.sf.odinms.server.TimerManager;
    import net.sf.odinms.server.maps.MapleMap;
    import net.sf.odinms.tools.ClassFinder;
    import net.sf.odinms.tools.MaplePacketCreator;
    import net.sf.odinms.tools.MockIOSession;
    import net.sf.odinms.tools.Pair;
    import net.sf.odinms.tools.StringUtil;
    
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    public class CommandProcessor implements CommandProcessorMBean {	
    	private static final Logger log = LoggerFactory.getLogger(GeneralchatHandler.class);
    	private static List<Pair<MapleCharacter,String>> gmlog = new LinkedList<Pair<MapleCharacter,String>>();
    	private Map<String, DefinitionCommandPair> commands = new LinkedHashMap<String, DefinitionCommandPair>();
    	private static CommandProcessor instance = new CommandProcessor();
    	private static Runnable persister;
    	private ScriptEngineFactory sef;
    
    	static {
    		persister = new PersistingTask();
    		TimerManager.getInstance().register(persister, 62000);
    	}
    	
    	private CommandProcessor() {
    		ScriptEngineManager sem = new ScriptEngineManager();
    		sef = sem.getEngineByName("javascript").getFactory();
    		
    		instance = this; // hackydihack		
    		reloadCommands();
    	}
    	
    	public static class PersistingTask implements Runnable {
    		@Override
    		public void run() {
    			synchronized (gmlog) {
    				Connection con = DatabaseConnection.getConnection();
    				try {
    					PreparedStatement ps = 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) {
    					log.error("error persisting cheatlog", e);
    				}
    				gmlog.clear();
    			}
    		}
    	}
    	
    	public static void registerMBean() {
    		MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    		try {
    			mBeanServer.registerMBean(instance, new ObjectName("net.sf.odinms.client.messages:name=CommandProcessor"));
    		} catch (Exception e) {
    			log.error("Error registering CommandProcessor MBean");
    		}
    	}
    
    	public static String joinAfterString(String splitted[], String str) {
    		for (int i = 1; i < splitted.length; i++) {
    			if (splitted[i].equalsIgnoreCase(str) && i + 1 < splitted.length) {
    				return StringUtil.joinStringFrom(splitted, i + 1);
    			}
    		}
    		return null;
    	}
    
    	public static int getOptionalIntArg(String splitted[], int position, int def) {
    		if (splitted.length > position) {
    			try {
    				return Integer.parseInt(splitted[position]);
    			} catch (NumberFormatException nfe) {
    				return def;
    			}
    		}
    		return def;
    	}
    
    	public static String getNamedArg(String splitted[], int startpos, String name) {
    		for (int i = startpos; i < splitted.length; i++) {
    			if (splitted[i].equalsIgnoreCase(name) && i + 1 < splitted.length) {
    				return splitted[i + 1];
    			}
    		}
    		return null;
    	}
    
    	public static Integer getNamedIntArg(String splitted[], int startpos, String name) {
    		String arg = getNamedArg(splitted, startpos, name);
    		if (arg != null) {
    			try {
    				return Integer.parseInt(arg);
    			} catch (NumberFormatException nfe) {
    				// swallow - we don't really care
    			}
    		}
    		return null;
    	}
    	
    	public static int getNamedIntArg(String splitted[], int startpos, String name, int def) {
    		Integer ret = getNamedIntArg(splitted, startpos, name);
    		if (ret == null) {
    			return def;
    		}
    		return ret.intValue();
    	}
    
    	public static Double getNamedDoubleArg(String splitted[], int startpos, String name) {
    		String arg = getNamedArg(splitted, startpos, name);
    		if (arg != null) {
    			try {
    				return Double.parseDouble(arg);
    			} catch (NumberFormatException nfe) {
    				// swallow - we don't really care
    			}
    		}
    		return null;
    	}
    
    	public boolean processCommand(MapleClient c, String line) {
    		return instance.processCommandInternal(c, new ServernoticeMapleClientMessageCallback(c), c.getPlayer().getGMLevel(), line);
    	}
    	
    	/* (non-Javadoc)
    	 * @see net.sf.odinms.client.messages.CommandProcessorMBean#processCommandJMX(int, int, java.lang.String)
    	 */
    	public String processCommandJMX(int cserver, int mapid, String command) {
    		ChannelServer cserv = ChannelServer.getInstance(cserver);
    		if (cserv == null) {
    			return "The specified channel Server does not exist in this serverprocess";
    		}
    		MapleClient c = new MapleClient(null, null, new MockIOSession());
    		MapleCharacter chr = MapleCharacter.getDefault(c, 26023);
    		c.setPlayer(chr);
    		chr.setName("/---------jmxuser-------------\\"); // (name longer than maxmimum length)
    		MapleMap map = cserv.getMapFactory().getMap(mapid);
    		if (map != null) {
    			chr.setMap(map);
    			SkillFactory.getSkill(5101004).getEffect(1).applyTo(chr);
    			map.addPlayer(chr);
    		}
    		cserv.addPlayer(chr);
    		MessageCallback mc = new StringMessageCallback();
    		try {
    			processCommandInternal(c, mc, 1000, command);
    		} finally {
    			if (map != null) {
    				map.removePlayer(chr);
    			}
    			cserv.removePlayer(chr);
    		}
    		return mc.toString();
    	}
    	
    	public static void forcePersisting() {
    		persister.run();
    	}
    	
    	public static CommandProcessor getInstance() {
    		return instance;
    	}
    	
    	public void reloadCommands() {
    		commands.clear();
    		try {
    			ClassFinder classFinder = new ClassFinder();
    			String[] classes = classFinder.listClasses("net.sf.odinms.client.messages.commands", true);
    			registerCommand(new HelpCommand()); // register the helpcommand first so it appears first in the list (LinkedHashMap)
    			for (String clazz : classes) {
    				Class<?> clasz = Class.forName(clazz);
    				if (Command.class.isAssignableFrom(clasz)) {
    					try {
    						Command newInstance = (Command) clasz.newInstance();
    						registerCommand(newInstance);
    					} catch (Exception e) {
    						log.error("ERROR INSTANCIATING COMMAND CLASS", e);
    					}
    				}
    			}
    		} catch (ClassNotFoundException e) {
    			log.error("THROW", e);
    		}
    		File scriptFolder = new File("scripts/command");
    		for (File file : scriptFolder.listFiles()) {
    			if (file.isFile() && file.canRead()) {
    				FileReader fr = null;
    				try {
    					ScriptEngine command = sef.getScriptEngine();
    					fr = new FileReader(file);
    					CompiledScript compiled = ((Compilable) command).compile(fr);
    					compiled.eval();
    					Command c = ((Invocable) command).getInterface(Command.class);
    					registerCommand(c);
    				} catch (ScriptException e) {
    					log.error("THROW", e);
    				} catch (IOException e) {
    					log.error("THROW", e);
    				} finally {
    					if (fr != null) {
    						try {
    							fr.close();
    						} catch (IOException e) {
    							log.error("ERROR CLOSING", e);
    						}
    					}
    				}
    			}
    		}
    	}
    	
    	private void registerCommand(Command command) {
    		CommandDefinition[] definition = command.getDefinition();
    		for (CommandDefinition def : definition) {
    			commands.put(def.getCommand(), new DefinitionCommandPair(command, def));
    		}
    	}
    	
    	public void dropHelp(MapleCharacter chr, MessageCallback mc, int page) {
    		List<DefinitionCommandPair> allCommands = new ArrayList<DefinitionCommandPair>(commands.values());
    		int startEntry = (page - 1) * 20;
    		mc.dropMessage("Command Help Page: --------" + page + "---------");
    		for (int i = startEntry; i < startEntry + 20 && i < allCommands.size(); i++) {
    			CommandDefinition commandDefinition = allCommands.get(i).getDefinition();
    			if (chr.hasGmLevel(commandDefinition.getRequiredLevel())) {
    				dropHelpForDefinition(chr.getClient(), commandDefinition);
    			}			
    		}
    	}
    	
    	private void dropHelpForDefinition(MapleClient c, CommandDefinition commandDefinition) {
    		c.getSession().write(MaplePacketCreator.yellowNotice(commandDefinition.getCommand() + " " + commandDefinition.getParameterDescription() + ": " + commandDefinition.getHelp()));
    	}
    	
    	/* (non-Javadoc)
    	 * @see net.sf.odinms.client.messages.CommandProcessorMBean#processCommandInstance(net.sf.odinms.client.MapleClient, java.lang.String)
    	 */
    	private boolean processCommandInternal(MapleClient c, MessageCallback mc, int gmLevel, String line) {
    		MapleCharacter player = c.getPlayer();
    		if (line.charAt(0) == '/' || line.charAt(0) == '@') {
    			String[] splitted = line.split(" ");
    			if (splitted.length > 0 && splitted[0].length() > 1) {
    				DefinitionCommandPair definitionCommandPair = commands.get(splitted[0]);
    				if (definitionCommandPair != null && gmLevel >= definitionCommandPair.getDefinition().getRequiredLevel()) {
    					if (c.getPlayer().isGM()) { //only save to the GM log what GMs do.
    						synchronized (gmlog) {
    							gmlog.add(new Pair<MapleCharacter, String>(player, line));
    						}
    					}
    					try {
    						definitionCommandPair.getCommand().execute(c, mc, splitted);
    					} catch (IllegalCommandSyntaxException e) {
    						mc.dropMessage("IllegalCommandSyntaxException:" + e.getMessage());
    						dropHelpForDefinition(c, definitionCommandPair.getDefinition());
    					} catch (Exception e) {
    						mc.dropMessage("An error occured: " + e.getClass().getName() + " " + e.getMessage());
    						log.error("COMMAND ERROR", e);
    					}
    					return true;
    				} else if (c.getPlayer().getGMLevel() > 0) {					
    					mc.dropMessage("Command " + splitted[0] + " does not exist or you do not have the required priviledges");
    					return true;
    				}
    			}
    		}
    		return false;
    	}
    }
    
    class DefinitionCommandPair {
    	private Command command;
    	private CommandDefinition definition;
    	
    	public DefinitionCommandPair(Command command, CommandDefinition definition) {
    		super();
    		this.command = command;
    		this.definition = definition;
    	}
    	
    	public Command getCommand() {
    		return command;
    	}
    	
    	public CommandDefinition getDefinition() {
    		return definition;
    	}
    }

  19. #394
    ♥Fatal|Error♥ JungleByte is offline
    MemberRank
    Oct 2009 Join Date
    Singapore, SingLocation
    1,096Posts

    Re: The best v75 Source

    Thx for releasing this source RaptorJesus.^^

  20. #395
    Apprentice Boxiom is offline
    MemberRank
    Apr 2008 Join Date
    9Posts

    Re: The best v75 Source

    I get this error:

    Error saving character data
    Field 'flags' doesn't have a default value

    Happens when I try to click my char at character selection. What gives?

  21. #396
    Account Upgraded | Title Enabled! lightstory is offline
    MemberRank
    Aug 2008 Join Date
    246Posts

    Re: The best v75 Source

    DestinyMS just got owned.

  22. #397
    offonline King Grub is offline
    MemberRank
    Aug 2009 Join Date
    Spring fieldLocation
    3,303Posts

    Re: The best v75 Source

    Quote Originally Posted by LightStory View Post
    DestinyMS just got owned.
    'just' ?
    It was a while back lol...and...DestinyMS is dead..

  23. #398
    ASAPROCKY Psychopath is offline
    MemberRank
    Mar 2007 Join Date
    The NetherlandsLocation
    1,263Posts

    Re: The best v75 Source

    Quote Originally Posted by PirateOwh View Post
    'just' ?
    It was a while back lol...and...DestinyMS is dead..
    LOL and LightStory just got owned

  24. #399
    Enthusiast iEviLx3 is offline
    MemberRank
    Dec 2009 Join Date
    My house.Location
    28Posts

    Re: The best v75 Source

    wow good comments o.o ima try o.o thx for release bro keep it up..

    is this better then shoot source?

  25. #400
    offonline King Grub is offline
    MemberRank
    Aug 2009 Join Date
    Spring fieldLocation
    3,303Posts

    Re: The best v75 Source

    Quote Originally Posted by iEviLx3 View Post
    wow good comments o.o ima try o.o thx for release bro keep it up..

    is this better then shoot source?
    Shootsource is the most complete v75 source out there.
    @edit flavs source beeest: / . haz everything shootsource got AND wrong coupon code fix
    Last edited by King Grub; 21-12-09 at 08:58 PM.



Advertisement