public override void HandleMessage(ClientStructure client, IMessageData messageData) { var message = messageData as VesselBaseMsgData; switch (message?.VesselMessageType) { case VesselMessageType.LIST_REQUEST: HandleVesselListRequest(client); break; case VesselMessageType.VESSELS_REQUEST: HandleVesselsRequest(client, messageData); break; case VesselMessageType.PROTO: HandleVesselProto(client, message); break; case VesselMessageType.REMOVE: HandleVesselRemove(client, message); break; case VesselMessageType.CHANGE: MessageQueuer.RelayMessage <VesselSrvMsg>(client, message); break; case VesselMessageType.UPDATE: VesselRelaySystem.HandleVesselMessage(client, message); break; default: throw new NotImplementedException("Warp Type not implemented"); } }
public override void HandleMessage(ClientStructure client, IClientMessageBase message) { var messageData = message.Data as VesselBaseMsgData; switch (messageData?.VesselMessageType) { case VesselMessageType.Sync: HandleVesselsSync(client, messageData); message.Recycle(); break; case VesselMessageType.Proto: HandleVesselProto(client, messageData); break; case VesselMessageType.Dock: HandleVesselDock(client, messageData); break; case VesselMessageType.Remove: HandleVesselRemove(client, messageData); break; case VesselMessageType.Position: VesselRelaySystem.HandleVesselMessage(client, messageData); if (!GeneralSettings.SettingsStore.ShowVesselsInThePast || client.Subspace == WarpContext.LatestSubspace) { VesselDataUpdater.WritePositionDataToFile(messageData); } break; case VesselMessageType.Flightstate: VesselRelaySystem.HandleVesselMessage(client, messageData); break; case VesselMessageType.Update: VesselDataUpdater.WriteUpdateDataToFile(messageData); MessageQueuer.RelayMessage <VesselSrvMsg>(client, messageData); break; case VesselMessageType.Resource: VesselDataUpdater.WriteResourceDataToFile(messageData); MessageQueuer.RelayMessage <VesselSrvMsg>(client, messageData); break; case VesselMessageType.PartSync: VesselDataUpdater.WriteModuleDataToFile(messageData); MessageQueuer.RelayMessage <VesselSrvMsg>(client, messageData); break; case VesselMessageType.Fairing: VesselDataUpdater.WriteFairingDataToFile(messageData); MessageQueuer.RelayMessage <VesselSrvMsg>(client, messageData); break; default: throw new NotImplementedException("Vessel message type not implemented"); } }
public override void HandleMessage(ClientStructure client, IMessageData messageData) { var message = messageData as VesselBaseMsgData; switch (message?.VesselMessageType) { case VesselMessageType.VesselsRequest: HandleVesselsRequest(client); break; case VesselMessageType.Proto: HandleVesselProto(client, message); break; case VesselMessageType.Dock: HandleVesselDock(client, message); break; case VesselMessageType.Remove: HandleVesselRemove(client, message); break; case VesselMessageType.Position: VesselRelaySystem.HandleVesselMessage(client, message); if (!GeneralSettings.SettingsStore.ShowVesselsInThePast || client.Subspace == WarpContext.LatestSubspace) { VesselFileUpdater.WritePositionDataToFile(message); } break; case VesselMessageType.Flightstate: VesselRelaySystem.HandleVesselMessage(client, message); break; case VesselMessageType.Update: VesselFileUpdater.WriteUpdateDataToFile(message); MessageQueuer.RelayMessage <VesselSrvMsg>(client, message); break; case VesselMessageType.Resource: VesselFileUpdater.WriteResourceDataToFile(message); MessageQueuer.RelayMessage <VesselSrvMsg>(client, message); break; default: throw new NotImplementedException("Warp Type not implemented"); } }
public override void HandleMessage(ClientStructure client, IMessageData messageData) { var message = messageData as VesselBaseMsgData; switch (message?.VesselMessageType) { case VesselMessageType.ListRequest: HandleVesselListRequest(client); break; case VesselMessageType.VesselsRequest: HandleVesselsRequest(client, messageData); break; case VesselMessageType.Proto: HandleVesselProto(client, message); break; case VesselMessageType.Dock: HandleVesselDock(client, message); break; case VesselMessageType.Remove: HandleVesselRemove(client, message); break; case VesselMessageType.Change: MessageQueuer.RelayMessage <VesselSrvMsg>(client, message); break; case VesselMessageType.Update: VesselRelaySystem.HandleVesselMessage(client, message); break; case VesselMessageType.Position: VesselRelaySystem.HandleVesselMessage(client, message); break; case VesselMessageType.Flightstate: VesselRelaySystem.HandleVesselMessage(client, message); break; default: throw new NotImplementedException("Warp Type not implemented"); } }
private static void HandleVesselProto(ClientStructure client, VesselBaseMsgData message) { var msgData = (VesselProtoMsgData)message; if (VesselContext.RemovedVessels.Contains(msgData.VesselId)) { return; } var path = Path.Combine(ServerContext.UniverseDirectory, "Vessels", $"{msgData.VesselId}.txt"); if (!File.Exists(path)) { LunaLog.Debug($"Saving vessel {msgData.VesselId} from {client.PlayerName}"); } FileHandler.WriteToFile(path, msgData.VesselData); VesselRelaySystem.HandleVesselMessage(client, message); }