From a92ef8b6bd8e38c2d7f0b89cb425b99d674a35f0 Mon Sep 17 00:00:00 2001 From: Koncord Date: Mon, 15 Aug 2016 22:49:34 +0800 Subject: [PATCH] Some fixes --- apps/openmw-mp/Log.cpp | 2 +- apps/openmw-mp/main.cpp | 8 +++++++- files/tes3mp/tes3mp-server-default.cfg | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/openmw-mp/Log.cpp b/apps/openmw-mp/Log.cpp index e37a2c821..646f1fb69 100644 --- a/apps/openmw-mp/Log.cpp +++ b/apps/openmw-mp/Log.cpp @@ -50,7 +50,7 @@ const char* getTime() void Log::print(int level, const char *file, int line, const char *message, ...) const { - if(level > logLevel) return; + if(level < logLevel) return; std::string str = "[" + string(getTime()) + "] "; if(file != 0 && line != 0) diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index 82791a958..ac4904611 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -107,9 +107,15 @@ int main(int argc, char *argv[]) const char passw[8] = "1234567"; peer->SetIncomingPassword(passw, sizeof(passw)); + if(RakNet::NonNumericHostString(addr.c_str())) + { + LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "%s", "You cannot use non numeric addresses for server."); + return 1; + } + RakNet::SocketDescriptor sd((unsigned short)port, addr.c_str()); if (peer->Startup((unsigned)players, &sd, 1) != RakNet::RAKNET_STARTED) - return 0; + return 1; peer->SetMaximumIncomingConnections((unsigned short)(players)); diff --git a/files/tes3mp/tes3mp-server-default.cfg b/files/tes3mp/tes3mp-server-default.cfg index 6c0ab52fc..7a809047a 100644 --- a/files/tes3mp/tes3mp-server-default.cfg +++ b/files/tes3mp/tes3mp-server-default.cfg @@ -2,7 +2,7 @@ # from 3 to 0. 3 - only errors, 0 - all messages loglevel = 0 motd = My TES3MP server -address = server.tes3mp.com +address = 0.0.0.0 port = 25565 players = 4