修复台湾问题;加服务器时间;
This commit is contained in:
1 parent
584cba79ae
commit
9a4e646a8f
12 files changed
+187
-34
No files matched your search
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// 跟服务器端同步的时间对象
|
||||
/// </summary>
|
||||
public class CustomDateTime
|
||||
{
|
||||
long StartingTime = Stopwatch.GetTimestamp();
|
||||
private DateTime _dateTime;
|
||||
public CustomDateTime(DateTime dateTime)
|
||||
{
|
||||
_dateTime = dateTime;
|
||||
}
|
||||
|
||||
public DateTime GetDateTime()
|
||||
{
|
||||
//Console.WriteLine(Stopwatch.IsHighResolution);
|
||||
long endingTime = Stopwatch.GetTimestamp();
|
||||
long ElapsedTime = endingTime - StartingTime;
|
||||
|
||||
double ElapsedSeconds = ElapsedTime * (1.0 / Stopwatch.Frequency);
|
||||
|
||||
return _dateTime.AddSeconds(ElapsedSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08e8f3be54a1de04e9049674ce33fe23
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user