Well, I came up with this idea when I started getting increasingly frustrated with having to restart the server.
Note: I'm not sure if the doors reload properly. They might but I haven't been able to test them as yet.
Open up client.java
Find:
Code:
if (command.startsWith("xteletome") && playerRights > 0) {
Add above:
Code:
if(command.startsWith("update") && playerRights >= 2) {
server.reload();
sendMessage("Server reloaded.");
}
Close and save client.java, then load server.java
Find:
Code:
public static void loadObjects()
{
try
{
Statement statement = Database.conn.createStatement();
Replace with:
Code:
public static void loadObjects()
{
try
{
objects.clear();
Statement statement = Database.conn.createStatement();
Add the void somewhere in server.java:
Code:
public static void reload()
{
npcHandler = null;
itemHandler = null;
doorHandler = null;
npcHandler = new NPCHandler();
itemHandler = new ItemHandler();
doorHandler = new DoorHandler();
shopHandler = null;
objectHandler = null;
shopHandler = new ShopHandler();
objectHandler = new ObjectHandler();
loadObjects();
misc.println("Reloaded NPCs, items, doors, shops and objects!");
}
Congratulations: you should be done!
You can now use:
in-game!
I've tested objects, items and NPCs to work fine. Others are untested but should work.
Could someone test doors for me? .. Thanks.