- Timestamp:
- Aug 26, 2014, 4:41:47 PM (10 years ago)
- Location:
- binary-improvements/7dtd-server-fixes/src/CustomCommands
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/CustomCommands/GetTime.cs
r107 r130 1 1 using System; 2 2 3 public class GetTime : ConsoleCommand 3 namespace AllocsFixes.CustomCommands 4 4 { 5 public GetTime (ConsoleSdtd cons) : base(cons)5 public class GetTime : ConsoleCommand 6 6 { 7 } 7 public GetTime (ConsoleSdtd cons) : base(cons) 8 { 9 } 8 10 9 public override string Description ()10 {11 return "retrieves current ingame time";12 }11 public override string Description () 12 { 13 return "retrieves current ingame time"; 14 } 13 15 14 public override string[] Names ()15 {16 return new string[] { "gettime", "gt" };17 }16 public override string[] Names () 17 { 18 return new string[] { "gettime", "gt" }; 19 } 18 20 19 public override void Run (string[] _params) 20 { 21 try { 22 ulong time = this.m_Console.gameManager.World.gameTime; 23 int day = (int)(time / 24000) + 1; 24 int hour = (int)(time % 24000) / 1000 + 8; 25 if (hour > 23) { 26 day++; 27 hour -= 24; 21 public override void Run (string[] _params) 22 { 23 try { 24 ulong time = this.m_Console.gameManager.World.gameTime; 25 int day = (int)(time / 24000) + 1; 26 int hour = (int)(time % 24000) / 1000 + 8; 27 if (hour > 23) { 28 day++; 29 hour -= 24; 30 } 31 int min = (int)(time % 1000) * 60 / 1000; 32 m_Console.SendResult (String.Format ("Day {0}, {1:00}:{2:00} ", day, hour, min)); 33 } catch (Exception e) { 34 Log.Out ("Error in GetTime.Run: " + e); 28 35 } 29 int min = (int)(time % 1000) * 60 / 1000;30 m_Console.SendResult (String.Format ("Day {0}, {1:00}:{2:00} ", day, hour, min));31 } catch (Exception e) {32 Log.Out ("Error in GetTime.Run: " + e);33 36 } 34 37 } 35 38 } 36
Note:
See TracChangeset
for help on using the changeset viewer.