Changeset 111 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Jul 26, 2014, 6:38:49 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/CommonMappingFunctions.cs
r110 r111 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Text.RegularExpressions; 3 4 using ManagedSteam.SteamTypes; 4 5 … … 101 102 } 102 103 103 public static ClientInfo GetClientInfoFromPlayerName (string _playerName )104 public static ClientInfo GetClientInfoFromPlayerName (string _playerName, bool ignoreColorcodes) 104 105 { 105 106 try { … … 107 108 108 109 _playerName = _playerName.ToLower (); 110 if (ignoreColorcodes) { 111 _playerName = Regex.Replace (_playerName, "\\[[0-9a-fA-F]{6}\\]", ""); 112 } 109 113 foreach (ClientInfo ci in cm.connectedClients.Values) { 110 if (GetPlayerName (ci).ToLower ().Equals (_playerName)) { 114 string curName = GetPlayerName (ci).ToLower (); 115 if (ignoreColorcodes) { 116 curName = Regex.Replace (curName, "\\[[0-9a-fA-F]{6}\\]", ""); 117 } 118 if (curName.Equals (_playerName)) { 111 119 return ci; 112 120 } … … 118 126 } 119 127 120 public static ClientInfo GetClientInfoFromNameOrID (string _nameOrId )128 public static ClientInfo GetClientInfoFromNameOrID (string _nameOrId, bool ignoreColorcodes) 121 129 { 122 130 try { … … 128 136 } 129 137 130 return GetClientInfoFromPlayerName (_nameOrId );138 return GetClientInfoFromPlayerName (_nameOrId, ignoreColorcodes); 131 139 } catch (Exception e) { 132 140 Log.Out ("Error getting ClientInfo for entity ID or player name: " + e); … … 142 150 string curId = string.Empty + ((SteamID)kvp.Value).AsUInt64; 143 151 if (curId.Equals (_steamId)) { 144 return GetClientInfoFromPlayerName (kvp.Key );152 return GetClientInfoFromPlayerName (kvp.Key, false); 145 153 } 146 154 } -
binary-improvements/7dtd-server-fixes/src/TelnetCommands/SayToPlayer.cs
r108 r111 51 51 } 52 52 53 ClientInfo receiver = CommonMappingFunctions.GetClientInfoFromNameOrID (_params [0] );53 ClientInfo receiver = CommonMappingFunctions.GetClientInfoFromNameOrID (_params [0], true); 54 54 if (receiver != null) { 55 55 SendMessage (receiver, _sender, message);
Note:
See TracChangeset
for help on using the changeset viewer.