Beispiel #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();
            }
        }
Beispiel #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());
        }
Beispiel #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());
        }
Beispiel #4
0
        public ResponseJson GetGamePlayersMove(int idGame)
        {
            GameMove gameMove = new GameMove {
                IdGame = idGame
            };
            ServiceExe service = new ServiceExe(gameMove);

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

            return(service.Get());
        }
Beispiel #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>();
         }
     }
 }
Beispiel #7
0
        public void DeleteLog()
        {
            string logName = Prompt("Which log do you want to delete?");

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

            return(service.Get());
        }
Beispiel #9
0
        public ResponseJson GetMoves()
        {
            ServiceExe service = new ServiceExe(new Move());

            return(service.Get());
        }
Beispiel #10
0
        public ResponseJson NewGame()
        {
            ServiceExe service = new ServiceExe(new Game());

            return(service.Create());
        }