Build 0.21.6.0 (1.0 pre-patch)

This commit is contained in:
Regalis11
2023-01-31 18:08:26 +02:00
parent e1c04bc31d
commit cf9ecd35b3
231 changed files with 4479 additions and 2276 deletions
@@ -29,49 +29,6 @@ namespace Barotrauma
static partial class ToolBox
{
internal static class Epoch
{
private static readonly DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
/// <summary>
/// Returns the current Unix Epoch (Coordinated Universal Time)
/// </summary>
public static int NowUTC
{
get
{
return (int)(DateTime.UtcNow.Subtract(epoch).TotalSeconds);
}
}
/// <summary>
/// Returns the current Unix Epoch (user's current time)
/// </summary>
public static int NowLocal
{
get
{
return (int)(DateTime.Now.Subtract(epoch).TotalSeconds);
}
}
/// <summary>
/// Convert an epoch to a datetime
/// </summary>
public static DateTime ToDateTime(decimal unixTime)
{
return epoch.AddSeconds((long)unixTime);
}
/// <summary>
/// Convert a DateTime to a unix time
/// </summary>
public static uint FromDateTime(DateTime dt)
{
return (uint)(dt.Subtract(epoch).TotalSeconds);
}
}
public static bool IsProperFilenameCase(string filename)
{
//File case only matters on Linux where the filesystem is case-sensitive, so we don't need these errors in release builds.