示例#1
0
 public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version)
 {
     return(new ReadBlogsResultInfo(
                Posts,
                _entityIds,
                version));
 }
示例#2
0
        public void RegisterClient(global::System.UInt64 hostId, global::System.String hostName, global::System.Action <global::Fenix.Common.DefaultErrCode, global::Fenix.HostInfo> callback)
#endif
        {
#if !FENIX_CODEGEN
            var toHostId = Global.IdManager.GetHostIdByActorId(this.toActorId, this.isClient);
            if (this.FromHostId == toHostId)
            {
                var protoCode = OpCode.REGISTER_CLIENT_REQ;
                if (Math.Abs(protoCode) < OpCode.CALL_ACTOR_METHOD)
                {
                    var peer    = Global.NetManager.GetRemotePeerById(this.FromHostId, this.NetType);
                    var context = new RpcContext(null, peer);
                    Global.Host.CallMethodWithParams(protoCode, new object[] { hostId, hostName, callback, context });
                }
                else
                {
                    Global.Host.GetActor(this.toActorId).CallMethodWithParams(protoCode, new object[] { hostId, hostName, callback });
                }
                return;
            }
            Task.Run(() => {
                var msg = new RegisterClientReq()
                {
                    hostId   = hostId,
                    hostName = hostName
                };
                var cb = new Action <byte[]>((cbData) => {
                    var cbMsg = cbData == null?new RegisterClientReq.Callback():global::Fenix.Common.Utils.RpcUtil.Deserialize <RegisterClientReq.Callback>(cbData);
                    callback?.Invoke(cbMsg.code, cbMsg.arg1);
                });
                this.CallRemoteMethod(OpCode.REGISTER_CLIENT_REQ, msg, cb);
            });
#endif
        }
示例#3
0
        public void Register(global::System.UInt64 hostId, global::System.String hostName)
        {
            var toHostId = Global.IdManager.GetHostIdByActorId(this.toActorId, this.isClient);

            if (this.FromHostId == toHostId)
            {
                var protoCode = OpCode.REGISTER_REQ;
                if (protoCode < OpCode.CALL_ACTOR_METHOD)
                {
                    var peer    = Global.NetManager.GetPeerById(this.FromHostId, this.NetType);
                    var context = new RpcContext(null, peer);
                    Global.Host.CallMethodWithParams(protoCode, new object[] { hostId, hostName, context });
                }
                else
                {
                    Global.Host.GetActor(this.toActorId).CallMethodWithParams(protoCode, new object[] { hostId, hostName });
                }
                return;
            }
            Task.Run(() => {
                var msg = new RegisterReq()
                {
                    hostId   = hostId,
                    hostName = hostName
                };
                this.CallRemoteMethod(OpCode.REGISTER_REQ, msg, null);
            });
        }
示例#4
0
        public void RemoveClientActor(global::System.UInt64 actorId, global::Fenix.Common.DisconnectReason reason, global::System.Action <global::Fenix.Common.DefaultErrCode> callback)
        {
            var toHostId = Global.IdManager.GetHostIdByActorId(this.toActorId, this.isClient);

            if (this.FromHostId == toHostId)
            {
                var protoCode = OpCode.REMOVE_CLIENT_ACTOR_REQ;
                if (protoCode < OpCode.CALL_ACTOR_METHOD)
                {
                    var peer    = Global.NetManager.GetPeerById(this.FromHostId, this.NetType);
                    var context = new RpcContext(null, peer);
                    Global.Host.CallMethodWithParams(protoCode, new object[] { actorId, reason, callback, context });
                }
                else
                {
                    Global.Host.GetActor(this.toActorId).CallMethodWithParams(protoCode, new object[] { actorId, reason, callback });
                }
                return;
            }
            Task.Run(() => {
                var msg = new RemoveClientActorReq()
                {
                    actorId = actorId,
                    reason  = reason
                };
                var cb = new Action <byte[]>((cbData) => {
                    var cbMsg = cbData == null?new RemoveClientActorReq.Callback():RpcUtil.Deserialize <RemoveClientActorReq.Callback>(cbData);
                    callback?.Invoke(cbMsg.code);
                });
                this.CallRemoteMethod(OpCode.REMOVE_CLIENT_ACTOR_REQ, msg, cb);
            });
        }
示例#5
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__add_actor_id(global::System.UInt64 hostId, global::System.UInt64 actorId, global::System.String actorName, global::System.String aTypeName, global::System.Action <global::System.Boolean> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.AddActorId(hostId, actorId, actorName, aTypeName, callback, context);
#else
            self.AddActorId(hostId, actorId, actorName, aTypeName, callback, context);
#endif
        }
