Custom LuaUI network messaging
Moderator: Moderators
Something like sending out a flood of unit commands?
(my point is that that can already be done)
I have new per-player bandwidth tracking code in my local
source code . You can access the information using LuaUI.
A bandwidth monitoring widget should be very easy to write.
Spring.GetPlayerTraffic(playerID, packetType)
playerID can be -1 for system messages like NETMSG_NEWFRAME
packetType can be -1 for the sum of all packet types
Here are the current limitations:
(my point is that that can already be done)
I have new per-player bandwidth tracking code in my local
source code . You can access the information using LuaUI.
A bandwidth monitoring widget should be very easy to write.
Spring.GetPlayerTraffic(playerID, packetType)
playerID can be -1 for system messages like NETMSG_NEWFRAME
packetType can be -1 for the sum of all packet types
Here are the current limitations:
Code: Select all
// only allow viewing stats for specific packet types
if ((playerID != -1) && // all system counts can be read
(playerID != gu->myPlayerNum) && // all self counts can be read
(packetID != -1) &&
(packetID != NETMSG_CHAT) &&
(packetID != NETMSG_PAUSE) &&
(packetID != NETMSG_LUAMSG) &&
(packetID != NETMSG_USER_SPEED)) {
// Return -1 as the count
lua_pushnumber(L, -1);
return 1;
}