Navigation

    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Users
    1. Home
    2. BlueBang
    • Continue chat with BlueBang
    • Start new chat with BlueBang
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    BlueBang

    @BlueBang

    0
    Reputation
    22
    Posts
    329
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    BlueBang Follow

    Posts made by BlueBang

    • RE: Hey All! I'm Luke

      welcome😂

      posted in Introduce Yourself
      BlueBang
    • RE: About Saving Room Data

      @endel Thank you for your reply.But this method is called to return an object. How can I put the object into the database?use JSON.stringify?

      
      //serverSide
      onCreate(options) {
          //check if need restore
          if(true){
           let roomstate=getRoomStateFromDB();
           this.state=JSON.Parse(roomstate);// Is it used like this?
          }
      
      }
      
      async onDispose() {
          let roomtState=JSON.stringify(this.state.toJSON());
          storeDataBase(roomtState);// Is it used like this?
      }
      
      
      
      
      posted in Questions & Help
      BlueBang
    • RE: About Saving Room Data

      There are many nested data in this root-state. It will be very cumbersome to assemble them when they are stored and used separately. Is there any way to save only root-state?

      @endel Can you give me some advice?thank you.

      posted in Questions & Help
      BlueBang
    • About Saving Room Data

      Hi all,
      In some cases, the room needs to be destroyed but the state information of the room needs to be recorded in the database so that the state can be restored next time.What do I need to do to implement this requirement? Do I serialize and deserialize directly?

      posted in Questions & Help
      BlueBang
    • RE: Is there a way to disconnect a client by id from the server?
      ...
      let playerList=new Map();//store player client info
      async onAuth(Client client,options){
         
          if(validate(options.token){
          //if already joined
          if(playerList.get(options.token)){
                //disconnect old clients
                this.clients.foreach(oldClient){
                  if(client.id==playerList.get(options.token)) oldClient.discontent();
               }
          }
              playerList.set(options.token,client.id,)
          }
      
      }
      
      ...
      
      
      
      posted in Questions & Help
      BlueBang
    • RE: Can't get basic client/server communication to work

      hi,you should use matchMaker.defineRoomType to defind this room.

      posted in Questions & Help
      BlueBang
    • Question About Client Disconnection

      Hi all,
      When I connect to the server and close WiFi, the server can receive the message quickly, but the client needs to wait about 50 seconds to receive the notice ofonLeave. This problem is the configuration problem or the lack of heartbeat detection? How can I fix it?
      The client is JS version.

      Thanks!

      posted in Questions & Help
      BlueBang
    • RE: Can I remove one handle in OnMessage?

      @endel Yes, it is. Haha, Cheers!

      posted in Questions & Help
      BlueBang
    • Can I remove one handle in OnMessage?

      Hi all,
      In the document, only remove all listeners method.

      posted in Questions & Help
      BlueBang
    • How to support sourse map

      Hi all,
      I am using typescript to debug the project in VS Code. My project has ts-nodeand source-map-support packages installed. But still can't display the correct number of error stack rows. Is my operation wrong or need other settings?
      thanks!

      e.g.
      0_1583583024983_1583582995819.jpg

      posted in Questions & Help
      BlueBang