Beispiel #1
0
        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)));
                }
            }
        }
 public IUserToken GetUserToken(string sessionID)
 {
     return((IUserToken)_server.GetCurrentObj(sessionID));
 }