Esempio n. 1
0
        public void SendJson(int cmd, int type, string json)
        {
            Msg msg = new Msg();

            msg.Cmd  = cmd;
            msg.Type = type;
            msg.Args = json;
            string str = JsonUtility.ToJson(msg);
            var    dat = Encoding.UTF8.GetBytes(str);

            link.Post(0, dat, EnvelopeType.Json);
        }
Esempio n. 2
0
        void Log(string condtion, string stack, LogType type)
        {
            for (int i = 0; i < logs.Count; i++)
            {
                if (logs[i].condition == condtion)
                {
                    if (logs[i].stackTrace == stack)
                    {
                        logs[i].count++;
                        return;
                    }
                }
            }
            LogData log = new LogData();

            log.count      = 1;
            log.condition  = condtion;
            log.stackTrace = stack;
            log.type       = type;
            logs.Add(log);
            var str = JsonUtility.ToJson(log);

            logLink.Post(0, Encoding.UTF8.GetBytes(str), EnvelopeType.String);
        }