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

◆ SyncOnePlayer()

static void Terraria.NetMessage.SyncOnePlayer ( int plr,
int toWho,
int fromWho )
inlinestaticprivate

Definition at line 3048 of file NetMessage.cs.

3049 {
3050 //IL_0464: Unknown result type (might be due to invalid IL or missing references)
3051 //IL_03bd: Unknown result type (might be due to invalid IL or missing references)
3052 int num = 0;
3053 if (Main.player[plr].active)
3054 {
3055 num = 1;
3056 }
3057 if (Netplay.Clients[plr].State == 10)
3058 {
3059 SendData(14, toWho, fromWho, null, plr, num);
3060 SendData(4, toWho, fromWho, null, plr);
3061 SendData(13, toWho, fromWho, null, plr);
3062 if (Main.player[plr].statLife <= 0)
3063 {
3064 SendData(135, toWho, fromWho, null, plr);
3065 }
3066 SendData(16, toWho, fromWho, null, plr);
3067 SendData(30, toWho, fromWho, null, plr);
3068 SendData(45, toWho, fromWho, null, plr);
3069 SendData(42, toWho, fromWho, null, plr);
3070 SendData(50, toWho, fromWho, null, plr);
3071 SendData(80, toWho, fromWho, null, plr, Main.player[plr].chest);
3072 SendData(142, toWho, fromWho, null, plr);
3073 SendData(147, toWho, fromWho, null, plr, Main.player[plr].CurrentLoadoutIndex);
3074 for (int i = 0; i < 59; i++)
3075 {
3076 SendData(5, toWho, fromWho, null, plr, PlayerItemSlotID.Inventory0 + i, Main.player[plr].inventory[i].prefix);
3077 }
3078 for (int j = 0; j < Main.player[plr].armor.Length; j++)
3079 {
3080 SendData(5, toWho, fromWho, null, plr, PlayerItemSlotID.Armor0 + j, Main.player[plr].armor[j].prefix);
3081 }
3082 for (int k = 0; k < Main.player[plr].dye.Length; k++)
3083 {
3084 SendData(5, toWho, fromWho, null, plr, PlayerItemSlotID.Dye0 + k, Main.player[plr].dye[k].prefix);
3085 }
3086 SyncOnePlayer_ItemArray(plr, toWho, fromWho, Main.player[plr].miscEquips, PlayerItemSlotID.Misc0);
3088 SyncOnePlayer_ItemArray(plr, toWho, fromWho, Main.player[plr].Loadouts[0].Armor, PlayerItemSlotID.Loadout1_Armor_0);
3090 SyncOnePlayer_ItemArray(plr, toWho, fromWho, Main.player[plr].Loadouts[1].Armor, PlayerItemSlotID.Loadout2_Armor_0);
3092 SyncOnePlayer_ItemArray(plr, toWho, fromWho, Main.player[plr].Loadouts[2].Armor, PlayerItemSlotID.Loadout3_Armor_0);
3095 if (!Netplay.Clients[plr].IsAnnouncementCompleted)
3096 {
3097 Netplay.Clients[plr].IsAnnouncementCompleted = true;
3098 ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.mp[19].Key, Main.player[plr].name), new Color(255, 240, 20), plr);
3099 if (Main.dedServ)
3100 {
3101 Logging.ServerConsoleLine(Lang.mp[19].Format(Main.player[plr].name));
3102 }
3103 }
3104 return;
3105 }
3106 num = 0;
3107 SendData(14, -1, plr, null, plr, num);
3108 if (Netplay.Clients[plr].IsAnnouncementCompleted)
3109 {
3110 Netplay.Clients[plr].IsAnnouncementCompleted = false;
3111 ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.mp[20].Key, Netplay.Clients[plr].Name), new Color(255, 240, 20), plr);
3112 if (Main.dedServ)
3113 {
3114 Logging.ServerConsoleLine(Lang.mp[20].Format(Netplay.Clients[plr].Name));
3115 }
3116 Netplay.Clients[plr].Name = "Anonymous";
3117 }
3118 Player.Hooks.PlayerDisconnect(plr);
3119 }
static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer=-1)
Definition ChatHelper.cs:51
static readonly int Loadout1_Armor_0
static readonly int Loadout3_Dye_0
static readonly int Loadout2_Dye_0
static readonly int Loadout1_Dye_0
static readonly int Loadout3_Armor_0
static readonly int Loadout2_Armor_0
static readonly int Inventory0
static NetworkText FromKey(string key, params object[] substitutions)
Creates a NetworkText object from a localization key and optional substitutions. The receiving client...
Represents text that will be sent over the network in multiplayer and displayed to the receiving user...
static void ServerConsoleLine(string msg)
Definition Logging.cs:319
static void SyncPlayer(Player player, int toWho, int fromWho, bool newPlayer)
This is where all ModPlayer hooks are gathered and called.
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 SyncOnePlayer_ItemArray(int plr, int toWho, int fromWho, Item[] arr, int slot)

References Terraria.ID.PlayerItemSlotID.Armor0, Terraria.Chat.ChatHelper.BroadcastChatMessage(), Terraria.Netplay.Clients, Terraria.Main.dedServ, Terraria.ID.PlayerItemSlotID.Dye0, Terraria.Localization.NetworkText.FromKey(), Terraria.ID.PlayerItemSlotID.Inventory0, Terraria.ID.PlayerItemSlotID.Loadout1_Armor_0, Terraria.ID.PlayerItemSlotID.Loadout1_Dye_0, Terraria.ID.PlayerItemSlotID.Loadout2_Armor_0, Terraria.ID.PlayerItemSlotID.Loadout2_Dye_0, Terraria.ID.PlayerItemSlotID.Loadout3_Armor_0, Terraria.ID.PlayerItemSlotID.Loadout3_Dye_0, Terraria.ID.PlayerItemSlotID.Misc0, Terraria.ID.PlayerItemSlotID.MiscDye0, Terraria.Lang.mp, Terraria.Main.player, Terraria.Player.Hooks.PlayerDisconnect(), Terraria.NetMessage.SendData(), Terraria.ModLoader.Logging.ServerConsoleLine(), Terraria.NetMessage.SyncOnePlayer_ItemArray(), and Terraria.ModLoader.PlayerLoader.SyncPlayer().

Referenced by Terraria.NetMessage.SyncConnectedPlayer(), and Terraria.NetMessage.SyncDisconnectedPlayer().

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