Beispiel #1
0
 public void Serialize(INetDataWriter writer)
 {
     writer.Put(x);
     writer.Put(y);
     writer.Put(z);
     writer.Put(w);
 }
Beispiel #2
0
 public void Serialize(INetDataWriter writer)
 {
     writer.Put(coreEnergyCap);
     writer.Put(corePowerGen);
     writer.Put(reactorPowerGen);
     writer.Put(walkPower);
     writer.Put(jumpEnergy);
     writer.Put(thrustPowerPerAcc);
     writer.Put(warpKeepingPowerPerSpeed);
     writer.Put(warpStartPowerPerSpeed);
     writer.Put(miningPower);
     writer.Put(replicatePower);
     writer.Put(researchPower);
     writer.Put(droneEjectEnergy);
     writer.Put(droneEnergyPerMeter);
     writer.Put(coreLevel);
     writer.Put(thrusterLevel);
     writer.Put(miningSpeed);
     writer.Put(replicateSpeed);
     writer.Put(walkSpeed);
     writer.Put(jumpSpeed);
     writer.Put(maxSailSpeed);
     writer.Put(maxWarpSpeed);
     writer.Put(buildArea);
     writer.Put(droneCount);
     writer.Put(droneSpeed);
     writer.Put(droneMovement);
     writer.Put(inventorySize);
 }
Beispiel #3
0
 public void Serialize(INetDataWriter writer)
 {
     writer.Put(Username);
     writer.Put(PlayerId);
     writer.Put(LocalPlanetId);
     writer.Put(MechaColors?.Length ?? 0);
     for (int i = 0; i < (MechaColors?.Length ?? 0); i++)
     {
         MechaColors[i].Serialize(writer);
     }
     LocalPlanetPosition.Serialize(writer);
     UPosition.Serialize(writer);
     Rotation.Serialize(writer);
     BodyRotation.Serialize(writer);
     Mecha.Serialize(writer);
     writer.Put(Appearance != null);
     if (Appearance != null)
     {
         using (MemoryStream ms = new MemoryStream())
         {
             using (BinaryWriter wr = new BinaryWriter(ms))
             {
                 Appearance.Export(wr);
             }
             byte[] export = ms.ToArray();
             writer.Put(export.Length);
             writer.Put(export);
         }
     }
     writer.Put(DIYAppearance != null);
     if (DIYAppearance != null)
     {
         using (MemoryStream ms = new MemoryStream())
         {
             using (BinaryWriter wr = new BinaryWriter(ms))
             {
                 DIYAppearance.Export(wr);
             }
             byte[] export = ms.ToArray();
             writer.Put(export.Length);
             writer.Put(export);
         }
     }
     writer.Put(DIYItemId.Length);
     for (int i = 0; i < DIYItemId.Length; i++)
     {
         writer.Put(DIYItemId[i]);
         writer.Put(DIYItemValue[i]);
     }
 }
Beispiel #4
0
 public void Serialize(INetDataWriter writer)
 {
     writer.Put(StarIndex);
     writer.Put((ushort)BulletList.Count);
     for (ushort i = 0; i < (ushort)BulletList.Count; i++)
     {
         Projectile data = BulletList[i];
         writer.Put((byte)(data.PlanetId % 100));
         writer.Put(data.Interval);
         writer.Put(data.TargetId);
         writer.Put(data.LocalPos.ToFloat3());
     }
     writer.Put((ushort)RocketList.Count);
     for (ushort i = 0; i < (ushort)RocketList.Count; i++)
     {
         Projectile data = RocketList[i];
         writer.Put((byte)(data.PlanetId % 100));
         writer.Put(data.Interval);
         writer.Put(data.TargetId);
         writer.Put(data.LocalPos.ToFloat3());
     }
 }
Beispiel #5
0
 public void Serialize(INetDataWriter writer)
 {
     TechBonuses.Serialize(writer);
     writer.Put(SandCount);
     writer.Put(CoreEnergy);
     writer.Put(ReactorEnergy);
     writer.Put(ReactorStorage != null);
     if (ReactorStorage != null)
     {
         using (MemoryStream ms = new MemoryStream())
         {
             using (BinaryWriter wr = new BinaryWriter(ms))
             {
                 Inventory.Export(wr);
                 ReactorStorage.Export(wr);
                 WarpStorage.Export(wr);
                 Forge.Export(wr);
             }
             byte[] export = ms.ToArray();
             writer.Put(export.Length);
             writer.Put(export);
         }
     }
 }
 public void Serialize(INetDataWriter writer)
 {
     writer.Put(ItemId);
     writer.Put(Count);
     writer.Put(BeltId);
 }
Beispiel #7
0
 public void Serialize(INetDataWriter writer)
 {
     writer.Put(timestamp);
     writer.Put(gameTick);
 }