Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using Steamworks;
|
---|
4 |
|
---|
5 | namespace AllocsFixes.CustomCommands
|
---|
6 | {
|
---|
7 | public class PrivateMessageConnections
|
---|
8 | {
|
---|
9 | private static Dictionary<CSteamID, CSteamID> senderOfLastPM = new Dictionary<CSteamID, CSteamID> ();
|
---|
10 |
|
---|
11 | public static void SetLastPMSender (ClientInfo _sender, ClientInfo _receiver)
|
---|
12 | {
|
---|
13 | senderOfLastPM [_receiver.steamId] = _sender.steamId;
|
---|
14 | }
|
---|
15 |
|
---|
16 | public static ClientInfo GetLastPMSenderForPlayer (ClientInfo _player)
|
---|
17 | {
|
---|
18 | if (senderOfLastPM.ContainsKey (_player.steamId)) {
|
---|
19 | CSteamID recSteamId = senderOfLastPM [_player.steamId];
|
---|
20 | ClientInfo recInfo = ConnectionManager.Instance.GetClientInfoForSteamId (recSteamId);
|
---|
21 | return recInfo;
|
---|
22 | }
|
---|
23 | return null;
|
---|
24 | }
|
---|
25 | }
|
---|
26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.