diff --git a/Server/Model/Component/AppManagerComponent.cs b/Server/Model/Component/AppManagerComponent.cs index 892a48ea63826759eb44761389001713d8cb966a..d8e20344a4b48b4fd76527a413a4fa91ea2f947b 100644 --- a/Server/Model/Component/AppManagerComponent.cs +++ b/Server/Model/Component/AppManagerComponent.cs @@ -39,14 +39,20 @@ namespace Model #if __MonoCS__ const string exe = @"mono"; string arguments = $"App.exe --id={startConfig.Options.Id} --appType={startConfig.Options.AppType}"; + const string workDir = @"../Server/Bin/Debug"; #else const string exe = @"App.exe"; string arguments = $"--id={startConfig.Options.Id} --appType={startConfig.Options.AppType}"; + const string workDir = @"..\Server\Bin\Debug"; #endif - ProcessStartInfo info = new ProcessStartInfo(exe, arguments) + Log.Debug($"{startConfig.Options.Id} {MongoHelper.ToJson(startConfig)}"); + ProcessStartInfo info = new ProcessStartInfo { + FileName = exe, + Arguments = arguments, + CreateNoWindow = true, UseShellExecute = true, - WorkingDirectory = @"..\Server\Bin\Debug" + WorkingDirectory = workDir }; Process process = Process.Start(info); diff --git a/Server/Start.sh b/Server/Start.sh new file mode 100644 index 0000000000000000000000000000000000000000..4dc343a45dddd507e4d0ef1e51f1d413f8f26565 --- /dev/null +++ b/Server/Start.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd Bin/Debug/ +pkill App.exe +mono App.exe --id=1 --appType=Manager \ No newline at end of file diff --git a/Tools/cwRsync/rsyncd.conf b/Tools/cwRsync/rsyncd.conf index 6761950f0508fa7633da6b2c7071309e892f9c98..60ea196de5ad129d3b4b16a34706abf93074f962 100644 --- a/Tools/cwRsync/rsyncd.conf +++ b/Tools/cwRsync/rsyncd.conf @@ -3,9 +3,12 @@ gid = root #strict modes = no use chroot = no max connections = 100 - -[Source] -path = /home/tanghai/Source/ +read only = no +write only = no +log file=/var/log/rsyncd.log +# Remote sync configuration module +[Tanghai] +path = /home/tanghai/ auth users = tanghai secrets file = /etc/rsyncd.secrets list = yes \ No newline at end of file diff --git a/Unity/Assets/Editor/RsyncEditor/RsyncEditor.cs b/Unity/Assets/Editor/RsyncEditor/RsyncEditor.cs index 4d5a11659f775268650506365a2b697cc1c2ff6a..f48f4030c80ca29d6f52bceef8e7f08badb072fc 100644 --- a/Unity/Assets/Editor/RsyncEditor/RsyncEditor.cs +++ b/Unity/Assets/Editor/RsyncEditor/RsyncEditor.cs @@ -1,15 +1,23 @@ using System; using System.Diagnostics; +using Base; using UnityEditor; namespace MyEditor { public class RsyncEditor : EditorWindow { - [MenuItem("Tools/Rsync")] + [MenuItem("Tools/同步到Linux")] private static void ShowUnDisposeObjects() { - Process.Start("../Tools/cwRsync/rsync.exe", ""); + ProcessStartInfo startInfo = new ProcessStartInfo(); + startInfo.FileName = @"Tools\cwRsync\rsync.exe"; + startInfo.Arguments = "-vzrtopg --password-file=./Tools/cwRsync/rsync.secrets --exclude-from=./Tools/cwRsync/exclude.txt --delete ./ tanghai@192.168.1.134::Tanghai/Source/Egametang --chmod=ugo=rwX"; + startInfo.UseShellExecute = true; + startInfo.WorkingDirectory = @"..\"; + Process p = Process.Start(startInfo); + p.WaitForExit(); + Log.Info("同步完成!"); } } -} \ No newline at end of file +} diff --git a/Unity/Unity.CSharp.Editor.csproj b/Unity/Unity.CSharp.Editor.csproj index 93317c6291290c99f4d72e80bc0135ff90c9aa4e..d7a1a737502191e38a3e2df2986632eb3d521e56 100644 --- a/Unity/Unity.CSharp.Editor.csproj +++ b/Unity/Unity.CSharp.Editor.csproj @@ -1,4 +1,4 @@ - + Debug @@ -124,4 +124,4 @@ - \ No newline at end of file +