TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ SendSection()

static void Terraria.NetMessage.SendSection ( int whoAmi,
int sectionX,
int sectionY )
inlinestatic

Definition at line 2880 of file NetMessage.cs.

2881 {
2882 if (Main.netMode != 2)
2883 {
2884 return;
2885 }
2886 try
2887 {
2888 if (sectionX < 0 || sectionY < 0 || sectionX >= Main.maxSectionsX || sectionY >= Main.maxSectionsY || Netplay.Clients[whoAmi].TileSections[sectionX, sectionY])
2889 {
2890 return;
2891 }
2892 Netplay.Clients[whoAmi].TileSections[sectionX, sectionY] = true;
2893 int number = sectionX * 200;
2894 int num = sectionY * 150;
2895 int num2 = 150;
2896 for (int i = num; i < num + 150; i += num2)
2897 {
2898 SendData(10, whoAmi, -1, null, number, i, 200f, num2);
2899 }
2900 for (int j = 0; j < 200; j++)
2901 {
2902 if (Main.npc[j].active && Main.npc[j].townNPC)
2903 {
2904 int sectionX2 = Netplay.GetSectionX((int)(Main.npc[j].position.X / 16f));
2905 int sectionY2 = Netplay.GetSectionY((int)(Main.npc[j].position.Y / 16f));
2906 if (sectionX2 == sectionX && sectionY2 == sectionY)
2907 {
2908 SendData(23, whoAmi, -1, null, j);
2909 }
2910 }
2911 }
2912 }
2913 catch
2914 {
2915 }
2916 }
static void SendData(int msgType, int remoteClient=-1, int ignoreClient=-1, NetworkText text=null, int number=0, float number2=0f, float number3=0f, float number4=0f, int number5=0, int number6=0, int number7=0)

References Terraria.Netplay.Clients, Terraria.Netplay.GetSectionX(), Terraria.Netplay.GetSectionY(), Terraria.Main.maxSectionsX, Terraria.Main.maxSectionsY, Terraria.Main.netMode, Terraria.Main.npc, and Terraria.NetMessage.SendData().

Referenced by Terraria.RemoteClient.CheckSection(), and Terraria.MessageBuffer.GetData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: