Beispiel #1
0
        public static void Serialize(Stream stream, AccountCompletionResultView instance)
        {
            int mask = 0;

            using (var bytes = new MemoryStream())
            {
                if (instance.ItemsAttributed != null)
                {
                    DictionaryProxy <int, int> .Serialize(bytes, instance.ItemsAttributed, Int32Proxy.Serialize, Int32Proxy.Serialize);
                }
                else
                {
                    mask |= 1;
                }
                if (instance.NonDuplicateNames != null)
                {
                    ListProxy <string> .Serialize(bytes, instance.NonDuplicateNames, StringProxy.Serialize);
                }
                else
                {
                    mask |= 2;
                }

                Int32Proxy.Serialize(bytes, instance.Result);
                Int32Proxy.Serialize(stream, ~mask);
                bytes.WriteTo(stream);
            }
        }
Beispiel #2
0
        public static void Serialize(Stream stream, MapView instance)
        {
            var mask = 0;

            using (var bytes = new MemoryStream())
            {
                if (instance.Description != null)
                {
                    StringProxy.Serialize(bytes, instance.Description);
                }
                else
                {
                    mask |= 1;
                }
                if (instance.DisplayName != null)
                {
                    StringProxy.Serialize(bytes, instance.DisplayName);
                }
                else
                {
                    mask |= 2;
                }

                BooleanProxy.Serialize(bytes, instance.IsBlueBox);
                Int32Proxy.Serialize(bytes, instance.MapId);
                Int32Proxy.Serialize(bytes, instance.MaxPlayers);
                Int32Proxy.Serialize(bytes, instance.RecommendedItemId);

                if (instance.SceneName != null)
                {
                    StringProxy.Serialize(bytes, instance.SceneName);
                }
                else
                {
                    mask |= 4;
                }
                if (instance.Settings != null)
                {
                    DictionaryProxy <GameModeType, MapSettingsView> .Serialize(bytes, instance.Settings, EnumProxy <GameModeType> .Serialize, MapSettingsViewProxy.Serialize);
                }
                else
                {
                    mask |= 8;
                }

                Int32Proxy.Serialize(bytes, instance.SupportedGameModes);
                Int32Proxy.Serialize(bytes, instance.SupportedItemClass);
                Int32Proxy.Serialize(stream, ~mask);
                bytes.WriteTo(stream);
            }
        }
Beispiel #3
0
        public static void Serialize(Stream stream, ApplicationConfigurationView instance)
        {
            int mask = 0;

            using (var bytes = new MemoryStream())
            {
                Int32Proxy.Serialize(bytes, instance.MaxLevel);
                Int32Proxy.Serialize(bytes, instance.MaxXp);
                Int32Proxy.Serialize(bytes, instance.PointsBaseLoser);
                Int32Proxy.Serialize(bytes, instance.PointsBaseWinner);
                Int32Proxy.Serialize(bytes, instance.PointsHeadshot);
                Int32Proxy.Serialize(bytes, instance.PointsKill);
                Int32Proxy.Serialize(bytes, instance.PointsNutshot);
                Int32Proxy.Serialize(bytes, instance.PointsPerMinuteLoser);
                Int32Proxy.Serialize(bytes, instance.PointsPerMinuteWinner);
                Int32Proxy.Serialize(bytes, instance.PointsSmackdown);
                Int32Proxy.Serialize(bytes, instance.XpBaseLoser);
                Int32Proxy.Serialize(bytes, instance.XpBaseWinner);
                Int32Proxy.Serialize(bytes, instance.XpHeadshot);
                Int32Proxy.Serialize(bytes, instance.XpKill);
                Int32Proxy.Serialize(bytes, instance.XpNutshot);
                Int32Proxy.Serialize(bytes, instance.XpPerMinuteLoser);
                Int32Proxy.Serialize(bytes, instance.XpPerMinuteWinner);

                if (instance.XpRequiredPerLevel != null)
                {
                    DictionaryProxy <int, int> .Serialize(bytes, instance.XpRequiredPerLevel, Int32Proxy.Serialize, Int32Proxy.Serialize);
                }
                else
                {
                    mask |= 1;
                }

                Int32Proxy.Serialize(bytes, instance.XpSmackdown);
                Int32Proxy.Serialize(stream, ~mask);
                bytes.WriteTo(stream);
            }
        }
