Skip to content

Commit

Permalink
Merge pull request #55 from dojoengine/update-0.7.3
Browse files Browse the repository at this point in the history
Update 0.7.3
  • Loading branch information
Larkooo authored Jul 4, 2024
2 parents c61a151 + 8d8d808 commit cad6adb
Show file tree
Hide file tree
Showing 23 changed files with 29,507 additions and 28,536 deletions.
Binary file modified Assets/Dojo/Plugins/Linux/libdojo_c.so
Binary file not shown.
4 changes: 2 additions & 2 deletions Assets/Dojo/Plugins/Windows/libdojo_c.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions Assets/Dojo/Plugins/iOS/libdojo_c.a
Git LFS file not shown
Binary file modified Assets/Dojo/Plugins/macOS/libdojo_c.bundle
Binary file not shown.
8 changes: 5 additions & 3 deletions Assets/Dojo/Runtime/Torii/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ public dojo.EntityKeysClause ToNative()
[Serializable]
public struct KeysClause
{
public FieldElement[] keys;
public FieldElement?[] keys;
[JsonConverter(typeof(StringEnumConverter))]
public dojo.PatternMatching pattern_matching;
public string[] models;

public KeysClause(FieldElement[] keys, dojo.PatternMatching pattern_matching, string[] models)
public KeysClause(FieldElement?[] keys, dojo.PatternMatching pattern_matching, string[] models)
{
this.keys = keys;
this.pattern_matching = pattern_matching;
Expand All @@ -163,7 +163,9 @@ public dojo.KeysClause ToNative()
{
return new dojo.KeysClause
{
keys = keys.Select(k => k.Inner).ToArray(),
keys = keys.Select(k => k is null ?
new dojo.COptionFieldElement { tag = dojo.COptionFieldElement_Tag.NoneFieldElement }
: new dojo.COptionFieldElement { tag = dojo.COptionFieldElement_Tag.SomeFieldElement, some = k.Inner }).ToArray(),
pattern_matching = pattern_matching,
models = models
};
Expand Down
1 change: 1 addition & 0 deletions Assets/Dojo/Runtime/Torii/ToriiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public ToriiClient(string toriiUrl, string rpcUrl, string relayUrl, FieldElement
}

client = result._ok;
dojo.client_set_logger(client, new dojo.FnPtr_CString_Void((msg) => Debug.Log(msg)));

RegisterEntityStateUpdateEvent(null, dispatchEventsToMainThread);
RegisterEventMessageUpdateEvent(null, dispatchEventsToMainThread);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// To disable generating this file set `isEnabledGenerateAssemblyAttributes` to `false` in the config file for generating C# code.
// <auto-generated>
// This code was generated by the following tool on 2024-06-27 17:20:53 GMT-04:00:
// This code was generated by the following tool on 2024-07-04 15:56:40 GMT-04:00:
// https://github.com/bottlenoselabs/c2cs (v0.0.0.0)
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
2 changes: 1 addition & 1 deletion Assets/Dojo/Runtime/bindings/client/Runtime.gen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// To disable generating this file set `isEnabledGeneratingRuntimeCode` to `false` in the config file for generating C# code.

// <auto-generated>
// This code was generated by the following tool on 2024-06-27 17:20:53 GMT-04:00:
// This code was generated by the following tool on 2024-07-04 15:56:40 GMT-04:00:
// https://github.com/bottlenoselabs/c2cs (v0.0.0.0)
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down
220 changes: 125 additions & 95 deletions Assets/Dojo/Runtime/bindings/client/dojo.gen.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// <auto-generated>
// This code was generated by the following tool on 2024-06-27 17:20:53 GMT-04:00:
// This code was generated by the following tool on 2024-07-04 15:56:40 GMT-04:00:
// https://github.com/bottlenoselabs/c2cs (v0.0.0.0)
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
Expand Down Expand Up @@ -91,7 +91,7 @@ public static unsafe partial class dojo

[CNode(Kind = "Function")]
[DllImport(LibraryName, EntryPoint = "client_model", CallingConvention = CallingConvention.Cdecl)]
public static extern ResultCOptionTy client_model(ToriiClient* client, ModelKeysClause* keys);
public static extern ResultTy client_model(ToriiClient* client, ModelKeysClause* keys);

[CNode(Kind = "Function")]
[DllImport(LibraryName, EntryPoint = "client_new", CallingConvention = CallingConvention.Cdecl)]
Expand All @@ -117,6 +117,10 @@ public static unsafe partial class dojo
[DllImport(LibraryName, EntryPoint = "client_remove_models_to_sync", CallingConvention = CallingConvention.Cdecl)]
public static extern Resultbool client_remove_models_to_sync(ToriiClient* client, ModelKeysClause* models, UIntPtr models_len);

[CNode(Kind = "Function")]
[DllImport(LibraryName, EntryPoint = "client_set_logger", CallingConvention = CallingConvention.Cdecl)]
public static extern void client_set_logger(ToriiClient* client, FnPtr_CString_Void logger);

[CNode(Kind = "Function")]
[DllImport(LibraryName, EntryPoint = "client_subscribed_models", CallingConvention = CallingConvention.Cdecl)]
public static extern CArrayModelKeysClause client_subscribed_models(ToriiClient* client);
Expand Down Expand Up @@ -197,6 +201,21 @@ public static unsafe partial class dojo

#region Types

[CNode(Kind = "FunctionPointer")]
[StructLayout(LayoutKind.Sequential)]
public struct FnPtr_CString_Void
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void @delegate(CString param);

public IntPtr Pointer;

public FnPtr_CString_Void(@delegate d)
{
Pointer = Marshal.GetFunctionPointerForDelegate(d);
}
}

[CNode(Kind = "FunctionPointer")]
[StructLayout(LayoutKind.Sequential)]
public struct FnPtr_FieldElement_CArrayModel_Void
Expand Down Expand Up @@ -293,6 +312,17 @@ public struct CArrayCHashItemc_charModelMetadata
public UIntPtr data_len;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
public struct CArrayCOptionFieldElement
{
[FieldOffset(0)] // size = 8
public COptionFieldElement* data;

[FieldOffset(8)] // size = 8
public UIntPtr data_len;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
public struct CArrayClause
Expand Down Expand Up @@ -454,54 +484,30 @@ public struct COptionClause_ANONYMOUS_FIELD1_ANONYMOUS_FIELD0
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
public struct COptionTy
[StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)]
public struct COptionFieldElement
{
[FieldOffset(0)] // size = 4
public COptionTy_Tag tag;
public COptionFieldElement_Tag tag;

[FieldOffset(8)] // size = 8
public Ty* _some;

public Ty some
{
get
{
return *_some;
}
}
[FieldOffset(4)] // size = 32
public FieldElement some;
}

[CNode(Kind = "Union")]
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)]
public struct COptionTy_ANONYMOUS_FIELD1
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 1)]
public struct COptionFieldElement_ANONYMOUS_FIELD1
{
[FieldOffset(0)] // size = 8
public Ty* _some;

public Ty some
{
get
{
return *_some;
}
}
[FieldOffset(0)] // size = 32
public FieldElement some;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)]
public struct COptionTy_ANONYMOUS_FIELD1_ANONYMOUS_FIELD0
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 1)]
public struct COptionFieldElement_ANONYMOUS_FIELD1_ANONYMOUS_FIELD0
{
[FieldOffset(0)] // size = 8
public Ty* _some;

public Ty some
{
get
{
return *_some;
}
}
[FieldOffset(0)] // size = 32
public FieldElement some;
}

