- Timestamp:
- Apr 30, 2015, 1:55:16 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/PersistentData/Players.cs
r202 r233 11 11 private Dictionary<string, Player> players = new Dictionary<string, Player> (); 12 12 13 public Player this [string steamId ] {13 public Player this [string steamId, bool create] { 14 14 get { 15 15 if (players.ContainsKey (steamId)) 16 16 return players [steamId]; 17 17 else { 18 if ( steamId != null && steamId.Length == 17) {18 if (create && steamId != null && steamId.Length == 17) { 19 19 Log.Out ("Created new player entry for ID: " + steamId); 20 20 Player p = new Player (steamId); … … 35 35 } 36 36 37 public Player GetPlayerByClientId (int _clientid) 38 { 39 foreach (Player p in players.Values) { 40 if (p.ClientInfo != null && p.ClientInfo.clientId == _clientid) { 41 return p; 42 } 43 } 44 return null; 45 } 46 47 public Player GetPlayerByNameOrId (string _nameOrId, bool _ignoreColorCodes) 48 { 49 string sid = GetSteamID (_nameOrId, _ignoreColorCodes); 50 if (sid != null) 51 return this [sid]; 52 else 53 return null; 54 } 37 // public Player GetPlayerByNameOrId (string _nameOrId, bool _ignoreColorCodes) 38 // { 39 // string sid = GetSteamID (_nameOrId, _ignoreColorCodes); 40 // if (sid != null) 41 // return this [sid]; 42 // else 43 // return null; 44 // } 55 45 56 46 public string GetSteamID (string _nameOrId, bool _ignoreColorCodes)
Note:
See TracChangeset
for help on using the changeset viewer.