コード例 #1
0
        public void SendDockInformation(VesselDockStructure dock, int subspaceId)
        {
            var vesselBytes = VesselSerializer.SerializeVessel(dock.DominantVessel.BackupVessel());

            if (vesselBytes.Length > 0)
            {
                CreateAndSendDockMessage(dock, subspaceId, vesselBytes);
            }
        }
コード例 #2
0
        public void SendDockInformation(Guid weakVesselId, Vessel dominantVessel, int subspaceId)
        {
            var vesselBytes = VesselSerializer.SerializeVessel(dominantVessel.BackupVessel());

            if (vesselBytes.Length > 0)
            {
                CreateAndSendDockMessage(weakVesselId, dominantVessel.id, subspaceId, vesselBytes);
            }
        }
コード例 #3
0
        /// <summary>
        /// Adds a vessel manually to the dictionary. Use this to add your own spawned vessels.
        /// </summary>
        public static void AddOrUpdateVesselToDictionary(Vessel vessel)
        {
            var ownVesselData = VesselSerializer.SerializeVessel(vessel.protoVessel);

            if (ownVesselData.Length > 0)
            {
                var newProtoUpdate = new VesselProtoUpdate(ownVesselData, ownVesselData.Length, vessel.id);
                AllPlayerVessels.AddOrUpdate(vessel.id, newProtoUpdate, (key, existingVal) => newProtoUpdate);
            }
        }
コード例 #4
0
        public void SendDockInformation(VesselDockStructure dock)
        {
            var vesselBytes = VesselSerializer.SerializeVessel(dock.DominantVessel.protoVessel);

            if (vesselBytes.Length > 0)
            {
                SendMessage(new VesselDockMsgData
                {
                    WeakVesselId     = dock.WeakVesselId,
                    DominantVesselId = dock.DominantVesselId,
                    FinalVesselData  = vesselBytes
                });
            }
        }
コード例 #5
0
 public void SendDockInformation(VesselDockStructure dock, int subspaceId, ProtoVessel finalDominantVesselProto)
 {
     if (finalDominantVesselProto != null)
     {
         var vesselBytes = VesselSerializer.SerializeVessel(finalDominantVesselProto);
         if (vesselBytes.Length > 0)
         {
             CreateAndSendDockMessage(dock, subspaceId, vesselBytes);
         }
     }
     else
     {
         SendDockInformation(dock, subspaceId);
     }
 }
コード例 #6
0
 public void SendDockInformation(Guid weakVesselId, Vessel dominantVessel, int subspaceId, ProtoVessel finalDominantVesselProto)
 {
     if (finalDominantVesselProto != null)
     {
         var vesselBytes = VesselSerializer.SerializeVessel(finalDominantVesselProto);
         if (vesselBytes.Length > 0)
         {
             CreateAndSendDockMessage(weakVesselId, dominantVessel.id, subspaceId, vesselBytes);
         }
     }
     else
     {
         SendDockInformation(weakVesselId, dominantVessel, subspaceId);
     }
 }