Пример #1
0
        private void _ErrorDeserialize(string method_name, long return_id, string message)
        {
            PackageErrorMethod package = new PackageErrorMethod();

            package.Message      = message;
            package.Method       = method_name;
            package.ReturnTarget = return_id;
            _Queue.Push(ServerToClientOpCode.ErrorMethod, package.ToBuffer(_Serializer));
        }
Пример #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);
            }
        }