Skip to content

Shandeika/nlogin_py

Repository files navigation

Installation

On PyPI: https://pypi.org/project/nlogin-py/

In terminal: pip install nlogin-py

Usage:

  1. Instantiating the nLogin class
  2. Verifying the Password
  3. Registering a Player
  4. Changing the Password

Instantiation

from nlogin_py import Nlogin

# Creates an instance
nlogin = Nlogin("localhost", "root", "", "nlogin", False)

Verifying the Password

from nlogin_py import Nlogin

# Creates an instance
nlogin = Nlogin("localhost", "root", "", "nlogin", False)

# Fetches the user identifier (search, mode)
user_id = nlogin.fetch_user_id("Player", Nlogin.FETCH_WITH_LAST_NAME)

# Verifies the password
is_valid = nlogin.verify_password(user_id, "password123")

Registering a Player

from nlogin_py import Nlogin

# Creates an instance
nlogin = Nlogin("localhost", "root", "", "nlogin", False)

# Registers a player (username, plain password, e-mail, mojang id (optional), bedrock id (optional))
success = nlogin.register("Player", "password123", "youremail@domain.com")

Changing the Password

from nlogin_py import Nlogin

# Creates an instance
nlogin = Nlogin("localhost", "root", "", "nlogin", False)

# Fetches the user identifier (search, mode)
user_id = nlogin.fetch_user_id("Player", Nlogin.FETCH_WITH_LAST_NAME)

# Changes the password (user identifier, new plain password)
success = nlogin.change_password(user_id, "newpassword123")

License

This project is licensed under the GNU General Public License v3.0.

Reference

I used a PHP package from the author of the nLogin plugin. My package is an almost exact copy written in Python.

About

A package for interacting with the nLogin plugin

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages