Before You Report
Version
1.1.1 (but it's base game stuff)
Description
SSDropdownSetting's SendDropdownUpdate uses this.Options instead of newOptions when called (other settings dont do this, they use the new value)
An example of an actual bug would be trying to send fake dropdown options to clients, with this method, you just cant do that without forcing the dropdowns Options (hell it even makes the applyOverride bool in the method useless)
To Reproduce
Try sending fake dropdown options without having to forcibly overwrite the settings Options property.
Expected Behavior
public void SendDropdownUpdate(
string[] newOptions,
bool applyOverride = true,
Func<ReferenceHub, bool> receiveFilter = null)
{
if (applyOverride)
this.Options = newOptions;
this.SendUpdate(receiveFilter, (Action) (writer =>
{
writer.WriteByte((byte) 2);
writer.WriteByte((byte) this.Options.Length);
this.Options.ForEach(new Action(((NetworkWriterExtensions) writer).WriteString));
}));
}
------>
public void SendDropdownUpdate(
string[] newOptions,
bool applyOverride = true,
Func<ReferenceHub, bool> receiveFilter = null)
{
if (applyOverride)
this.Options = newOptions;
this.SendUpdate(receiveFilter, (Action) (writer =>
{
writer.WriteByte((byte) 2);
writer.WriteByte((byte) this.Options.Length);
newOptions.ForEach(new Action(((NetworkWriterExtensions) writer).WriteString));
}));
}
so I can fake the options of a setting without overriding the property of the setting
Additional Information
why is this required
Before You Report
Version
1.1.1 (but it's base game stuff)
Description
SSDropdownSetting's SendDropdownUpdate uses this.Options instead of newOptions when called (other settings dont do this, they use the new value)
An example of an actual bug would be trying to send fake dropdown options to clients, with this method, you just cant do that without forcing the dropdowns Options (hell it even makes the applyOverride bool in the method useless)
To Reproduce
Try sending fake dropdown options without having to forcibly overwrite the settings Options property.
Expected Behavior
public void SendDropdownUpdate(
string[] newOptions,
bool applyOverride = true,
Func<ReferenceHub, bool> receiveFilter = null)
{
if (applyOverride)
this.Options = newOptions;
this.SendUpdate(receiveFilter, (Action) (writer =>
{
writer.WriteByte((byte) 2);
writer.WriteByte((byte) this.Options.Length);
this.Options.ForEach(new Action(((NetworkWriterExtensions) writer).WriteString));
}));
}
------>
public void SendDropdownUpdate(
string[] newOptions,
bool applyOverride = true,
Func<ReferenceHub, bool> receiveFilter = null)
{
if (applyOverride)
this.Options = newOptions;
this.SendUpdate(receiveFilter, (Action) (writer =>
{
writer.WriteByte((byte) 2);
writer.WriteByte((byte) this.Options.Length);
newOptions.ForEach(new Action(((NetworkWriterExtensions) writer).WriteString));
}));
}
so I can fake the options of a setting without overriding the property of the setting
Additional Information
why is this required