Example #1
0
 public void OnPlayerJoining(int playerIndex)
 {
     foreach (string item in _chattedWithPlayer)
     {
         if (ContentSamples.NpcNetIdsByPersistentIds.TryGetValue(item, out var value))
         {
             NetManager.Instance.SendToClient(NetBestiaryModule.SerializeChat(value), playerIndex);
         }
     }
 }
Example #2
0
        public void RegisterChatStartWith(NPC npc)
        {
            string bestiaryCreditId = npc.GetBestiaryCreditId();
            bool   flag             = !_chattedWithPlayer.Contains(bestiaryCreditId);

            _chattedWithPlayer.Add(bestiaryCreditId);
            if (Main.netMode == 2 && flag)
            {
                NetManager.Instance.Broadcast(NetBestiaryModule.SerializeChat(npc.netID));
            }
        }
 public void OnPlayerJoining(int playerIndex)
 {
     foreach (string key in this._chattedWithPlayer)
     {
         int npcNetId;
         if (ContentSamples.NpcNetIdsByPersistentIds.TryGetValue(key, out npcNetId))
         {
             NetManager.Instance.SendToClient(NetBestiaryModule.SerializeChat(npcNetId), playerIndex);
         }
     }
 }