1 /* 2 * This file is part of Dune Legacy. 3 * 4 * Dune Legacy is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * Dune Legacy is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with Dune Legacy. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef GAMESERVERINFO_H 19 #define GAMESERVERINFO_H 20 21 #include <enet/enet.h> 22 #include <SDL.h> 23 #include <string> 24 25 class GameServerInfo { 26 public: 27 ENetAddress serverAddress; 28 std::string serverName; 29 std::string serverVersion; 30 std::string mapName; 31 int numPlayers; 32 int maxPlayers; 33 bool bPasswordProtected; 34 Uint32 lastUpdate; 35 36 /** 37 Do not compare numPlayers, bPasswordProtected and lastUpdate 38 \param gameServerInfo the other object to compare with 39 \return true if equal, false otherwise 40 */ 41 bool operator==(const GameServerInfo& gameServerInfo) const { 42 return ((serverAddress.host == gameServerInfo.serverAddress.host) 43 && (serverAddress.port == gameServerInfo.serverAddress.port) 44 && (serverName == gameServerInfo.serverName) 45 && (mapName == gameServerInfo.mapName) 46 && (maxPlayers == gameServerInfo.maxPlayers)); 47 } 48 }; 49 50 #endif // GAMESERVERINFO_H 51