public static void SendSection(int whoAmi, int sectionX, int sectionY, bool skipSent = false)
{
if (Main.netMode != 2)
return;
try
{
if (sectionX < 0 || sectionY < 0 || (sectionX >= Main.maxSectionsX || sectionY >= Main.maxSectionsY) || skipSent && Netplay.Clients[whoAmi].TileSections[sectionX, sectionY])
return;
Netplay.Clients[whoAmi].TileSections[sectionX, sectionY] = true;
int number1 = sectionX * 200;
int num1 = sectionY * 150;
int num2 = 150;
int num3 = num1;
while (num3 < num1 + 150)
{
NetMessage.SendData(10, whoAmi, -1, "", number1, (float)num3, 200f, (float)num2, 0, 0, 0);
num3 += num2;
}
for (int number2 = 0; number2 < 200; ++number2)
{
if (Main.npc[number2].active && Main.npc[number2].townNPC)
{
int sectionX1 = Netplay.GetSectionX((int)((double)Main.npc[number2].position.X / 16.0));
int sectionY1 = Netplay.GetSectionY((int)((double)Main.npc[number2].position.Y / 16.0));
if (sectionX1 == sectionX && sectionY1 == sectionY)
NetMessage.SendData(23, whoAmi, -1, "", number2, 0.0f, 0.0f, 0.0f, 0, 0, 0);
}
}
}
catch
{
}
}