Esempio n. 1
0
        private void _LoadSoulCompile(int type_id, long id, long return_id)
        {
            PackageLoadSoulCompile package = new PackageLoadSoulCompile();

            package.EntityId = id;
            package.ReturnId = return_id;
            package.TypeId   = type_id;
            _Queue.Push(ServerToClientOpCode.LoadSoulCompile, package.ToBuffer(_Serializer));
        }
Esempio n. 2
0
        protected void _OnResponse(ServerToClientOpCode id, byte[] args)
        {
            if (id == ServerToClientOpCode.Ping)
            {
                Ping = _PingTimeCounter.Ticks;
                _StartPing();
            }
            else if (id == ServerToClientOpCode.SetProperty)
            {
                PackageSetProperty data = args.ToPackageData <PackageSetProperty>(_Serializer);
                _UpdateSetProperty(data.EntityId, data.Property, data.Value);
            }

            else if (id == ServerToClientOpCode.InvokeEvent)
            {
                PackageInvokeEvent data = args.ToPackageData <PackageInvokeEvent>(_Serializer);
                _InvokeEvent(data.EntityId, data.Event, data.HandlerId, data.EventParams);
            }
            else if (id == ServerToClientOpCode.ErrorMethod)
            {
                PackageErrorMethod data = args.ToPackageData <PackageErrorMethod>(_Serializer);

                _ErrorReturnValue(data.ReturnTarget, data.Method, data.Message);
            }
            else if (id == ServerToClientOpCode.ReturnValue)
            {
                PackageReturnValue data = args.ToPackageData <PackageReturnValue>(_Serializer);
                _SetReturnValue(data.ReturnTarget, data.ReturnValue);
            }
            else if (id == ServerToClientOpCode.LoadSoulCompile)
            {
                PackageLoadSoulCompile data = args.ToPackageData <PackageLoadSoulCompile>(_Serializer);

                _LoadSoulCompile(data.TypeId, data.EntityId, data.ReturnId, data.PassageId);
            }
            else if (id == ServerToClientOpCode.LoadSoul)
            {
                PackageLoadSoul data = args.ToPackageData <PackageLoadSoul>(_Serializer);

                _LoadSoul(data.TypeId, data.EntityId, data.ReturnType);
            }
            else if (id == ServerToClientOpCode.UnloadSoul)
            {
                PackageUnloadSoul data = args.ToPackageData <PackageUnloadSoul>(_Serializer);

                _UnloadSoul(data.TypeId, data.EntityId, data.PassageId);
            }
            else if (id == ServerToClientOpCode.ProtocolSubmit)
            {
                PackageProtocolSubmit data = args.ToPackageData <PackageProtocolSubmit>(_Serializer);

                _ProtocolSubmit(data);
            }
        }
Esempio n. 3
0
        private void _LoadSoulCompile(int type_id, Guid id, Guid return_id)
        {
            /*var argmants = new Dictionary<byte, byte[]>();
             * argmants.Add(0, TypeHelper.Serialize(type_id));
             * argmants.Add(1, id.ToByteArray());
             * argmants.Add(2, ReturnId.ToByteArray());*/

            var package = new PackageLoadSoulCompile();

            package.EntityId = id;
            package.ReturnId = return_id;
            package.TypeId   = type_id;

            _Queue.Push(ServerToClientOpCode.LoadSoulCompile, package.ToBuffer(_Serializer));
        }