Beispiel #4
0
        public static void Serialize(Stream stream, DamageEventView instance)
        {
            int mask = 0;

            using (var bytes = new MemoryStream())
            {
                ByteProxy.Serialize(bytes, instance.BodyPartFlag);

                if (instance.Damage != null)
                {
                    DictionaryProxy <byte, byte> .Serialize(bytes, instance.Damage, ByteProxy.Serialize, ByteProxy.Serialize);
                }
                else
                {
                    mask |= 1;
                }

                Int32Proxy.Serialize(bytes, instance.DamageEffectFlag);
                SingleProxy.Serialize(bytes, instance.DamgeEffectValue);
                Int32Proxy.Serialize(stream, ~mask);
                bytes.WriteTo(stream);
            }
        }
        public static void Serialize(Stream stream, UberStrikeItemQuickView instance)
        {
            int mask = 0;

            using (var bytes = new MemoryStream())
            {
                EnumProxy <QuickItemLogic> .Serialize(bytes, instance.BehaviourType);

                Int32Proxy.Serialize(bytes, instance.CoolDownTime);

                if (instance.CustomProperties != null)
                {
                    DictionaryProxy <string, string> .Serialize(bytes, instance.CustomProperties, StringProxy.Serialize, StringProxy.Serialize);
                }
                else
                {
                    mask |= 1;
                }
                if (instance.Description != null)
                {
                    StringProxy.Serialize(bytes, instance.Description);
                }
                else
                {
                    mask |= 2;
                }

                Int32Proxy.Serialize(bytes, instance.ID);
                BooleanProxy.Serialize(bytes, instance.IsConsumable);
                EnumProxy <UberStrikeItemClass> .Serialize(bytes, instance.ItemClass);

                if (instance.ItemProperties != null)
                {
                    DictionaryProxy <ItemPropertyType, int> .Serialize(bytes, instance.ItemProperties, EnumProxy <ItemPropertyType> .Serialize, Int32Proxy.Serialize);
                }
                else
                {
                    mask |= 4;
                }

                Int32Proxy.Serialize(bytes, instance.LevelLock);
                Int32Proxy.Serialize(bytes, instance.MaxDurationDays);
                Int32Proxy.Serialize(bytes, instance.MaxOwnableAmount);

                if (instance.Name != null)
                {
                    StringProxy.Serialize(bytes, instance.Name);
                }
                else
                {
                    mask |= 8;
                }
                if (instance.PrefabName != null)
                {
                    StringProxy.Serialize(bytes, instance.PrefabName);
                }
                else
                {
                    mask |= 16;
                }
                if (instance.Prices != null)
                {
                    ListProxy <ItemPriceView> .Serialize(bytes, instance.Prices, ItemPriceViewProxy.Serialize);
                }
                else
                {
                    mask |= 32;
                }

                EnumProxy <ItemShopHighlightType> .Serialize(bytes, instance.ShopHighlightType);

                Int32Proxy.Serialize(bytes, instance.UsesPerGame);
                Int32Proxy.Serialize(bytes, instance.UsesPerLife);
                Int32Proxy.Serialize(bytes, instance.UsesPerRound);
                Int32Proxy.Serialize(bytes, instance.WarmUpTime);
                Int32Proxy.Serialize(stream, ~mask);
                bytes.WriteTo(stream);
            }
        }
Beispiel #6
0
        public static void Serialize(Stream stream, UberStrikeItemFunctionalView instance)
        {
            int mask = 0;

            using (var bytes = new MemoryStream())
            {
                if (instance.CustomProperties != null)
                {
                    DictionaryProxy <string, string> .Serialize(bytes, instance.CustomProperties, new DictionaryProxy <string, string> .Serializer <string>(StringProxy.Serialize), new DictionaryProxy <string, string> .Serializer <string>(StringProxy.Serialize));
                }
                else
                {
                    mask |= 1;
                }
                if (instance.Description != null)
                {
                    StringProxy.Serialize(bytes, instance.Description);
                }
                else
                {
                    mask |= 2;
                }

                Int32Proxy.Serialize(bytes, instance.ID);
                BooleanProxy.Serialize(bytes, instance.IsConsumable);
                EnumProxy <UberStrikeItemClass> .Serialize(bytes, instance.ItemClass);

                if (instance.ItemProperties != null)
                {
                    DictionaryProxy <ItemPropertyType, int> .Serialize(bytes, instance.ItemProperties, EnumProxy <ItemPropertyType> .Serialize, Int32Proxy.Serialize);
                }
                else
                {
                    mask |= 4;
                }

                Int32Proxy.Serialize(bytes, instance.LevelLock);
                Int32Proxy.Serialize(bytes, instance.MaxDurationDays);

                if (instance.Name != null)
                {
                    StringProxy.Serialize(bytes, instance.Name);
                }
                else
                {
                    mask |= 8;
                }
                if (instance.PrefabName != null)
                {
                    StringProxy.Serialize(bytes, instance.PrefabName);
                }
                else
                {
                    mask |= 16;
                }
                if (instance.Prices != null)
                {
                    ListProxy <ItemPriceView> .Serialize(bytes, instance.Prices, ItemPriceViewProxy.Serialize);
                }
                else
                {
                    mask |= 32;
                }

                EnumProxy <ItemShopHighlightType> .Serialize(bytes, instance.ShopHighlightType);

                Int32Proxy.Serialize(stream, ~mask);
                bytes.WriteTo(stream);
            }
        }
