- Timestamp:
- Sep 22, 2014, 11:54:56 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/CommandExtensions.cs
r163 r198 2 2 using System; 3 3 using System.Collections.Generic; 4 using System.Reflection; 4 5 5 6 namespace AllocsFixes … … 11 12 try { 12 13 ConsoleSdtd cons = manager.m_GUIConsole; 13 cons.AddCommand (new CreativeMenu (cons)); 14 cons.AddCommand (new EnableRendering (cons)); 15 cons.AddCommand (new GetGamePrefs (cons)); 16 cons.AddCommand (new GetTime (cons)); 17 cons.AddCommand (new Give (cons)); 18 cons.AddCommand (new Kill (cons)); 19 cons.AddCommand (new ListItems (cons)); 20 cons.AddCommand (new ListKnownPlayers (cons)); 21 cons.AddCommand (new ListLandProtection (cons)); 22 cons.AddCommand (new ListPlayersExtended (cons)); 23 cons.AddCommand (new RemoveLandProtection (cons)); 24 cons.AddCommand (new RenderMap (cons)); 25 cons.AddCommand (new Reply (cons)); 26 cons.AddCommand (new SayToPlayer (cons)); 27 cons.AddCommand (new SetTimeReal (cons)); 28 cons.AddCommand (new ShowInventory (cons)); 29 cons.AddCommand (new TeleportPlayer (cons)); 30 cons.AddCommand (new AllocsFixes.CustomCommands.Version (cons)); 14 string ns = "AllocsFixes.CustomCommands"; 15 string basetype = "ConsoleCommand"; 16 17 foreach (Type t in Assembly.GetExecutingAssembly ().GetTypes()) { 18 if (t.IsClass && t.Namespace.Equals (ns) && t.BaseType.Name.Equals (basetype)) { 19 try { 20 ConstructorInfo ctor = t.GetConstructor (new Type[] {typeof(ConsoleSdtd)}); 21 cons.AddCommand ((ConsoleCommand)ctor.Invoke (new object[] {cons})); 22 } catch (Exception e) { 23 Log.Out ("Could not register custom command \"" + t.Name + "\": " + e); 24 } 25 } 26 } 31 27 } catch (Exception e) { 32 28 Log.Out ("Error registering custom commands: " + e);
Note:
See TracChangeset
for help on using the changeset viewer.