make some progress toward getting psogc to work again

This commit is contained in:
Martin Michelsen
2018-11-10 23:52:23 -08:00
parent 00bbd6a0a3
commit 833bf90333
20 changed files with 286 additions and 124 deletions
+2 -4
View File
@@ -35,7 +35,7 @@ void Lobby::reassign_leader_on_client_departure_locked(size_t leaving_client_ind
return;
}
}
throw out_of_range("no clients remain");
this->leader_id = 0;
}
bool Lobby::any_client_loading() const {
@@ -68,11 +68,11 @@ void Lobby::add_client(shared_ptr<Client> c) {
}
void Lobby::add_client_locked(shared_ptr<Client> c) {
rw_guard g(this->lock, true);
size_t index;
for (index = 0; index < this->max_clients; index++) {
if (!this->clients[index].get()) {
this->clients[index] = c;
break;
}
}
if (index >= this->max_clients) {
@@ -101,8 +101,6 @@ void Lobby::remove_client(shared_ptr<Client> c) {
}
void Lobby::remove_client_locked(shared_ptr<Client> c) {
rw_guard g(this->lock, true);
if (this->clients[c->lobby_client_id] != c) {
throw logic_error("client\'s lobby client id does not match client list");
}