Skip to content

Instantly share code, notes, and snippets.

View Peckham08's full-sized avatar
🏠
Working from home

Peckham08

🏠
Working from home
View GitHub Profile
var netManager = NetManager.instance;
for (ushort n = 0; n < NetManager.MAX_NODE_COUNT; n++)
{
if ((netManager.m_nodes.m_buffer[n].m_flags & NetNode.Flags.Created) != NetNode.Flags.None)
{
var segmentCount = netManager.m_nodes.m_buffer[n].CountSegments();
if (segmentCount == 0)
{
Debug.Log("Releasing ghost node " + n);
netManager.ReleaseNode(n);