コード例 #1
0
    private void UpdateStatus()
    {
        if ((double)this.nextUpdate > (double)Time.get_realtimeSinceStartup() || Net.sv == null || !((Server)Net.sv).IsConnected())
        {
            return;
        }
        this.nextUpdate = Time.get_realtimeSinceStartup() + 0.33f;
        if (!this.input.valid)
        {
            return;
        }
        string str1 = NumberExtensions.FormatSeconds((long)Time.get_realtimeSinceStartup());
        string str2 = " " + this.currentGameTime.ToString("[H:mm]") + " [" + (object)this.currentPlayerCount + "/" + (object)this.maxPlayerCount + "] " + Server.hostname + " [" + Server.level + "]";
        string str3 = Performance.current.frameRate.ToString() + "fps " + (object)Performance.current.memoryCollections + "gc " + str1 ?? "";
        string str4 = NumberExtensions.FormatBytes <ulong>((M0)(long)((NetworkPeer)Net.sv).GetStat((Connection)null, (NetworkPeer.StatTypeLong) 3), true) + "/s in, " + NumberExtensions.FormatBytes <ulong>((M0)(long)((NetworkPeer)Net.sv).GetStat((Connection)null, (NetworkPeer.StatTypeLong) 1), true) + "/s out";
        string str5 = str3.PadLeft(this.input.lineWidth - 1);
        string str6 = str2 + (str2.Length < str5.Length ? str5.Substring(str2.Length) : "");
        string str7 = " " + this.currentEntityCount.ToString("n0") + " ents, " + this.currentSleeperCount.ToString("n0") + " slprs";
        string str8 = str4.PadLeft(this.input.lineWidth - 1);
        string str9 = str7 + (str7.Length < str8.Length ? str8.Substring(str7.Length) : "");

        this.input.statusText[0] = "";
        this.input.statusText[1] = str6;
        this.input.statusText[2] = str9;
    }
コード例 #2
0
 public override string DebugText()
 {
     return(string.Format("State: {0}\nGenetics: {1:0.00}\nHealth: {2:0.00}\nGroundCondition: {3:0.00}\nHappiness: {4:0.00}\nWater: {5:0.00}\nAge: {6}", (object)this.state, (object)this.genetics, (object)this.health, (object)this.groundConditions, (object)this.Happiness(), (object)this.water, (object)NumberExtensions.FormatSeconds((long)this.realAge)));
 }