[8.6x] OTServ 0.6.4 (Cast System)

Discussion in 'Distributions' started by Nottinghster, Jun 23, 2016.

Tags:
  1. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    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
     
    Cade, Gesior.pl and tetra20 like this.
  2. Thexamx

    Thexamx worst coder

    Joined:
    Sep 7, 2015
    Messages:
    1,414
    Likes Received:
    379
    Best Answers:
    35
    Got war system?:p
     
  3. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    @Thexamx
    War System is already included
     
  4. Gesior.pl

    Gesior.pl Mega Noob&LOL 2012

    Joined:
    Sep 18, 2007
    Messages:
    1,842
    Likes Received:
    652
    Best Answers:
    2
    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:
    1.  
    2.     if(_player->client){
    3.         if(eventConnect != 0 && !castAccount){
    4.             //A task has already been scheduled just bail out (should not be overriden)
    5.             disconnectClient(0x14, "You are already logged in.");
    6.             return false;
    7.         }
    8.  
    9.         if(!castAccount)
    10.         {
    11.             g_chat.removeUserFromAllChannels(_player);
    12.             _player->disconnect();
    13.             _player->isConnecting = true;
    14.         }
    15.  
    16.         addRef();
    17.         if(!castAccount)
    18.             eventConnect = g_scheduler.addEvent(
    19.                 createSchedulerTask(1000, boost::bind(&ProtocolGame::connect, this, _player->getID(), true, castAccount)));
    20.         else
    21.             connect(_player->getID(), true, castAccount);
    22.        
    23.         return true;
    24.     }
    25.  
    26.     addRef();
    27.     return connect(_player->getID(), false, castAccount);
    28. }
    29.  
    30. bool ProtocolGame::connect(uint32_t playerId, const bool isLoggingIn, bool castAccount)
    31. {
    32.     unRef();
    33.     eventConnect = 0;
    34. ...
    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.
     
  5. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    @Gesior.pl

    Thank you for that fix, I'll commit

    You're the best !
     
  6. Thexamx

    Thexamx worst coder

    Joined:
    Sep 7, 2015
    Messages:
    1,414
    Likes Received:
    379
    Best Answers:
    35
    Getting error in compiling. ubuntu 14.04
    Code (Text):
    1.  
    2. cp ./../config.lua.dist config.lua
    3. cp: cannot stat ‘./../config.lua.dist’: No such file or directory
    4. make[1]: *** [config.lua] Error 1
    5.  
     
  7. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    Rename config.lua in main folder to config.lua.dist
     
  8. Thexamx

    Thexamx worst coder

    Joined:
    Sep 7, 2015
    Messages:
    1,414
    Likes Received:
    379
    Best Answers:
    35
    Also how do I run server without admin?
    Code (Text):
    1. : OTServ Version 0.6.4_SVN
    2. :: ============================================================================
    3. ::
    4.  
    5. OTServ executed as root user, please login with a normal user.
    6.  
     
  9. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    https://github.com/Nottinghster/OTServ_SVN-0.6.4/blob/master/src/otserv.cpp#L224

    You can make your own modifications ;)

    P.S: I'm not being rude with you...
     
  10. Thexamx

    Thexamx worst coder

    Joined:
    Sep 7, 2015
    Messages:
    1,414
    Likes Received:
    379
    Best Answers:
    35
    This is not compatible with gesior account manager? ;d
     
  11. Lelodro

    Lelodro OTX Collaborator

    Joined:
    Sep 15, 2008
    Messages:
    315
    Likes Received:
    168
    Best Answers:
    3
    Nottinghster likes this.
  12. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    Made some commits about Cast System, now it's working 100% !!!
     
  13. Nottinghster

    Nottinghster Tibia World RPG Developer

    Joined:
    Oct 24, 2007
    Messages:
    1,426
    Likes Received:
    294
    Best Answers:
    0
    For all OTHire users, you can import the Cast System without problem !
     
  14. pierroth

    pierroth Mar Co.

    Joined:
    Sep 11, 2008
    Messages:
    339
    Likes Received:
    8
    Best Answers:
    0
    uumm.. how to compile? why no data folder?
     
  15. PB3LL

    PB3LL Member

    Joined:
    Oct 30, 2015
    Messages:
    60
    Likes Received:
    7
    Best Answers:
    0
    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..."
     
  16. uke15

    uke15 New Member

    Joined:
    Aug 30, 2016
    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Hello! Just a noob question, what is the difference betwen otserv and theforgottenserver?
     
  17. Jompi

    Jompi A hoagie in disguise.

    Joined:
    Oct 22, 2007
    Messages:
    178
    Likes Received:
    6
    Best Answers:
    0
    Is this only available for x32?
     
  18. PB3LL

    PB3LL Member

    Joined:
    Oct 30, 2015
    Messages:
    60
    Likes Received:
    7
    Best Answers:
    0
  19. PB3LL

    PB3LL Member

    Joined:
    Oct 30, 2015
    Messages:
    60
    Likes Received:
    7
    Best Answers:
    0
    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?
     
  20. megagaea

    megagaea Scripter and mapper

    Joined:
    Sep 25, 2013
    Messages:
    148
    Likes Received:
    29
    Best Answers:
    1
    PRo CAn u Give name oR dirct link of edit iam sreaching it form much time
     

Share This Page

Loading...