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

◆ Deserialize_SyncEveryone()

void Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower.Deserialize_SyncEveryone ( BinaryReader reader,
int userId )
inlineprivateinherited

Definition at line 78 of file CreativePowers.cs.

79 {
80 int num = (int)Math.Ceiling((float)_perPlayerIsEnabled.Length / 8f);
81 if (Main.netMode == 2 && !CreativePowersHelper.IsAvailableForPlayer(this, userId))
82 {
83 reader.ReadBytes(num);
84 return;
85 }
86 for (int i = 0; i < num; i++)
87 {
88 BitsByte bitsByte = reader.ReadByte();
89 for (int j = 0; j < 8; j++)
90 {
91 int num2 = i * 8 + j;
92 if (num2 != Main.myPlayer)
93 {
94 if (num2 >= _perPlayerIsEnabled.Length)
95 {
96 break;
97 }
99 }
100 }
101 }
102 }
virtual byte ReadByte()
virtual byte[] ReadBytes(int count)
static double Ceiling(double a)

References Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower._perPlayerIsEnabled, System.Math.Ceiling(), Terraria.GameContent.Creative.CreativePowersHelper.IsAvailableForPlayer(), Terraria.Main.myPlayer, Terraria.Main.netMode, System.IO.BinaryReader.ReadByte(), System.IO.BinaryReader.ReadBytes(), and Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower.SetEnabledState().

Referenced by Terraria.GameContent.Creative.CreativePowers.APerPlayerTogglePower.DeserializeNetMessage().