diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 6698c3d..d428879 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -1322,12 +1322,9 @@ bool Minecraft::joinMultiplayerFromString( const std::string& server ) } else { ip = server; } - - printf("%s \n", port.c_str()); if (isLookingForMultiplayer && netCallback) { isLookingForMultiplayer = false; - printf("test"); int portNum = atoi(port.c_str()); return raknetInstance->connect(ip.c_str(), portNum); } diff --git a/src/main_dedicated.cpp b/src/main_dedicated.cpp index f1a0921..2c429ed 100755 --- a/src/main_dedicated.cpp +++ b/src/main_dedicated.cpp @@ -52,7 +52,7 @@ std::string findStringInConfig(std::string line, std::string config) { } if (valuePos == config.size()) { - throw std::runtime_error("Cannot end line"); + throw std::runtime_error("Cannot find end of the line"); } valueStr += sym; @@ -63,31 +63,7 @@ std::string findStringInConfig(std::string line, std::string config) { } -int main(int numArguments, char* pszArgs[]) { - ArgumentsSettings aSettings(numArguments, pszArgs); - // if(aSettings.getShowHelp()) { - // // TODO: Map with args and print it with std::cout and for loop - // // TODO: World size setting - - // ArgumentsSettings defaultSettings(0, NULL); - - // printf("Minecraft Pockect Edition Server %s\n", Common::getGameVersionString("").c_str()); - // printf("-------------------------------------------------------\n"); - - // printf("--cachepath - Path to where the server can store temp stuff (not sure if this is used) [default: \"%s\"]\n", defaultSettings.getCachePath().c_str()); - // printf("--externalpath - The path to the place where the server should store the levels. [default: \"%s\"]\n", defaultSettings.getExternalPath().c_str()); - // printf("--levelname - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelName().c_str()); - // printf("--gamemode - The name of the gamemode [default: \"%s\"]\n", defaultSettings.getGamemode().c_str()); - // printf("--leveldir - The name of the server [default: \"%s\"]\n", defaultSettings.getLevelDir().c_str()); - // printf("--help - Shows this message.\n"); - // printf("--port - The port to run the server on. [default: %d]\n", defaultSettings.getPort()); - // printf("--serverkey - The key that the server should use for API calls. [default: \"%s\"]\n", defaultSettings.getServerKey().c_str()); - - // printf("-------------------------------------------------------\n"); - - // return 0; - // } - +int main(int numArguments, char* pszArgs[]) { std::ifstream serverProperties("server.properties"); int port = 0; @@ -138,7 +114,7 @@ int main(int numArguments, char* pszArgs[]) { gamemode = GameType::Survival; } - printf("%d %s %s %d \n", port, cachePath.c_str(), externalPath.c_str(), gamemode); + printf("%d %s %s %d %d\n", port, cachePath.c_str(), externalPath.c_str(), gamemode, LevelConstants::CHUNK_CACHE_WIDTH); } else { std::ofstream defaultProperties("server.properties"); @@ -160,7 +136,7 @@ int main(int numArguments, char* pszArgs[]) { printf("%s \n", buffer.str().c_str()); - printf("Edit a config file first!"); + printf("Edit a config file first!\n"); defaultProperties.close(); exit(0); diff --git a/src/network/ClientSideNetworkHandler.cpp b/src/network/ClientSideNetworkHandler.cpp index 9c3a6b5..e5db2b7 100755 --- a/src/network/ClientSideNetworkHandler.cpp +++ b/src/network/ClientSideNetworkHandler.cpp @@ -45,6 +45,9 @@ ClientSideNetworkHandler::ClientSideNetworkHandler(Minecraft* minecraft, IRakNet requestNextChunkPosition(0), requestNextChunkIndex(0) { + NumRequestChunks = LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH; + requestNextChunkIndexList.resize(NumRequestChunks); + chunksLoaded.resize(NumRequestChunks); rakPeer = raknetInstance->getPeer(); }