Esempio n. 1
0
        /// <summary>
        /// Update multiplayer state.
        /// </summary>
        void Update()
        {
            Utils.CallSafe("Update", () => {
                Steamworks.SteamAPI.RunCallbacks();

                if (IsInvitePanelVisible())
                {
                    UpdateFriendList();
                }

                gameWorld.Update();
                netManager.Update();


                // Development stuff.
#if !PUBLIC_RELEASE
                devTools.Update();

                if (localPlayer == null)
                {
                    localPlayer = GameObject.Find("PLAYER");
                }
                else
                {
                    devTools.UpdatePlayer(localPlayer);
                }
#endif
            });
        }
Esempio n. 2
0
        public static void DumpWorld(string levelName)
        {
            Utils.CallSafe("DUmpWorld", () => {
                Development.WorldDumper worldDumper = new Development.WorldDumper();
                var dumpFolder = ModUtils.GetPath($"HTMLWorldDump\\{levelName}");
                if (Directory.Exists(dumpFolder))
                {
                    Directory.Delete(dumpFolder, true);
                }

                Directory.CreateDirectory(dumpFolder);

                var watch = Stopwatch.StartNew();

                worldDumper.Dump(dumpFolder);

                Logger.Log($"World dump finished - took {watch.ElapsedMilliseconds} ms");
            });

            /*GameObject[] gos = gos = GameObject.FindObjectsOfType<GameObject>();
             *
             * string path = Client.GetPath($"WorldDump\\{levelName}");
             * Directory.CreateDirectory(path);
             *
             * StringBuilder builder = new StringBuilder();
             * int index = 0;
             * foreach (GameObject go in gos) {
             *      Transform trans = go.GetComponent<Transform>();
             *      if (trans == null || trans.parent != null) continue;
             *
             *      string SanitizedName = go.name;
             *      SanitizedName = SanitizedName.Replace("/", "");
             *      string dumpFilePath = path + "\\" + SanitizedName + ".txt";
             *      try {
             *              DumpObject(trans, dumpFilePath);
             *      }
             *      catch (Exception e) {
             *              Logger.Log("Unable to dump objects: " + SanitizedName + "\n");
             *              Logger.Log(e.Message + "\n");
             *      }
             *
             *      builder.Append(go.name + " (" + SanitizedName + "), Trans: " +
             * trans.position.ToString() + "\n");
             ++index;
             * }
             *
             * System.IO.File.WriteAllText(path + "\\dumpLog.txt", builder.ToString());*/
        }
Esempio n. 3
0
        /// <summary>
        /// Update multiplayer state.
        /// </summary>
        void LateUpdate()
        {
            Utils.CallSafe("Update", () => {
                Steamworks.SteamAPI.RunCallbacks();

                if (IsInvitePanelVisible())
                {
                    UpdateFriendList();
                }

                gameWorld.Update();
                netManager.Update();

                // Development stuff.
#if !PUBLIC_RELEASE
                DevTools.Update();
#endif
            });
        }
Esempio n. 4
0
 /// <summary>
 /// Fixed update multiplayer state.
 /// </summary>
 void FixedUpdate()
 {
     Utils.CallSafe("FixedUpdate", () => {
         netManager.FixedUpdate();
     });
 }