Skip to content

Commit

Permalink
Try to remove a compilation error and a few warnings in server_lobby.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kimden committed Apr 3, 2024
1 parent dcfe18d commit e359adc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/network/protocols/server_lobby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ void ServerLobby::asynchronousUpdate()
std::string track_name = winner_vote.m_track_name;
if (ServerConfig::m_soccer_tournament)
{
if (m_tournament_game >= m_tournament_arenas.size())
if (m_tournament_game >= (int)m_tournament_arenas.size())
m_tournament_arenas.resize(m_tournament_game + 1, "");
m_tournament_arenas[m_tournament_game] = track_name;
}
Expand Down Expand Up @@ -2138,7 +2138,8 @@ bool ServerLobby::canLiveJoinNow() const
float total_distance =
Track::getCurrentTrack()->getTrackLength() *
(float)RaceManager::get()->getNumLaps();
float progress = leader_distance / total_distance;
// standard version uses (leader_distance / total_distance > 0.9f)
// TODO: allow switching
if (total_distance - leader_distance < 250.0)
return false;
}
Expand Down Expand Up @@ -2400,7 +2401,6 @@ void ServerLobby::finishedLoadingLiveJoinClient(Event* event)
live_join_start_time += 3000;

bool spectator = false;
FreeForAll* ffa_world = dynamic_cast<FreeForAll*>(World::getWorld());
for (const int id : peer->getAvailableKartIDs())
{
const RemoteKartInfo& rki = RaceManager::get()->getKartInfo(id);
Expand Down Expand Up @@ -2570,7 +2570,7 @@ void ServerLobby::update(int ticks)
peer->getPlayerProfiles()[0]->getName()).c_str();
Log::info("ServerLobby", "%s %s has been idle on the server for "
"more than %d seconds, kick.",
peer->getAddress().toString().c_str(), peer_name, sec);
peer->getAddress().toString().c_str(), peer_name.c_str(), sec);
peer->kick();
}
}
Expand Down Expand Up @@ -6830,7 +6830,7 @@ void ServerLobby::storeResults()
}
}
m_saved_ffa_points.clear();
for (int i = 0; i < usernames.size(); ++i)
for (int i = 0; i < (int)usernames.size(); ++i)
{
std::string query = StringUtils::insertValues(
"INSERT INTO %s "
Expand All @@ -6852,7 +6852,8 @@ void ServerLobby::storeResults()
#endif
);
std::string name = usernames[i];
bool written = easySQLQuery(query, [name](sqlite3_stmt* stmt)
//bool written =
easySQLQuery(query, [name](sqlite3_stmt* stmt)
{
if (sqlite3_bind_text(stmt, 1, name.c_str(),
-1, SQLITE_TRANSIENT) != SQLITE_OK)
Expand Down

0 comments on commit e359adc

Please sign in to comment.