Changeset 91 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Jul 20, 2014, 3:41:46 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.userprefs
r75 r91 1 1 <Properties> 2 2 <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" /> 3 <MonoDevelop.Ide.Workbench ActiveDocument="src/ AllocsTelnetCommand.cs">3 <MonoDevelop.Ide.Workbench ActiveDocument="src/TelnetCommands/GetGamePrefs.cs"> 4 4 <Files> 5 <File FileName="src/AssemblyInfo.cs" Line="1" Column="1" /> 6 <File FileName="src/AllocsNetTelnetServer.cs" Line="40" Column="101" /> 7 <File FileName="src/AllocsTelnetConnection.cs" Line="16" Column="34" /> 8 <File FileName="src/AllocsTelnetCommand.cs" Line="3" Column="4" /> 5 <File FileName="src/AssemblyInfo.cs" Line="20" Column="40" /> 6 <File FileName="src/AllocsNetTelnetServer.cs" Line="33" Column="1" /> 7 <File FileName="src/AllocsTelnetConnection.cs" Line="44" Column="42" /> 8 <File FileName="src/AllocsLogFunctions.cs" Line="27" Column="42" /> 9 <File FileName="src/TelnetCommands/GetGamePrefs.cs" Line="71" Column="3" /> 10 <File FileName="src/TelnetCommands/ListPlayersExtended.cs" Line="49" Column="17" /> 11 <File FileName="src/TelnetCommands/SayToPlayer.cs" Line="75" Column="33" /> 12 <File FileName="src/AdminToolsStuff.cs" Line="30" Column="54" /> 9 13 </Files> 10 14 </MonoDevelop.Ide.Workbench> -
binary-improvements/7dtd-server-fixes/src/AllocsNetTelnetServer.cs
r84 r91 91 91 c.WriteLine ("*** Connected with 7DTD server."); 92 92 c.WriteLine ("*** Server version: Alpha 8.7 (b29) Compatibility Version: Alpha 8.7"); 93 c.WriteLine ("*** Allocs server fixes loaded"); 93 94 c.WriteLine (string.Empty); 94 95 c.WriteLine ("Server IP: " + -
binary-improvements/7dtd-server-fixes/src/AllocsTelnetConnection.cs
r75 r91 34 34 public void WriteLine (string s) 35 35 { 36 if (!IsClosed () && stream.CanWrite) { 37 for (int i = 0; i < s.Length; i++) { 38 WriteByte ((byte)s [i]); 36 try { 37 if (!IsClosed () && stream.CanWrite) { 38 for (int i = 0; i < s.Length; i++) { 39 WriteByte ((byte)s [i]); 40 } 41 WriteByte (10); 39 42 } 40 WriteByte (10); 43 } catch (Exception e) { 44 Log.Out("Error writing to client: " + e); 41 45 } 42 46 } -
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.