network: Grant private room hosts moderator privileges

This commit is contained in:
Kleidis 2025-01-03 04:49:08 +01:00 committed by OpenSauce
parent 2e118e2aad
commit c14206640b
2 changed files with 9 additions and 2 deletions

View File

@ -144,8 +144,8 @@ void HostRoomWindow::Host() {
bool created = room->Create(ui->room_name->text().toStdString(),
ui->room_description->toPlainText().toStdString(), "",
static_cast<u16>(port), password, ui->max_player->value(),
NetSettings::values.citra_username, game_name.toStdString(),
game_id, CreateVerifyBackend(is_public), ban_list);
ui->username->text().toStdString(),, game_name.toStdString(),
game_id, CreateVerifyBackend(is_public), ban_list, true);
if (!created) {
NetworkMessage::ErrorManager::ShowError(
NetworkMessage::ErrorManager::COULD_NOT_CREATE_ROOM);

View File

@ -375,6 +375,13 @@ void Room::RoomImpl::HandleJoinRequest(const ENetEvent* event) {
if (verify_backend != nullptr)
member.user_data = verify_backend->LoadUserData(uid, token);
if (nickname == room_information.host_username) {
member.user_data.moderator = true;
LOG_INFO(Network, "User {} is a moderator", std::string(room_information.host_username));
}
std::string ip;
{
std::lock_guard lock(ban_list_mutex);