public static void Error(string msg) { DateTime dateTime = DateTime.Now; string s = $"{dateTime.ToString("yyyy-MM-dd HH:mm:ss")} {TimeHelper.ClientNow()} {msg}"; error.WriteLine(s); if (IsNeedFlush) { error.Flush(); } info.WriteLine(s); if (IsNeedFlush) { info.Flush(); } #if UNITY_EDITOR UnityEngine.Debug.LogError(s); #endif long timeNow = TimeHelper.ClientNow(); if (timeNow - SendToServerTime > SendToServerFrequency) { SendToServerTime = timeNow; } }
public void Debug(string msg) { #if UNITY_EDITOR DateTime dateTime = DateTime.Now; string s = $"{dateTime.ToString("yyyy-MM-dd HH:mm:ss")} {TimeHelper.ClientNow()} {msg}"; UnityEngine.Debug.Log(s); #endif }
/// <summary> /// 登陆前是客户端时间,登陆后是同步过的服务器时间 /// </summary> /// <returns></returns> public static long Now() { TimeComponent gameTimeComponent = Game.Scene?.GetComponent <TimeComponent>(); if (gameTimeComponent == null) { return(TimeHelper.ClientNow()); } long t = gameTimeComponent.Now(); return(t); }
public static void Debug(string msg) { #if UNITY_EDITOR DateTime dateTime = DateTime.Now; string s = $"{dateTime.ToString("yyyy-MM-dd HH:mm:ss")} {TimeHelper.ClientNow()} {msg}"; UnityEngine.Debug.Log(s); info.WriteLine(s); if (IsNeedFlush) { info.Flush(); } #endif }
public void Error(string msg) { DateTime dateTime = DateTime.Now; string s = $"{dateTime.ToString("yyyy-MM-dd HH:mm:ss")} {TimeHelper.ClientNow()} {msg}"; error.WriteLine(s); if (IsNeedFlush) { error.Flush(); } #if UNITY_EDITOR UnityEngine.Debug.LogError(s); #endif long timeNow = TimeHelper.ClientNow(); if (timeNow - SendToServerTime > SendToServerFrequency) { SendToServerTime = timeNow; Share.Scene.GetComponent <EventComponent>().Run(EventIdType.LogError, s); } }