mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-10 00:20:36 -04:00
Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
This commit is contained in:
parent
f12ba1502b
commit
22191ce648
591 changed files with 53264 additions and 3362 deletions
27
server/tso.common/Utils/TSOTime.cs
Executable file
27
server/tso.common/Utils/TSOTime.cs
Executable file
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
|
||||
namespace FSO.Common.Utils
|
||||
{
|
||||
public class TSOTime
|
||||
{
|
||||
public static Tuple<int,int,int> FromUTC(DateTime time)
|
||||
{
|
||||
//var count = time.Minute * 60 * 1000 + time.Second * 1000 + time.Millisecond;
|
||||
//count *= 8;
|
||||
//count %= 1000 * 60 * 24;
|
||||
|
||||
//var hour = count / (1000 * 60);
|
||||
//var min = (count / 1000) % 60;
|
||||
//var sec = ((count * 60) / 1000) % 60;
|
||||
|
||||
var hour = time.Hour;
|
||||
var min = time.Minute;
|
||||
var sec = time.Second;
|
||||
var ms = time.Millisecond;
|
||||
|
||||
var cycle = (hour % 2 == 1) ? 3600 : 0;
|
||||
cycle += min * 60 + sec;
|
||||
return new Tuple<int, int, int>(cycle / 300, (cycle % 300) / 5, (cycle % 5)*12 + ((ms * 12) / 1000));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue