diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index d9255ea..51f376a 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
WebDoorCreator - Egalware
- Version: 0.9.2309.0512
+ Version: 0.9.2309.0515
Release note:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index 05ee08f..af96f71 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-0.9.2309.0512
+0.9.2309.0515
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index 21aa05c..a896da1 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 0.9.2309.0512
+ 0.9.2309.0515
http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip
http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html
false
diff --git a/WebDoorCreator.Data/Services/WebDoorCreatorService.cs b/WebDoorCreator.Data/Services/WebDoorCreatorService.cs
index 3cffe63..0f93cd0 100644
--- a/WebDoorCreator.Data/Services/WebDoorCreatorService.cs
+++ b/WebDoorCreator.Data/Services/WebDoorCreatorService.cs
@@ -2229,87 +2229,92 @@ namespace WebDoorCreator.Data.Services
string compoTempOrShape = "";
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
- string[] templateDirectories = Directory.GetDirectories(dir);
+ //string[] templateDirectories = Directory.GetDirectories(dir);
+ string[] hwDirectories = Directory.GetDirectories(dir);
- string[] iniFiles = Directory.GetFiles(dir, "Config.ini");
int ordin = 1;
- foreach (string templateDirectory in templateDirectories)
+ foreach (var hw in hwDirectories)
{
- var tName = templateDirectory.Split("\\");
- var fName = templateDirectory.Split("\\");
+ string[] iniFiles = Directory.GetFiles(hw, "Config.ini");
+ string[] templateDirectories = Directory.GetDirectories(hw);
- foreach (var file in iniFiles)
+ foreach (string templateDirectory in templateDirectories)
{
- List lines = File.ReadAllLines(file).ToList();
- IniFile fIni = new IniFile(file);
+ var tName = templateDirectory.Split("\\");
+ var fName = templateDirectory.Split("\\");
- var compoName = fIni.ReadString("Compo", "Name", "COMPONAME");
- var compoT = fIni.ReadString("Template", "Name", "TEMPSHAPE");
- compoCode = compoName.Split("/")[0].Trim();
- compoTempOrShape = compoT.Split("/")[0].Trim();
- }
-
- string[] templateFiles = Directory.GetFiles(templateDirectory);
- if (templateFiles.Length > 0)
- {
- ListValuesTempModel folderNames = new ListValuesTempModel()
+ foreach (var file in iniFiles)
{
- TableName = $"{compoCode}".Replace(" ", "_"),
- FieldName = "Folder",
- Value = @$"{tName[tName.Length - 1]}",
- Label = @$"{tName[tName.Length - 1]}",
- Ordinal = 0,
- DefaultVal = " ",
- InputType = " ",
- };
- values.Add(folderNames);
- }
+ List lines = File.ReadAllLines(file).ToList();
+ IniFile fIni = new IniFile(file);
- foreach (string templateFile in templateFiles)
- {
- FileInfo fi = new FileInfo(templateFile);
- string defGpNum = "";
- var lines = File.ReadAllLines(templateFile).ToList();
+ var compoName = fIni.ReadString("Compo", "Name", "COMPONAME");
+ var compoT = fIni.ReadString("Template", "Name", "TEMPSHAPE");
+ compoCode = compoName.Split("/")[0].Trim();
+ compoTempOrShape = compoT.Split("/")[0].Trim();
+ }
- foreach (var line in lines)
+ string[] templateFiles = Directory.GetFiles(templateDirectory);
+ if (templateFiles.Length > 0)
{
- if (line.StartsWith("--") && line.Contains("Default"))
+ ListValuesTempModel folderNames = new ListValuesTempModel()
{
- if (line.Split("=")[1] != null)
+ TableName = $"{compoCode}".Replace(" ", "_"),
+ FieldName = "Folder",
+ Value = @$"{tName[tName.Length - 1]}",
+ Label = @$"{tName[tName.Length - 1]}",
+ Ordinal = 0,
+ DefaultVal = " ",
+ InputType = " ",
+ };
+ values.Add(folderNames);
+ }
+
+ foreach (string templateFile in templateFiles)
+ {
+ FileInfo fi = new FileInfo(templateFile);
+ string defGpNum = "";
+ var lines = File.ReadAllLines(templateFile).ToList();
+
+ foreach (var line in lines)
+ {
+ if (line.StartsWith("--") && line.Contains("Default"))
{
- defGpNum = line.Split("=")[1];
- }
- else
- {
- defGpNum = " ";
+ if (line.Split("=")[1] != null)
+ {
+ defGpNum = line.Split("=")[1];
+ }
+ else
+ {
+ defGpNum = " ";
+ }
}
}
- }
- var fileName = "";
- if (Path.GetFileName(templateFile).Split(".")[1] == "lua")
- {
- fileName = Path.GetFileName(templateFile).Split(".")[0];
- }
- else
- {
- fileName = Path.GetFileName(templateFile);
- }
+ var fileName = "";
+ if (Path.GetFileName(templateFile).Split(".")[1] == "lua")
+ {
+ fileName = Path.GetFileName(templateFile).Split(".")[0];
+ }
+ else
+ {
+ fileName = Path.GetFileName(templateFile);
+ }
- ListValuesTempModel temp = new ListValuesTempModel()
- {
- TableName = $"{compoCode}".Replace(" ", "_"),
- FieldName = compoTempOrShape,
- Value = @$"{tName[tName.Length - 1]}\{fileName}",
- Label = fileName,
- Ordinal = ordin,
- DefaultVal = defGpNum,
- InputType = " ",
- };
- var fileContent = File.ReadAllBytes(templateFile);
- var hash = md5.ComputeHash(fileContent);
- var oldMD5 = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
+ ListValuesTempModel temp = new ListValuesTempModel()
+ {
+ TableName = $"{compoCode}".Replace(" ", "_"),
+ FieldName = compoTempOrShape,
+ Value = @$"{tName[tName.Length - 1]}\{fileName}",
+ Label = fileName,
+ Ordinal = ordin,
+ DefaultVal = defGpNum,
+ InputType = " ",
+ };
+ var fileContent = File.ReadAllBytes(templateFile);
+ var hash = md5.ComputeHash(fileContent);
+ var oldMD5 = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
#if false
DoorOpTypeModel tempType = new DoorOpTypeModel()
{
@@ -2325,18 +2330,19 @@ namespace WebDoorCreator.Data.Services
};
doorOpTypesList.Add(tempType);
#endif
- if (values.Where(x => x.TableName == temp.TableName && x.FieldName == temp.FieldName && x.Value == temp.Value).Count() == 0 && temp.TableName != null && temp.FieldName != null && temp.Value != null)
- {
- values.Add(temp);
- ordin++;
- }
- else
- {
- Log.Error($"ListValuesLuaNgeInsert | Duplicated key: {temp.TableName} {temp.FieldName} {temp.Value} ");
+ if (values.Where(x => x.TableName == temp.TableName && x.FieldName == temp.FieldName && x.Value == temp.Value).Count() == 0 && temp.TableName != null && temp.FieldName != null && temp.Value != null)
+ {
+ values.Add(temp);
+ ordin++;
+ }
+ else
+ {
+ Log.Error($"ListValuesLuaNgeInsert | Duplicated key: {temp.TableName} {temp.FieldName} {temp.Value} ");
+ }
}
}
- }
+ }
answ = await dbController.ListValuesAdd(values);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
@@ -3552,7 +3558,7 @@ namespace WebDoorCreator.Data.Services
string rawData = JsonConvert.SerializeObject(filesDict);
await redisDb.StringSetAsync(currKey, rawData);
-
+
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Debug($"scanSrcDestDir in: {ts.TotalMilliseconds} ms");
diff --git a/WebDoorCreator.UI/Components/FilesMan/CompoCompare.razor.cs b/WebDoorCreator.UI/Components/FilesMan/CompoCompare.razor.cs
index 2e3ca10..fd04686 100644
--- a/WebDoorCreator.UI/Components/FilesMan/CompoCompare.razor.cs
+++ b/WebDoorCreator.UI/Components/FilesMan/CompoCompare.razor.cs
@@ -204,6 +204,11 @@ namespace WebDoorCreator.UI.Components.FilesMan
);
await updTask1;
sendDataVal = 30;
+ var updTask2 = Task.Run(async () =>
+ {
+ await WDCService.ListValuesLuaNgeInsert(rootPathOld);
+ });
+ await updTask2;
await doScan();
sendDataVal = 90;
}
@@ -294,7 +299,7 @@ namespace WebDoorCreator.UI.Components.FilesMan
}
protected void ReplaceFile(string FileToMoveAndDelete, string FileToReplace)
{
-
+
File.Replace(FileToMoveAndDelete, FileToReplace, null);
}
diff --git a/WebDoorCreator.UI/WebDoorCreator.UI.csproj b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
index af54c58..b845b55 100644
--- a/WebDoorCreator.UI/WebDoorCreator.UI.csproj
+++ b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
@@ -3,7 +3,7 @@
net6.0
enable
- 0.9.2309.0512
+ 0.9.2309.0515
enable
aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608