• Vote in November Mapping Competition to select a winner!
  • 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,507
Solutions
4
Reaction score
356
Location
Brazil - Rio de Janeiro
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
 

Gesior.pl

Mega Noob&LOL 2012
Senator
Premium User
Joined
Sep 18, 2007
Messages
2,133
Solutions
25
Reaction score
1,380
Location
PLand
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.
 

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,230
Solutions
98
Reaction score
1,156
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
 

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,230
Solutions
98
Reaction score
1,156
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.
 
OP
Nottinghster

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,507
Solutions
4
Reaction score
356
Location
Brazil - Rio de Janeiro

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,230
Solutions
98
Reaction score
1,156
This is not compatible with gesior account manager? ;d
 

PB3LL

Member
Joined
Oct 30, 2015
Messages
60
Reaction score
8
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..."
 

uke15

New Member
Joined
Aug 30, 2016
Messages
16
Reaction score
0
Hello! Just a noob question, what is the difference betwen otserv and theforgottenserver?
 

PB3LL

Member
Joined
Oct 30, 2015
Messages
60
Reaction score
8
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?
 

megagaea

Scripter and mapper
Joined
Sep 25, 2013
Messages
147
Solutions
1
Reaction score
29
PRo CAn u Give name oR dirct link of edit iam sreaching it form much time
 
Top