Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
Version 1.1.6
Browse files Browse the repository at this point in the history
- Mods spaces fix.
- README.md updated.
  • Loading branch information
Cap authored Jul 17, 2020
2 parents 9601d43 + adda6e7 commit 078888e
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 30 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [Where find the X values of my Firebase project?](#where-find-the-x-values-of-my-firebase-project)
- [Creating database](#creating-databse)
- [All finished](#all-finished)
- [Issues](#issues)

## Getting started

Expand Down Expand Up @@ -124,3 +125,7 @@ Now your Firebase database is registered and you can now use the control, check,
- Delete Firebase Member Data
- Delete Firebase Global Data
- Store Firebase Member Data List

## Issues

If you want to make a suggestion or report a possible bug, open an [issue](https://github.com/cappp/dbm-firebase/issues).
2 changes: 1 addition & 1 deletion actions/check_firebase_global_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down
2 changes: 1 addition & 1 deletion actions/check_firebase_member_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down
10 changes: 5 additions & 5 deletions actions/check_firebase_server_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down Expand Up @@ -88,13 +88,13 @@ module.exports = {

init() {
const { glob, document } = this;

glob.serverChange(
glob.serverChange(
document.getElementById('server'),
'varNameContainer'
);
glob.onChangeTrue(document.getElementById('iftrue'));
glob.onChangeFalse(document.getElementById('iffalse'));
glob.onChangeTrue(document.getElementById('iftrue'));
glob.onChangeFalse(document.getElementById('iffalse'));
},

async action(cache) {
Expand Down
2 changes: 1 addition & 1 deletion actions/control_firebase_global_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down
24 changes: 12 additions & 12 deletions actions/control_firebase_member_data_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module.exports = {
},

init() {
const { glob, document } = this;
const { glob, document } = this;

glob.memberChange(
document.getElementById('member'),
Expand All @@ -77,48 +77,48 @@ module.exports = {

async action(cache) {
const fs = require('fs');
const firebase = this.getMods().require('firebase');
const firebase = this.getMods().require('firebase');

if (!fs.existsSync('./data/fbConfig.json')) {
return console.log(
'You do not have the fbConfig.json file in your bot to continue use Firebase. Visit this repository to learn how to do it: https://github.com/cappp/dbm-firebase'
);
}
}

const fbConfig = JSON.parse(
fs.readFileSync(
'./data/fbConfig.json',
'utf-8'
)
);

if (firebase.apps.length === 0) {
firebase.initializeApp(fbConfig);
}
);
if (firebase.apps.length === 0) {
firebase.initializeApp(fbConfig);
}

const data = cache.actions[cache.index];
const memberType = parseInt(data.member);
const varName = this.evalMessage(data.varName, cache);
const member = this.getMember(memberType, varName, cache);
const dataName = this.evalMessage(data.dataName, cache);
const controlType = parseInt(data.controlType);
const value = this.eval(
const controlType = parseInt(data.controlType);
const value = this.eval(
this.evalMessage(data.value, cache),
cache
);

if (member && dataName && value) {
const membersData = firebase
.database()
.ref(`data/players/${member.id}/${dataName}`);
.ref(`data/players/${member.id}/${dataName}`);

if (controlType === 0) {
await membersData.set(value);
} else {
const data = (await membersData.once('value')).val();
await membersData.set(data + value);
}
}
}

this.callNextAction(cache);
},
Expand Down
4 changes: 2 additions & 2 deletions actions/control_firebase_server_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down Expand Up @@ -82,7 +82,7 @@ module.exports = {
return console.log(
'You do not have the fbConfig.json file in your bot to continue use Firebase. Visit this repository to learn how to do it: https://github.com/cappp/dbm-firebase'
);
}
}

const fbConfig = JSON.parse(
fs.readFileSync(
Expand Down
2 changes: 1 addition & 1 deletion actions/delete_firebase_global_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down
2 changes: 1 addition & 1 deletion actions/delete_firebase_member_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down
4 changes: 2 additions & 2 deletions actions/delete_firebase_server_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand All @@ -9,7 +9,7 @@ module.exports = {
name: 'Delete Firebase Server Data',
section: 'Other Stuff',

subtitle (data) {
subtitle(data) {
const servers = [
'Current Server',
'Temp Variable',
Expand Down
2 changes: 1 addition & 1 deletion actions/store_firebase_global_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down
2 changes: 1 addition & 1 deletion actions/store_firebase_member_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down
2 changes: 1 addition & 1 deletion actions/store_firebase_member_data_list_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down
2 changes: 1 addition & 1 deletion actions/store_firebase_server_data_MOD.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* DBM Firebase - v1.1.5
* DBM Firebase - v1.1.6
* https://github.com/cappp/dbm-firebase
*
*/
Expand Down

0 comments on commit 078888e

Please sign in to comment.