public void OnPlayerJoining(int playerIndex) { foreach (KeyValuePair <string, int> item in _killCountsByNpcId) { int npcNetId = ContentSamples.NpcNetIdsByPersistentIds[item.Key]; NetManager.Instance.SendToClient(NetBestiaryModule.SerializeKillCount(npcNetId, item.Value), playerIndex); } }
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 OnPlayerJoining(int playerIndex) { foreach (string item in _chattedWithPlayer) { if (ContentSamples.NpcNetIdsByPersistentIds.TryGetValue(item, out var value)) { NetManager.Instance.SendToClient(NetBestiaryModule.SerializeChat(value), playerIndex); } } }
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); } } }
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)); } }
public void RegisterKill(NPC npc) { string bestiaryCreditId = npc.GetBestiaryCreditId(); _killCountsByNpcId.TryGetValue(bestiaryCreditId, out var value); value++; _killCountsByNpcId[bestiaryCreditId] = Utils.Clamp(value, 0, 9999); if (Main.netMode == 2) { NetManager.Instance.Broadcast(NetBestiaryModule.SerializeKillCount(npc.netID, value)); } }
public void RegisterKill(NPC npc) { string bestiaryCreditId = npc.GetBestiaryCreditId(); int num; this._killCountsByNpcId.TryGetValue(bestiaryCreditId, out num); int killcount = num + 1; this._killCountsByNpcId[bestiaryCreditId] = Utils.Clamp <int>(killcount, 0, 9999); if (Main.netMode != 2) { return; } NetManager.Instance.Broadcast(NetBestiaryModule.SerializeKillCount(npc.netID, killcount), -1); }