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

◆ Deserialize()

override bool Terraria.GameContent.NetModules.NetCreativePowerPermissionsModule.Deserialize ( BinaryReader reader,
int userId )
inline

Definition at line 20 of file NetCreativePowerPermissionsModule.cs.

21 {
22 if (reader.ReadByte() == 0)
23 {
24 ushort id = reader.ReadUInt16();
25 int currentPermissionLevel = reader.ReadByte();
26 if (Main.netMode == 2)
27 {
28 return false;
29 }
30 if (!CreativePowerManager.Instance.TryGetPower(id, out var power))
31 {
32 return false;
33 }
34 power.CurrentPermissionLevel = (PowerPermissionLevel)currentPermissionLevel;
35 }
36 return true;
37 }
virtual byte ReadByte()
virtual ushort ReadUInt16()

References Terraria.GameContent.Creative.CreativePowerManager.Instance, Terraria.Main.netMode, System.IO.BinaryReader.ReadByte(), and System.IO.BinaryReader.ReadUInt16().