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

Last change on this file since 396 was 369, checked in by alloc, 3 years ago

Preparations for A20 release
Changes usage of "SteamID" to "UserID" in console commands
Also changes a bunch of the WebAPI stuff to show / use UserIDs

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