Giter Club home page Giter Club logo

rage-accounts's Introduction

RAGE Accounts

NOTE: Requires RAGE:MP 1.1

A MySQL boilerplate to quickly create an account system without all the work. This handles both logging in and registration. This also utilised the delayedInitilisation feature added in RAGE:MP 1.1 to allow time for your database and any other assets on your server to be loaded first before allowing any user connections. By using this feature, this avoids any errors of users connecting before your resources are done loading. Read below for more information. A custom config file has also been used to easily change your database variables (username/database name/database password) and will allow you to easily add more configuration options going forward.

Features

  • CEF Login/Registration pages with error handling
  • Idle Kicker (Kicks any player who is sitting on the login/register pages after 60 seconds of no attempts)
  • Promise based loading
  • Easy imported SQL into your MySQL database

Database Schema

  • Username
  • Email
  • Password (Encryted using BCrypt)
  • Registration Date
  • Last Active (Updated each time you login)
  • Social Club
  • Social Club ID

Limitations

  • This doesn't include password recovery, this will need to be setup yourself.
  • There is a banned handler clientside to block logins of banned players, but there is no banning system put in place, you will need to set this up (This requires an admin system and this isn't included).

Player Variables

  • loggedIn : Boolean (True when the player is logged in, False when they're on the login/registration page)

Delayed Initilisation

RAGE:MP introduced a delayed initilisation feature so servers can properly load their resources before allowing connections.

Inside packages/folder/index.js there is a self-executing anonymous async function (line 23 or look for the "Step 4" comment) which runs as soon as the server starts. For each resource you need knowledge around promises in order to utilise this function properly. I've added a 'test' package to also see even when a package takes a couple seconds to load, the server won't accept connections until it's done. This doesn't need to be used however it is highly recommended that you continue using this method when creating your server.

rage-accounts's People

Contributors

mrpancakers avatar carbowix avatar

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.