コード例 #1
0
        static void Main(string[] args)
        {
            TryWritePid(true);
            Initialize(args);

            EnsureAdminRights();
            // must match values in bamd.exe
            ServiceExe.SetInfo(new ServiceInfo("BamHttpServer", "Bam Http Server", "Bam http application server"));
            ServiceExe.Kill(ServiceExe.Info.ServiceName);
            //
            IsolateMethodCalls = false;

            Type type = typeof(Program);

            AddSwitches(type);
            DefaultMethod = type.GetMethod(nameof(Interactive));

            if (Arguments.Length > 0)
            {
                ExecuteSwitches(Arguments, type, null, null);
            }
            else
            {
                Interactive();
            }
        }
コード例 #2
0
        public ResponseJson NewPlayer(string player, int idGame)
        {
            Player newPlayer = new Player {
                Name = player, IdGame = idGame
            };
            ServiceExe service = new ServiceExe(newPlayer);

            return(service.Create());
        }
コード例 #3
0
        public ResponseJson NewMove(int idGame, int idMove, int idPlayer, int idRound)
        {
            Move newMove = new Move {
                IdGame = idGame, Id = idMove, IdPlayer = idPlayer, IdRound = idRound
            };
            ServiceExe service = new ServiceExe(newMove);

            return(service.Create());
        }
コード例 #4
0
        public ResponseJson GetGamePlayersMove(int idGame)
        {
            GameMove gameMove = new GameMove {
                IdGame = idGame
            };
            ServiceExe service = new ServiceExe(gameMove);

            return(service.Get());
        }
コード例 #5
0
        public ResponseJson GetGameDetailScore(int idPlayer)
        {
            Game game = new Game {
                PlayerOne = new Player {
                    Id = idPlayer
                }
            };
            ServiceExe service = new ServiceExe(game);

            return(service.Get());
        }
コード例 #6
0
 static void Main(string[] args)
 {
     TryWritePid(true);
     ServiceExe.SetInfo(HeartService.ServiceInfo);
     if (!HeartService.ProcessCommandLineArgs(args))
     {
         IsolateMethodCalls = false;
         AddSwitches(typeof(ConsoleActions));
         AddConfigurationSwitches();
         Initialize(args, (a) =>
         {
             OutLineFormat("Error parsing arguments: {0}", ConsoleColor.Red, a.Message);
             Environment.Exit(1);
         });
         if (Arguments.Contains("i"))
         {
             Interactive();
         }
         else if (!ExecuteSwitches(Arguments, new ConsoleActions()))
         {
             HeartService.RunService <HeartService>();
         }
     }
 }
コード例 #7
0
ファイル: ConsoleActions.cs プロジェクト: dekkerb115/Bam.Net
        public void DeleteLog()
        {
            string logName = Prompt("Which log do you want to delete?");

            ServiceExe.DeleteLog(false, logName);
        }
コード例 #8
0
        public ResponseJson GetPlayersGame()
        {
            ServiceExe service = new ServiceExe(new Player());

            return(service.Get());
        }
コード例 #9
0
        public ResponseJson GetMoves()
        {
            ServiceExe service = new ServiceExe(new Move());

            return(service.Get());
        }
コード例 #10
0
        public ResponseJson NewGame()
        {
            ServiceExe service = new ServiceExe(new Game());

            return(service.Create());
        }