yyl
2025-05-19 b118ece3db250a5a257b60713da92234d8d5a57a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.Collections.Generic;
 
public class DebugPkgCache
{
    private string dataTime;
    private int code;
 
    private static List<DebugPkgCache> m_List = new List<DebugPkgCache>();
 
    public static void Push(GameNetPackBasic package)
    {
        if (m_List.Count != 0)
        {
            if (m_List[m_List.Count - 1].code == 258)
            {
                return;
            }
        }
 
        DebugPkgCache _p = new DebugPkgCache();
        _p.dataTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
        _p.code = package.cmd;
 
        m_List.Add(_p);
    }
 
    public static void UpLoad()
    {
        var _contents = new System.Text.StringBuilder();
        foreach (var _content in m_List)
        {
            _contents.Append("[");
            _contents.Append(_content.dataTime);
            _contents.Append("]");
            _contents.Append(_content.code);
            _contents.Append("\r\n");
        }
 
#if UNITY_EDITOR
        UnityEngine.Debug.Log("登陆异常: " + _contents.ToString());
#endif
        _contents = null;
 
        m_List.Clear();
    }
}