refactor/remove mongoose + quality of life

This commit is contained in:
SowinskiBraeden committed 2023-10-21 15:03:45 -07:00
1 parent ae2f651c83
commit 37aff39490
26 files changed
+235 -329

No files matched your search

+164
View File
@@ -0,0 +1,164 @@
module.exports = {
Armbands: [
{
name: "Black",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/8/82/ArmbandBlack.png/revision/latest?cb=20161127174754"
},
{
name: "Blue",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/b/bd/ArmbandBlue.png/revision/latest?cb=20161127174803"
},
{
name: "Green",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/c/ce/ArmbandGreen.png/revision/latest?cb=20161127174812"
},
{
name: "Orange",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/e/e6/ArmbandOrange.png/revision/latest?cb=20161127174846"
},
{
name: "Pink",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/f/f7/ArmbandPink.png/revision/latest?cb=20161127174854"
},
{
name: "Red",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/1/14/Armband.png/revision/latest?cb=20161127174901"
},
{
name: "Yellow",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/8/81/ArmbandYellow.png/revision/latest?cb=20161127174918"
},
{
name: "White",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/c/c7/Armband_White.png/revision/latest?cb=20161127174926"
},
{
name: "Altis",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/e/ee/Flag_alti_co.png/revision/latest?cb=20200820222622"
},
{
name: "Asiain Pacific Alliance (APA)",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/c/c2/Flag_apa_co.png/revision/latest?cb=20200820222623"
},
{
name: "Bear",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/e/e1/Flag_bear_co.png/revision/latest?cb=20200820222626"
},
{
name: "Bohemia Interactive",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/e/ee/Flag_bi_co.png/revision/latest?cb=20200820222627"
},
{
name: "Brain",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/7/7d/Flag_brain_co.png/revision/latest?cb=20200820222628"
},
{
name: "Chernarussian Defence Forces (CDF)",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/d/d6/Flag_cdf_co.png/revision/latest?cb=20200820222629"
},
{
name: "Chedaki (CHED)",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/9/96/Flag_ched_co.png/revision/latest?cb=20200820222630"
},
{
name: "CHEL",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/9/98/Flag_chel_co.png/revision/latest?cb=20200820222631"
},
{
name: "Chernarus",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/e/ef/Flag_chern_co.png/revision/latest?cb=20200820222632"
},
{
name: "Chernarus Mining Corporation (CMC)",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/d/da/Flag_cmc_co.png/revision/latest?cb=20200820222634"
},
{
name: "Rooster",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/4/44/Flag_cock_co.png/revision/latest?cb=20200820222635"
},
{
name: "DayZ",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/b/b2/Flag_dayz_co.png/revision/latest?cb=20200820222636"
},
{
name: "North Sahrani (DROS)",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/2/24/Flag_dros_co.png/revision/latest?cb=20200820222637"
},
{
name: "Fawn",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/d/d2/Flag_fawn_co.png/revision/latest/scale-to-width-down/1000?cb=20200820222639"
},
{
name: "Pirates",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/a/ab/Flag_jolly_co.png/revision/latest?cb=20200820222643"
},
{
name: "Cannibals",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/4/42/Flag_jolly_c_co.png/revision/latest?cb=20200820222641"
},
{
name: "North Sahrani (KOS)",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/a/a1/Flag_kos_co.png/revision/latest?cb=20200820222644"
},
{
name: "Livonia Army (LDF)",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/c/c1/Flag_ldf_co.png/revision/latest?cb=20200820222645"
},
{
name: "Livonia",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/e/e6/Flag_livo_co.png/revision/latest?cb=20200820222647"
},
{
name: "NAPA",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/e/e4/Flag_napa_co.png/revision/latest?cb=20200820222648"
},
{
name: "Livonia Police",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/6/63/Flag_police_co.png/revision/latest?cb=20200820222649"
},
{
name: "TEC",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/e/ea/Flag_tec_co.png/revision/latest?cb=20200820222650"
},
{
name: "United Earth Coalition (UEC)",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/c/ca/Flag_uec_co.png/revision/latest?cb=20200820222651"
},
{
name: "Wolf",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/b/b2/Flag_wolf_co.png/revision/latest?cb=20200820222653"
},
{
name: "Zenit Radio Station",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/0/05/Flag_zenit_co.png/revision/latest?cb=20200820222654"
},
{
name: "Zombie Hunters",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/9/97/Flag_zhunters_co.png/revision/latest?cb=20200820222621"
},
{
name: "RSTA",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/2/20/Flag_rsta_co.png/revision/latest/scale-to-width-down/1000?cb=20210216191221"
},
{
name: "Refuge",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/8/8e/Flag_refuge_co.png/revision/latest/scale-to-width-down/1000?cb=20210216191205"
},
{
name: "Snake",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/5/54/Flag_snake_co.png/revision/latest/scale-to-width-down/1000?cb=20210216191234"
},
{
name: "Zagorky",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/7/75/Flag_zagorky_co.png/revision/latest/scale-to-width-down/1000?cb=20230619164704"
},
{
name: "Crook",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/c/c8/Flag_crook_co.png/revision/latest/scale-to-width-down/1000?cb=20230619164705"
},
{
name: "Rex",
url: "https://static.wikia.nocookie.net/dayz_gamepedia/images/c/c5/Flag_rex_co.png/revision/latest/scale-to-width-down/1000?cb=20230619164706"
},
]
}
+314
View File
@@ -0,0 +1,314 @@
module.exports = {
destinations: [
{
name: 'Sinystok',
coord: [1481.47, 11933.38],
}, {
name: 'Novaya Petrovka',
coord: [3437.31, 13010.46],
}, {
name: 'Zaprundoe',
coord: [5171.52, 12753.83],
}, {
name: 'Ratnoe',
coord: [6174.72, 12722.72],
}, {
name: 'Severograd',
coord: [7986.69, 12699.39],
}, {
name: 'Svergino',
coord: [9464.27, 13718.14],
}, {
name: 'West Novodmitrovsk',
coord: [10988.51, 14344.17],
}, {
name: 'East Novodmitrovsk',
coord: [12143.35, 14336.39],
}, {
name: 'North Novodmitrovsk',
coord: [11544.55, 14764.11],
}, {
name: 'Cernaya Polyana',
coord: [12112.25, 13760.91],
}, {
name: 'Turovo',
coord: [13585.94, 14060.32],
}, {
name: 'Karmanovka',
coord: [12679.95, 14678.56],
}, {
name: 'Dobroe',
coord: [12956.02, 15051.85],
}, {
name: 'Belaya Polyana',
coord: [14161.41, 14942.97],
}, {
name: 'Svetlojarsk',
coord: [14001.99, 13251.54],
}, {
name: 'Olsha',
coord: [13348.75, 12897.70],
}, {
name: 'Black Lake',
coord: [13438.18, 12127.80],
}, {
name: 'Krasno Airfield',
coord: [12018.93, 12586.63],
}, {
name: 'Krasnostav',
coord: [11163.49, 12248.34],
}, {
name: 'Rify',
coord: [13811.46, 11210.15],
}, {
name: 'Khelmn',
coord: [12287.22, 10840.75],
}, {
name: 'North Berezino',
coord: [12905.47, 10059.19],
}, {
name: 'Central Berezino',
coord: [12423.31, 9600.36],
}, {
name: 'South Berezino',
coord: [11968.38, 9079.32],
}, {
name: 'Dubrovka',
coord: [10362.48, 9837.55],
}, {
name: 'Vyshnaya Dubrovka',
coord: [9891.99, 10432.47],
}, {
name: 'North Solnichniy',
coord: [13123.22, 7100.15]
}, {
name: 'Solnichniy',
coord: [13418.74, 6248.60],
}, {
name: 'Orlovets',
coord: [12201.68, 7275.12],
}, {
name: 'Polana',
coord: [10743.54, 8134.45],
}, {
name: 'Gorka',
coord: [9487.60, 8811.03],
}, {
name: 'Radio Zenit',
coord: [8128.62, 9230.97],
}, {
name: 'Dolina',
coord: [11276.25, 6594.66],
}, {
name: 'Devil\'s Castle',
coord: [6890.18, 11439.56],
}, {
name: 'Zolotar Castle (Black Mountain)',
coord: [10189.45, 12038.37],
}, {
name: 'Kamensk',
coord: [6684.09, 14410.27],
}, {
name: 'MB Kamensk',
coord: [7862.27, 14698.01],
}, {
name: 'Quarry',
coord: [8614.66, 13333.19],
}, {
name: 'Nagornoe',
coord: [9262.08, 14620.24],
}, {
name: 'Stary Yar',
coord: [4965.44, 15028.52],
}, {
name: 'Tisy',
coord: [3425.65, 14783.55],
}, {
name: 'MB Tisy',
coord: [1543.68, 14052.54],
}, {
name: 'Topolniki',
coord: [2834.62, 12388.32],
}, {
name: 'North NWAF',
coord: [4024.45, 11738.96],
}, {
name: 'Central NWAF',
coord: [4249.98, 10766.87],
}, {
name: 'South NWAF',
coord: [4864.34, 9588.70],
}, {
name: 'Grishino',
coord: [5976.41, 10300.27],
}, {
name: 'Kabanino',
coord: [5284.28, 8604.94],
}, {
name: 'Stary Sobor',
coord: [6058.07, 7792.28],
}, {
name: 'Novy Sobor',
coord: [7088.48, 7648.41],
}, {
name: 'MB VMC',
coord: [4483.28, 8286.10],
}, {
name: 'Vybor',
coord: [3814.48, 8904.35],
}, {
name: 'Pustoshka',
coord: [3060.14, 7905.04],
}, {
name: 'Lopatino',
coord: [2725.74, 10016.42],
}, {
name: 'Vavilovo',
coord: [2228.03, 11039.06],
}, {
name: 'Kalinka',
coord: [3301.22, 11249.03],
}, {
name: 'Biathlon Arena',
coord: [493.82, 11093.50],
}, {
name: 'Krona Castle',
coord: [1395.92, 9246.52],
}, {
name: 'Myshkino',
coord: [2010.28, 7317.90],
}, {
name: 'Polesovo',
coord: [5929.75, 13523.72],
}, {
name: 'Kalinovka',
coord: [7516.20, 13457.62],
}, {
name: 'Skalisty Island',
coord: [13620.93, 3040.70],
}, {
name: 'Kamyshovo',
coord: [12061.70, 3526.74],
}, {
name: 'Elektrozavodsk',
coord: [10273.05, 2010.28],
}, {
name: 'Cherno. Prigorodki',
coord: [7733.95, 3182.62],
}, {
name: 'Chernogorsk',
coord: [6573.28, 2544.93],
}, {
name: 'Cherno. Dubovo',
coord: [6672.43, 3616.18],
}, {
name: 'Cherno. Vysotovo',
coord: [5686.73, 2552.71],
}, {
name: 'Cherno. Novoselki',
coord: [6139.72, 3239.01],
}, {
name: 'Balota Airfield',
coord: [5054.87, 2344.68],
}, {
name: 'Balota',
coord: [4463.84, 2441.89],
}, {
name: 'Komarovo',
coord: [3670.61, 2457.44],
}, {
name: 'Prison Island',
coord: [2702.41, 1296.77],
}, {
name: 'Kamenka',
coord: [1905.30, 2231.92],
}, {
name: 'MB Pavlovo',
coord: [2130.82, 3363.43],
}, {
name: 'Pavlovo',
coord: [1675.88, 3845.59],
}, {
name: 'Bor',
coord: [3324.55, 3985.57],
}, {
name: 'Nadezhdino',
coord: [5867.54, 4790.46],
}, {
name: 'Mogilevka',
coord: [7570.64, 5140.41],
}, {
name: 'Pusta',
coord: [9192.09, 3861.14],
}, {
name: 'Staroye',
coord: [10136.96, 5443.71],
}, {
name: 'MSTA',
coord: [11334.57, 5486.48],
}, {
name: 'Tulga',
coord: [12753.83, 4405.51],
}, {
name: 'Guglovo',
coord: [8437.74, 6680.21],
}, {
name: 'Vyshnoye',
coord: [6586.88, 6054.18],
}, {
name: 'Rogovo',
coord: [4763.24, 6765.75],
}, {
name: 'Pulkovo',
coord: [4969.33, 5614.79],
}, {
name: 'Green Mountain',
coord: [3707.55, 6003.63],
}, {
name: 'Zelenogorsk',
coord: [2581.87, 5190.96],
}, {
name: 'Sosnovka',
coord: [2527.43, 6369.14],
}, {
name: 'Plotina Tishina Damn',
coord: [1193.73, 6363.30],
}, {
name: 'Zvir',
coord: [571.59, 5294.00],
}, {
name: 'Shakhovka',
coord: [9658.69, 6555.78],
}, {
name: 'Black Forrest',
coord: [9021.00, 7792.28],
}, {
name: 'Nizhneye',
coord: [12971.57, 8142.23],
}, {
name: 'Rog Castle',
coord: [11249.03, 4281.09],
}, {
name: 'Krasnoe',
coord: [6400.24, 15012.96],
}, {
name: 'Zub Castle',
coord: [6538.28, 5595.35],
}, {
name: 'Pogorevka',
coord: [4417.18, 6400.24],
}, {
name: 'Kozlovka',
coord: [4389.96, 4693.25],
}, {
name: 'Logging Yard',
coord: [940.98, 7660.07],
}, {
name: 'Zabolotye',
coord: [1193.73, 10020.31],
}, {
name: 'Ski Resort Peak',
coord: [250.80, 11867.28],
},
]
}
+39
View File
@@ -0,0 +1,39 @@
module.exports = {
getDefaultSettings(GuildId) {
return {
serverID: GuildId,
autoRestart: 0,
showKillfeedCoords: 0,
allowedChannels: [],
killfeedChannel: "",
connectionLogsChannel: "",
activePlayersChannel: "",
welcomeChannel: "",
factionArmbands: {},
usedArmbands: [],
excludedRoles: [],
botAdminRoles: [],
playerstats: [], // to be removed
alarms: [],
events: [],
uavs: [],
incomeRoles: [],
incomeLimiter: 168, // # of hours in 7 days
startingBalance: 500,
uavPrice: 50000,
empPrice: 500000,
linkedGamertagRole: "",
memberRole: "",
adminRole: "",
combatLogTimer: 5, // minutes
}
}
}
+36
View File
@@ -0,0 +1,36 @@
module.exports = {
getDefaultPlayerStats(gt, pID) {
return {
gamertag: gt,
playerID: pID,
discordID: "",
KDR: 0.00,
kills: 0,
deaths: 0,
killStreak: 0,
bestKillStreak: 0,
longestKill: 0,
deathStreak: 0,
worstDeathStreak: 0,
pos: [],
lastPos: [],
time: null,
lastTime: null,
lastConnectionDate: null,
lastDisconnectionDate: null,
lastDamageDate: null,
lastDeathDate: null,
lastHitBy: null,
connected: false,
totalSessionTime: 0,
lastSessionTime: 0,
longestSessionTime: 0,
bounties: [],
}
}
}
+43
View File
@@ -0,0 +1,43 @@
module.exports = {
createUser: async (userID, initialGuildID, startingBalance, client) => {
let User = {
user: {
userID: userID,
guilds: {}
}
};
User.user.guilds[initialGuildID] = {
balance: startingBalance,
lastIncome: new Date('2000-01-01T00:00:00'),
};
await client.dbo.collection("users").insertOne(User, (err, res) => {
if (err) {
client.error(`Failed to create user - ${err}`);
return undefined;
}
});
return User;
},
/*
This function is to add a new guild specific user to an already existing
user document
or
can be used to reset a data back to default
*/
addUser: async (guilds, newGuildID, userID, client, startingBalance) => {
let updatedGuilds = guilds;
updatedGuilds[newGuildID] = {
balance: startingBalance,
lastIncome: new Date('2000-01-01T00:00:00')
}
await client.dbo.collection("users").updateOne({"user.userID":userID}, {$set: {"user.guilds": updatedGuilds}}, (err, res) => {
if (err) return false
})
return true
}
}