mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 14:52:35 +02:00
Net message functions are now cached when the message is registered or the string table updates (client side). This removes the cache call from DispatchNetMessage. Receiving net messages that we don't have reception callbacks for, or that are blocked with the new NetMessageAccept enum, will instantly cause the net manager to drop the offending connection to avoid malicious use. This means trying to send string tables to the server will just result in an instant kick without even hitting ReadFromBuffer(). This allows us to move some if() checks to asserts.
27 lines
943 B
C#
27 lines
943 B
C#
using Robust.Client.Interfaces.Console;
|
|
using Robust.Shared.Interfaces.Network;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Network;
|
|
|
|
namespace Robust.Client.Console.Commands
|
|
{
|
|
internal sealed class SendGarbageCommand : IConsoleCommand
|
|
{
|
|
public string Command => "sendgarbage";
|
|
public string Description => "Sends garbage to the server.";
|
|
public string Help => "The server will reply with 'no u'";
|
|
|
|
public bool Execute(IDebugConsole console, params string[] args)
|
|
{
|
|
// MsgStringTableEntries is registered as NetMessageAccept.Client so the server will immediately deny it.
|
|
// And kick us.
|
|
var net = IoCManager.Resolve<IClientNetManager>();
|
|
var msg = net.CreateNetMessage<MsgStringTableEntries>();
|
|
msg.Entries = new MsgStringTableEntries.Entry[0];
|
|
net.ClientSendMessage(msg);
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|