• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem loading map after applying a commit Use string views to avoid copying strings (#4079)

johnsamir

Advanced OT User
Joined
Oct 13, 2009
Messages
1,011
Solutions
6
Reaction score
171
Location
Nowhere
i use tfs 1.5 protocol 8.6 - global map that includes all cities of this version

Hello i have cherry pick this commit Use string views to avoid copying strings (#4079) · otland/forgottenserver@a295ea7 (https://github.com/otland/forgottenserver/commit/a295ea7b8881f73160500757a2f860dbc64bbf4f) i had a lot problems because had to re write a lot of things in order to compile this properly
now that i've compile it i cant load the map. i've cutted the map from 35000x311000 or something like that to 250000x2500000 but did nto worked everytjign was erased
Lua:
Linked with LuaJIT 2.1.0-beta3 for Lua support

A server developed by Mark Samman
A server downgraded by Nekiro
Visit our forum for updates, support, and resources: https://otland.net/.

>> Loading config
>> Loading RSA key
>> Establishing database connection... MySQL 3.3.1
>> Running database manager
>> Loading vocations
>> Loading items... OTB v3.62.80
>> Loading script systems
>> Using LuaJIT 2.1.0-beta3
>> Loading lua libs
>> Loading lua scripts
>> Loading monsters
>> Loading lua monsters
>> Loading outfits
>> Loading outfits
>> Checking world type... PVP
>> Loading map
> Map size: 33568x33111.
Duplicate unique id: 50056
> Map loading time: 5.882 seconds.
Allocation failed, server out of memory.
Decrease the size of your map or compile in 64 bits mode.
map dimension 33568 x 33111 which values can i use instead of these  without removing important pieces of map? how do i calculate this?
 
Last edited:
its compiled in 64 that the weirdest part
Lua:
Rebuild started at 5:56 PM...
1>------ Rebuild All started: Project: theforgottenserver, Configuration: Release x64 ------
1>otpch.cpp
1>actions.cpp
1>auras.cpp
1>ban.cpp
1>baseevents.cpp
1>bed.cpp
1>chat.cpp
1>combat.cpp
1>C:\Users\slim\Documents\GitHub\pro-ot\src\combat.cpp(650,52): warning C4100: 'spectators': unreferenced formal parameter
1>(compiling source file '/src/combat.cpp')
1>condition.cpp
1>configmanager.cpp
1>connection.cpp
1>container.cpp
1>creature.cpp
1>creatureevent.cpp
1>cylinder.cpp
1>database.cpp
1>databasemanager.cpp
1>databasetasks.cpp
1>depotchest.cpp
1>depotlocker.cpp
1>events.cpp
1>fileloader.cpp
1>game.cpp
1>globalevent.cpp
1>groups.cpp
1>guild.cpp
1>house.cpp
1>housetile.cpp
1>C:\Users\slim\Documents\GitHub\pro-ot\src\game.cpp(3331,95): warning C4100: 'shader': unreferenced formal parameter
1>(compiling source file '/src/game.cpp')
1>C:\Users\slim\Documents\GitHub\pro-ot\src\game.cpp(3331,85): warning C4100: 'aura': unreferenced formal parameter
1>(compiling source file '/src/game.cpp')
1>C:\Users\slim\Documents\GitHub\pro-ot\src\game.cpp(3331,74): warning C4100: 'wings': unreferenced formal parameter
1>(compiling source file '/src/game.cpp')
1>inbox.cpp
1>iologindata.cpp
1>iomap.cpp
1>iomapserialize.cpp
1>iomarket.cpp
1>item.cpp
1>items.cpp
1>luascript.cpp
1>mailbox.cpp
1>map.cpp
1>monster.cpp
1>monsters.cpp
1>mounts.cpp
1>movement.cpp
1>networkmessage.cpp
1>npc.cpp
1>otserv.cpp
1>outfit.cpp
1>outputmessage.cpp
1>party.cpp
1>player.cpp
1>position.cpp
1>protocol.cpp
1>C:\Users\slim\Documents\GitHub\pro-ot\src\spells.h(210,22): warning C4242: 'argument': conversion from 'int32_t' to 'unsigned short', possible loss of data
1>(compiling source file '/src/otserv.cpp')
1>protocolgame.cpp
1>C:\Users\slim\Documents\GitHub\pro-ot\src\player.cpp(2634,79): warning C4100: 'status': unreferenced formal parameter
1>(compiling source file '/src/player.cpp')
1>C:\Users\slim\Documents\GitHub\pro-ot\src\player.cpp(2634,58): warning C4100: 'vipName': unreferenced formal parameter
1>(compiling source file '/src/player.cpp')
1>protocollogin.cpp
1>protocolold.cpp
1>quests.cpp
1>raids.cpp
1>rsa.cpp
1>scheduler.cpp
1>script.cpp
1>scriptmanager.cpp
1>server.cpp
1>shaders.cpp
1>signals.cpp
1>spawn.cpp
1>spells.cpp
1>storeinbox.cpp
1>protocolstatus.cpp
1>talkaction.cpp
1>tasks.cpp
1>teleport.cpp
1>thing.cpp
1>tile.cpp
1>tools.cpp
1>trashholder.cpp
1>vocation.cpp
1>weapons.cpp
1>C:\Users\slim\Documents\GitHub\pro-ot\src\tile.cpp(1125,29): warning C4245: 'argument': conversion from 'int' to 'uint16_t', signed/unsigned mismatch
1>(compiling source file '/src/tile.cpp')
1>wildcardtree.cpp
1>wings.cpp
1>xtea.cpp
1>Generating code
1>C:\Users\slim\Documents\GitHub\pro-ot\src\iologindata.cpp(1027): warning C4715: 'IOLoginData::getNameByGuid': not all control paths return a value
1>C:\Users\slim\Documents\GitHub\pro-ot\src\player.cpp(2650): warning C4715: 'Player::addVIP': not all control paths return a value
1>Finished generating code
1>theforgottenserver.vcxproj -> C:\Users\slim\Documents\GitHub\pro-ot\vc17\x64\Release\theforgottenserver-x64.exe
1>Done building project "theforgottenserver.vcxproj".
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
========== Rebuild completed at 5:58 PM and took 02:04.164 minutes ==========
Post automatically merged:

up i been stuck with this,

somebody can tell me how to release commits in order to display just the changes and nothing else? Does not care about other commits but my datapack files it just that or if somebody could help me via remote desktop like AnyDesk teamviewer etc would appreciate it a lot
 
Last edited:
Solved thanks to @Codinablack, im very to you. that you let me review yout repo in order to achieve this the problem maybe was with vipentry or smissing code related to it not quite sure since reverted my commit and redo everything
also a problem im mainloader otbm
and here too
Lua:
static Tile* createTile(Item*& ground, Item* item, uint16_t x, uint16_t y, uint8_t z);

    public:
        bool loadMap(Map* map, const std::filesystem::path& fileName);

        /* Load the spawns
         * \param map pointer to the Map class
         * \returns Returns true if the spawns were loaded successfully
         */
        static bool loadSpawns(Map* map) {
            if (map->spawnfile.empty()) {
                //OTBM file doesn't tell us about the spawnfile,
                //lets guess it is mapname-spawn.xml.
                map->spawnfile = g_config.getString(ConfigManager::MAP_NAME);
                map->spawnfile += "-spawn.xml";
            }

            return map->spawns.loadFromXml(map->spawnfile.string());
        }

        /* Load the houses (not house tile-data)
         * \param map pointer to the Map class
         * \returns Returns true if the houses were loaded successfully
         */
        static bool loadHouses(Map* map) {
            if (map->housefile.empty()) {
                //OTBM file doesn't tell us about the housefile,
                //lets guess it is mapname-house.xml.
                map->housefile = g_config.getString(ConfigManager::MAP_NAME);
                map->housefile += "-house.xml";
            }

            return map->houses.loadHousesXML(map->housefile.string());
        }
 
Back
Top