Exemple #1
0
            public FieldSave(PersistentDialog parent, Type type, object value) : this(parent)
            {
                this.type  = type;
                typeName   = type.FullName;
                this.value = value;

                if (typeof(Delegate).IsAssignableFrom(type))
                {
                    mode = (LookMode)101;
                }
                else if (ParseHelper.HandlesType(type))
                {
                    mode = LookMode.Value;
                }
                else if (typeof(Def).IsAssignableFrom(type))
                {
                    mode = LookMode.Def;
                }
                else if (value is Thing thing && !thing.Spawned)
                {
                    mode = LookMode.Deep;
                }
Exemple #2
0
 public FieldSave(PersistentDialog parent)
 {
     this.parent = parent;
 }
Exemple #3
0
 public DiaOptionSave(PersistentDialog parent, DiaOption opt) : this(parent)
 {
     this.opt = opt;
 }
Exemple #4
0
 public DiaOptionSave(PersistentDialog parent)
 {
     this.parent = parent;
 }
Exemple #5
0
 public DiaNodeSave(PersistentDialog parent, DiaNode node) : this(parent)
 {
     this.node = node;
 }
Exemple #6
0
 public DiaNodeSave(PersistentDialog parent)
 {
     this.parent = parent;
 }
Exemple #7
0
        static MultiplayerStatic()
        {
            Native.InitLmfPtr();

            // UnityEngine.Debug.Log instead of Verse.Log.Message because the server runs on its own thread
            ServerLog.info  = str => UnityEngine.Debug.Log($"MpServerLog: {str}");
            ServerLog.error = str => UnityEngine.Debug.Log($"MpServerLog Error: {str}");
            NetDebug.Logger = new ServerLog();

            SetUsername();

            if (SteamManager.Initialized)
            {
                SteamIntegration.InitCallbacks();
            }

            Log.Message($"Multiplayer version {MpVersion.Version}");
            Log.Message($"Player's username: {Multiplayer.username}");

            var persistentObj = new GameObject();

            persistentObj.AddComponent <OnMainThread>();
            UnityEngine.Object.DontDestroyOnLoad(persistentObj);

            MpConnectionState.SetImplementation(ConnectionStateEnum.ClientSteam, typeof(ClientSteamState));
            MpConnectionState.SetImplementation(ConnectionStateEnum.ClientJoining, typeof(ClientJoiningState));
            MpConnectionState.SetImplementation(ConnectionStateEnum.ClientPlaying, typeof(ClientPlayingState));

            MultiplayerData.CollectCursorIcons();

            PersistentDialog.BindAll(typeof(Multiplayer).Assembly);

            using (DeepProfilerWrapper.Section("Multiplayer MpPatches"))
                Multiplayer.harmony.DoAllMpPatches();

            using (DeepProfilerWrapper.Section("Multiplayer patches"))
                DoPatches();

            Log.messageQueue.maxMessages = 1000;

            DoubleLongEvent(() =>
            {
                MultiplayerData.CollectDefInfos();
                Sync.PostInitHandlers();
            }, "Loading"); // Right before the events from HandleCommandLine

            HandleRestartConnect();
            HandleCommandLine();

            if (Multiplayer.arbiterInstance)
            {
                RuntimeHelpers.RunClassConstructor(typeof(Text).TypeHandle);
            }

            using (DeepProfilerWrapper.Section("Multiplayer TakeModDataSnapshot"))
                JoinData.TakeModDataSnapshot();

            using (DeepProfilerWrapper.Section("MultiplayerData PrecacheMods"))
                MultiplayerData.PrecacheMods();

            if (GenCommandLine.CommandLineArgPassed("profiler"))
            {
                SimpleProfiler.Print("mp_prof_out.txt");
            }
        }