Skip to content

Commit

Permalink
GroupManager now accepts incommingConnections for Linux and Mac. Fix …
Browse files Browse the repository at this point in the history
…is similar to the previous proxy bug
  • Loading branch information
nschimme committed Jan 19, 2015
1 parent 95629af commit 20c53c2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MMapper 2.3.3 (January 18, 2015)
Changes:
- [GroupManager] Player's hp, mana, and moves are now correctly updated (nschimme)
- [GroupManager] Player's room name has been moved into the far right column (nschimme)
- [GroupManager] Linux and Mac hosts can now accept incoming connections (nschimme)
- Prompts should not be displayed after an internal command like _help is run (nschimme)
- Added new _vote command and menu action to vote for MUME on TMC (nschimme)

Expand Down
2 changes: 1 addition & 1 deletion src/pandoragroup/CGroupClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ CGroupClient::CGroupClient(QObject *parent) :
linkSignals();
}

void CGroupClient::setSocket(int socketDescriptor)
void CGroupClient::setSocket(qintptr socketDescriptor)
{
if (setSocketDescriptor(socketDescriptor) == false) {
// failure ... what to do?
Expand Down
2 changes: 1 addition & 1 deletion src/pandoragroup/CGroupClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CGroupClient : public QTcpSocket
CGroupClient(QByteArray host, int remotePort, QObject *parent);
virtual ~CGroupClient();

void setSocket(int socketDescriptor);
void setSocket(qintptr socketDescriptor);

int getConnectionState() {return connectionState; }
void setConnectionState(int val);
Expand Down
9 changes: 4 additions & 5 deletions src/pandoragroup/CGroupServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
CGroupServer::CGroupServer(int localPort, QObject *parent) :
QTcpServer(parent)
{
printf("Creating the GroupManager Server.\r\n");
qDebug("Creating the GroupManager Server.\r\n");
if (listen(QHostAddress::Any, localPort) != true) {
getCommunicator()->sendLog("Failed to start a group Manager server!");
getCommunicator()->serverStartupFailed();
Expand All @@ -45,7 +45,7 @@ CGroupServer::~CGroupServer()

}

void CGroupServer::incomingConnection(int socketDescriptor)
void CGroupServer::incomingConnection(qintptr socketDescriptor)
{
getCommunicator()->sendLog("Incoming connection");
// connect the client straight to the Communicator, as he handles all the state changes
Expand Down Expand Up @@ -85,10 +85,9 @@ void CGroupServer::sendToAllExceptOne(CGroupClient *conn, QByteArray message)

void CGroupServer::closeAll()
{

printf("Closing connections\r\n");
qDebug("Closing connections\r\n");
for (int i = 0; i < connections.size(); i++) {
printf("Closing connections %i\r\n", connections[i]->socketDescriptor());
qDebug("Closing connections ", connections[i]->socketDescriptor(), "\r\n");
connections[i]->deleteLater();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pandoragroup/CGroupServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CGroupServer: public QTcpServer
void closeAll();

protected:
void incomingConnection(int socketDescriptor);
void incomingConnection(qintptr socketDescriptor);

public slots:
void connectionClosed(CGroupClient *connection);
Expand Down

0 comments on commit 20c53c2

Please sign in to comment.