Esempio n. 1
0
    private void ProcessMessage(string message)
    {
        PLogger.Log("接收信息:" + message);
        List <string> messages = new List <string>(message.Split(' '));

        messages.RemoveAll((string x) => x.Equals(string.Empty));
        string[] MessageList = messages.ToArray();
        if (MessageList.Length < 1)
        {
            return;
        }
        string OrderName = MessageList[0].Split('\'')[0];

        try {
            int OrderIndex = Convert.ToInt32(MessageList[0].Split('\'')[1]);
            if (OrderIndex <= CurrentIndex)
            {
                PLogger.Log("不正当的信息:" + message);
                return;
            }
            else
            {
                CurrentIndex = OrderIndex;
            }
            POrder Order = POrder.GetOrder(OrderName);
            Order.ClientResponseAction(MessageList);
        } catch (Exception e) {
            PLogger.Log("客户端处理信息时发生错误:" + message);
            PLogger.Log(e.ToString());
        }
    }
Esempio n. 2
0
    private void ProcessMessage(string message, string IPAddress)
    {
        PLogger.Log("接收信息 (" + IPAddress + "):" + message);
        List <string> messages = new List <string>(message.Split(' '));

        messages.RemoveAll((string x) => x.Equals(string.Empty));
        string[] MessageList = messages.ToArray();
        if (MessageList.Length < 1)
        {
            return;
        }
        string OrderName = MessageList[0];

        try {
            POrder Order = POrder.GetOrder(OrderName);
            Order.ServerResponseAction(MessageList, IPAddress);
        } catch (Exception e) {
            PLogger.Log("服务器处理信息时发生错误:" + message);
            PLogger.Log(e.ToString());
        }
    }