NetPlayServer: Remove unused code
GetPlayerList is always called on the client.
This commit is contained in:
parent
5c3dcc50bc
commit
7a41acd8ff
|
@ -9,17 +9,6 @@ NetPlayServer::Client::Client()
|
|||
memset(pad_map, -1, sizeof(pad_map));
|
||||
}
|
||||
|
||||
// called from ---GUI--- thread
|
||||
std::string NetPlayServer::Client::ToString() const
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << name << '[' << (char)(pid+'0') << "] : " << revision << " |";
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
ss << (pad_map[i]>=0 ? (char)(pad_map[i]+'1') : '-');
|
||||
ss << '|';
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
NetPlayServer::~NetPlayServer()
|
||||
{
|
||||
if (is_connected)
|
||||
|
@ -484,25 +473,6 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, sf::SocketTCP& socket)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// called from ---GUI--- thread
|
||||
void NetPlayServer::GetPlayerList(std::string& list, std::vector<int>& pid_list)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lkp(m_crit.players);
|
||||
|
||||
std::ostringstream ss;
|
||||
|
||||
std::map<sf::SocketTCP, Client>::const_iterator
|
||||
i = m_players.begin(),
|
||||
e = m_players.end();
|
||||
for ( ; i!=e; ++i)
|
||||
{
|
||||
ss << i->second.ToString() << " " << i->second.ping << "ms\n";
|
||||
pid_list.push_back(i->second.pid);
|
||||
}
|
||||
|
||||
list = ss.str();
|
||||
}
|
||||
|
||||
// called from ---GUI--- thread / and ---NETPLAY--- thread
|
||||
void NetPlayServer::SendChatMessage(const std::string& msg)
|
||||
{
|
||||
|
|
|
@ -27,8 +27,6 @@ public:
|
|||
NetPlayServer(const u16 port);
|
||||
~NetPlayServer();
|
||||
|
||||
void GetPlayerList(std::string& list, std::vector<int>& pid_list);
|
||||
|
||||
bool ChangeGame(const std::string& game);
|
||||
void SendChatMessage(const std::string& msg);
|
||||
|
||||
|
@ -53,7 +51,6 @@ private:
|
|||
{
|
||||
public:
|
||||
Client();
|
||||
std::string ToString() const;
|
||||
|
||||
PlayerId pid;
|
||||
std::string name;
|
||||
|
|
Loading…
Reference in New Issue