Skip to content

Commit f9d1c34

Browse files
committed
chore: retype some things
1 parent c470ef7 commit f9d1c34

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

GhostServer/networkmanager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void NetworkManager::ScheduleServerThread(std::function<void()> func) {
120120
g_server_queue_mutex.unlock();
121121
}
122122

123-
std::vector<Client *> NetworkManager::GetPlayerByName(std::string name)
123+
std::vector<Client *> NetworkManager::GetPlayerByName(const std::string name)
124124
{
125125
std::vector<Client *> matches;
126126
for (auto &client : this->clients) {
@@ -132,7 +132,7 @@ std::vector<Client *> NetworkManager::GetPlayerByName(std::string name)
132132
return matches;
133133
}
134134

135-
Client* NetworkManager::GetClientByID(sf::Uint32 ID)
135+
Client* NetworkManager::GetClientByID(const sf::Uint32 ID)
136136
{
137137
for (auto& client : this->clients) {
138138
if (client.ID == ID) {
@@ -143,7 +143,7 @@ Client* NetworkManager::GetClientByID(sf::Uint32 ID)
143143
return nullptr;
144144
}
145145

146-
std::vector<Client *> NetworkManager::GetClientByIP(sf::IpAddress ip) {
146+
std::vector<Client *> NetworkManager::GetClientByIP(const sf::IpAddress ip) {
147147
std::vector<Client *> clients;
148148
for (auto& client : this->clients) {
149149
if (client.IP == ip) {
@@ -214,7 +214,7 @@ void NetworkManager::StopServer()
214214
GHOST_LOG("Server stopped!");
215215
}
216216

217-
void NetworkManager::DisconnectPlayer(Client& c, const char *reason)
217+
void NetworkManager::DisconnectPlayer(Client& c, const std::string reason)
218218
{
219219
sf::Packet packet;
220220
packet << HEADER::DISCONNECT << c.ID;

GhostServer/networkmanager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ class NetworkManager
127127

128128
void ScheduleServerThread(std::function<void()> func);
129129

130-
std::vector<Client *> GetPlayerByName(std::string name);
131-
Client* GetClientByID(sf::Uint32 ID);
132-
std::vector<Client *> GetClientByIP(sf::IpAddress ip);
130+
std::vector<Client *> GetPlayerByName(const std::string name);
131+
Client* GetClientByID(const sf::Uint32 ID);
132+
std::vector<Client *> GetClientByIP(const sf::IpAddress ip);
133133

134134
bool StartServer(const int port);
135135
void StopServer();
136136
void RunServer();
137137

138138
bool ShouldBlockConnection(const sf::IpAddress &ip);
139-
void DisconnectPlayer(Client &client, const char *reason);
139+
void DisconnectPlayer(Client &client, const std::string reason);
140140
void StartCountdown(const std::string preCommands, const std::string postCommands, const int duration);
141141
void SetAccept(bool players, bool accept);
142142
void SetAlwaysListClients(bool alwaysList);

0 commit comments

Comments
 (0)