コード例 #1
0
        /// <summary>
        /// Commands to power off the console.
        /// </summary>
        /// <param name="ip"></param>
        /// <param name="flag"></param>
        public static void Power(string ip, PowerFlags flag)
        {
            switch (flag)
            {
            case PowerFlags.QuickReboot:
                HandleRequest(ip, "reboot.ps3?quick");
                break;

            case PowerFlags.SoftReboot:
                HandleRequest(ip, "reboot.ps3?soft");
                break;

            case PowerFlags.HardReboot:
                HandleRequest(ip, "reboot.ps3?hard");
                break;

            case PowerFlags.Shutdown:
                HandleRequest(ip, "shutdown.ps3");
                break;

            case PowerFlags.Restart:
                HandleRequest(ip, "restart.ps3");
                break;
            }
        }
コード例 #2
0
ファイル: MafiaGame.cs プロジェクト: Enervate/NoxMafiaBot
 public PlayerRole(string RoleName, string RoleDescription, PowerFlags RolePowers, int[] PowerCharges, PlayerAlignment RoleAlignment)
 {
     Name        = RoleName;
     Description = RoleDescription;
     Powers      = RolePowers;
     Charges     = PowerCharges;
     Alignment   = RoleAlignment;
 }
コード例 #3
0
ファイル: Webman.cs プロジェクト: StarmanX32/StarmanLib
        /// <summary>
        /// Power options for the PS3
        /// </summary>
        /// <param name="flag"></param>
        public void Power(PowerFlags flag)
        {
            if (flag == PowerFlags.QuickReboot)
            {
                WebRequest  cidpsid = WebRequest.Create("http://" + ip + "/reboot.ps3?quick");
                WebResponse rsp     = cidpsid.GetResponse();

                using (Stream dataStream = rsp.GetResponseStream())
                {
                    StreamReader rd = new StreamReader(dataStream);
                    rd.ReadToEnd();
                }
                rsp.Close();
            }
            else if (flag == PowerFlags.SoftReboot)
            {
                WebRequest  cidpsid = WebRequest.Create("http://" + ip + "/reboot.ps3?soft");
                WebResponse rsp     = cidpsid.GetResponse();

                using (Stream dataStream = rsp.GetResponseStream())
                {
                    StreamReader rd = new StreamReader(dataStream);
                    rd.ReadToEnd();
                }
                rsp.Close();
            }
            else if (flag == PowerFlags.HardReboot)
            {
                WebRequest  cidpsid = WebRequest.Create("http://" + ip + "/reboot.ps3?hard");
                WebResponse rsp     = cidpsid.GetResponse();

                using (Stream dataStream = rsp.GetResponseStream())
                {
                    StreamReader rd = new StreamReader(dataStream);
                    rd.ReadToEnd();
                }
                rsp.Close();
            }
            else if (flag == PowerFlags.Shutdown)
            {
                WebRequest  cidpsid = WebRequest.Create("http://" + ip + "/shutdown.ps3");
                WebResponse rsp     = cidpsid.GetResponse();

                using (Stream dataStream = rsp.GetResponseStream())
                {
                    StreamReader rd = new StreamReader(dataStream);
                    rd.ReadToEnd();
                }
                rsp.Close();
            }
        }
コード例 #4
0
 /// <summary>You can shutdown the console or just reboot her according the flag selected (CcApi And Ps3mApi Only).</summary>
 public void Power(PowerFlags flag)
 {
     if (SetAPI.API == SelectAPI.ControlConsole)
     {
         if (flag == PowerFlags.ShutDown)
         {
             Common.CcApi.ShutDown(CCAPI.RebootFlags.ShutDown);
         }
         else if (flag == PowerFlags.QuickReboot)
         {
             Common.CcApi.ShutDown(CCAPI.RebootFlags.SoftReboot);
         }
         else if (flag == PowerFlags.SoftReboot)
         {
             Common.CcApi.ShutDown(CCAPI.RebootFlags.SoftReboot);
         }
         else if (flag == PowerFlags.HardReboot)
         {
             Common.CcApi.ShutDown(CCAPI.RebootFlags.HardReboot);
         }
     }
     else if (SetAPI.API == SelectAPI.PS3Manager)
     {
         if (flag == PowerFlags.ShutDown)
         {
             Common.Ps3mApi.Power(PS3ManagerAPI.PS3MAPI.PS3_CMD.PowerFlags.ShutDown);
         }
         else if (flag == PowerFlags.QuickReboot)
         {
             Common.Ps3mApi.Power(PS3ManagerAPI.PS3MAPI.PS3_CMD.PowerFlags.QuickReboot);
         }
         else if (flag == PowerFlags.SoftReboot)
         {
             Common.Ps3mApi.Power(PS3ManagerAPI.PS3MAPI.PS3_CMD.PowerFlags.SoftReboot);
         }
         else if (flag == PowerFlags.HardReboot)
         {
             Common.Ps3mApi.Power(PS3ManagerAPI.PS3MAPI.PS3_CMD.PowerFlags.ShutDown);
         }
     }
 }