Esempio n. 1
0
 public void messageReceived(string message, messageType msgType)
 {
     if (msgType.Equals(messageType.REGISTERED))
         updateLabelStatus(statusLabel, "注册成功");
     else if (msgType.Equals(messageType.KEEPALIVE))
         PublishMessage(keepaliveTextbox, message);
     else 
         PublishMessage(ReceiveTextBox, message);
 }
Esempio n. 2
0
        public void messageReceived(string message, messageType msgType)
        {
            publishMessage(message, msgType);
            if (msgType.Equals(messageType.REGISTERED))
            {
                return;
            }
            if (msgType.Equals(messageType.TEST))
            {
                return;
            }
            if (msgType.Equals(messageType.KEEPALIVE))
            {
                return;
            }

            string operationType = TextFollowing(message, "OPERATION:", "");
            string localRoomId   = TextFollowing(message, "LOCALCONFROOMID:", "");
            string serverRoomId  = TextFollowing(message, "SERVERROOMID:", "");
            string operatorName  = TextFollowing(message, "OPERATORNAME:", "");

            if (operationType == "ADDMEMBER")
            {
                foreach (KeyValuePair <string, int> kv in addIndex)
                {
                    if (message.Contains(kv.Key))
                    {
                        string oneLine = TextFollowing(message, kv.Key + ":", "");
                        string type    = kv.Key;
                        int    index   = addIndex[type];
                        addDelegates[index](oneLine, operatorName, localRoomId, serverRoomId);
                    }
                }
            }

            else if (operationType == "DELETEMEMBER")
            {
                foreach (KeyValuePair <string, int> kv in deleteIndex)
                {
                    if (message.Contains(kv.Key))
                    {
                        string oneLine = TextFollowing(message, kv.Key + ":", "");
                        string type    = kv.Key;
                        int    index   = deleteIndex[type];
                        deleteDelegates[index](oneLine, operatorName, localRoomId, serverRoomId);
                    }
                }
            }
        }
Esempio n. 3
0
 public void messageReceived(string message, messageType msgType)
 {
     if (msgType.Equals(messageType.REGISTERED))
     {
         updateLabelStatus(statusLabel, "注册成功");
     }
     else if (msgType.Equals(messageType.KEEPALIVE))
     {
         PublishMessage(keepaliveTextbox, message);
     }
     else
     {
         PublishMessage(ReceiveTextBox, message);
     }
 }
Esempio n. 4
0
        public void messageReceived(string message, messageType msgType)
        {
           
            publishMessage(message, msgType);
            if (msgType.Equals(messageType.REGISTERED))
                return;
            if (msgType.Equals(messageType.TEST))
                return;
            if (msgType.Equals(messageType.KEEPALIVE))
                return;

            string operationType = TextFollowing(message, "OPERATION:", "");
            string localRoomId = TextFollowing(message, "LOCALCONFROOMID:", "");
            string serverRoomId = TextFollowing(message, "SERVERROOMID:", "");
            string operatorName = TextFollowing(message, "OPERATORNAME:", "");

            if (operationType == "ADDMEMBER")
            {
                foreach (KeyValuePair<string, int> kv in addIndex)
                {
                    if (message.Contains(kv.Key))
                    {
                        string oneLine = TextFollowing(message, kv.Key + ":", "");
                        string type = kv.Key;
                        int index = addIndex[type];
                        addDelegates[index](oneLine, operatorName, localRoomId, serverRoomId);
                    }
                }
            }

            else if (operationType == "DELETEMEMBER")
            {
                foreach (KeyValuePair<string, int> kv in deleteIndex)
                {
                    if (message.Contains(kv.Key))
                    {
                        string oneLine = TextFollowing(message, kv.Key + ":", "");
                        string type = kv.Key;
                        int index = deleteIndex[type];
                        deleteDelegates[index](oneLine, operatorName, localRoomId, serverRoomId);
                    }
                }
            }
        }