Exemplo n.º 1
0
        public void RequestLobbyMatch(ServerPacketData packetData)
        {
            var sessionID = packetData.SessionID;

            LobbyServer.MainLogger.Debug("RequestMatch");

            try
            {
                var lobbyObject = CheckLobbyAndLobbyUser(sessionID);
                if (lobbyObject.Item1 == false)
                {
                    return;
                }

                var lobbyUser = lobbyObject.Item3;

                ResponseLobbyMatchToClient(sessionID, ERROR_CODE.NONE);

                var user = new MatchUser();
                user.LobbyNetSessionID = sessionID;
                MatchingSys.Add(user);

                MatchingSys.Process(LobbyServer.ServerOpt.GameServerIP, (UInt16)LobbyServer.ServerOpt.GameServerPort);
            }
            catch (Exception ex)
            {
                LobbyServer.MainLogger.Error(ex.ToString());
            }
        }
        void MatchingComplete(MatchUser user1, MatchUser user2, string gameServerIP, UInt16 gameServerPort)
        {
            // 사용할 수 있는 방을 얻는다
            ++RoomNumber;

            // 유저들이 있는 로비서버에 통보한다
            NotifyLobbyMatchToClient(user1.LobbyNetSessionID, gameServerIP, gameServerPort, RoomNumber);
            NotifyLobbyMatchToClient(user2.LobbyNetSessionID, gameServerIP, gameServerPort, RoomNumber);
        }
 public void Add(MatchUser data)
 {
     MatchUserQueue.Enqueue(data);
 }