Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop
This commit is contained in:
@@ -785,6 +785,7 @@ namespace Barotrauma
|
||||
AssignRelayToServer("simulatedduplicateschance", false);
|
||||
AssignRelayToServer("simulatedlongloadingtime", false);
|
||||
AssignRelayToServer("storeinfo", false);
|
||||
AssignRelayToServer("sendrawpacket", false);
|
||||
#endif
|
||||
|
||||
commands.Add(new Command("clientlist", "", (string[] args) => { }));
|
||||
@@ -3273,6 +3274,36 @@ namespace Barotrauma
|
||||
LocationType.Prefabs.Select(lt => lt.Identifier.Value).ToArray()
|
||||
};
|
||||
}));
|
||||
|
||||
commands.Add(new Command("sendrawpacket", "sendrawpacket [data]: Send a string of hex values as raw binary data to the server", (string[] args) =>
|
||||
{
|
||||
if (GameMain.NetworkMember is null)
|
||||
{
|
||||
ThrowError("Not connected to a server");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length == 0)
|
||||
{
|
||||
ThrowError("No data provided");
|
||||
return;
|
||||
}
|
||||
|
||||
string dataString = string.Join(" ", args);
|
||||
|
||||
try
|
||||
{
|
||||
byte[] bytes = ToolBox.HexStringToBytes(dataString);
|
||||
IWriteMessage msg = new WriteOnlyMessage();
|
||||
foreach (byte b in bytes) { msg.WriteByte(b); }
|
||||
GameMain.Client?.ClientPeer?.DebugSendRawMessage(msg);
|
||||
NewMessage($"Sent {bytes.Length} byte(s)", Color.Green);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ThrowError("Failed to parse the data", e);
|
||||
}
|
||||
}));
|
||||
#endif
|
||||
|
||||
commands.Add(new Command("limbscale", "Define the limbscale for the controlled character. Provide id or name if you want to target another character. Note: the changes are not saved!", (string[] args) =>
|
||||
|
||||
Reference in New Issue
Block a user