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

◆ Deserialize()

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

Definition at line 41 of file NetBestiaryModule.cs.

42 {
43 if (Main.dedServ)
44 {
45 return false;
46 }
47 switch ((BestiaryUnlockType)reader.ReadByte())
48 {
49 case BestiaryUnlockType.Kill:
50 {
51 short key3 = reader.ReadInt16();
52 string bestiaryCreditId3 = ContentSamples.NpcsByNetId[key3].GetBestiaryCreditId();
53 ushort killCount = reader.ReadUInt16();
54 Main.BestiaryTracker.Kills.SetKillCountDirectly(bestiaryCreditId3, killCount);
55 break;
56 }
57 case BestiaryUnlockType.Chat:
58 {
59 short key2 = reader.ReadInt16();
60 string bestiaryCreditId2 = ContentSamples.NpcsByNetId[key2].GetBestiaryCreditId();
61 Main.BestiaryTracker.Chats.SetWasChatWithDirectly(bestiaryCreditId2);
62 break;
63 }
64 case BestiaryUnlockType.Sight:
65 {
66 short key = reader.ReadInt16();
67 string bestiaryCreditId = ContentSamples.NpcsByNetId[key].GetBestiaryCreditId();
68 Main.BestiaryTracker.Sights.SetWasSeenDirectly(bestiaryCreditId);
69 break;
70 }
71 }
72 return true;
73 }
virtual byte ReadByte()
virtual ushort ReadUInt16()
virtual short ReadInt16()
static Dictionary< int, NPC > NpcsByNetId

References Terraria.Main.BestiaryTracker, Terraria.Main.dedServ, Terraria.ID.ContentSamples.NpcsByNetId, System.IO.BinaryReader.ReadByte(), System.IO.BinaryReader.ReadInt16(), and System.IO.BinaryReader.ReadUInt16().