wbrandon25 / online-crash-gambling-simulator Goto Github PK
View Code? Open in Web Editor NEWOnline Crash Gambling Game Web App Built with the MERN Stack
Home Page: https://effulgent-travesseiro-c05997.netlify.app
Online Crash Gambling Game Web App Built with the MERN Stack
Home Page: https://effulgent-travesseiro-c05997.netlify.app
i installed all the files and then put them in replit and i run all the commands for the backend server and when i do npm start it says the app crashes
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\react-scripts\scripts\start.js:19
throw err;
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\NormalModule.js:417:16)
at C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\NormalModule.js:452:10
at C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\webpack\lib\NormalModule.js:323:13
at C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at C:\Users\DELL\Desktop\Nowy folder\Online-Crash-Gambling-Simulator\client\node_modules\babel-loader\lib\index.js:59:103 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
The last 25 crash history is not showing. Any ideas? I check db and it is empty. Probably issue saving to MongoDB
it wont stop giving me this error: MongooseError: Operation game_loops.findOne()
buffering timed out after 10000ms
it happens when i run npm start on backend
The game is quite slow and it's not that responsive when it comes to staking and opening account
FIXED
I got the game running. I solved the issue this way.
1. At server.js add the following code after the MongoDB connection line:
const crashSchema = new mongoose.Schema(
{ round_number: Number,
active_player_id_list: [String],
multiplier_crash: Number,
b_betting_phase: Boolean,
b_game_phase: Boolean,
b_cashout_phase: Boolean,
time_now: Number,
previous_crashes: [Number],
round_id_list: [Number],
chat_messages_list: []
}
);const Crash = mongoose.model(
'Crash', crashSchema
);Crash.create({
round_number: 1,
active_player_id_list: [],
multiplier_crash: 0,
b_betting_phase: false,
b_game_phase: false,
b_cashout_phase: false,
time_now: -1,
previous_crashes: [],
round_id_list: 0,
chat_messages_list: []
})
.then(result => {
console.log(result)
});
Save it and run the server. It will now automatically generate the documents.
NOTE: The server will crash thats OK!
2. Now, copy the ID of the document and paste it in server.js at GAME_LOOP_ID.
3. Go to /models/game_loop.js and change:
const game_loop = new mongoose.Schema => const crashSchema = new mongoose.Schema
mongoose.model("game_loop", game_loop); => mongoose.model("Crash", crashSchema);
4. In the root folder, create an .evn file with the following line:
PASSPORT_SECRET = "YOURPASSWORDHERE"
Original message:
Noticed the other issues claiming the same but without a clear answer still.. App does connect to my mongodb, i can see it in the connections list, however.. schema's arent generated even though the app has permission. Adding the game_loop schema manually also not solves the problem
What did I not do that would prevent Register and Login from working?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.