public static SendData ( Packet packet, int remoteClient = -1, int ignoreClient = -1, string text = "", int number, float number2 = 0f, float number3 = 0f, float number4 = 0f, int number5 ) : int | ||
packet | Packet | |
remoteClient | int | |
ignoreClient | int | |
text | string | |
number | int | |
number2 | float | |
number3 | float | |
number4 | float | |
number5 | int | |
return | int |
public static void SendSection(int whoAmi, int sectionX, int sectionY, bool skipSent = false) { if (sectionX >= 0 && sectionY >= 0 && sectionX < Main.maxSectionsX && sectionY < Main.maxSectionsY) { if (!skipSent || !Terraria.Netplay.Clients[whoAmi].TileSections[sectionX, sectionY]) { Terraria.Netplay.Clients[whoAmi].TileSections[sectionX, sectionY] = true; int number = sectionX * 200; int num = sectionY * 150; int num2 = 150; for (int i = num; i < num + 150; i += num2) { NewNetMessage.SendData(10, whoAmi, -1, "", number, (float)i, 200f, (float)num2, 0); } for (int j = 0; j < 200; j++) { if (Main.npc[j].active && Main.npc[j].townNPC) { int sectionX2 = Netplay.GetSectionX((int)(Main.npc[j].position.X / 16f)); int sectionY2 = Netplay.GetSectionY((int)(Main.npc[j].position.Y / 16f)); if (sectionX2 == sectionX && sectionY2 == sectionY) { NewNetMessage.SendData(23, whoAmi, -1, "", j, 0f, 0f, 0f, 0); } } } } } }
public static void SendTileSquare(int whoAmi, int tileX, int tileY, int size) { int num = (size - 1) / 2; float x = tileX - num; float y = tileY - num; NewNetMessage.SendData(20, whoAmi, -1, System.String.Empty, size, x, y, 0f); }
public static void SendTileSquare(int whoAmi, int x, int y, int size, bool centered) { if (centered) { SendTileSquare(whoAmi, x, y, size); } else { NewNetMessage.SendData(20, whoAmi, -1, System.String.Empty, size, x, y, 0f); } }