فهرست منبع

服务器客户端配置全部放到一个目录/Logs,方便看log

tanghai 9 سال پیش
والد
کامیت
281ef80003
5فایلهای تغییر یافته به همراه10 افزوده شده و 26 حذف شده
  1. 1 0
      .gitignore
  2. 4 4
      Server/App/NLog.config
  3. 0 16
      Server/Server.sln
  4. 4 5
      Unity/Assets/Plugins/Base/Log.cs
  5. 1 1
      Unity/ClientConfig.txt

+ 1 - 0
.gitignore

@@ -32,3 +32,4 @@ _ReSharper.CSharp/
 /Server/Server.VC.opendb
 /Log
 /Temp
+/Logs

+ 4 - 4
Server/App/NLog.config

@@ -5,27 +5,27 @@
 	<variable name="appId" value="" />
 	<targets>
 		<target name="all" xsi:type="File"
-			fileName="${basedir}/Logs/Log.txt"
+			fileName="${basedir}/../Logs/Log.txt"
 			deleteOldFileOnStartup="false"
 		layout="${longdate} ${var:appType} ${var:appId} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
 	</targets>
 	<targets>
 		<target name="debug" xsi:type="File"
-			fileName="${basedir}/Logs/Log-${var:appType}-${var:appId}-Debug.txt"
+			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}-Debug.txt"
 			deleteOldFileOnStartup="false"
 			layout="${longdate} ${var:appType} ${var:appId} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
 	</targets>
 
 	<targets>
 		<target name="info" xsi:type="File"
-			fileName="${basedir}/Logs/Log-${var:appType}-${var:appId}-Info.txt"
+			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}-Info.txt"
 			deleteOldFileOnStartup="false"
 			layout="${longdate} ${var:appType} ${var:appId} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
 	</targets>
 	
 	<targets>
 		<target name="error" xsi:type="File"
-			fileName="${basedir}/Logs/Log-${var:appType}-${var:appId}-Error.txt"
+			fileName="${basedir}/../Logs/Log-${var:appType}-${var:appId}-Error.txt"
 			deleteOldFileOnStartup="false"
 			layout="${longdate} ${var:appType} ${var:appId} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message} ${stacktrace:format=Flat:topFrames=100:skipFrames=2}" />
 	</targets>

+ 0 - 16
Server/Server.sln

@@ -13,8 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ThirdParty", "ThirdParty",
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server.App", "App\Server.App.csproj", "{3F8DC04C-9E05-403F-B6A5-36293EB99937}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ENet", "ThirdParty\ENet\ENet.vcxproj", "{C9992B7C-313E-4C9F-A954-640D01EDFB58}"
-EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -73,22 +71,8 @@ Global
 		{3F8DC04C-9E05-403F-B6A5-36293EB99937}.Release|x64.Build.0 = Release|Any CPU
 		{3F8DC04C-9E05-403F-B6A5-36293EB99937}.Release|x86.ActiveCfg = Release|Any CPU
 		{3F8DC04C-9E05-403F-B6A5-36293EB99937}.Release|x86.Build.0 = Release|Any CPU
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Any CPU.ActiveCfg = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|Any CPU.Build.0 = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|x64.ActiveCfg = Debug|x64
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|x64.Build.0 = Debug|x64
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|x86.ActiveCfg = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Debug|x86.Build.0 = Debug|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|Any CPU.ActiveCfg = Release|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|x64.ActiveCfg = Release|x64
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|x64.Build.0 = Release|x64
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|x86.ActiveCfg = Release|Win32
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58}.Release|x86.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
-	GlobalSection(NestedProjects) = preSolution
-		{C9992B7C-313E-4C9F-A954-640D01EDFB58} = {01CCAD69-09B1-42F9-8A39-489268BEE18D}
-	EndGlobalSection
 EndGlobal

+ 4 - 5
Unity/Assets/Plugins/Base/Log.cs

@@ -23,13 +23,12 @@ namespace Base
 
 		static Log()
 		{
-			if (!Directory.Exists("../Log"))
+			if (!Directory.Exists("../Logs"))
 			{
-				Directory.CreateDirectory("../Log");
+				Directory.CreateDirectory("../Logs");
 			}
-			string s = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
-			info = new StreamWriter($"../Log/log-{s}.info.log", false, Encoding.Unicode, 1024);
-			error = new StreamWriter($"../Log/log-{s}.error.log", false, Encoding.Unicode, 1024);
+			info = new StreamWriter($"../Logs/Log-Client-Info.txt", false, Encoding.Unicode, 1024);
+			error = new StreamWriter($"../Logs/Log-Client-Error.txt", false, Encoding.Unicode, 1024);
 		}
 
 		public static void Warning(string msg)

+ 1 - 1
Unity/ClientConfig.txt

@@ -1 +1 @@
-{ "_t" : "ClientConfig", "Host" : "192.168.12.188", "Port" : 10001 }
+{ "_t" : "ClientConfig", "Host" : "127.0.0.1", "Port" : 10000 }