示例#6
0
        public void SERVER_API_NATIVE__Fenix__Host__remove_client_actor(global::System.UInt64 actorId, global::Fenix.Common.DisconnectReason reason, global::System.Action <global::Fenix.Common.DefaultErrCode> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.RemoveClientActor(actorId, reason, callback, context);
#else
            self.RemoveClientActor(actorId, reason, callback, context);
#endif
        }
示例#7
0
        public void CLIENT_API_NATIVE__Fenix__Host__reconnect_server_actor(global::System.UInt64 hostId, global::System.String hostName, global::System.String hostIP, global::System.Int32 hostPort, global::System.UInt64 actorId, global::System.String actorName, global::System.String aTypeName, global::System.Action <global::Fenix.Common.DefaultErrCode> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.ReconnectServerActor(hostId, hostName, hostIP, hostPort, actorId, actorName, aTypeName, callback, context);
#else
            self.ReconnectServerActor(hostId, hostName, hostIP, hostPort, actorId, actorName, aTypeName, callback, context);
#endif
        }
示例#8
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__on_add_client_host_id(global::System.UInt64 clientId, global::System.String clientName, global::System.String address, global::System.Action <global::System.Boolean> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.OnAddClientHostId(clientId, clientName, address, callback, context);
#else
            self.OnAddClientHostId(clientId, clientName, address, callback, context);
#endif
        }
示例#9
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__register(global::System.UInt64 hostId, global::System.String hostName, global::System.Action <global::Fenix.Common.DefaultErrCode, global::Fenix.HostInfo> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.Register(hostId, hostName, callback, context);
#else
            self.Register(hostId, hostName, callback, context);
#endif
        }
示例#10
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__remove_actor(global::System.UInt64 actorId, global::System.Action <global::Fenix.Common.DefaultErrCode> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.RemoveActor(actorId, callback, context);
#else
            self.RemoveActor(actorId, callback, context);
#endif
        }
示例#11
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__remove_actor_id(global::System.UInt64 actorId, global::System.Action <global::System.Boolean> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.RemoveActorId(actorId, callback, context);
#else
            self.RemoveActorId(actorId, callback, context);
#endif
        }
示例#12
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__remove_client_host_id(global::System.UInt64 fromHostId, global::System.UInt64 clientId, global::System.Action <global::System.Boolean> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.RemoveClientHostId(fromHostId, clientId, callback, context);
#else
            self.RemoveClientHostId(fromHostId, clientId, callback, context);
#endif
        }
示例#13
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__remove_host_id(global::System.UInt64 hostId, global::System.String hostName, global::System.Action <global::System.Boolean> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.RemoveHostId(hostId, hostName, callback, context);
#else
            self.RemoveHostId(hostId, hostName, callback, context);
#endif
        }
示例#14
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__get_id_all(global::System.UInt64 hostId, global::System.Action <global::System.Boolean, global::Fenix.IdDataSet> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.GetIdAll(hostId, callback, context);
#else
            self.GetIdAll(hostId, callback, context);
#endif
        }
示例#15
0
        public void SERVER_ONLY_NATIVE__Fenix__Host__add_host_id(global::System.UInt64 hostId, global::System.String hostName, global::System.String intAddr, global::System.String extAddr, global::System.Action <global::System.Boolean, global::Fenix.IdDataSet> callback, RpcContext context)
        {
#if ENABLE_IL2CPP || !DEBUG || RUNTIME
            this.AddHostId(hostId, hostName, intAddr, extAddr, callback, context);
#else
            self.AddHostId(hostId, hostName, intAddr, extAddr, callback, context);
#endif
        }
示例#16
0
        public async Task <RegisterClientReq.Callback> RegisterClientAsync(global::System.UInt64 hostId, global::System.String hostName, global::System.Action <global::Fenix.Common.DefaultErrCode, global::Fenix.HostInfo> callback = null)
