Package networking.request

Source Code of networking.request.RequestDeleteWorld

package networking.request;

import dataAccessLayer.WorldDAO;
import java.io.IOException;

import networking.response.ResponseDeleteWorld;
import utility.DataReader;

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

    // Data
    private int world_id;
    // Responses
    private ResponseDeleteWorld responseDeleteWorld;

    public RequestDeleteWorld() {
        responses.add(responseDeleteWorld = new ResponseDeleteWorld());
    }

    @Override
    public void parse() throws IOException {
        world_id = DataReader.readInt(dataInput);
    }

    @Override
    public void doBusiness() throws Exception {
        WorldDAO.removeWorld(world_id);

        responseDeleteWorld.setStatus((short) 0);
        responseDeleteWorld.setWorldID(world_id);
    }
}
TOP

Related Classes of networking.request.RequestDeleteWorld

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.