mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-03-14 09:42:28 +01:00
network: Grant private room hosts moderator privileges
This commit is contained in:
parent
2e118e2aad
commit
c14206640b
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user