#endif
        {
#if FENIX_CODEGEN
#if !RUNTIME
            var t = new TaskCompletionSource <dynamic>();
#else
            var t = new TaskCompletionSource <RegisterClientReq.Callback>();
#endif
#else
            var t        = new TaskCompletionSource <RegisterClientReq.Callback>();
            var toHostId = Global.IdManager.GetHostIdByActorId(this.toActorId, this.isClient);
            if (this.FromHostId == toHostId)
            {
                global::System.Action <global::Fenix.Common.DefaultErrCode, global::Fenix.HostInfo> _cb = (code, arg1) =>
                {
                    var cbMsg = new RegisterClientReq.Callback();
                    cbMsg.code = code;
                    cbMsg.arg1 = arg1;
                    callback?.Invoke(cbMsg.code, cbMsg.arg1);
                    t.TrySetResult(cbMsg);
                };
                var protoCode = OpCode.REGISTER_CLIENT_REQ;
                if (Math.Abs(protoCode) < OpCode.CALL_ACTOR_METHOD)
                {
                    var peer    = Global.NetManager.GetRemotePeerById(this.FromHostId, this.NetType);
                    var context = new RpcContext(null, peer);
                    Global.Host.CallMethodWithParams(protoCode, new object[] { hostId, hostName, _cb, context });
                }
                else
                {
                    Global.Host.GetActor(this.toActorId).CallMethodWithParams(protoCode, new object[] { hostId, hostName, _cb });
                }
            }
            else
            {
                Action <RegisterClientReq.Callback> _cb = (cbMsg) =>
                {
                    callback?.Invoke(cbMsg.code, cbMsg.arg1);
                    t.TrySetResult(cbMsg);
                };
                await Task.Run(() => {
                    var msg = new RegisterClientReq()
                    {
                        hostId   = hostId,
                        hostName = hostName
                    };
                    var cb = new Action <byte[]>((cbData) => {
                        var cbMsg = cbData == null ? new RegisterClientReq.Callback() : global::Fenix.Common.Utils.RpcUtil.Deserialize <RegisterClientReq.Callback>(cbData);
                        _cb?.Invoke(cbMsg);
                    });
                    this.CallRemoteMethod(OpCode.REGISTER_CLIENT_REQ, msg, cb);
                });
            }
#endif
            return(await t.Task);
        }
示例#17
0
 public ReadBlogsResultInfo(
     global::System.Collections.Generic.IReadOnlyList <global::StrawberryShakeTesting.Tests.State.BlogPostData?>?posts,
     global::System.Collections.Generic.IReadOnlyCollection <global::StrawberryShake.EntityId> entityIds,
     global::System.UInt64 version)
 {
     Posts      = posts;
     _entityIds = entityIds
                  ?? throw new global::System.ArgumentNullException(nameof(entityIds));
     _version = version;
 }
示例#18
0
        public async Task <MigrateActorReq.Callback> MigrateActorAsync(global::System.UInt64 actorId, global::System.Action <global::Fenix.Common.DefaultErrCode, global::System.Byte[]> callback = null)
        {
            var t        = new TaskCompletionSource <MigrateActorReq.Callback>();
            var toHostId = Global.IdManager.GetHostIdByActorId(this.toActorId, this.isClient);

            if (this.FromHostId == toHostId)
            {
                global::System.Action <global::Fenix.Common.DefaultErrCode, global::System.Byte[]> _cb = (code, arg1) =>
                {
                    var cbMsg = new MigrateActorReq.Callback();
                    cbMsg.code = code;
                    cbMsg.arg1 = arg1;
                    callback?.Invoke(cbMsg.code, cbMsg.arg1);
                    t.TrySetResult(cbMsg);
                };
                var protoCode = OpCode.MIGRATE_ACTOR_REQ;
                if (protoCode < OpCode.CALL_ACTOR_METHOD)
                {
                    var peer    = Global.NetManager.GetPeerById(this.FromHostId, this.NetType);
                    var context = new RpcContext(null, peer);
                    Global.Host.CallMethodWithParams(protoCode, new object[] { actorId, _cb, context });
                }
                else
                {
                    Global.Host.GetActor(this.toActorId).CallMethodWithParams(protoCode, new object[] { actorId, _cb });
                }
            }
            else
            {
                Action <MigrateActorReq.Callback> _cb = (cbMsg) =>
                {
                    callback?.Invoke(cbMsg.code, cbMsg.arg1);
                    t.TrySetResult(cbMsg);
                };
                await Task.Run(() => {
                    var msg = new MigrateActorReq()
                    {
                        actorId = actorId
                    };
                    var cb = new Action <byte[]>((cbData) => {
                        var cbMsg = cbData == null ? new MigrateActorReq.Callback() : RpcUtil.Deserialize <MigrateActorReq.Callback>(cbData);
                        _cb?.Invoke(cbMsg);
                    });
                    this.CallRemoteMethod(OpCode.MIGRATE_ACTOR_REQ, msg, cb);
                });
            }
            return(await t.Task);
        }
