예제 #1
0
        ////////////////

        internal void Update()
        {
            if (!this.IsInitialized)
            {
                return;
            }
            if (!this.IsMismatched)
            {
                return;
            }
//if( (this.ExitDuration % 60) == 0 ) {LogHelpers.Log( "bye? IsInitialized:"+this.IsInitialized+" IsMismatched:"+this.IsMismatched+"," + ( this.ExitDuration / 60) );}

            if (Main.netMode == 2 && !this.MismatchBroadcastMade)
            {
                var modworld = HamstarHelpersMod.Instance.GetModWorld <HamstarHelpersWorld>();

                if (LoadHelpers.IsWorldSafelyBeingPlayed())
                {
                    this.MismatchBroadcastMade = true;

                    int eta = this.ExitDuration / 60;
                    var msg = NetworkText.FromLiteral("World mod mismatch found. Server shutting down in " + eta + " seconds.");

                    NetMessage.BroadcastChatMessage(msg, Color.Red, -1);
                }
            }

            if (this.ExitDuration > 0)
            {
                this.ExitDuration--;
            }
            else
            {
                if (Main.netMode == 0 || Main.netMode == 1)
                {
                    TmlHelpers.ExitToMenu(false);
                }
                else if (Main.netMode == 2)
                {
                    TmlHelpers.ExitToDesktop(false);
                }
            }
        }