• 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!

[8.6x] OTServ 0.6.4 (Cast System)

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,565
Solutions
6
Reaction score
430
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
OTServ_SVN 0.6.4
Client version: 8.60

Changes can be found here https://github.com/Nottinghster/OTServ_SVN-0.6.4/commits/master

List of lua functions:

You can see the functions and their parameters in these files :
functions.lua and luascript.cpp and npc functions in /npc/scripts/lib/

If you want to compile the server by yourself on windows/linux please take a look at this tutorial:
http://otland.net/threads/compiling-simple-otserv-msvc-2010-linux-compiling-the-source.218342/

From what I can say the server is most stablest distro over all and have all 8.6 features working as they should.

Github link: https://github.com/Nottinghster/OTServ_SVN-0.6.4
 
Cast system is not optimized [in player.cpp check if 'this' player is casting, before you iterated over list of all casts spectators!] and there is memory [+CPU, because it iterates over bigger and bigger table] leak.

Compare this code:
https://github.com/Nottinghster/OTServ_SVN-0.6.4/blob/master/src/protocolgame.cpp#L232

with my code [fixed by Elf]:
PHP:
    if(_player->client){
        if(eventConnect != 0 && !castAccount){
            //A task has already been scheduled just bail out (should not be overriden)
            disconnectClient(0x14, "You are already logged in.");
            return false;
        }

        if(!castAccount)
        {
            g_chat.removeUserFromAllChannels(_player);
            _player->disconnect();
            _player->isConnecting = true;
        }

        addRef();
        if(!castAccount)
            eventConnect = g_scheduler.addEvent(
                createSchedulerTask(1000, boost::bind(&ProtocolGame::connect, this, _player->getID(), true, castAccount)));
        else
            connect(_player->getID(), true, castAccount);
       
        return true;
    }

    addRef();
    return connect(_player->getID(), false, castAccount);
}

bool ProtocolGame::connect(uint32_t playerId, const bool isLoggingIn, bool castAccount)
{
    unRef();
    eventConnect = 0;
...

Your code adds 'ref' to protocolgame object of spectator and never remove it. Server keeps all spectators until restart. After 10 hours with 500 online [around 10000 connect/disconnect from casts] RAM grown from 3GB to 5GB and CPU use even with 10 online was 30% of 4GHz core, because every packet iterated over big list of protocolgames.
 
Getting error in compiling. ubuntu 14.04
Code:
cp ./../config.lua.dist config.lua
cp: cannot stat ‘./../config.lua.dist’: No such file or directory
make[1]: *** [config.lua] Error 1
 
Also how do I run server without admin?
Code:
: OTServ Version 0.6.4_SVN
:: ============================================================================
::

OTServ executed as root user, please login with a normal user.
 
This is not compatible with gesior account manager? ;d
 
doesnt seem to be working with 0.4 -- i have a cast running from my account but site doesnt have anything show up. "Currently there are no active casts online..."
 
Hello! Just a noob question, what is the difference betwen otserv and theforgottenserver?
 
For some reason it isnt changing the value in database when cast should be online. Cast has started but value shows 0. When I change value to 1 then it shows on the page. Why is the value not changing when cast online?
 
PRo CAn u Give name oR dirct link of edit iam sreaching it form much time
 
Back
Top