public void OnPlayerJoining(int playerIndex) { foreach (string index in this._wasNearPlayer) { int idsByPersistentId = ContentSamples.NpcNetIdsByPersistentIds[index]; NetManager.Instance.SendToClient(NetBestiaryModule.SerializeSight(idsByPersistentId), playerIndex); } }
public void RegisterWasNearby(NPC npc) { string bestiaryCreditId = npc.GetBestiaryCreditId(); bool flag = !_wasNearPlayer.Contains(bestiaryCreditId); _wasNearPlayer.Add(bestiaryCreditId); if (Main.netMode == 2 && flag) { NetManager.Instance.Broadcast(NetBestiaryModule.SerializeSight(npc.netID)); } }