コード例 #1
0
 private void LogError(String message, Exception e)
 {
     Message(message);
     Slot.AddSlot("Error message in tag").Tag = e.Message;
     UniLog.Error(message, false);
     UniLog.Error(e.Message, true);
 }
コード例 #2
0
        /// <summary>
        /// Overrides the internal definitions of CompatabilityHash and Version String in FrooxEngine
        /// </summary>
        /// <param name="compatHash">the new CompatabilityHash string</param>
        /// <param name="appVersion">the new Version string</param>
        /// <param name="Engine">Reference to FrooxEngine</param>
        public static void SetHash(string compatHash, string appVersion, Engine Engine)
        {
            var versionStringField = typeof(Engine).GetField("_versionString", BindingFlags.NonPublic | BindingFlags.Static);
            var compatHashProperty = typeof(Engine).GetProperty("CompatibilityHash");
            var userStatusField    = typeof(StatusManager).GetField("status", BindingFlags.NonPublic | BindingFlags.Instance);

            try
            {
                versionStringField.SetValue(Engine, appVersion);
                compatHashProperty.SetValue(Engine, compatHash, null);
                if (userStatusField.GetValue(Engine.Cloud.Status) is UserStatus status)
                {
                    status.CompatibilityHash = compatHash;
                    status.NeosVersion       = appVersion;
                    CurrentVersion           = appVersion;
                    CurrentHash = compatHash;
                }
                else
                {
                    UniLog.Error("Failed to override UserStatus CompatibilityHash", false);
                }
            }
            catch (Exception ex)
            {
                UniLog.Error("Failed to override Engine CompatibilityHash: " + ex.ToString(), false);
            }
        }