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

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

Fixed a bunch of warnings

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