Hello, im nl pk3er.
And i got a little request for somebody thats know a liltle bit about java and mySQL.
Ok, i searching to put my commands & NPC spawn to a mySQL database so i can load command from my mySQL DB.
This is the command file:
Code:
package com.hotyute.clientdata.players.ipackets;
import com.hotyute.clientdata.players.Player;
import com.hotyute.clientdata.players.items.InventoryCalc;
import com.hotyute.clientdata.players.skills.SkillCalc;
import com.hotyute.clientdata.players.update.PlayerCycle;
import com.hotyute.clientdata.players.update.masks.DataCollect;
import com.hotyute.communications.ActionSender;
import com.hotyute.communications.InStream;
import java.nio.ByteBuffer;
/**
* Created by IntelliJ IDEA.
* User: Samuel ([email protected])
* Date: Mar 1, 2010
* Time: 8:19:05 PM
*/
public class Commands implements Packet {
public void execute(Player player, ByteBuffer buffer, int packetId, int size) {
boolean bool = (buffer.get() & 0xff) == 1;
boolean bool2 = (buffer.get() & 0xff) == 1;
String[] command = InStream.readString(buffer).split(" ");
if (player.getPlayerdata().getPlayerRights() >= 2) {
if (command[0].equals("addxp") && player.getIdentity().getUsername().toLowerCase().equals("hotyute")) {
SkillCalc.addSkillXP(player, Integer.parseInt(command[2]), Integer.parseInt(command[1]));
} else if (command[0].equals("add")) {
PlayerCycle.add = 1;
} else if (command[0].equals("item")) {
InventoryCalc.addItem(player, Integer.parseInt(command[1]), Integer.parseInt(command[2]));
ActionSender.sendItems(player, 93, player.getItems(), false);
} else if (command[0].equals("graphics"))
DataCollect.applyGraphicsUpdate(player, Short.parseShort(command[1]), 0);
else if (command[0].equals("anim"))
DataCollect.applyAnimationUpdate(player, Short.parseShort(command[1]), 0);
else if (command[0].equals("equip")) {
player.getEquipment().set(Integer.parseInt(command[1]), new int[]{Integer.parseInt(command[2]), 1});
DataCollect.applyVisualUpdate(player);
} else if (command[0].equals("gcserver") && player.getIdentity().getUsername().toLowerCase().equals("hotyute")) {
System.out.print("running garbage collector...");
System.gc();
System.out.println("DONE");
} else if (command[0].equals("tele")) {
player.getPosition().FINALGENX = -player.getPosition().getX() + Integer.parseInt(command[1]);
player.getPosition().FINALGENY = -player.getPosition().getY() + Integer.parseInt(command[2]);
player.getPosition().setCoords(Integer.parseInt(command[1]), Integer.parseInt(command[2]), 0);
ActionSender.sendMapRegion(player, true);
player.getPosition().setDidtele(true);
}
} else if (player.getPlayerdata().getPlayerRights() == 1) {
} else if (player.getPlayerdata().getPlayerRights() == 0) {
}
}
}
And about the NPC Spawn, i neet a full new code for this ;-)
So can somebody post the mySQL & JAVA Code in here for a 601 server in here?
Greets nl pk3er