Added Warnings & changeApiUrl (authenticator.js)

This commit is contained in:
Pierce 2020-04-04 13:25:14 -04:00
parent 4e9c2fbfb3
commit c35332a8e5
3 changed files with 17 additions and 7 deletions

View file

@ -2,7 +2,7 @@
##### This project is complete for now.
[![Build Status](https://travis-ci.com/Pierce01/MinecraftLauncher-core.svg?branch=master)](https://travis-ci.com/Pierce01/MinecraftLauncher-core)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![version](https://img.shields.io/badge/stable_version-3.12.0-blue)
![version](https://img.shields.io/badge/stable_version-3.12.3-blue)
![badge](https://img.shields.io/badge/ncurses-not_supported-purple)
MCLC (Minecraft Launcher Core) is a NodeJS solution for launching modded and vanilla Minecraft without having to download and format everything yourself.
@ -61,7 +61,7 @@ launcher.on('data', (e) => console.log(e));
| Parameter | Type | Description | Required |
|--------------------------|----------|-------------------------------------------------------------------------------------------|----------|
| `options.clientPackage` | String | Path or URL to the client package zip file. | False |
| `options.clientPackage` | String | Path or URL to the client package zip file. Do not rehost Minecraft, it's against ToS. | False |
| `options.removePackage` | Boolean | Option to remove the client package zip file after its finished extracting. | False |
| `options.installer` | String | Path to installer being executed. | False |
| `options.root` | String | Path where you want the launcher to work in. like `C:/Users/user/AppData/Roaming/.mc`, | True |
@ -86,6 +86,7 @@ launcher.on('data', (e) => console.log(e));
| `options.window.fullscreen` | Boolean| Fullscreen the Minecraft Client. | False |
| `options.overrides` | Object | Json object redefining paths for better customization. Example below. | False |
| `options.overrides.minArgs`| Integer| The amount of launch arguments specified in the version file before it adds the default again| False |
#### IF YOU'RE NEW TO MCLC, LET IT HANDLE EVERYTHING! DO NOT USE OVERRIDES!
```js
let opts = {
otherOps...,
@ -166,6 +167,12 @@ You'll need to provide the folder created in the versions if you're running the
| `username` | String | Username used to login with | True |
| `password` | String | Password used to login with | True |
##### changeApiUrl
| Parameter | Type | Description | Required |
|-----------|--------|--------------------------------------------------------------|----------|
| `url` | String | New URL that MCLC will make calls to authenticate the login. | True |
#### Events
| Event Name | Type | Description |

View file

@ -1,6 +1,6 @@
const request = require('request');
const uuid = require('uuid/v1');
const api_url = "https://authserver.mojang.com";
let api_url = "https://authserver.mojang.com";
module.exports.getAuth = function (username, password) {
return new Promise((resolve, reject) => {
@ -13,8 +13,7 @@ module.exports.getAuth = function (username, password) {
user_properties: JSON.stringify({})
};
resolve(user);
return;
return resolve(user);
}
const requestObject = {
@ -137,4 +136,8 @@ module.exports.signOut = function (username, password) {
else reject(body);
});
});
};
};
module.exports.changeApiUrl = function(url) {
api_url = url;
}

View file

@ -1,6 +1,6 @@
{
"name": "minecraft-launcher-core",
"version": "3.12.2",
"version": "3.12.3",
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
"main": "index.js",
"dependencies": {