Fix up midi stuff, support mild black midis (#1056)

This commit is contained in:
Tyler Young
2020-06-02 14:42:23 -04:00
committed by GitHub
parent 2301d8faae
commit 2eb715a9ca
4 changed files with 310 additions and 85 deletions

View File

@@ -8,6 +8,13 @@ namespace Content.Shared.GameObjects.Components.Instruments
{
public class SharedInstrumentComponent : Component
{
// These 2 values are quite high for now, and this could be easily abused. Change this if people are abusing it.
public const int MaxMidiEventsPerSecond = 1000;
public const int MaxMidiEventsPerBatch = 60;
public const int MaxMidiBatchDropped = 1;
public const int MaxMidiLaggedBatches = 8;
public override string Name => "Instrument";
public override uint? NetID => ContentNetIDs.INSTRUMENTS;
@@ -52,12 +59,10 @@ namespace Content.Shared.GameObjects.Components.Instruments
public class InstrumentState : ComponentState
{
public bool Playing { get; }
public uint SequencerTick { get; }
public InstrumentState(bool playing, uint sequencerTick = 0) : base(ContentNetIDs.INSTRUMENTS)
{
Playing = playing;
SequencerTick = sequencerTick;
}
}