public void JoinGame(LobbyDto lobby) { networkAddress = lobby.ip; networkAddress = "localhost"; Debug.Log("Attempting to connect to " + networkAddress); StartClient(); }
public CreateLobbyResponse(Guid id, Guid requestId, LobbyDto lobbyDto, bool isSuccess) { Id = id; RequestId = requestId; IsSuccess = isSuccess; LobbyDto = lobbyDto; }
public void SwitchToLobby(LobbyDto lobby) { DisableAllPanels(); _lobbyPanel.SetActive(true); _lobbyPanel.GetComponent <LobbyUi>().PopulateDetails(lobby); _activePanel = _lobbyPanel; }
public void SetData(LobbyDto lobby) { _lobby = lobby; _lobbyName.text = lobby.name; _lobbyPlayers.text = $"{lobby.players}/{lobby.maxPlayers}"; _lobbyMap.text = lobby.map; }
public void Populate(LobbyDto lobby) { gameObject.SetActive(true); EmptyContent.SetActive(false); _lobbyName.text = lobby.name; _lobbyPlayers.text = $"{lobby.players}/{lobby.maxPlayers}"; _lobbyMap.text = lobby.map; }
public async Task <ActionResult <Lobby> > CreateLobby(LobbyDto lobbyDto) { var lobby = new Lobby { NumberOfLives = lobbyDto.NumberOfLives, LobbySize = lobbyDto.LobbySize, Status = LobbyStatus.New }; _context.Lobbies.Add(lobby); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLobby", new { id = lobby.Id }, lobby)); }
// UI Hooks // ReSharper disable UnusedMember.Global public void HostGameClicked() { var lobby = new LobbyDto { name = "Test lobby", maxPlayers = 8, players = 1, ip = "localhost", map = "test_map" }; LobbyManager.Instance.HostGame(); SwitchToLobby(lobby); }
public async Task CreateLobby() { // Arrange var lobby = new LobbyDto { LobbySize = 5, NumberOfLives = 15 }; var content = new StringContent(JsonSerializer.Serialize(lobby), Encoding.UTF8, "application/json"); // Act var response = await _client.PostAsync(_baseUrl, content); // Assert response.EnsureSuccessStatusCode(); }
public void SetJoinedLobby(LobbyDto lobbyDto) { joinedLobby = lobbyDto; }
public void LobbySelected(LobbyDto lobby) { _selectedLobby = lobby; JoinLobbyDetails.Populate(lobby); }
public void PopulateDetails(LobbyDto lobby) { Debug.Log("Populating details"); _lobbyDetails.Populate(lobby); }