Ignore:
Timestamp:
Aug 9, 2017, 7:43:07 PM (7 years ago)
Author:
alloc
Message:

Fixes 14_16_21

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/AllocsCommands/PrivateMessageConnections.cs

    r251 r309  
    11using System;
    22using System.Collections.Generic;
     3using Steamworks;
    34
    45namespace AllocsFixes.CustomCommands
     
    67        public class PrivateMessageConnections
    78        {
    8                 private static Dictionary<ClientInfo, ClientInfo> senderOfLastPM = new Dictionary<ClientInfo, ClientInfo> ();
     9                private static Dictionary<CSteamID, CSteamID> senderOfLastPM = new Dictionary<CSteamID, CSteamID> ();
    910
    1011                public static void SetLastPMSender (ClientInfo _sender, ClientInfo _receiver)
    1112                {
    12                         if (senderOfLastPM.ContainsKey (_receiver))
    13                                 senderOfLastPM [_receiver] = _sender;
    14                         else
    15                                 senderOfLastPM.Add (_receiver, _sender);
     13                        senderOfLastPM [_receiver.steamId] = _sender.steamId;
    1614                }
    1715
    1816                public static ClientInfo GetLastPMSenderForPlayer (ClientInfo _player)
    1917                {
    20                         if (senderOfLastPM.ContainsKey (_player))
    21                                 return senderOfLastPM [_player];
     18                        if (senderOfLastPM.ContainsKey (_player.steamId)) {
     19                                CSteamID recSteamId = senderOfLastPM [_player.steamId];
     20                                ClientInfo recInfo = ConnectionManager.Instance.GetClientInfoForSteamId (recSteamId);
     21                                return recInfo;
     22                        }
    2223                        return null;
    2324                }
Note: See TracChangeset for help on using the changeset viewer.