030
This commit is contained in:
parent
502d679848
commit
6602744325
@ -36,7 +36,9 @@
|
|||||||
<Compile Include="Dtsod\DtsodV21.cs" />
|
<Compile Include="Dtsod\DtsodV21.cs" />
|
||||||
<Compile Include="Dtsod\DtsodV22.cs" />
|
<Compile Include="Dtsod\DtsodV22.cs" />
|
||||||
<Compile Include="cs9somefix.cs" />
|
<Compile Include="cs9somefix.cs" />
|
||||||
<Compile Include="Dtsod\ValueTypes.cs" />
|
<Compile Include="Dtsod\V30\DtsodSerializableAttribute.cs" />
|
||||||
|
<Compile Include="Dtsod\V30\DtsodV30.cs" />
|
||||||
|
<Compile Include="Dtsod\V30\DtsodVersion.cs" />
|
||||||
<Compile Include="EventHandlerAsync.cs" />
|
<Compile Include="EventHandlerAsync.cs" />
|
||||||
<Compile Include="Filesystem\Directory.cs" />
|
<Compile Include="Filesystem\Directory.cs" />
|
||||||
<Compile Include="Filesystem\File.cs" />
|
<Compile Include="Filesystem\File.cs" />
|
||||||
|
|||||||
@ -16,6 +16,7 @@ namespace DTLib.Dtsod
|
|||||||
// парсер теперь не может игнорировать комменты, потом починю
|
// парсер теперь не может игнорировать комменты, потом починю
|
||||||
// теперь числовые значения конвертируются в правильный тип, а не в int64/uint64 (новый вариант switch из c#9.0 делал какую-то херню)
|
// теперь числовые значения конвертируются в правильный тип, а не в int64/uint64 (новый вариант switch из c#9.0 делал какую-то херню)
|
||||||
// исправлены некоторые другие баги
|
// исправлены некоторые другие баги
|
||||||
|
|
||||||
public class DtsodV21 : Dictionary<string, dynamic>
|
public class DtsodV21 : Dictionary<string, dynamic>
|
||||||
{
|
{
|
||||||
static readonly bool debug = false;
|
static readonly bool debug = false;
|
||||||
@ -82,15 +83,6 @@ namespace DTLib.Dtsod
|
|||||||
List,
|
List,
|
||||||
Complex,
|
Complex,
|
||||||
String,
|
String,
|
||||||
/*Double,
|
|
||||||
Long,
|
|
||||||
Ulong,
|
|
||||||
Short,
|
|
||||||
Ushort,
|
|
||||||
Int,
|
|
||||||
Uint,
|
|
||||||
Null,
|
|
||||||
Bool,*/
|
|
||||||
Default
|
Default
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +348,6 @@ namespace DTLib.Dtsod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Debug(params string[] msg)
|
void Debug(params string[] msg)
|
||||||
{
|
{
|
||||||
if(debug)
|
if(debug)
|
||||||
@ -369,3 +360,4 @@ namespace DTLib.Dtsod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,23 @@ namespace DTLib.Dtsod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum ValueTypes
|
||||||
|
{
|
||||||
|
List,
|
||||||
|
Complex,
|
||||||
|
String,
|
||||||
|
Short,
|
||||||
|
Int,
|
||||||
|
Long,
|
||||||
|
UShort,
|
||||||
|
UInt,
|
||||||
|
ULong,
|
||||||
|
Double,
|
||||||
|
Null,
|
||||||
|
Bool,
|
||||||
|
Unknown
|
||||||
|
}
|
||||||
|
|
||||||
public DtsodV22() { }
|
public DtsodV22() { }
|
||||||
|
|
||||||
public DtsodV22(string text)
|
public DtsodV22(string text)
|
||||||
@ -51,7 +68,6 @@ namespace DTLib.Dtsod
|
|||||||
Add(pair.Key, pair.Value);
|
Add(pair.Key, pair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DtsodV22(Dictionary<string, DtsodV22.ValueStruct> dict)
|
public DtsodV22(Dictionary<string, DtsodV22.ValueStruct> dict)
|
||||||
{
|
{
|
||||||
foreach(KeyValuePair<string, ValueStruct> pair in dict)
|
foreach(KeyValuePair<string, ValueStruct> pair in dict)
|
||||||
|
|||||||
14
Dtsod/V30/DtsodSerializableAttribute.cs
Normal file
14
Dtsod/V30/DtsodSerializableAttribute.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DTLib.Dtsod
|
||||||
|
{
|
||||||
|
public class DtsodSerializableAttribute : Attribute
|
||||||
|
{
|
||||||
|
public DtsodVersion Version;
|
||||||
|
public DtsodSerializableAttribute(DtsodVersion ver) => Version=ver;
|
||||||
|
}
|
||||||
|
}
|
||||||
23
Dtsod/V30/DtsodV30.cs
Normal file
23
Dtsod/V30/DtsodV30.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DTLib.Dtsod
|
||||||
|
{
|
||||||
|
static public class DtsodV30
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
public static DtsodV30 FromObject(object target)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public T ToObject<T>()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
9
Dtsod/V30/DtsodVersion.cs
Normal file
9
Dtsod/V30/DtsodVersion.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace DTLib.Dtsod
|
||||||
|
{
|
||||||
|
public enum DtsodVersion : byte
|
||||||
|
{
|
||||||
|
V21 = 21,
|
||||||
|
V22 = 22,
|
||||||
|
V30 = 30
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,19 +0,0 @@
|
|||||||
namespace DTLib.Dtsod
|
|
||||||
{
|
|
||||||
public enum ValueTypes
|
|
||||||
{
|
|
||||||
List,
|
|
||||||
Complex,
|
|
||||||
String,
|
|
||||||
Short,
|
|
||||||
Int,
|
|
||||||
Long,
|
|
||||||
UShort,
|
|
||||||
UInt,
|
|
||||||
ULong,
|
|
||||||
Double,
|
|
||||||
Null,
|
|
||||||
Bool,
|
|
||||||
Unknown
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -144,7 +144,7 @@ namespace DTLib.Network
|
|||||||
if(!dirOnServer.EndsWith("\\"))
|
if(!dirOnServer.EndsWith("\\"))
|
||||||
dirOnServer+="\\";
|
dirOnServer+="\\";
|
||||||
Debug("b", "downloading manifest <", "c", dirOnServer+"manifest.dtsod", "b", ">\n");
|
Debug("b", "downloading manifest <", "c", dirOnServer+"manifest.dtsod", "b", ">\n");
|
||||||
var manifest = new DtsodV22(SimpleConverter.ToString(DownloadFileToMemory(dirOnServer+"manifest.dtsod")));
|
var manifest = new Dtsod.DtsodV22(SimpleConverter.ToString(DownloadFileToMemory(dirOnServer+"manifest.dtsod")));
|
||||||
Debug("g", $"found {manifest.Values.Count} files in manifest\n");
|
Debug("g", $"found {manifest.Values.Count} files in manifest\n");
|
||||||
var hasher = new Hasher();
|
var hasher = new Hasher();
|
||||||
foreach(string fileOnServer in manifest.Keys)
|
foreach(string fileOnServer in manifest.Keys)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user