- Timestamp:
- Aug 9, 2017, 7:43:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/PrivateMessageConnections.cs
r251 r309 1 1 using System; 2 2 using System.Collections.Generic; 3 using Steamworks; 3 4 4 5 namespace AllocsFixes.CustomCommands … … 6 7 public class PrivateMessageConnections 7 8 { 8 private static Dictionary<C lientInfo, ClientInfo> senderOfLastPM = new Dictionary<ClientInfo, ClientInfo> ();9 private static Dictionary<CSteamID, CSteamID> senderOfLastPM = new Dictionary<CSteamID, CSteamID> (); 9 10 10 11 public static void SetLastPMSender (ClientInfo _sender, ClientInfo _receiver) 11 12 { 12 if (senderOfLastPM.ContainsKey (_receiver)) 13 senderOfLastPM [_receiver] = _sender; 14 else 15 senderOfLastPM.Add (_receiver, _sender); 13 senderOfLastPM [_receiver.steamId] = _sender.steamId; 16 14 } 17 15 18 16 public static ClientInfo GetLastPMSenderForPlayer (ClientInfo _player) 19 17 { 20 if (senderOfLastPM.ContainsKey (_player)) 21 return senderOfLastPM [_player]; 18 if (senderOfLastPM.ContainsKey (_player.steamId)) { 19 CSteamID recSteamId = senderOfLastPM [_player.steamId]; 20 ClientInfo recInfo = ConnectionManager.Instance.GetClientInfoForSteamId (recSteamId); 21 return recInfo; 22 } 22 23 return null; 23 24 }
Note:
See TracChangeset
for help on using the changeset viewer.