Package networking.request

Source Code of networking.request.RequestLeaveWorld

package networking.request;

import core.GameServer;

import java.io.IOException;

import model.World;

/**
*
* @author Gary
*/
public class RequestLeaveWorld extends GameRequest {

    // Data
    // Responses
    public RequestLeaveWorld() {
    }

    @Override
    public void parse() throws IOException {
    }

    @Override
    public void doBusiness() throws Exception {
        World world = client.getWorld();

        if (world != null) {
            world.removePlayer(client.getPlayer().getID());

            if (world.getPlayers().isEmpty()) {
                GameServer.getInstance().removeWorldAndWorldMapFromBuffer(world.getID(), world.getGameMode());
            }
        }
    }
}
TOP

Related Classes of networking.request.RequestLeaveWorld

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.