コード例 #1
0
ファイル: MessageServer.cs プロジェクト: ywscr/SAEA
        void ReplyPrivateMessage(MessageUserToken userToken, ChatMessage cm)
        {
            ReplyBase(userToken, new ChatMessage(ChatMessageType.PrivateMessageAnswer, ""));

            var privateMessage = SerializeHelper.Deserialize <PrivateMessage>(cm.Content);

            if (privateMessage != null && !string.IsNullOrEmpty(privateMessage.Receiver))
            {
                privateMessage.Sender = userToken.ID;

                privateMessage.Sended = DateTimeHelper.ToString();

                var r = (IUserToken)_server.GetCurrentObj(privateMessage.Receiver);
                if (r != null)
                {
                    ReplyBase(r, new ChatMessage(ChatMessageType.PrivateMessage, SerializeHelper.Serialize(privateMessage)));
                }
            }
        }