Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
NetPlayServer: Remove unused code
GetPlayerList is always called on the client.
  • Loading branch information
magcius committed Aug 19, 2013
1 parent 5c3dcc5 commit 7a41acd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
30 changes: 0 additions & 30 deletions Source/Core/Core/Src/NetPlayServer.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/Core/Src/NetPlayServer.h
Expand Up @@ -27,8 +27,6 @@ class NetPlayServer
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);

Expand All @@ -53,7 +51,6 @@ class NetPlayServer
{
public:
Client();
std::string ToString() const;

PlayerId pid;
std::string name;
Expand Down

0 comments on commit 7a41acd

Please sign in to comment.