OTServlist - Idle time

Discussion in 'Otservlist Discussion' started by Sajgon, Aug 2, 2017.

  1. Sajgon

    Sajgon Member

    Joined:
    Mar 10, 2017
    Messages:
    74
    Likes Received:
    53
    Best Answers:
    1
    Hello,
    I would like to change kickIdlePlayerAfterMinutes = 15 to infinitive but how can I do this without getting banned on OTServlist?

    Kind regards
     
    supergt likes this.
  2. Sir Knighter

    Sir Knighter ArchLight Developer Premium User

    Joined:
    Jun 29, 2009
    Messages:
    3,608
    Likes Received:
    927
    Best Answers:
    0
    Source edits to not count a player after 15 minutes as being online ^_^ we did similar on Archlight so afk's weren't counted but they could still afk train.
     
  3. Sajgon

    Sajgon Member

    Joined:
    Mar 10, 2017
    Messages:
    74
    Likes Received:
    53
    Best Answers:
    1
    Anything you could share to the public or private bro? :)
     
  4. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,776
    Likes Received:
    581
    Best Answers:
    10
    you will have to edit protocol login information about players online and set it to real players or whatever u want, something like

    Code (C++):
    1.    uint32_t real = 0;
    2.    std::map<uint32_t, uint32_t> list;
    3.    for (const auto& it : g_game.getPlayers()) {
    4.        if (it.second->getIP() != 0) {
    5.            int32_t value;
    6.            it.second->getStorageValue(storageID, value);
    7.            if (value != 1) {
    8.                real++;
    9.            }
    10.        }
    11.    }
    12.    players.append_attribute("online") = std::to_string(real).c_str();
    13.  
     
    Sajgon likes this.
  5. Sajgon

    Sajgon Member

    Joined:
    Mar 10, 2017
    Messages:
    74
    Likes Received:
    53
    Best Answers:
    1
    Adding that code to after this line forgottenserver/protocolgame.cpp at master · otland/forgottenserver · GitHub would do it?
     
  6. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,776
    Likes Received:
    581
    Best Answers:
    10
    Last edited: Aug 2, 2017
    supergt and Sajgon like this.
  7. Sir Knighter

    Sir Knighter ArchLight Developer Premium User

    Joined:
    Jun 29, 2009
    Messages:
    3,608
    Likes Received:
    927
    Best Answers:
    0
    He got it ^_^
     
    Sajgon likes this.
  8. supergt

    supergt Member

    Joined:
    May 11, 2017
    Messages:
    38
    Likes Received:
    11
    Best Answers:
    0
    Looking on status.cpp in 0.4 i found the function:
    getPlayersOnline()
    That i think count on otservlist...

    And i just found this function on game.h on line 219
    forgottenserver/game.h at master · otland/forgottenserver · GitHub

    But that is so strange, did u know how to do it on 0.4 or could us who uses 0.4 to do?
     
  9. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,776
    Likes Received:
    581
    Best Answers:
    10
    did you got the sources?
     
    supergt likes this.
  10. Sajgon

    Sajgon Member

    Joined:
    Mar 10, 2017
    Messages:
    74
    Likes Received:
    53
    Best Answers:
    1
    @StreamSide What is storageID supposed to be?
    I am getting this error: protocolstatus.cpp:126:31: error: ‘storageID’ was not declared in this scope
    Can I just use any free storageID or needs to be a specific one?

    Edit: I tried 54321 and no errors.
     
    Last edited: Aug 3, 2017
  11. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,776
    Likes Received:
    581
    Best Answers:
    10
    I used storage id you show you what you can do, if players goes afk then storage->1, thats why.
     
  12. supergt

    supergt Member

    Joined:
    May 11, 2017
    Messages:
    38
    Likes Received:
    11
    Best Answers:
    0
  13. paradanca

    paradanca New Member

    Joined:
    Aug 19, 2010
    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Hello, I'm not able to report on the website, I'm not sure why, but I come in this way to report the server guerra-war.com, this without limit of mcs being that each one is logging more than 20 mcs and ADM asks for all log in to give players online.
    Thanks, I get a response
     

Share This Page

Loading...