예제 #1
0
 public void OnPlayerJoining(int playerIndex)
 {
     foreach (string index in this._wasNearPlayer)
     {
         int idsByPersistentId = ContentSamples.NpcNetIdsByPersistentIds[index];
         NetManager.Instance.SendToClient(NetBestiaryModule.SerializeSight(idsByPersistentId), playerIndex);
     }
 }
예제 #2
0
        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));
            }
        }