[CNode(Kind = "Struct")]
Expand Down Expand Up @@ -942,25 +948,25 @@ public Span<byte> data
public struct KeysClause
{
[FieldOffset(0)] // size = 16
public CArrayFieldElement _keys;
public CArrayCOptionFieldElement _keys;

public Span<FieldElement> keys
public Span<COptionFieldElement> keys
{
get
{
fixed (KeysClause* @this = &this)
{
var span = new Span<FieldElement>(@this->_keys.data, (int)@this->_keys.data_len);
var span = new Span<COptionFieldElement>(@this->_keys.data, (int)@this->_keys.data_len);
return span;
}
}

set
{

_keys = new CArrayFieldElement();
_keys = new CArrayCOptionFieldElement();
_keys.data_len = (UIntPtr)value.Length;
fixed (FieldElement* ptr = value)
fixed (COptionFieldElement* ptr = value)
{
_keys.data = ptr;
}
Expand Down Expand Up @@ -1945,47 +1951,6 @@ public struct ResultCArrayu8_ANONYMOUS_FIELD1_ANONYMOUS_FIELD1
public Error err;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)]
public struct ResultCOptionTy
{
[FieldOffset(0)] // size = 4
public ResultCOptionTy_Tag tag;

[FieldOffset(8)] // size = 16
public COptionTy ok;

[FieldOffset(8)] // size = 8
public Error err;
}

[CNode(Kind = "Union")]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
public struct ResultCOptionTy_ANONYMOUS_FIELD1
{
[FieldOffset(0)] // size = 16
public COptionTy ok;

[FieldOffset(0)] // size = 8
public Error err;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
public struct ResultCOptionTy_ANONYMOUS_FIELD1_ANONYMOUS_FIELD0
{
[FieldOffset(0)] // size = 16
public COptionTy ok;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)]
public struct ResultCOptionTy_ANONYMOUS_FIELD1_ANONYMOUS_FIELD1
{
[FieldOffset(0)] // size = 8
public Error err;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 40, Pack = 8)]
public struct ResultFieldElement
Expand Down Expand Up @@ -2263,6 +2228,71 @@ public struct ResultToriiClient_ANONYMOUS_FIELD1_ANONYMOUS_FIELD1
public Error err;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
public struct ResultTy
{
[FieldOffset(0)] // size = 4
public ResultTy_Tag tag;

[FieldOffset(8)] // size = 8
public Ty* _ok;

public Ty ok
{
get
{
return *_ok;
}
}

[FieldOffset(8)] // size = 8
public Error err;
}

