Code Monkey home page Code Monkey logo

Comments (2)

CuriousMike56 avatar CuriousMike56 commented on June 15, 2024

To expand on this, there should also be banned vehicles and usernames. The server scripts can ban vehicles, but the server must be restarted for the changes to apply.

from ror-server.

ohlidalp avatar ohlidalp commented on June 15, 2024

Hi.

RoRserver has persistent state AUTH_BANNED(32) based on token in authfile - this is checked first when connecting.

There are also IP-bans which are created by "!ban " command and aren't persisted. Nickname is recorded but not checked:

// check if banned
SWBaseSocket::SWBaseError error;
if (Sequencer::IsBanned(sock->get_peerAddr(&error).c_str())) {
Logger::Log(LOG_VERBOSE, "rejected banned IP %s", sock->get_peerAddr(&error).c_str());
Messaging::SendMessage(sock, RoRnet::MSG2_BANNED, 0, 0, 0, 0);
return;
}

Draft

  • Maintain "blacklist.json" containing existing ban-records:
    struct ban_t {
    unsigned int uid; //!< userid
    char ip[40]; //!< ip of banned client
    char nickname[RORNET_MAX_USERNAME_LEN]; //!< Username, this is what they are called to
    char bannedby_nick[RORNET_MAX_USERNAME_LEN]; //!< Username, this is what they are called to
    char banmsg[256]; //!< why he got banned
    };
  • Add nick-blacklist by adding a "type {IP, NICK, BOTH}" field to the above struct.
  • Vehicle bans: add "![un]blacklist " commands, create new struct similar to ban_t and persist it in "blacklist.json" as well.
  • Vehicle bans: record { truckfile name/truck full name, GUID }, but those be easily faked, we may need to record node/beam/wheel/command/hydro counts, possibly with custom checksums - whatever data server has available.

from ror-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.