Package networking.request

Source Code of networking.request.RequestParams

package networking.request;

import core.GameServer;

import java.io.IOException;
import java.util.HashMap;

import metadata.Constants;
import networking.response.ResponseChangeParameters;
import utility.DataReader;
import worldManager.gameEngine.Zone;

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

    // Data
    private HashMap<Short, Float> parameterList;
    // Responses
    private ResponseChangeParameters responseChangeParameters;

    public RequestParams() {
        parameterList = new HashMap<Short, Float>();
        responses.add(responseChangeParameters = new ResponseChangeParameters());
    }

    @Override
    public void parse() throws IOException {
    }

    @Override
    public void doBusiness() throws Exception {
        for (Zone zone : client.getWorld().getEnvByUserID(client.getPlayer().getID()).getZones()) {
            if (zone.isEnable()) {
                parameterList = zone.getParameters();
                break;
            }
        }

        responseChangeParameters.setParameter(parameterList);

//        int experience = 0;

//        for (short parameter : parameterList.keySet()) {
//            experience += 100;
//        }
//
//        GameServer.getInstance().updateExperience(client.getPlayer(), experience);
    }
}
TOP

Related Classes of networking.request.RequestParams

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.