initial player stuff

This commit is contained in:
Blue 2018-08-05 00:52:16 +03:00 committed by Gitea
parent 4b60ece582
commit 00f26c431e
38 changed files with 1107 additions and 93 deletions

View file

@ -44,14 +44,14 @@ void W::Server::stop()
}
}
const W::Socket& W::Server::getConnection(uint64_t p_id) const
const W::Socket* W::Server::getConnection(uint64_t p_id) const
{
std::map<uint64_t, Socket*>::const_iterator itr = connections.find(p_id);
if (itr == connections.end()) {
throw new SocketAccessError();
}
return *(itr->second);
return itr->second;
}
uint64_t W::Server::getConnectionsCount() const

View file

@ -27,7 +27,7 @@ namespace W
void listen(uint16_t port);
void stop();
const Socket& getConnection(uint64_t p_id) const;
const Socket* getConnection(uint64_t p_id) const;
uint64_t getConnectionsCount() const;
void closeConnection(uint64_t p_id);
void openConnection(const String& addr, const Uint64& port);