[CNode(Kind = "Union")]
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)]
public struct ResultTy_ANONYMOUS_FIELD1
{
[FieldOffset(0)] // size = 8
public Ty* _ok;

public Ty ok
{
get
{
return *_ok;
}
}

[FieldOffset(0)] // size = 8
public Error err;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)]
public struct ResultTy_ANONYMOUS_FIELD1_ANONYMOUS_FIELD0
{
[FieldOffset(0)] // size = 8
public Ty* _ok;

public Ty ok
{
get
{
return *_ok;
}
}
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)]
public struct ResultTy_ANONYMOUS_FIELD1_ANONYMOUS_FIELD1
{
[FieldOffset(0)] // size = 8
public Error err;
}

[CNode(Kind = "Struct")]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
public struct Resultbool
Expand Down Expand Up @@ -2975,10 +3005,10 @@ public enum COptionClause_Tag : int
}

[CNode(Kind = "Enum")]
public enum COptionTy_Tag : int
public enum COptionFieldElement_Tag : int
{
SomeTy = 0,
NoneTy = 1
SomeFieldElement = 0,
NoneFieldElement = 1
}

[CNode(Kind = "Enum")]
Expand Down Expand Up @@ -3065,13 +3095,6 @@ public enum ResultCArrayu8_Tag : int
ErrCArrayu8 = 1
}

[CNode(Kind = "Enum")]
public enum ResultCOptionTy_Tag : int
{
OkCOptionTy = 0,
ErrCOptionTy = 1
}

[CNode(Kind = "Enum")]
public enum ResultFieldElement_Tag : int
{
Expand Down Expand Up @@ -3107,6 +3130,13 @@ public enum ResultToriiClient_Tag : int
ErrToriiClient = 1
}

[CNode(Kind = "Enum")]
public enum ResultTy_Tag : int
{
OkTy = 0,
ErrTy = 1
}

[CNode(Kind = "Enum")]
public enum Resultbool_Tag : int
{
Expand Down
Loading

0 comments on commit cad6adb

Please sign in to comment.