Beispiel #7
0
        public static void Serialize(Stream stream, UberStrikeItemWeaponView instance)
        {
            int mask = 0;

            using (var bytes = new MemoryStream())
            {
                Int32Proxy.Serialize(bytes, instance.AccuracySpread);
                Int32Proxy.Serialize(bytes, instance.CombatRange);
                Int32Proxy.Serialize(bytes, instance.CriticalStrikeBonus);

                if (instance.CustomProperties != null)
                {
                    DictionaryProxy <string, string> .Serialize(bytes, instance.CustomProperties, new DictionaryProxy <string, string> .Serializer <string>(StringProxy.Serialize), new DictionaryProxy <string, string> .Serializer <string>(StringProxy.Serialize));
                }
                else
                {
                    mask |= 1;
                }

                Int32Proxy.Serialize(bytes, instance.DamageKnockback);
                Int32Proxy.Serialize(bytes, instance.DamagePerProjectile);
                Int32Proxy.Serialize(bytes, instance.DefaultZoomMultiplier);

                if (instance.Description != null)
                {
                    StringProxy.Serialize(bytes, instance.Description);
                }
                else
                {
                    mask |= 2;
                }

                BooleanProxy.Serialize(bytes, instance.HasAutomaticFire);
                Int32Proxy.Serialize(bytes, instance.ID);
                BooleanProxy.Serialize(bytes, instance.IsConsumable);
                EnumProxy <UberStrikeItemClass> .Serialize(bytes, instance.ItemClass);

                if (instance.ItemProperties != null)
                {
                    DictionaryProxy <ItemPropertyType, int> .Serialize(bytes, instance.ItemProperties, EnumProxy <ItemPropertyType> .Serialize, Int32Proxy.Serialize);
                }
                else
                {
                    mask |= 4;
                }

                Int32Proxy.Serialize(bytes, instance.LevelLock);
                Int32Proxy.Serialize(bytes, instance.MaxAmmo);
                Int32Proxy.Serialize(bytes, instance.MaxDurationDays);
                Int32Proxy.Serialize(bytes, instance.MaxZoomMultiplier);
                Int32Proxy.Serialize(bytes, instance.MinZoomMultiplier);
                Int32Proxy.Serialize(bytes, instance.MissileBounciness);
                Int32Proxy.Serialize(bytes, instance.MissileForceImpulse);
                Int32Proxy.Serialize(bytes, instance.MissileTimeToDetonate);

                if (instance.Name != null)
                {
                    StringProxy.Serialize(bytes, instance.Name);
                }
                else
                {
                    mask |= 8;
                }
                if (instance.PrefabName != null)
                {
                    StringProxy.Serialize(bytes, instance.PrefabName);
                }
                else
                {
                    mask |= 16;
                }
                if (instance.Prices != null)
                {
                    ListProxy <ItemPriceView> .Serialize(bytes, instance.Prices, ItemPriceViewProxy.Serialize);
                }
                else
                {
                    mask |= 32;
                }

                Int32Proxy.Serialize(bytes, instance.ProjectileSpeed);
                Int32Proxy.Serialize(bytes, instance.ProjectilesPerShot);
                Int32Proxy.Serialize(bytes, instance.RateOfFire);
                Int32Proxy.Serialize(bytes, instance.RecoilKickback);
                Int32Proxy.Serialize(bytes, instance.RecoilMovement);
                Int32Proxy.Serialize(bytes, instance.SecondaryActionReticle);
                EnumProxy <ItemShopHighlightType> .Serialize(bytes, instance.ShopHighlightType);

                Int32Proxy.Serialize(bytes, instance.SplashRadius);
                Int32Proxy.Serialize(bytes, instance.StartAmmo);
                Int32Proxy.Serialize(bytes, instance.Tier);
                Int32Proxy.Serialize(bytes, instance.WeaponSecondaryAction);
                Int32Proxy.Serialize(stream, ~mask);
                bytes.WriteTo(stream);
            }
        }