source: binary-improvements2/AllocsCommands/PrivateMessageConnections.cs@ 384

Last change on this file since 384 was 383, checked in by alloc, 2 years ago

Fixed a bunch of warnings

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