1.0.17 • Published 4 years ago

multicraft v1.0.17

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Multicraft

Node.js API for Multicraft (https://multicraft.org)

Under active development.

This package isn't finished, alot of the functions listed below either aren't working or aren't even implemented, however most of the server & user ones are, use with caution.

Join the discussion!

Discord | GitHub

Basic implementation of the package.
const api = require("multicraft").begin({
  url: "API PANEL URL",
  user: "USERNAME",
  key: "API_KEY"
});
Built using Promises.

If you don't know how Promises work, please take a look. Promises all us to use async/await and chained responses.

// Chained
api.getUser(1).then((response) => {
  console.log(response);
});

// Async / Await
let response = await api.getUser(1);
console.log(response);

Frequently asked questions;

  • x is returning function not defined.
    • That function isn't implemented yet or you aren't on the latest build, firstly check for updates, if it persits, join the discord and ask for it to be implemented.
  • I found a bug, or, x isn't working!
    • Check for updates on the package, if that doesn't fix the problem, join the discord and ask for help.
  • I'd like to help out!
    • Wow that's amazing, however, currently the project source isn't public, feel free to join my discord and I'll let you know when I'm posting to GitHub.
List of functions.

All of these functions are prefixed by your API instance; api.

User functions // 90% implemented.

listUsers();

findUsers(field, value);

getUser(0);

getCurrentUser();

updateUser(id, field, value);

createUser(name, email, password);

deleteUser(id);

getUserRole(user_id, server_id);

setUserRole(user_id, server_id, role);

getUserFtpAccess(user_id, server_id);

setUserFtpAccess(user_id, user_id, mode);

getUserId(name);

validateUser(name, password);

generateUserApiKey(id);

getUserApiKey(user_id);

removeUserApiKey(user_id);

Player functions // 10% implemented.

listPlayers(server_id);

findPlayers(server_id, field, value);

getPlayer(id);

updatePlayer(id, field, value);

createPlayer(server_id, name);

deletePlayer(id);

assignPlayerToUser(player_id, user_id);

Command functions // Not implemented.

listCommands(server_id);

findCommands(server_id, field, value);

getCommand(id);

updateCommand(id, field, value);

createCommand(server_id, name, role, chat, response, run);

deleteCommand(id);

Server functions // 90% implemented.

listServers();

findServers(field, value);

listServersByConnection(connection_id);

listServersByOwner(user_id);

getServer(id);

updateServer(id, field, value);

createServerOn(daemon_id = 0, no_commands = 0, no_setup_script = 0);

createServer(name = '', port = 0, base = '', players = 0, no_setup_script = 0);

suspendServer(id, stop = 1);

resumeServer(id, start = 1);

deleteServer(id, delete_dir = 'no', delete_user = 'no');

getServerStatus(id, player_list = 0);

getServerOwner(server_id);

setServerOwner(server_id, user_id);

getServerConfig(id);

updateServerConfig(id, field, value);

startServerBackup(id);

getServerBackupStatus(id);

startServer(id);

stopServer(id);

restartServer(id);

killServer(id);

startAllServers();

stopAllServers();

restartAllServers();

killAllServers();

sendConsoleCommand(server_id, command);

sendAllConsoleCommand(command);

runCommand(server_id, command_id, run_for = 0);

getServerLog(id);

clearServerLog(id);

getServerChat(id);

clearServerChat(id);

sendServerControl(id, command);

getServerResources(id);

moveServer(server_id, daemon_id);

Daemon functions // Fully implemented.

listConnections();

findConnections(field, value);

getConnection(id);

removeConnection(id);

getConnectionStatus(id);

getConnectionMemory(id, include_suspended = 0);

getStatistics(daemon_id = 0, include_suspended = 0);

Settings function // Somewhat functional?

listSettings();

getSetting(key);

setSetting(key, value);

deleteSetting(key);

Schedule functions // Not implemented.

listSchedules(server_id);

findSchedules(server_id, field, value);

getSchedule(id);

updateSchedule(id, field, value);

createSchedule(server_id, name, ts, interval, cmd, status, for);

deleteSchedule(id);

Database functions // Not functional.

getDatabaseInfo(server_id);

createDatabase(server_id);

changeDatabasePassword(server_id);

deleteDatabase(server_id);

Well then, that's alot of functions!

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.14-0

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago