Server
- Working init discord bot
- Modular events and commands
- Has access to the socket server
- Working init socket server
- Need to work on getting access to discord bot
- Working init web server
Currently working on breaking out the init of the socket server
Client
- Working init socket client
Currently working on the discord bot to join voice channels
40 lines
1.4 KiB
JavaScript
40 lines
1.4 KiB
JavaScript
import dotenv from 'dotenv';
|
|
dotenv.config()
|
|
|
|
/**
|
|
*
|
|
*/
|
|
export class ClientNodeObject {
|
|
/**
|
|
*
|
|
* @param {string} param0._id The ID of the node (Assigned by the client on first boot)
|
|
* @param {string} param0._name The name of the node (Assigned by the user)
|
|
* @param {string} param0._location The physical location of the node (Assigned by the user)
|
|
* @param {object} param0._nearbySystems An object array of nearby systems (Assigned by the user)
|
|
*/
|
|
constructor({ _id = undefined, _name = undefined, _location = undefined, _nearbySystems = undefined}) {
|
|
this.id = _id;
|
|
this.name = _name;
|
|
this.location = _location;
|
|
this.nearbySystems = _nearbySystems;
|
|
}
|
|
}
|
|
|
|
|
|
/** The configuration object for the node */
|
|
export class ClientNodeConfig {
|
|
constructor({
|
|
_id = process.env.CLIENT_ID,
|
|
_name = process.env.CLIENT_NAME,
|
|
_location = process.env.CLIENT_LOCATION,
|
|
_nearbySystems = undefined, // TODO - Get the presets when loading the config instead of having to do it after the fact
|
|
_serverIp = process.env.SERVER_IP,
|
|
_serverPort = process.env.SERVER_PORT,
|
|
}) {
|
|
this.node = new ClientNodeObject({
|
|
_id:_id, _name:_name, _location:_location, _nearbySystems:_nearbySystems
|
|
});
|
|
this.serverIp = _serverIp;
|
|
this.serverPort = _serverPort;
|
|
}
|
|
} |