Inheritance: global::ProtoBuf.IExtensible
Exemplo n.º 1
0
        // ---------- system ----------
        public void UpdateSystemStatus(ResponseSystemStatus msg)
        {
            if (msg.status != null && msg.status.code == Status.StatusCode.SUCCESS)
            {
                gb_systemStatus.Text = "System Status: Running!";

                switch (msg.net_status)
                {
                    case ResponseSystemStatus.NetCode.BAD_NATSYM:
                        l_network.Text = "BAD: symmetric NAT";
                        break;
                    case ResponseSystemStatus.NetCode.BAD_NODHT_NAT:
                        l_network.Text = "BAD: natted/no DHT";
                        break;
                    case ResponseSystemStatus.NetCode.BAD_OFFLINE:
                        l_network.Text = "BAD: offline";
                        break;
                    case ResponseSystemStatus.NetCode.BAD_UNKNOWN:
                        l_network.Text = "BAD: unknown";
                        break;
                    case ResponseSystemStatus.NetCode.WARNING_NATTED:
                        l_network.Text = "Warning: natted";
                        break;
                    case ResponseSystemStatus.NetCode.WARNING_NODHT:
                        l_network.Text = "Warning: no DHT";
                        break;
                    case ResponseSystemStatus.NetCode.WARNING_RESTART:
                        l_network.Text = "Warning: restarting";
                        break;
                    case ResponseSystemStatus.NetCode.ADV_FORWARD:
                        l_network.Text = "GOD: adv. forward";
                        break;
                    case ResponseSystemStatus.NetCode.GOOD:
                        l_network.Text = "GOD :)";
                        break;
                }

                l_connected.Text = "Connected: " + Convert.ToString(msg.no_connected);
                l_peers.Text = "Peers: " + Convert.ToString(msg.no_peers);

                l_bwUp.Text = "Up: " + String.Format("{0:0,0.00}", msg.bw_total.up) + "kb/s";
                l_bwDown.Text = "Down: " + String.Format("{0:0,0.00}", msg.bw_total.down) + "kb/s";
            }
            else if (msg.status != null && msg.status.code == Status.StatusCode.READMSG)
                gb_systemStatus.Text = "System Status: " + msg.status.msg;
            else
                gb_systemStatus.Text = "System Status: Error";
        }
Exemplo n.º 2
0
 private void ProcessSystemStatus(RSProtoBuffSSHMsg msg)
 {
     ResponseSystemStatus response = new ResponseSystemStatus();
     Exception e;
     if (RSProtoBuf.Deserialize<ResponseSystemStatus>(msg.ProtoBuffMsg, out response, out e))
         _b.GUI.UpdateSystemStatus(response);
     else
         System.Diagnostics.Debug.WriteLine("ProcessSystemstatus: error deserializing " + e.Message);
 }