Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. Viveksharma
V

Viveksharma

@Viveksharma

Chat Follow Unfollow
0
Reputation
4
Posts
950
Profile views
0
Followers
0
Following
Joined 24 Aug 2019, 10:24 Last Online 27 Aug 2019, 13:01

  • Profile
  • More
    • Continue chat with Viveksharma
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
Viveksharma Follow

Posts made by Viveksharma

RE: process.env.MONGO_URI not working as expected in colyseus social package

@endel thanks .I have import @colyseus/social in my index.ts before dotenv

posted in Questions & Help • 27 Aug 2019, 11:56
process.env.MONGO_URI not working as expected in colyseus social package

I am trying to use colyseus social package and I set MONGO_URI as expected via process.env.MONGO_URI in my index.ts but while colyseus server going to make a connection with mongodb it is getting default value(old value) although process.env.MONGO_URI updated to new value.

I tried to check it in connectDatabase method of index.ts in social module and console like :-

import { MONGO_URI } from "./env";

export async function connectDatabase(cb?: (err: MongoError) => void) {
// skip if already connecting or connected.
if (mongoose.connection.readyState !== 0) {
if (cb) cb(null);
return;
}

try {
    console.log(process.env.MONGO_URI);// getting updated value
    console.log(MONGO_URI);//getting old value
    await mongoose.connect(MONGO_URI, { autoIndex: false, useNewUrlParser: true }, cb);
    debug(`Successfully connected to ${MONGO_URI}`)

    // reconnect if disconnected.
    mongoose.connection.on('disconnected', () => connectDatabase());
} catch (e) {
    console.error('Error connecting to database: ', e);
}

}

Please help it out . Thanks in advance

posted in Questions & Help • 26 Aug 2019, 06:10
RE: Client joined even authentication failed after upgrading to version 0.11.0?

@endel thanks

posted in Questions & Help • 26 Aug 2019, 05:39
Client joined even authentication failed after upgrading to version 0.11.0?

Inside RoomHandler, OnJoin should be called iff onAuth executed successfully with returning true but i am returning false but still my player able to join my room.

Is something changed in new version or it is a bug? or may be i am understood something wrong.

export class MyRoom extends Room<State>
{

onCreate(options: any) {
}


onAuth(client: Client, options: any) {
    return false;
}

onJoin(client: Client, options?: any, auth?: any) {
    console.log("client joined ");

}

}

posted in Questions & Help • 24 Aug 2019, 10:31

© 2023 Endel Dreyer