Changeset 91 for binary-improvements/7dtd-server-fixes/src/TelnetCommands
- Timestamp:
- Jul 20, 2014, 3:41:46 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src/TelnetCommands
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/TelnetCommands/GetGamePrefs.cs
r83 r91 45 45 public override void Run (string[] _params) 46 46 { 47 if (_params.Length <= 0) { 47 EnumGamePrefs enumGamePrefs = EnumGamePrefs.Last; 48 49 if (_params.Length > 0) { 50 try { 51 enumGamePrefs = (EnumGamePrefs)((int)Enum.Parse (typeof(EnumGamePrefs), _params [0])); 52 } catch (Exception) { 53 } 54 } 55 56 if (enumGamePrefs == EnumGamePrefs.Last) { 48 57 SortedList<string, string> sortedList = new SortedList<string, string> (); 49 58 foreach (EnumGamePrefs gp in Enum.GetValues(typeof(EnumGamePrefs))) { 50 if (prefAccessAllowed (gp)) 51 sortedList.Add (gp.ToString (), string.Format ("{0} = {1}", gp.ToString (), GamePrefs.GetObject (gp))); 59 if ((_params.Length == 0) || (gp.ToString ().ToLower ().Contains (_params [0].ToLower ()))) { 60 if (prefAccessAllowed (gp)) { 61 sortedList.Add (gp.ToString (), string.Format ("{0} = {1}", gp.ToString (), GamePrefs.GetObject (gp))); 62 } 63 } 52 64 } 53 65 foreach (string s in sortedList.Keys) { 54 66 m_Console.md000a (sortedList [s]); 55 67 } 56 return; 68 } else { 69 if (prefAccessAllowed (enumGamePrefs)) 70 m_Console.md000a (string.Format ("{0} = {1}", enumGamePrefs, GamePrefs.GetObject (enumGamePrefs))); 71 else 72 m_Console.md000a ("Access to requested preference is forbidden"); 57 73 } 58 59 EnumGamePrefs enumGamePrefs;60 try {61 enumGamePrefs = (EnumGamePrefs)((int)Enum.Parse (typeof(EnumGamePrefs), _params [0]));62 } catch (Exception) {63 m_Console.md000a ("Error parsing parameter: " + _params [0]);64 return;65 }66 67 if (prefAccessAllowed (enumGamePrefs))68 m_Console.md000a (string.Format ("{0} = {1}", enumGamePrefs, GamePrefs.GetObject (enumGamePrefs)));69 else70 m_Console.md000a ("Access to requested preference is forbidden");71 74 } 72 75 } -
binary-improvements/7dtd-server-fixes/src/TelnetCommands/ListPlayersExtended.cs
r76 r91 60 60 SingletonMonoBehaviour<Authenticator>.Instance.GetPlayerId (current.Value.EntityName), 61 61 ", ip=", 62 ip 62 ip, 63 ", ping=", 64 current.Value.pingToServer 63 65 })); 64 66 }
Note:
See TracChangeset
for help on using the changeset viewer.