예제 #1
0
 /// <summary>
 /// When invited to a team
 /// </summary>
 /// <param name="Message"></param>
 public TeamQueuePage(string Invid, LobbyStatus NewLobby = null)
 {
     InitializeComponent();
     Client.InviteListView = InviteListView;
     Client.PVPNet.OnMessageReceived += Update_OnMessageReceived;
     Client.OnMessage += Client_OnMessage;
     //MainWindow Window = new MainWindow();
     //Window.Hide();
     //Opps
     Invite = Invid;
     CurrentLobby = NewLobby;
     LoadStats();
 }
예제 #2
0
 public LobbyStatus createArrangedRankedTeamLobby(double QueueId, string TeamName)
 {
     int Id = Invoke("lcdsGameInvitationService", "createArrangedRankedTeamLobby", new object[] { QueueId , TeamName});
     while (!results.ContainsKey(Id))
         System.Threading.Thread.Sleep(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     LobbyStatus result = new LobbyStatus(messageBody);
     results.Remove(Id);
     return result;
 }
예제 #3
0
 public LobbyStatus checkLobbyStatus()
 {
     int Id = Invoke("lcdsGameInvitationService", "checkLobbyStatus", new object[] {  });
     while (!results.ContainsKey(Id))
         System.Threading.Thread.Sleep(20);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     LobbyStatus result = new LobbyStatus(messageBody);
     results.Remove(Id);
     return result;
 }
예제 #4
0
 public object transferOwnership(string InvitationId)
 {
     int Id = Invoke("lcdsGameInvitationService", "transferOwnership", new object[] { InvitationId });
     while (!results.ContainsKey(Id))
         System.Threading.Thread.Sleep(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     LobbyStatus result = new LobbyStatus(messageBody);
     results.Remove(Id);
     return result;
 }
예제 #5
0
        public async void LoadStats()
        {
            i = 10;
            PingTimer = new Timer(1000);
            PingTimer.Elapsed += new ElapsedEventHandler(PingElapsed);
            PingTimer.Enabled = true;
            PingElapsed(1, null);
            InviteButton.IsEnabled = false;
            StartGameButton.IsEnabled = false;

            if (CurrentLobby == null)
            {
                //Yay fixed lobby. Riot hates me still though. They broke this earlier, except I have fixed it
                CurrentLobby = await Client.PVPNet.getLobbyStatus();
            }
            string ObfuscatedName = Client.GetObfuscatedChatroomName(CurrentLobby.InvitationID.Replace("INVID", "invid"), ChatPrefixes.Arranging_Game); //Why do you need to replace INVID with invid Riot?
            string JID = Client.GetChatroomJID(ObfuscatedName, CurrentLobby.ChatKey, false);
            newRoom = Client.ConfManager.GetRoom(new jabber.JID(JID));
            newRoom.Nickname = Client.LoginPacket.AllSummonerData.Summoner.Name;
            newRoom.OnRoomMessage += newRoom_OnRoomMessage;
            newRoom.OnParticipantJoin += newRoom_OnParticipantJoin;
            newRoom.Join(CurrentLobby.ChatKey);


            ///Way smarter way then just putting the code here

            RenderLobbyData();
        }
예제 #6
0
        private void GotQueuePop(object sender, object message)
        {
            if (message.GetType() == typeof(GameDTO))
            {
                GameDTO Queue = message as GameDTO;
                Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
                {
                    Client.OverlayContainer.Content = new QueuePopOverlay(Queue).Content;
                    Client.OverlayContainer.Visibility = Visibility.Visible;
                }));
                Client.PVPNet.OnMessageReceived -= GotQueuePop;

            }
            else if (message.GetType() == typeof(LobbyStatus))
            {
                LobbyStatus mg = message as LobbyStatus;
                {
                    CurrentLobby = mg;
                }
            }
        }
 public async Task<LobbyStatus> createArrangedBotTeamLobby(double QueueId, string Difficulty)
 {
     int Id = Invoke("lcdsGameInvitationService", "createArrangedBotTeamLobby", new object[] { QueueId, Difficulty});
     while (!results.ContainsKey(Id))
         await Task.Delay(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     LobbyStatus result = new LobbyStatus(messageBody);
     results.Remove(Id);
     return result;
 }
예제 #8
0
 private void Update_OnMessageReceived(object sender, object message)
 {
     if (message.GetType() == typeof(LobbyStatus))
     {
         LobbyStatus Lobby = message as LobbyStatus;
         CurrentLobby = Lobby;
         RenderLobbyData();
     }
     else if (message.GetType() == typeof(GameDTO) && Client.runonce == false)
     {
         GameDTO Queue = message as GameDTO;
         Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
         {
             Client.OverlayContainer.Content = new QueuePopOverlay(Queue).Content;
             Client.OverlayContainer.Visibility = Visibility.Visible;
         }));
         Client.runonce = true;
     }
 }
 public async Task<LobbyStatus> checkLobbyStatus()
 {
     int Id = Invoke("lcdsGameInvitationService", "checkLobbyStatus", new object[] {  });
     while (!results.ContainsKey(Id))
         await Task.Delay(20);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     LobbyStatus result = new LobbyStatus(messageBody);
     results.Remove(Id);
     return result;
 }
 public async Task<object> transferOwnership(string InvitationId)
 {
     int Id = Invoke("lcdsGameInvitationService", "transferOwnership", new object[] { InvitationId });
     while (!results.ContainsKey(Id))
         await Task.Delay(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     LobbyStatus result = new LobbyStatus(messageBody);
     results.Remove(Id);
     return result;
 }
예제 #11
0
 public async Task<object> getPendingInvitations()
 {
     int Id = Invoke("lcdsGameInvitationService", "getPendingInvitations", new object[] { });
     while (!results.ContainsKey(Id))
         await Task.Delay(10);
     LobbyStatus result = new LobbyStatus();
     results.Remove(Id);
     return result;
 }
예제 #12
0
 public async Task<object> createArrangedTeamLobby(double QueueId)
 {
     int Id = Invoke("lcdsGameInvitationService", "createArrangedTeamLobby", new object[] { QueueId });
     while (!results.ContainsKey(Id))
         await Task.Delay(10);
     LobbyStatus result = new LobbyStatus();
     results.Remove(Id);
     return result;
 }
예제 #13
0
 public async Task<object> transferOwnership(string InvitationId)
 {
     int Id = Invoke("lcdsGameInvitationService", "transferOwnership", new object[] { InvitationId });
     while (!results.ContainsKey(Id))
         await Task.Delay(10);
     LobbyStatus result = new LobbyStatus();
     results.Remove(Id);
     return result;
 }