예제 #1
0
        public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
        {
            switch (message.Command)
            {
            case FightProtocol.ENTER_CREQ:
                enterBattle(token);
                break;

            case FightProtocol.MOVE_CREQ:
                move(token, message.GetMessage <MoveDTO>());
                break;

            case FightProtocol.ATTACK_CREQ:
                attack(token, message.GetMessage <int>());
                break;

            case FightProtocol.DAMAGE_CREQ:
                damage(token, message.GetMessage <DamageDTO>());
                break;

            case FightProtocol.SKILL_UP_CREQ:
                skillUp(token, message.GetMessage <int>());
                break;

            case FightProtocol.SKILL_CREQ:
                skill(token, message.GetMessage <SkillAttackModel>());
                break;
            }
        }
예제 #2
0
 public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
 {
     switch (message.command)
     {
     case ExploreProtocol.INPUT_CREQ:
         Input(message.GetMessage <byte[]>());
         break;
     }
 }
예제 #3
0
 public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
 {
     switch (message.command)
     {
     case FightProtocol.ENTER_CREQ:
         enter(token);
         break;
     }
 }
예제 #4
0
        public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
        {
            int userId = getUserId(token);

            if (userRoom.ContainsKey(userId))
            {
                int roomId = userRoom[userId];
                if (roomMap.ContainsKey(roomId))
                {
                    roomMap[roomId].MessageReceive(token, message);
                }
            }
        }
예제 #5
0
        public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
        {
            switch (message.Command)
            {
            case MatchProtocol.ENTER_CREQ:
                //Console.WriteLine("角色发来匹配请求...");
                enter(token);
                break;

            case MatchProtocol.LEAVE_CREQ:
                //Console.WriteLine("申请取消匹配...");
                leave(token);
                break;
            }
        }
예제 #6
0
        public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
        {
            //if(roomMap.ContainsKey(message.Area))
            //{
            //    roomMap[message.Area].MessageReceive(token, message);
            //}
            int userID = getUserID(token);

            if (userRoom.ContainsKey(userID))
            {
                int roomID = userRoom[userID];
                if (roomMap.ContainsKey(roomID))
                {
                    roomMap[roomID].MessageReceive(token, message);
                }
            }
        }
        public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
        {
            switch (message.command)
            {
            case SelectProtocol.ENTER_CREQ:
                enter(token);
                break;

            case SelectProtocol.SELECT_CREQ:
                select(token, message.GetMessage <int>());
                break;

            case SelectProtocol.TALK_CREQ:
                talk(token, message.GetMessage <string>());
                break;

            case SelectProtocol.READY_CREQ:
                ready(token);
                break;
            }
        }
예제 #8
0
        public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
        {
            switch (message.command)
            {
            case ExploreProtocol.ENTER_CREQ:
                enter(token, message.area);
                break;

            case ExploreProtocol.INFORM_CREQ:
                inform(token, message.area);
                break;

            case ExploreProtocol.LEAVE_CREQ:
                leave(token);
                break;

            default:
                roomMap[userRoom[getUserId(token)]].MessageReceive(token, message);
                break;
            }
        }
예제 #9
0
 public void MessageReceive(NetFrame.UserToken token, NetFrame.auto.SocketModel message)
 {
     roomMap[userRoom[getUserId(token)]].MessageReceive(token, message);
 }