Example #1
0
 private void showDetails(JsonResponsePacketDeserializer.RoomData data)
 {
     this.RoomName.Text = data.name + " Players";
     JsonRequestPacketSerializer.GetPlayersInRoomRequest getPlayersInRoomReq = new JsonRequestPacketSerializer.GetPlayersInRoomRequest(data.id);
     try
     {
         JsonResponsePacketDeserializer.GetPlayersInRoomResponse getPlayersInRoomResp = this.client.SendAndReceive <JsonResponsePacketDeserializer.GetPlayersInRoomResponse>(getPlayersInRoomReq, (uint)JsonRequestPacketSerializer.reqCodes.GETPLAYERSROOM_REQ_CODE);
         if (getPlayersInRoomResp.status == 1)
         {
             this.Players.Children.Clear();
             for (int i = 0; i < getPlayersInRoomResp.users.Count; i++)
             {
                 TextBlock playerName = new TextBlock();
                 playerName.Text                = getPlayersInRoomResp.users[i];
                 playerName.FontSize            = 20;
                 playerName.HorizontalAlignment = HorizontalAlignment.Left;
                 playerName.VerticalAlignment   = VerticalAlignment.Center;
                 playerName.Height              = 30;
                 playerName.Width               = 525;
                 this.Players.Children.Add(playerName);
             }
         }
         else
         {
         }
     }
     catch (Exception exception)
     {
     }
 }
 private void showDetails(JsonResponsePacketDeserializer.RoomData data)
 {
     this.RoomName.Text      = data.name + " Details";
     this.RoomId.Text        = data.id.ToString();
     this.PlayersNum.Text    = data.maxPlayers.ToString();
     this.QuestionsNum.Text  = data.questionCount.ToString();
     this.QuestionsTime.Text = data.timePerQuestion.ToString();
 }
 public RoomDetailsWindow(JsonResponsePacketDeserializer.RoomData data)
 {
     InitializeComponent();
     showDetails(data);
 }
Example #4
0
 public RoomPlayersWindow(Client client, JsonResponsePacketDeserializer.RoomData data)
 {
     InitializeComponent();
     this.client = new Client(client);
     showDetails(data);
 }