mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-21 11:39:35 +08:00
修改反射DLL的根目录路径
This commit is contained in:
parent
0121c42ac7
commit
2823cbf6cc
@ -27,7 +27,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
/// <param name="FileName">文件名,缺省为FunGame.ini</param>
|
/// <param name="FileName">文件名,缺省为FunGame.ini</param>
|
||||||
public static void WriteINI(string Section, string Key, string Value, string FileName = DefaultFileName)
|
public static void WriteINI(string Section, string Key, string Value, string FileName = DefaultFileName)
|
||||||
{
|
{
|
||||||
WritePrivateProfileString(Section, Key, Value, Environment.CurrentDirectory.ToString() + @"\" + FileName);
|
WritePrivateProfileString(Section, Key, Value, AppDomain.CurrentDomain.BaseDirectory + FileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -40,7 +40,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
public static string ReadINI(string Section, string Key, string FileName = DefaultFileName)
|
public static string ReadINI(string Section, string Key, string FileName = DefaultFileName)
|
||||||
{
|
{
|
||||||
char[] val = new char[General.StreamByteSize];
|
char[] val = new char[General.StreamByteSize];
|
||||||
_ = GetPrivateProfileString(Section, Key, "", val, General.StreamByteSize, Environment.CurrentDirectory.ToString() + @"\" + FileName);
|
_ = GetPrivateProfileString(Section, Key, "", val, General.StreamByteSize, AppDomain.CurrentDomain.BaseDirectory + FileName);
|
||||||
string? read = new(val);
|
string? read = new(val);
|
||||||
return read != null ? read.Trim('\0') : "";
|
return read != null ? read.Trim('\0') : "";
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="FileName">文件名,缺省为FunGame.ini</param>
|
/// <param name="FileName">文件名,缺省为FunGame.ini</param>
|
||||||
/// <returns>是否存在</returns>
|
/// <returns>是否存在</returns>
|
||||||
public static bool ExistINIFile(string FileName = DefaultFileName) => File.Exists($@"{Environment.CurrentDirectory}\{FileName}");
|
public static bool ExistINIFile(string FileName = DefaultFileName) => File.Exists($@"{AppDomain.CurrentDomain.BaseDirectory}{FileName}");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化ini模板文件
|
/// 初始化ini模板文件
|
||||||
@ -136,7 +136,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
public static string ReadTXT(string filename, string path = "")
|
public static string ReadTXT(string filename, string path = "")
|
||||||
{
|
{
|
||||||
if (path.Trim() != "") path = Path.Combine(path, filename);
|
if (path.Trim() != "") path = Path.Combine(path, filename);
|
||||||
else path = $@"{Environment.CurrentDirectory}\{filename}";
|
else path = $@"{AppDomain.CurrentDomain.BaseDirectory}{filename}";
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
string s = "";
|
string s = "";
|
||||||
@ -168,7 +168,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
if (!Directory.Exists(path)) Directory.CreateDirectory(path);
|
if (!Directory.Exists(path)) Directory.CreateDirectory(path);
|
||||||
path = Path.Combine(path, filename);
|
path = Path.Combine(path, filename);
|
||||||
}
|
}
|
||||||
else path = $@"{Environment.CurrentDirectory}\{filename}";
|
else path = $@"{AppDomain.CurrentDomain.BaseDirectory}{filename}";
|
||||||
// 写入内容
|
// 写入内容
|
||||||
StreamWriter writer = File.Exists(path) ? new(path, true, General.DefaultEncoding) : new(path, false, General.DefaultEncoding);
|
StreamWriter writer = File.Exists(path) ? new(path, true, General.DefaultEncoding) : new(path, false, General.DefaultEncoding);
|
||||||
writer.WriteLine(message);
|
writer.WriteLine(message);
|
||||||
|
@ -2747,14 +2747,5 @@
|
|||||||
<param name="action"></param>
|
<param name="action"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Service.TaskExtension.WithCancellation(System.Threading.Tasks.Task,System.Threading.CancellationToken)">
|
|
||||||
<summary>
|
|
||||||
用于取消任务
|
|
||||||
</summary>
|
|
||||||
<param name="task"></param>
|
|
||||||
<param name="cancellationToken"></param>
|
|
||||||
<returns></returns>
|
|
||||||
<exception cref="T:System.OperationCanceledException"></exception>
|
|
||||||
</member>
|
|
||||||
</members>
|
</members>
|
||||||
</doc>
|
</doc>
|
||||||
|
@ -213,10 +213,10 @@ namespace Milimoe.FunGame.Core.Library.Constant
|
|||||||
public class ReflectionSet
|
public class ReflectionSet
|
||||||
{
|
{
|
||||||
public const string FUNGAME_IMPL = "FunGame.Implement";
|
public const string FUNGAME_IMPL = "FunGame.Implement";
|
||||||
public static string EXEFolderPath { get; } = Environment.CurrentDirectory.ToString() + "\\"; // 程序目录
|
public static string EXEFolderPath { get; } = AppDomain.CurrentDomain.BaseDirectory; // 程序目录
|
||||||
public static string PluginFolderPath { get; } = Environment.CurrentDirectory.ToString() + "\\plugins\\"; // 插件目录
|
public static string PluginFolderPath { get; } = AppDomain.CurrentDomain.BaseDirectory + @"plugins\"; // 插件目录
|
||||||
public static string GameModeFolderPath { get; } = Environment.CurrentDirectory.ToString() + "\\gamemods\\"; // 游戏模组目录
|
public static string GameModeFolderPath { get; } = AppDomain.CurrentDomain.BaseDirectory + @"gamemods\"; // 游戏模组目录
|
||||||
public static string GameMapFolderPath { get; } = Environment.CurrentDirectory.ToString() + "\\maps\\"; // 游戏地图目录
|
public static string GameMapFolderPath { get; } = AppDomain.CurrentDomain.BaseDirectory + @"maps\"; // 游戏地图目录
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FormSet
|
public class FormSet
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
FunGame.FunGame_Server => FunGame_Server,
|
FunGame.FunGame_Server => FunGame_Server,
|
||||||
_ => ""
|
_ => ""
|
||||||
};
|
};
|
||||||
return type + " [ 版本: " + FunGame_Version + FunGame_VersionPatch + " ]\n" + (type.Equals(FunGame_Desktop) ? @"©" : "(C)") + "2023 Milimoe. 保留所有权利\n";
|
return type + " [版本: " + FunGame_Version + FunGame_VersionPatch + "]\n" + (type.Equals(FunGame_Desktop) ? @"©" : "(C)") + "2023 Milimoe. 保留所有权利\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user