Exemple #1
0
 public WeihuaGames.ClientClass.ChatMessage FromProtoClass(com.kodgames.corgi.protocol.ChatMessage chatMessage)
 {
     if (chatMessage != null)
     {
         this.messageId        = chatMessage.messageId;
         this.messageType      = chatMessage.messageType;
         this.receiverId       = chatMessage.receiverId;
         this.senderId         = chatMessage.senderId;
         this.senderName       = chatMessage.senderName;
         this.time             = chatMessage.time;
         this.content          = chatMessage.content;
         this.receiverName     = chatMessage.receiverName;
         this.senderVipLevel   = chatMessage.senderVipLevel;
         this.receiverVipLevel = chatMessage.receiverVipLevel;
     }
     return(this);
 }
Exemple #2
0
    public static int CompareChageMessage(com.kodgames.corgi.protocol.ChatMessage msgX, com.kodgames.corgi.protocol.ChatMessage msgY)
    {
        if (msgX.messageType == msgY.messageType)
        {
            return(-1);
        }

        if (msgX.messageType == _ChatType.System)
        {
            return(1);
        }

        if (msgX.messageType == _ChatType.Private)
        {
            if (msgY.messageType == _ChatType.System)
            {
                return(-1);
            }
            else
            {
                return(1);
            }
        }

        if (msgX.messageType == _ChatType.World)
        {
            if (msgY.messageType == _ChatType.System || msgY.messageType == _ChatType.Private)
            {
                return(-1);
            }
            else
            {
                return(1);
            }
        }

        if (msgX.messageType == _ChatType.FlowMessage)
        {
            return(-1);
        }

        return(1);
    }