Coder Social home page Coder Social logo

boson's People

Contributors

cubrr avatar

Watchers

 avatar  avatar  avatar  avatar

boson's Issues

Command spell checking

Implement spell checking for commands. The Levenshtein algo from the old plugin could be used.

jCuber: !halp
[Q - BOSON] Did you mean: !help?

Modularity: Support on the fly plugin updates

Should we consider making the plugin fully modular? Note to self: don't use Assembly.LoadFile.

Todo: EXPLORE APPDOMAINS MORE IN THE PLUGIN CONTEXT

Options for on the fly updates

Method Pros  Cons Notes
Use separate loader DLL and Assembly.LoadFrom the entire shebang Enables on the fly updates Low modularity Can't unload assemblies without unloading the AppDomain
Use Assembly.LoadFrom from main plugin DLL to load each module ? ? Can't unload assemblies without unloading the AppDomain
Separate AppDomains and shadow copying[1] [2] Enables hot module updates; no restarts. How to do appdomain interop? Will Mono crash? https://github.com/jduv/AppDomainToolkit
Use separate program which calls embedded Mono methods that unloads the assemblies and fastrestarts Complete control and access Need someone to run the program...unless we can drop an executable. Also, still need to restart. If managed: Marshal.GetDelegateForFunctionPointer

Support remote command calling

// TODO: Maybe some day we can call commands remotely

public BaseScript.EventEat CallCommand(string commandName, IList<string> arguments, ChatMessage message, out string exceptionMessage)
{
    // TODO: Maybe some day we can call commands remotely
    exceptionMessage = null;

    ICommand command;
    ...

PM system

  • Basic PM functionality, silEnT mod/shrubbot style (or was it MC?); shows you the message you just sent
  • Possibility to leave messages to offline players, fetched when player joins (or spawns on) the server

Implement blacklist

Need to be able to blacklist following entity properties:

  • Name
  • HWID
  • IP
    • Explicit address
    • Subnet?
  • Callsign title
    • String representation
    • Explicit bytes
  • Callsign clantag
    • String representation
    • Explicit bytes

Pagination for long plugin responses

Long plugin responses to clients should be paginated with manual page turning.

  • Determine maximum length for a readable message
    • Maximum length is:
  • Create PaginatedMessage class with IList<string> containing the pages and a CurrentPage property.
  • Manual pagination by commands
    • Connect the class to BosonClient and let the command check if the client has any paginated messages pending?
    • Or create a pagination manager which maintains client states?

Finish database object models

Need the following models:

  • Account
    • Username
    • Password & hash
    • Whichever UID we go for (#8)
    • Command exceptions: forbidden commands and explicitly allowed commands (e.g. give a random lvl 100 !ban or something)
  • Rank
    • Numeric level
    • VIP status
  • Commands
    • Need to figure out some relational design for connecting the commands to the ranks!
  • Logging errors and other info (#9)

Create account system

Plausible specification

1. Ranks

A rank shall contain an integer level, a string description and a list of commands.
The level shall be an unique integer where the lowest number represents a rank with the least rights and the highest number represents a rank with the most rights. The description string shall be used to provide context to other users about the rank. The list of commands contains the base commands for the rank.

interface IRank
{
    IEnumerable<ICommand> Commands { get; }
    string Description { get; }
    int Level { get; }
}

2. Accounts

An account shall consist of a rank, unique username, password and VIP status flag.

If the account is the guest account used for unregistered clients, the username shall be "Guest", the password null and vip status false.

interface IUserAccount
{
    string Username { get; }
    string Password { get; }
    IRank Rank { get; }
    bool Vip { get; }
}

abstract class IGuestAccount : IUserAccount
{
    public virtual string Username { get { return "Guest"; } }
    public virtual string Password { get { return null; } }
    public abstract IRank Rank { get; protected set; }
    public virtual bool Vip { get { return false; } }
}

3. Account manager

The account manager shall handle client registrations, logins, password changes.

interface IAccountManager
{
    HashSet<IUserAccount> AuthenticatedUsers { get; }
    /* Return type undefined for now */ void Authenticate(IUserAccount userAccount, string password);
    /* Return type undefined for now */ void SignOut(IUserAccount userAccount);
    /* Return type undefined for now */ void Register(IUserAccount userAccount, string password);
    /* Return type undefined for now */ void UpdatePassword(IUserAccount userAccount, string currentPassword, string newPassword);
}

4. Future plans

  • Make the account system fully autonomous, allowing for lost password resets without administrator notice.

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.