static void Main(string[] args) { PlayerProfile currentPlayer; PlayerAuthentication.baseWebAddress = "http://*****:*****@itsligo.ie", "itsPaul$1"); if (logged) { currentPlayer = PlayerAuthentication.getPlayerProfile(); //Console.WriteLine("Token acquired {0}", PlayerAuthentication.PlayerToken); List <GameScoreObject> scores = PlayerAuthentication.getScores(4, "Battle Call"); foreach (var item in scores) { Console.WriteLine("Game {0} {1} Score for {1} is {3}", item.GameId, item.GameName, item.GamerTag, item.score); } if (currentPlayer != null) { PlayerAuthentication.PostScore(new PlayerScoreObject { GameId = scores.First().GameId, PlayerId = currentPlayer.id, score = r.Next(900, 1000) }); } Console.WriteLine("Top 4 scores After New score Added"); foreach (var item in PlayerAuthentication.getScores(4, "Battle Call")) { Console.WriteLine("After New score Game {0} {1} Score for {1} is {3}", item.GameId, item.GameName, item.GamerTag, item.score); } } else { Console.WriteLine("Failed to acquire Token "); } Console.ReadKey(); }
protected override void Initialize() { graphics.PreferredBackBufferHeight = 768; graphics.PreferredBackBufferWidth = 1280; graphics.ApplyChanges(); proxy = connection.CreateHubProxy("GameHub"); clientID = connection.ConnectionId; Action <string, Vector2> ReciveNewPosition = reciveNewPlayerPosition; proxy.On("updatePosition", ReciveNewPosition); try { bool valid = PlayerAuthentication.login("*****@*****.**", "itsPaul$1").Result; if (valid) { Message = "Player Logged in with Token " + PlayerAuthentication.PlayerToken; } else { Message = PlayerAuthentication.PlayerToken; } } catch (Exception ex) { Message = ex.Message; } base.Initialize(); }
public MainViewModel() { PlayerAuthentication.baseWebAddress = "http://*****:*****@itsligo.ie", "itsPaul$1")) { currentPlayer = PlayerAuthentication.getPlayerProfile(); } list = PlayerAuthentication.getScores(4, "Battle Call"); }
public bool login(string username, string password) { if (PlayerAuthentication.login(username, password)) { _token = PlayerAuthentication.PlayerToken; currentPlayer = PlayerAuthentication.getPlayerProfile(); return(true); } return(false); }
public PlayerInfoViewModel() { if (DesignerProperties.GetIsInDesignMode( new System.Windows.DependencyObject())) { return; } PlayerAuthentication.baseWebAddress = "http://*****:*****@itsligo.ie", "itsPaul$1")) { currentPlayer = PlayerAuthentication.getPlayerProfile(); } }
protected override void Initialize() { oldState = Keyboard.GetState(); graphics.PreferredBackBufferWidth = 800; //set the size of the window graphics.PreferredBackBufferHeight = 600; graphics.ApplyChanges(); proxy = connection.CreateHubProxy("GameHub"); clientID = connection.ConnectionId; Action <string, string> RecivePlayer = recivePlayerMessage; Action <string, Vector2[]> ReciveBarriersPositions = reciveBarriers; Action <Vector2> ReciveNewPosition = reciveNewPlayerPosition; Action <string, Vector2, Vector2> ReciveNewBullet = reciveNewEnemyBullet; Action <Vector2> ReciveNewSuperCollectable = reciveSupercollectable; Action <List <Vector2> > ReciveCollectablePositions = reciveCollectablePositions; Action <Vector2> ReciveDiffrentStartposition = reciveDiffrentStartposition; proxy.On("sendPositionCollectables", ReciveCollectablePositions); proxy.On("sendBarriers", ReciveBarriersPositions); proxy.On("otherStartpoint", ReciveDiffrentStartposition); proxy.On("sendPlayer", RecivePlayer); proxy.On("updatePosition", ReciveNewPosition); proxy.On("newBullet", ReciveNewBullet); proxy.On("newSuperCollectable", ReciveNewSuperCollectable); new InputEngine(this); setupChatViewPort(); // TODO: Add your initialization logic here //HubConnection connection = new HubConnection("http://cgmonogameserver2015.azurewebsites.net/"); connection = new HubConnection("http://*****:*****@itsligo.ie", "itsPaul$1"); t.Wait(); Action <string, string> ChatRecieved = ChatRecievedMessage; chatproxy.On("heyThere", ChatRecieved); chatMessages.Add("Chat-->"); connection.Start().Wait(); base.Initialize(); }
static void Main(string[] args) { PlayerProfile currentPlayer; //Added the URL for the Web App that is depolyed to Azure... PlayerAuthentication.baseWebAddress = "http://rtjjmonogameserver.azurewebsites.net/";// "http://*****:*****@itsligo.ie", "itsPaul$1"); if (logged) { currentPlayer = PlayerAuthentication.getPlayerProfile(); //Console.WriteLine("Token acquired {0}", PlayerAuthentication.PlayerToken); List <GameScoreObject> scores = PlayerAuthentication.getScores(4, "Battle Call"); foreach (var item in scores) { Console.WriteLine("Game {0} {1} Score for {1} is {3}", item.GameId, item.GameName, item.GamerTag, item.score); } if (currentPlayer != null) { PlayerAuthentication.PostScore(new PlayerScoreObject { GameId = scores.First().GameId, PlayerId = currentPlayer.Id, score = r.Next(900, 1000) }); } Console.WriteLine("Top 4 scores After New score Added"); foreach (var item in PlayerAuthentication.getScores(4, "Battle Call")) { Console.WriteLine("After New score Game {0} {1} Score for {1} is {3}", item.GameId, item.GameName, item.GamerTag, item.score); } } else { Console.WriteLine("Failed to acquire Token "); } ExternalGameObject gameInfo = PlayerAuthentication.getExtGame(1); Console.WriteLine(" Name: {0} \n Summary {1} \n Image URL : {2}", gameInfo.Name, gameInfo.Summary, gameInfo.Cover); Console.ReadKey(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { new InputEngine(this); setupChatViewPort(); // TODO: Add your initialization logic here //HubConnection connection = new HubConnection("http://cgmonogameserver2015.azurewebsites.net/"); connection = new HubConnection("http://*****:*****@itsligo.ie", "itsPaul$1"); t.Wait(); Action <string, string> ChatRecieved = ChatRecievedMessage; chatproxy.On("heyThere", ChatRecieved); chatMessages.Add("Chat-->"); connection.Start().Wait(); base.Initialize(); }