wbrandon25 / Online-Crash-Gambling-Simulator

Online Crash Gambling Game Web App Built with the MERN Stack
https://effulgent-travesseiro-c05997.netlify.app
117 stars 80 forks source link

Issue with backend #4

Open digbee42 opened 2 years ago

digbee42 commented 2 years ago

image

I get this issue with the backend while running npm start.

VardanMelik commented 1 year ago

Hi, did you find solution? I have the same with empty/new MongoDB database.

Mi-Boss commented 1 year ago

hi anyone find a solution on this please update regarding same mangodb connection error

roxtar-venture commented 1 year ago

@wbrandon25 seems like we need migration files for db.

Jacob-Petro commented 1 year ago

Hi i have tried recreating the game_loop collection and added default data but still getting the same error

BustAces commented 1 year ago

hi anyone find a solution on this please update regarding same mangodb connection error

Its not a connection error, i added a console log and that confirms that the connection to the mongodb is successfully.. But still get this error

nakamoto-dev commented 1 year ago

i fixed by creating the schema manually then i exported my Game_loop id and updated and got fixed

nakamoto-dev commented 1 year ago

use mydb switched to db mydb show collections collection users db.game_loops.insertOne({ 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: [], chat_messages_list: [] }) { "acknowledged" : true, "insertedId" : ObjectId("6491ea03b8255fc2af655e71") } show collections collection game_loops users

nakamoto-dev commented 1 year ago

With this new id , update GAME_LOOP constant

nakamoto-dev commented 1 year ago

const Game_loop = require("./models/game_loop") require('dotenv').config()

const GAME_LOOP_ID = 'update here'

const { Server } = require('socket.io') const http = require('http') const Stopwatch = require('statman-stopwatch'); const { update } = require("./models/user"); const sw = new Stopwatch(true);``

VardanMelik commented 1 year ago

@nakamoto-dev You right with that data database work. Try test in long time, You will have an issue with No User Authentication, and after that you can't bet.

nakamoto-dev commented 1 year ago

Where can you host this solution?

On Fri, 23 Jun 2023, 00:38 Vardan Meliksetyan, @.***> wrote:

@nakamoto-dev https://github.com/nakamoto-dev You right with that data database work. Try test in long time, You will have an issue with No User Authentication, and after that you can't bet.

— Reply to this email directly, view it on GitHub https://github.com/wbrandon25/Online-Crash-Gambling-Simulator/issues/4#issuecomment-1603348945, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUPTNCPDTPHNBSXTXKZRVS3XMS3NBANCNFSM6AAAAAAQZWF62A . You are receiving this because you were mentioned.Message ID: @.*** com>

BustAces commented 1 year ago

I found a way to make it working, it works for me 100% now after getting this error, the fix i posted here: https://github.com/wbrandon25/Online-Crash-Gambling-Simulator/issues/6