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