@@ -83,7 +83,7 @@ bool CQueryReceiver::ReadString(std::string& strRead, const char* szBuffer, int&
8383 return false ;
8484}
8585
86- SQueryInfo CQueryReceiver::GetServerResponse (uint restrictions )
86+ SQueryInfo CQueryReceiver::GetServerResponse ()
8787{
8888 SQueryInfo info;
8989
@@ -120,8 +120,7 @@ SQueryInfo CQueryReceiver::GetServerResponse(uint restrictions)
120120 // Game
121121 if (!ReadString (strTemp, szBuffer, i, len))
122122 return info;
123- if ((restrictions & RESTRICTION_GAME_NAME) == false )
124- info.gameName = strTemp;
123+ info.gameName = strTemp;
125124
126125 // Port (Ignore result as we must already have the correct value)
127126 if (!ReadString (strTemp, szBuffer, i, len))
@@ -130,42 +129,31 @@ SQueryInfo CQueryReceiver::GetServerResponse(uint restrictions)
130129 // Server name
131130 if (!ReadString (strTemp, szBuffer, i, len))
132131 return info;
133- if ((restrictions & RESTRICTION_SERVER_NAME) == false )
134- info.serverName = strTemp;
132+ info.serverName = strTemp;
135133
136134 // Game type
137135 if (!ReadString (strTemp, szBuffer, i, len))
138136 return info;
139- if ((restrictions & RESTRICTION_GAME_MODE) == false )
140- info.gameType = strTemp;
137+ info.gameType = strTemp;
141138
142139 // Map name
143140 if (!ReadString (strMapTemp, szBuffer, i, len))
144141 return info;
145- if ((restrictions & RESTRICTION_MAP_NAME) == false )
146- info.mapName = strMapTemp;
142+ info.mapName = strMapTemp;
147143
148144 // Version
149145 if (!ReadString (strTemp, szBuffer, i, len))
150146 return info;
151- if ((restrictions & RESTRICTION_SERVER_VERSION) == false )
152- info.versionText = strTemp;
147+ info.versionText = strTemp;
153148
154149 // Got space for password, serial verification, player count, players max?
155150 if (i + 4 > len)
156151 return info;
157152
158- if ((restrictions & RESTRICTION_PASSWORDED_FLAG) == false )
159- info.isPassworded = (szBuffer[i++] == 1 );
160-
161- if ((restrictions & RESTRICTION_SERIALS_FLAG) == false )
162- info.serials = (szBuffer[i++] == 1 );
163-
164- if ((restrictions & RESTRICTION_PLAYER_COUNT) == false )
165- info.players = (unsigned char )szBuffer[i++];
166-
167- if ((restrictions & RESTRICTION_MAX_PLAYER_COUNT) == false )
168- info.playerSlot = (unsigned char )szBuffer[i++];
153+ info.isPassworded = (szBuffer[i++] == 1 );
154+ info.serials = (szBuffer[i++] == 1 );
155+ info.players = (unsigned char )szBuffer[i++];
156+ info.playerSlot = (unsigned char )szBuffer[i++];
169157
170158 // Recover large player count if present
171159 const SString strPlayerCount = strMapTemp.Right (strMapTemp.length () - strlen (strMapTemp) - 1 );
@@ -174,10 +162,8 @@ SQueryInfo CQueryReceiver::GetServerResponse(uint restrictions)
174162 SString strJoinedPlayers, strMaxPlayers;
175163 if (strPlayerCount.Split (" /" , &strJoinedPlayers, &strMaxPlayers))
176164 {
177- if ((restrictions & RESTRICTION_PLAYER_COUNT) == false )
178- info.players = atoi (strJoinedPlayers);
179- if ((restrictions & RESTRICTION_MAX_PLAYER_COUNT) == false )
180- info.playerSlot = atoi (strMaxPlayers);
165+ info.players = atoi (strJoinedPlayers);
166+ info.playerSlot = atoi (strMaxPlayers);
181167 }
182168 }
183169
@@ -218,8 +204,7 @@ SQueryInfo CQueryReceiver::GetServerResponse(uint restrictions)
218204 SString strResult = RemoveColorCodes (strPlayer.c_str ());
219205 if (strResult.length () == 0 )
220206 strResult = strPlayer;
221- if ((restrictions & RESTRICTION_PLAYER_LIST) == false )
222- info.playersPool .push_back (strResult);
207+ info.playersPool .push_back (strResult);
223208 }
224209 }
225210 catch (...)
0 commit comments