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

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