- Timestamp:
- Nov 9, 2021, 6:28:33 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/PrivateMessageConnections.cs
r326 r369 4 4 namespace AllocsFixes.CustomCommands { 5 5 public class PrivateMessageConnections { 6 private static readonly Dictionary< CSteamID, CSteamID> senderOfLastPM = new Dictionary<CSteamID, CSteamID> ();6 private static readonly Dictionary<PlatformUserIdentifierAbs, PlatformUserIdentifierAbs> senderOfLastPM = new Dictionary<PlatformUserIdentifierAbs, PlatformUserIdentifierAbs> (); 7 7 8 8 public static void SetLastPMSender (ClientInfo _sender, ClientInfo _receiver) { 9 senderOfLastPM [_receiver. steamId] = _sender.steamId;9 senderOfLastPM [_receiver.InternalId] = _sender.InternalId; 10 10 } 11 11 12 12 public static ClientInfo GetLastPMSenderForPlayer (ClientInfo _player) { 13 if (!senderOfLastPM. ContainsKey (_player.steamId)) {13 if (!senderOfLastPM.TryGetValue (_player.InternalId, out PlatformUserIdentifierAbs recUserId)) { 14 14 return null; 15 15 } 16 16 17 CSteamID recSteamId = senderOfLastPM [_player.steamId]; 18 ClientInfo recInfo = ConnectionManager.Instance.Clients.ForSteamId (recSteamId); 17 ClientInfo recInfo = ConnectionManager.Instance.Clients.ForUserId (recUserId); 19 18 return recInfo; 20 19 }
Note:
See TracChangeset
for help on using the changeset viewer.