示例#19
0
        public void ReconnectServerActor(global::System.UInt64 hostId, global::System.String hostName, global::System.String hostIP, global::System.Int32 hostPort, global::System.UInt64 actorId, global::System.String actorName, global::System.String aTypeName, global::System.Action <global::Fenix.Common.DefaultErrCode> callback)
        {
            var toHostId = Global.IdManager.GetHostIdByActorId(this.toActorId, this.isClient);

            if (this.FromHostId == toHostId)
            {
                var protoCode = OpCode.RECONNECT_SERVER_ACTOR_NTF;
                if (protoCode < OpCode.CALL_ACTOR_METHOD)
                {
                    var peer    = Global.NetManager.GetPeerById(this.FromHostId, this.NetType);
                    var context = new RpcContext(null, peer);
                    Global.Host.CallMethodWithParams(protoCode, new object[] { hostId, hostName, hostIP, hostPort, actorId, actorName, aTypeName, callback, context });
                }
                else
                {
                    Global.Host.GetActor(this.toActorId).CallMethodWithParams(protoCode, new object[] { hostId, hostName, hostIP, hostPort, actorId, actorName, aTypeName, callback });
                }
                return;
            }
            Task.Run(() => {
                var msg = new ReconnectServerActorNtf()
                {
                    hostId    = hostId,
                    hostName  = hostName,
                    hostIP    = hostIP,
                    hostPort  = hostPort,
                    actorId   = actorId,
                    actorName = actorName,
                    aTypeName = aTypeName
                };
                var cb = new Action <byte[]>((cbData) => {
                    var cbMsg = cbData == null?new ReconnectServerActorNtf.Callback():RpcUtil.Deserialize <ReconnectServerActorNtf.Callback>(cbData);
                    callback?.Invoke(cbMsg.code);
                });
                this.CallRemoteMethod(OpCode.RECONNECT_SERVER_ACTOR_NTF, msg, cb);
            });
        }
示例#20
0
        internal static global::LibPostalNet.LibpostalNormalizeResponse __CreateInstance(global::System.SByte **native, global::System.UInt64 count)
        {
            var expansions = new string[count];

            for (ulong i = 0; i < count; i++)
            {
                var normalized = new IntPtr(native[i]);
                var str        = Marshal.PtrToStringAnsi(normalized);
                expansions[i] = str;
            }

            libpostal.LibpostalExpansionArrayDestroy(native, count);

            return(new global::LibPostalNet.LibpostalNormalizeResponse(expansions));
        }
示例#21
0
 public void SERVER_API_NATIVE__Fenix__Host__register_client(global::System.UInt64 hostId, global::System.String hostName, global::System.Action <global::Fenix.Common.DefaultErrCode, global::Fenix.HostInfo> callback, RpcContext context)
 {
     this.RegisterClient(hostId, hostName, callback, context);
 }
示例#22
0
 public void SERVER_API_NATIVE__Fenix__Host__remove_client_actor(global::System.UInt64 actorId, global::Fenix.Common.DisconnectReason reason, global::System.Action <global::Fenix.Common.DefaultErrCode> callback, RpcContext context)
 {
     this.RemoveClientActor(actorId, reason, callback, context);
 }
示例#23
0
 public void SERVER_ONLY_NATIVE__Fenix__Host__register(global::System.UInt64 hostId, global::System.String hostName, RpcContext context)
 {
     this.Register(hostId, hostName, context);
 }
 public FindPlayersResultInfo(global::System.Collections.Generic.IReadOnlyList <global::WotBlitzStatisticsPro.Blazor.GraphQl.State.AccountsSearchResponseItemData> players, global::System.Collections.Generic.IReadOnlyCollection <global::StrawberryShake.EntityId> entityIds, global::System.UInt64 version)
 {
     Players    = players;
     _entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds));
     _version   = version;
 }
示例#25
0
 public void SERVER_ONLY_NATIVE__Fenix__Host__remove_actor(global::System.UInt64 actorId, global::System.Action <global::Fenix.Common.DefaultErrCode> callback, RpcContext context)
 {
     this.RemoveActor(actorId, callback, context);
 }
示例#26
0
 public extern static void void_objc_msgSendSuper_UInt64_IntPtr(IntPtr receiver, IntPtr selector, global::System.UInt64 arg1, IntPtr arg2);
 public GetHeroResultInfo(global::StrawberryShake.EntityId?hero, global::System.Collections.Generic.IReadOnlyCollection <global::StrawberryShake.EntityId> entityIds, global::System.UInt64 version)
 {
     Hero       = hero;
     _entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds));
     _version   = version;
 }
 public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version)
 {
     return(new GetHeroResultInfo(Hero, _entityIds, version));
 }
 public GetCustomValueResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.Custom?customScalar, global::System.Collections.Generic.IReadOnlyCollection <global::StrawberryShake.EntityId> entityIds, global::System.UInt64 version)
 {
     CustomScalar = customScalar;
     _entityIds   = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds));
     _version     = version;
 }
 public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version)
 {
     return(new GetCustomValueResultInfo(CustomScalar, _entityIds, version));
 }