Server errors are now shown.
This commit is contained in:
@@ -104,7 +104,7 @@ void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) { myW->s
|
|||||||
void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myChat->signalChatMessage(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myChat->signalChatMessage(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||||
|
|
||||||
void GuiWrapper::SignalNetServerSuccess(int actionID) { }
|
void GuiWrapper::SignalNetServerSuccess(int actionID) { }
|
||||||
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { }
|
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); }
|
||||||
void GuiWrapper::SignalNetServerPlayerJoined(const string &playerName) { myW->signalNetServerPlayerJoined(QString::fromUtf8(playerName.c_str())); }
|
void GuiWrapper::SignalNetServerPlayerJoined(const string &playerName) { myW->signalNetServerPlayerJoined(QString::fromUtf8(playerName.c_str())); }
|
||||||
void GuiWrapper::SignalNetServerPlayerLeft(const string &playerName) { myW->signalNetServerPlayerLeft(QString::fromUtf8(playerName.c_str())); }
|
void GuiWrapper::SignalNetServerPlayerLeft(const string &playerName) { myW->signalNetServerPlayerLeft(QString::fromUtf8(playerName.c_str())); }
|
||||||
|
|
||||||
|
|||||||
@@ -615,6 +615,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
|
|
||||||
// Errors are handled globally, not within one dialog.
|
// Errors are handled globally, not within one dialog.
|
||||||
connect(this, SIGNAL(signalNetClientError(int, int)), this, SLOT(networkError(int, int)));
|
connect(this, SIGNAL(signalNetClientError(int, int)), this, SLOT(networkError(int, int)));
|
||||||
|
connect(this, SIGNAL(signalNetServerError(int, int)), this, SLOT(networkError(int, int)));
|
||||||
connect(this, SIGNAL(signalNetClientGameStart(boost::shared_ptr<Game>)), this, SLOT(networkStart(boost::shared_ptr<Game>)));
|
connect(this, SIGNAL(signalNetClientGameStart(boost::shared_ptr<Game>)), this, SLOT(networkStart(boost::shared_ptr<Game>)));
|
||||||
|
|
||||||
connect(this, SIGNAL(signalNetServerPlayerJoined(QString)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(QString)));
|
connect(this, SIGNAL(signalNetServerPlayerJoined(QString)), myStartNetworkGameDialog, SLOT(addConnectedPlayer(QString)));
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ signals:
|
|||||||
void signalNetClientConnect(int actionID);
|
void signalNetClientConnect(int actionID);
|
||||||
void signalNetClientGameInfo(int actionID);
|
void signalNetClientGameInfo(int actionID);
|
||||||
void signalNetClientError(int errorID, int osErrorID);
|
void signalNetClientError(int errorID, int osErrorID);
|
||||||
|
void signalNetServerError(int errorID, int osErrorID);
|
||||||
void signalNetClientPlayerJoined(QString playerName);
|
void signalNetClientPlayerJoined(QString playerName);
|
||||||
void signalNetClientPlayerLeft(QString playerName);
|
void signalNetClientPlayerLeft(QString playerName);
|
||||||
void signalNetClientGameStart(boost::shared_ptr<Game> game);
|
void signalNetClientGameStart(boost::shared_ptr<Game> game);
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ ServerThread::Listen()
|
|||||||
{
|
{
|
||||||
ServerContext &context = GetContext();
|
ServerContext &context = GetContext();
|
||||||
|
|
||||||
// if (context.GetServerPort() < 1024)
|
if (context.GetServerPort() < 1024)
|
||||||
// throw ServerException(ERR_SOCK_INVALID_PORT, 0);
|
throw ServerException(ERR_SOCK_INVALID_PORT, 0);
|
||||||
|
|
||||||
context.SetSocket(socket(context.GetAddrFamily(), SOCK_STREAM, context.GetProtocol()));
|
context.SetSocket(socket(context.GetAddrFamily(), SOCK_STREAM, context.GetProtocol()));
|
||||||
if (!IS_VALID_SOCKET(context.GetSocket()))
|
if (!IS_VALID_SOCKET(context.GetSocket()))
|
||||||
|
|||||||
Reference in New Issue
Block a user