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(); } }
public ResponseJson NewPlayer(string player, int idGame) { Player newPlayer = new Player { Name = player, IdGame = idGame }; ServiceExe service = new ServiceExe(newPlayer); return(service.Create()); }
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()); }
public ResponseJson GetGamePlayersMove(int idGame) { GameMove gameMove = new GameMove { IdGame = idGame }; ServiceExe service = new ServiceExe(gameMove); return(service.Get()); }
public ResponseJson GetGameDetailScore(int idPlayer) { Game game = new Game { PlayerOne = new Player { Id = idPlayer } }; ServiceExe service = new ServiceExe(game); return(service.Get()); }
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>(); } } }
public void DeleteLog() { string logName = Prompt("Which log do you want to delete?"); ServiceExe.DeleteLog(false, logName); }
public ResponseJson GetPlayersGame() { ServiceExe service = new ServiceExe(new Player()); return(service.Get()); }
public ResponseJson GetMoves() { ServiceExe service = new ServiceExe(new Move()); return(service.Get()); }
public ResponseJson NewGame() { ServiceExe service = new ServiceExe(new Game()); return(service.Create()); }