|
Last change
on this file since 332 was 326, checked in by alloc, 7 years ago |
|
More cleanup, allocation improvements
|
|
File size:
716 bytes
|
| Rev | Line | |
|---|
| [251] | 1 | using System.Collections.Generic;
|
|---|
| [309] | 2 | using Steamworks;
|
|---|
| [251] | 3 |
|
|---|
| [325] | 4 | namespace AllocsFixes.CustomCommands {
|
|---|
| 5 | public class PrivateMessageConnections {
|
|---|
| 6 | private static readonly Dictionary<CSteamID, CSteamID> senderOfLastPM = new Dictionary<CSteamID, CSteamID> ();
|
|---|
| [251] | 7 |
|
|---|
| [325] | 8 | public static void SetLastPMSender (ClientInfo _sender, ClientInfo _receiver) {
|
|---|
| [309] | 9 | senderOfLastPM [_receiver.steamId] = _sender.steamId;
|
|---|
| [251] | 10 | }
|
|---|
| 11 |
|
|---|
| [325] | 12 | public static ClientInfo GetLastPMSenderForPlayer (ClientInfo _player) {
|
|---|
| [326] | 13 | if (!senderOfLastPM.ContainsKey (_player.steamId)) {
|
|---|
| 14 | return null;
|
|---|
| [309] | 15 | }
|
|---|
| [325] | 16 |
|
|---|
| [326] | 17 | CSteamID recSteamId = senderOfLastPM [_player.steamId];
|
|---|
| 18 | ClientInfo recInfo = ConnectionManager.Instance.Clients.ForSteamId (recSteamId);
|
|---|
| 19 | return recInfo;
|
|---|
| [251] | 20 | }
|
|---|
| 21 | }
|
|---|
| [325] | 22 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.