tModLoader v2024.04
A mod to make and play Terraria mods
NetMessage Class Reference

Classes

struct  NetSoundInfo
 

Static Public Member Functions

static void BootPlayer (int plr, NetworkText msg)
 
static void CheckBytes (int bufferIndex=256)
 
static void CompressTileBlock (int xStart, int yStart, short width, short height, Stream stream)
 
static void CompressTileBlock_Inner (BinaryWriter writer, int xStart, int yStart, int width, int height)
 
static void DecompressTileBlock (Stream stream)
 
static void DecompressTileBlock_Inner (BinaryReader reader, int xStart, int yStart, int width, int height)
 
static bool DoesPlayerSlotCountAsAHost (int plr)
 
static void greetPlayer (int plr)
 
static void PlayNetSound (NetSoundInfo info, int remoteClient=-1, int ignoreClient=-1)
 
static void ReceiveBytes (byte[] bytes, int streamLength, int i=256)
 
static void SendAnglerQuest (int remoteClient)
 
static void SendCoinLossRevengeMarker (CoinLossRevengeSystem.RevengeMarker marker, int remoteClient=-1, int ignoreClient=-1)
 
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)
 
static void SendObjectPlacement (int whoAmi, int x, int y, int type, int style, int alternative, int random, int direction)
 
static void SendPlayerDeath (int playerTargetIndex, PlayerDeathReason reason, int damage, int direction, bool pvp, int remoteClient=-1, int ignoreClient=-1)
 
static void SendPlayerHurt (int playerTargetIndex, Player.HurtInfo info, int ignoreClient=-1)
 
static void SendSection (int whoAmi, int sectionX, int sectionY)
 
static void SendStrikeNPC (NPC npc, in NPC.HitInfo hit, int ignoreClient=-1)
 Use this to synchronize damage strikes against NPCs!
 
static void SendTemporaryAnimation (int whoAmi, int animationType, int tileType, int xCoord, int yCoord)
 
static void SendTileSquare (int whoAmi, int tileX, int tileY, int centeredSquareSize, TileChangeType changeType=TileChangeType.None)
 Range: In this particular overload, tileX and tileY denote the center of a square range of tiles to sync and centeredSquareSize denotes the width/height of the square to send. Odd centeredSquareSize values result in a square centered directly on tileX and tileY . The SendTileSquare(int, int, int, int, int, TileChangeType) overload is usually preferred to this because it sends the exact range of tiles desired and visualizing how the square range fits over the desired range of tiles can be hard to visualize and program correctly.
 
static void SendTileSquare (int whoAmi, int tileX, int tileY, int xSize, int ySize, TileChangeType changeType=TileChangeType.None)
 Range: In this particular overload, tileX and tileY denote the top left corner of tiles to sync and xSize and ySize denote the width and height of the rectangle. More...
 
static void SendTileSquare (int whoAmi, int tileX, int tileY, TileChangeType changeType=TileChangeType.None)
 Range: In this particular overload, tileX and tileY denote a single tile to sync. If sending multiple tiles use the other overloads instead.
 
static void SendTravelShop (int remoteClient)
 
static void sendWater (int x, int y)
 
static void SyncConnectedPlayer (int plr)
 
static void SyncDisconnectedPlayer (int plr)
 
static bool TrySendData (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)
 

Static Public Attributes

static PlayerDeathReason _currentPlayerDeathReason
 
static MessageBuffer[] buffer = new MessageBuffer[257]
 

Member Function Documentation

◆ SendTileSquare()

static void NetMessage.SendTileSquare ( int  whoAmi,
int  tileX,
int  tileY,
int  xSize,
int  ySize,
TileChangeType  changeType = TileChangeType.None 
)
static

Range: In this particular overload, tileX and tileY denote the top left corner of tiles to sync and xSize and ySize denote the width and height of the rectangle.

<SharedSummary> Sends all the tiles in a rectangle range to sync them. The range is defined by parameters explained below.

whoAmi should usually be -1. changeType can optionally be set to one of the TileChangeType to automatically play the corresponding liquid sound on the receiving clients.

If called on a client, the server will relay the changed tiles to other clients when it is received.

Use this method when manually adjusting Main.tile. Uses such as wiring, right clicking on tiles, tiles randomly updating, and projectiles modifying tiles are all exhibited in ExampleMod

.

</SharedSummary>