package com.nhn.example;

import com.nhn.example.protocol.Message;
import com.nhn.gameanvil.GameAnvilServer;
import com.nhn.gameanvil.common.GameAnvilApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@GameAnvilApplication
public class Main {
    public static void main(String[] args) {
        final GameAnvilServer gameAnvilServer = GameAnvilServer.getInstance();

        gameAnvilServer.addProtocol(Message.class);

        gameAnvilServer.run(Main.class, args);
//
//        final IGameAnvilServerBuilder builder = gameAnvilServer.getServerTemplateBuilder();
//
//        builder.addProtocol(Message.class);
//
//        builder.connection(Connection::new, config -> {
//        });
//        builder.session(Session::new, config -> {
//        });
//        builder.gatewayNode(GatewayNode::new, config -> {
//        });
//
//        final IGameServiceBuilder gameServiceBuilder = builder.createGameService("SCENARIO_SERVICE");
//        gameServiceBuilder.gameNode(GameNode::new, config -> {
//        });
//        gameServiceBuilder.user("SCENARIO_USER", GameUser::new, config -> {
//        });
//        gameServiceBuilder.room("SCENARIO_ROOM", GameRoom::new, config -> {
//            config.protoBufferHandler(Message.EchoReq.class, new _EchoReq());
//            config.matchMaker(UserMatchMaker::new);
//        });
//
//        gameAnvilServer.run();
    }
}
