package com.nhn.example.game.handler;

import com.nhn.example.game.GameRoom;
import com.nhn.example.protocol.Message;
import com.nhn.gameanvil.common.GameAnvilController;
import com.nhn.gameanvil.game.GameRoomMapping;
import com.nhn.gameanvil.game.IRoomDispatchContext;
import com.nhn.gameanvil.packet.message.IMessageHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@GameAnvilController
public class _EchoReq implements IMessageHandler<IRoomDispatchContext, Message.EchoReq> {
    private static final Logger log = LoggerFactory.getLogger(_EchoReq.class);

    @GameRoomMapping(value = Message.EchoReq.class, loadClass = GameRoom.class)
    @Override
    public void execute(IRoomDispatchContext ctx, Message.EchoReq request) {
        Message.EchoRes response = Message.EchoRes.newBuilder().setMessage(request.getMessage()).build();
        ctx.reply(response);
    }
}
