Пример #1
0
 internal void SendOverRidesUpdate(WeaponComponent comp, GroupOverrides overRides)
 {
     if (MpActive)
     {
         comp.SyncIds.MIds[(int)PacketType.OverRidesUpdate]++;
         if (IsClient)
         {
             PacketsToServer.Add(new OverRidesPacket
             {
                 EntityId = comp.MyCube.EntityId,
                 SenderId = MultiplayerId,
                 MId      = comp.SyncIds.MIds[(int)PacketType.OverRidesUpdate],
                 PType    = PacketType.OverRidesUpdate,
                 Data     = comp.Set.Value.Overrides,
             });
         }
         else
         {
             PacketsToClient.Add(new PacketInfo
             {
                 Entity = comp.MyCube,
                 Packet = new OverRidesPacket
                 {
                     EntityId = comp.MyCube.EntityId,
                     SenderId = 0,
                     MId      = comp.SyncIds.MIds[(int)PacketType.OverRidesUpdate],
                     PType    = PacketType.OverRidesUpdate,
                     Data     = comp.Set.Value.Overrides,
                 }
             });
         }
     }
 }
Пример #2
0
 internal void SendOverRidesUpdate(GridAi ai, string groupName, GroupOverrides overRides)
 {
     if (MpActive)
     {
         ai.UiMId++;
         if (IsClient)
         {
             PacketsToServer.Add(new OverRidesPacket
             {
                 EntityId  = ai.MyGrid.EntityId,
                 SenderId  = MultiplayerId,
                 MId       = ai.UiMId,
                 GroupName = groupName,
                 PType     = PacketType.OverRidesUpdate,
                 Data      = overRides,
             });
         }
         else if (IsServer)
         {
             PacketsToClient.Add(new PacketInfo
             {
                 Entity = ai.MyGrid,
                 Packet = new OverRidesPacket
                 {
                     EntityId  = ai.MyGrid.EntityId,
                     SenderId  = 0,
                     MId       = ai.UiMId,
                     GroupName = groupName,
                     PType     = PacketType.OverRidesUpdate,
                     Data      = overRides,
                 }
             });
         }
     }
 }
Пример #3
0
 public override void CleanUp()
 {
     base.CleanUp();
     Data      = null;
     GroupName = string.Empty;
     Setting   = string.Empty;
     Value     = 0;
 }
Пример #4
0
 public void Sync(GroupOverrides syncFrom)
 {
     Activate       = syncFrom.Activate;
     Neutrals       = syncFrom.Neutrals;
     Unowned        = syncFrom.Unowned;
     Friendly       = syncFrom.Friendly;
     TargetPainter  = syncFrom.TargetPainter;
     ManualControl  = syncFrom.ManualControl;
     FocusTargets   = syncFrom.FocusTargets;
     FocusSubSystem = syncFrom.FocusSubSystem;
     SubSystem      = syncFrom.SubSystem;
     Meteors        = syncFrom.Meteors;
     Biologicals    = syncFrom.Biologicals;
     Projectiles    = syncFrom.Projectiles;
 }
Пример #5
0
 internal static void SyncGridOverrides(GridAi ai, string groupName, GroupOverrides o)
 {
     ai.BlockGroups[groupName].Settings["Active"]         = o.Activate ? 1 : 0;
     ai.BlockGroups[groupName].Settings["Neutrals"]       = o.Neutrals ? 1 : 0;
     ai.BlockGroups[groupName].Settings["Projectiles"]    = o.Projectiles ? 1 : 0;
     ai.BlockGroups[groupName].Settings["Biologicals"]    = o.Biologicals ? 1 : 0;
     ai.BlockGroups[groupName].Settings["Meteors"]        = o.Meteors ? 1 : 0;
     ai.BlockGroups[groupName].Settings["Friendly"]       = o.Friendly ? 1 : 0;
     ai.BlockGroups[groupName].Settings["Unowned"]        = o.Unowned ? 1 : 0;
     ai.BlockGroups[groupName].Settings["TargetPainter"]  = o.TargetPainter ? 1 : 0;
     ai.BlockGroups[groupName].Settings["ManualControl"]  = o.ManualControl ? 1 : 0;
     ai.BlockGroups[groupName].Settings["FocusTargets"]   = o.FocusTargets ? 1 : 0;
     ai.BlockGroups[groupName].Settings["FocusSubSystem"] = o.FocusSubSystem ? 1 : 0;
     ai.BlockGroups[groupName].Settings["SubSystems"]     = (int)o.SubSystem;
 }
