Direct almost all chr saving through CharacterSaver
Client#disconnectInternal remains. Had to remove some configurable save points to keep it simple.
This commit is contained in:
@@ -41,7 +41,7 @@ public class SaveAllCommand extends Command {
|
||||
Character player = c.getPlayer();
|
||||
for (World world : Server.getInstance().getWorlds()) {
|
||||
for (Character chr : world.getPlayerStorage().getAllCharacters()) {
|
||||
chr.saveCharToDB();
|
||||
ctx.characterSaver().save(chr);
|
||||
}
|
||||
}
|
||||
String message = player.getName() + " used !saveall.";
|
||||
|
||||
@@ -55,7 +55,7 @@ public class WarpWorldCommand extends Command {
|
||||
player.getMap().removePlayer(player);//LOL FORGOT THIS ><
|
||||
player.setSessionTransitionState();
|
||||
player.setWorld(worldb);
|
||||
player.saveCharToDB();//To set the new world :O (true because else 2 player instances are created, one in both worlds)
|
||||
ctx.characterSaver().save(player);//To set the new world :O (true because else 2 player instances are created, one in both worlds)
|
||||
c.sendPacket(PacketCreator.getChannelChange(InetAddress.getByName(socket[0]), Integer.parseInt(socket[1])));
|
||||
} catch (UnknownHostException | NumberFormatException ex) {
|
||||
ex.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user