コード例 #1
0
 public void RemoveClient(UnityClient client)
 {
     using (WriteLock.TryEnter(this.readWriteLock, 1000))
     {
         Clients.Remove(client);
     }
 }
コード例 #2
0
ファイル: World.cs プロジェクト: nPaul/TestPhotonLib
 public void RemoveClient(UnityClient client)
 {
     using (WriteLock.TryEnter(this.readWriteLock, 1000))
     {
         Clients.Remove(client);
     }
 }
コード例 #3
0
 public void AddClient(UnityClient client)
 {
     using (WriteLock.TryEnter(this.readWriteLock, 1000))
     {
         Clients.Add(client);
     }
 }
コード例 #4
0
ファイル: World.cs プロジェクト: nPaul/TestPhotonLib
 public void AddClient(UnityClient client)
 {
     using (WriteLock.TryEnter(this.readWriteLock, 1000))
     {
         Clients.Add(client);
     }
 }
コード例 #5
0
        public void TrySendChatMessage()
        {
            var chatRequest = new ChatMessage(UnityClient.Protocol, OperationRequest);

            if (!chatRequest.IsValid)
            {
                UnityClient.SendOperationResponse(chatRequest.GetResponse(ErrorCode.InvalidParameters), SendParameters);
                return;
            }

            string message = chatRequest.Message;

            message = UnityClient.CharacterName + ": " + message;
            ChatLobby.Instance.AddMessage(message);

            var eventData = new EventData((byte)EventCode.ChatMessage);

            eventData.Parameters = new Dictionary <byte, object>()
            {
                { (byte)ParameterCode.ChatMessage, message }
            };
            eventData.SendTo(AccountService.Instance.Clients, SendParameters);
        }
コード例 #6
0
        public void TryAuthorization()
        {
            var loginRequest = new Login(UnityClient.Protocol, OperationRequest);

            UnityClient.CharacterName = loginRequest.CharacterName;

            if (!loginRequest.IsValid)
            {
                UnityClient.SendOperationResponse(loginRequest.GetResponse(ErrorCode.InvalidParameters), SendParameters);
                return;
            }

            if (AccountService.Instance.IsContain(UnityClient.CharacterName))
            {
                UnityClient.SendOperationResponse(loginRequest.GetResponse(ErrorCode.NameIsExist), SendParameters);
                return;
            }

            AccountService.Instance.AddClient(UnityClient);

            var response = new OperationResponse(OperationRequest.OperationCode);

            UnityClient.SendOperationResponse(response, SendParameters);
        }
コード例 #7
0
 public ChatInfo(UnityClient client, OperationRequest operationRequest, SendParameters sendParameters)
 {
     UnityClient      = client;
     OperationRequest = operationRequest;
     SendParameters   = sendParameters;
 }
コード例 #8
0
ファイル: ChatInfo.cs プロジェクト: AlexGrey/MinesServer
 public ChatInfo(UnityClient client, OperationRequest operationRequest, SendParameters sendParameters)
 {
     UnityClient = client;
     OperationRequest = operationRequest;
     SendParameters = sendParameters;
 }