Add "debug lludp drop out <add|remove> <packet-name>" console command for debug/test purposes.
This drops all outbound packets that match a given packet name. Can currently only be applied to all connections in a scene.bullet-2.82
parent
ce74418c20
commit
298376d5c7
|
@ -12341,6 +12341,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
/// provide your own method.</param>
|
||||
protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting, UnackedPacketMethod method)
|
||||
{
|
||||
if (m_outPacketsToDrop != null)
|
||||
if (m_outPacketsToDrop.Contains(packet.Type.ToString()))
|
||||
return;
|
||||
|
||||
if (DebugPacketLevel > 0)
|
||||
{
|
||||
bool logPacket = true;
|
||||
|
@ -13123,5 +13127,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
eq.Enqueue(BuildEvent("BulkUpdateInventory",
|
||||
llsd), AgentId);
|
||||
}
|
||||
|
||||
private HashSet<string> m_outPacketsToDrop;
|
||||
|
||||
public bool AddOutPacketToDropSet(string packetName)
|
||||
{
|
||||
if (m_outPacketsToDrop == null)
|
||||
m_outPacketsToDrop = new HashSet<string>();
|
||||
|
||||
return m_outPacketsToDrop.Add(packetName);
|
||||
}
|
||||
|
||||
public bool RemoveOutPacketFromDropSet(string packetName)
|
||||
{
|
||||
if (m_outPacketsToDrop == null)
|
||||
return false;
|
||||
|
||||
return m_outPacketsToDrop.Remove(packetName);
|
||||
}
|
||||
|
||||
public HashSet<string> GetOutPacketDropSet()
|
||||
{
|
||||
return new HashSet<string>(m_outPacketsToDrop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -697,6 +697,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
+ "If an avatar name is given then only packets from that avatar are logged.",
|
||||
HandlePacketCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"Debug", false, "debug lludp drop out",
|
||||
"debug lludp drop out <add|remove> <packet-name>",
|
||||
"Drop all outbound packets that match the given name",
|
||||
"For test purposes.",
|
||||
HandleDropCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"Debug",
|
||||
false,
|
||||
|
@ -820,6 +827,48 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
}
|
||||
|
||||
private void HandleDropCommand(string module, string[] args)
|
||||
{
|
||||
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene)
|
||||
return;
|
||||
|
||||
if (args.Length != 6)
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: debug lludp drop out <add|remove> <packet-name>");
|
||||
return;
|
||||
}
|
||||
|
||||
string subCommand = args[4];
|
||||
string packetName = args[5];
|
||||
|
||||
if (subCommand == "add")
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"Adding packet {0} to out drop list for all connections in {1}", packetName, Scene.Name);
|
||||
|
||||
Scene.ForEachScenePresence(
|
||||
sp =>
|
||||
{
|
||||
LLClientView llcv = (LLClientView)sp.ControllingClient;
|
||||
llcv.AddOutPacketToDropSet(packetName);
|
||||
}
|
||||
);
|
||||
}
|
||||
else if (subCommand == "remove")
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"Removing packet {0} from out drop list for all connections in {1}", packetName, Scene.Name);
|
||||
|
||||
Scene.ForEachScenePresence(
|
||||
sp =>
|
||||
{
|
||||
LLClientView llcv = (LLClientView)sp.ControllingClient;
|
||||
llcv.RemoveOutPacketFromDropSet(packetName);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleStartCommand(string module, string[] args)
|
||||
{
|
||||
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene)
|
||||
|
|
Loading…
Reference in New Issue