Пример #6
0
 public void Sync(GroupOverrides syncFrom)
 {
     MoveMode       = syncFrom.MoveMode;
     MaxSize        = syncFrom.MaxSize;
     MinSize        = syncFrom.MinSize;
     Neutrals       = syncFrom.Neutrals;
     Unowned        = syncFrom.Unowned;
     Friendly       = syncFrom.Friendly;
     Control        = syncFrom.Control;
     FocusTargets   = syncFrom.FocusTargets;
     FocusSubSystem = syncFrom.FocusSubSystem;
     SubSystem      = syncFrom.SubSystem;
     Meteors        = syncFrom.Meteors;
     Biologicals    = syncFrom.Biologicals;
     Projectiles    = syncFrom.Projectiles;
 }
Пример #7
0
        internal static GroupOverrides GetOverrides(GridAi ai, string groupName)
        {
            var o = new GroupOverrides();

            o.Activate       = ai.BlockGroups[groupName].Settings["Active"] == 1 ? true : false;
            o.Neutrals       = ai.BlockGroups[groupName].Settings["Neutrals"] == 1 ? true : false;
            o.Projectiles    = ai.BlockGroups[groupName].Settings["Projectiles"] == 1 ? true : false;
            o.Biologicals    = ai.BlockGroups[groupName].Settings["Biologicals"] == 1 ? true : false;
            o.Meteors        = ai.BlockGroups[groupName].Settings["Meteors"] == 1 ? true : false;
            o.Friendly       = ai.BlockGroups[groupName].Settings["Friendly"] == 1 ? true : false;
            o.Unowned        = ai.BlockGroups[groupName].Settings["Unowned"] == 1 ? true : false;
            o.TargetPainter  = ai.BlockGroups[groupName].Settings["TargetPainter"] == 1 ? true : false;
            o.ManualControl  = ai.BlockGroups[groupName].Settings["ManualControl"] == 1 ? true : false;
            o.FocusTargets   = ai.BlockGroups[groupName].Settings["FocusTargets"] == 1 ? true : false;
            o.FocusSubSystem = ai.BlockGroups[groupName].Settings["FocusSubSystem"] == 1 ? true : false;
            o.SubSystem      = (BlockTypes)ai.BlockGroups[groupName].Settings["SubSystems"];

            return(o);
        }
Пример #8
0
 public void Sync(GroupOverrides syncFrom)
 {
     MoveMode       = syncFrom.MoveMode;
     MaxSize        = syncFrom.MaxSize;
     MinSize        = syncFrom.MinSize;
     Neutrals       = syncFrom.Neutrals;
     Unowned        = syncFrom.Unowned;
     Friendly       = syncFrom.Friendly;
     Control        = syncFrom.Control;
     FocusTargets   = syncFrom.FocusTargets;
     FocusSubSystem = syncFrom.FocusSubSystem;
     SubSystem      = syncFrom.SubSystem;
     Meteors        = syncFrom.Meteors;
     Grids          = syncFrom.Grids;
     Biologicals    = syncFrom.Biologicals;
     Projectiles    = syncFrom.Projectiles;
     Repel          = syncFrom.Repel;
     CameraChannel  = syncFrom.CameraChannel;
     Debug          = syncFrom.Debug;
     LeadGroup      = syncFrom.LeadGroup;
 }
Пример #9
0
        public void Sync(WeaponComponent comp, CompSettingsValues syncFrom)
        {
            Guidance = syncFrom.Guidance;
            Modes    = syncFrom.Modes;

            Range = syncFrom.Range;

            foreach (var w in comp.Platform.Weapons)
            {
                w.UpdateWeaponRange();
            }

            InventoryInited = syncFrom.InventoryInited;
            Overrides       = syncFrom.Overrides;

            if (Overload != syncFrom.Overload || RofModifier != syncFrom.RofModifier || DpsModifier != syncFrom.DpsModifier)
            {
                Overload    = syncFrom.Overload;
                RofModifier = syncFrom.RofModifier;
                WepUi.SetDps(comp, syncFrom.DpsModifier, true);
            }
        }
Пример #10
0
 public CompSettingsValues()
 {
     Overrides = new GroupOverrides();
 }
Пример #11
0
 public override void CleanUp()
 {
     base.CleanUp();
     Data      = null;
     GroupName = "";
 }