public override void Process(NitroxModel.Packets.ToggleLights packet, NitroxServer.Player player) { Optional <SeamothModel> opSeamoth = Vehicles.GetVehicleModel <SeamothModel>(packet.Guid); if (opSeamoth.IsPresent() && opSeamoth.Get().GetType() == typeof(SeamothModel)) { opSeamoth.Get().LightOn = packet.IsOn; } PlayerManager.SendPacketToOtherPlayers(packet, player); }
public override void Process(CyclopsToggleEngineState packet, NitroxServer.Player player) { Optional <CyclopsModel> opCyclops = Vehicles.GetVehicleModel <CyclopsModel>(packet.Id); if (opCyclops.IsPresent()) { // If someone starts the engine, IsOn will be false, so only isStarting contains the info we need opCyclops.Get().EngineState = packet.IsStarting; } PlayerManager.SendPacketToOtherPlayers(packet, player); }