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

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

Code style cleanup (mostly whitespace changes, enforcing braces, using cleanup)

File size: 717 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 CSteamID recSteamId = senderOfLastPM [_player.steamId];
15 ClientInfo recInfo = ConnectionManager.Instance.Clients.ForSteamId (recSteamId);
16 return recInfo;
17 }
18
19 return null;
20 }
21 }
22}
Note: See TracBrowser for help on using the repository browser.