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