From c6355a680d3b61c45580c052b38bc6c1b726aa82 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 29 八月 2018 17:56:46 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
Core/NetworkPackage/NetPkgCtl.cs | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/Core/NetworkPackage/NetPkgCtl.cs b/Core/NetworkPackage/NetPkgCtl.cs
index 1aeeda8..bc893b2 100644
--- a/Core/NetworkPackage/NetPkgCtl.cs
+++ b/Core/NetworkPackage/NetPkgCtl.cs
@@ -3,6 +3,7 @@
using UnityEngine;
using System;
using System.Text;
+using System.IO;
public class NetPkgCtl
{
@@ -79,6 +80,38 @@
{
return _tempNetPkgLst;
}
+
+ public static void WriteAllNetLog()
+ {
+ if (_typeLst != null)
+ {
+ var count = 0;
+ var lines = new List<string>();
+ for (int i = _typeLst.Count - 1; i >= 0; i--)
+ {
+ if (count > 20000)
+ {
+ break;
+ }
+
+ var package = _typeLst[i];
+ var line = string.Empty;
+ line = StringUtility.Contact(package.NetPkgTp == NetPkgType.Client ? "銆愬彂閫併��" : "銆愭帴鏀躲��", package.SendOrGetTime, ":", package.GameNetName, "\r\n");
+ if (package.fieldDetails != null)
+ {
+ for (int j = 0; j < package.fieldDetails.Count; j++)
+ {
+ line = StringUtility.Contact(line, "\t\t\t", package.fieldDetails[j], "\r\n");
+ }
+ }
+
+ lines.Add(line);
+ count++;
+ }
+
+ File.WriteAllLines(Application.dataPath + "/PackageLogs" + "_" + DateTime.Now.ToString("HH_mm_ss") + ".txt", lines.ToArray());
+ }
+ }
}
public class NetPkg
--
Gitblit v1.8.0