source: binary-improvements/AllocsCommands/PrivateMessageConnections.cs@ 362

Last change on this file since 362 was 326, checked in by alloc, 6 years ago

More cleanup, allocation improvements

File size: 716 bytes
Line 
1using System.Collections.Generic;
2using Steamworks;
3
4namespace AllocsFixes.CustomCommands {
5 public class PrivateMessageConnections {
6 private static readonly Dictionary<CSteamID, CSteamID> senderOfLastPM = new Dictionary<CSteamID, CSteamID> ();
7
8 public static void SetLastPMSender (ClientInfo _sender, ClientInfo _receiver) {
9 senderOfLastPM [_receiver.steamId] = _sender.steamId;
10 }
11
12 public static ClientInfo GetLastPMSenderForPlayer (ClientInfo _player) {
13 if (!senderOfLastPM.ContainsKey (_player.steamId)) {
14 return null;
15 }
16
17 CSteamID recSteamId = senderOfLastPM [_player.steamId];
18 ClientInfo recInfo = ConnectionManager.Instance.Clients.ForSteamId (recSteamId);
19 return recInfo;
20 }
21 }
22}
Note: See TracBrowser for help on using the repository browser.