Git Product home page Git Product logo

Comments (15)

endel avatar endel commented on June 18, 2024 1

Hi @niklaswolf, thanks for sending the sources. I hope to find some time during this week to check it out. Sorry.

from colyseus-unity-sdk.

endel avatar endel commented on June 18, 2024

I'll investigate during this week!

from colyseus-unity-sdk.

lonewolfaka9 avatar lonewolfaka9 commented on June 18, 2024

facing same issue :(

from colyseus-unity-sdk.

endel avatar endel commented on June 18, 2024

Sorry @lonewolfaka9 @quanglam68,

I believe the bad code example (server-side) was causing this problem. It was removing all user data after 5 seconds: f349f3b#diff-b144d0c249b359c454ed45edd9ef619d

Please let me know if this occurs to you even after removing those lines.

from colyseus-unity-sdk.

niklaswolf avatar niklaswolf commented on June 18, 2024

@endel same issue here :(
I am using the colyseus-starter template for the server and modified it, so unfortunatly I don't think this was the problem :/
The error occurs when the first patch is beeing processed. The first full state Exchange is working fine, an I get the following on the Client side:

{ "players" : [], "messages" : [] }

Now I'm adding a new Player in the onJoin-method of the Server and get the following on the Server:

StateHandler {
  players: [ SJCHVwPCl: Player { xPosition: 0, yPosition: 0, zPosition: 0 } ],
  messages: [ 'SJCHVwPCl joined!' ] `
}

Looking good so far!
But when it's trying to apply the patch client-side, the described error occurs...

from colyseus-unity-sdk.

niklaswolf avatar niklaswolf commented on June 18, 2024

I investigated a bit further:
The above does NOT work in the JS-Client, too. It gives an empty Players-property.
What I then tried was too get rid of the Player-reference in the state and added a simple String ('adv') instead, so I got the following on the Server

StateHandler {
  players: [ Skws5wP0g: 'adv', S1V0cvv0l: 'adv' ],
  messages:
   [ 'Skws5wP0g joined!',
     'S1V0cvv0l joined!' ]
 }

This didn't work either on the JS-Client. It gave the same empty Players-property.

Then I tried to get rid of the object/Array completely, because the Messages-property was working fine.
So server-side it looked like this:

StateHandler {
  players: [ 'B1grovPAx', 'rkmUjwwCx'],
  messages:
   [ 'B1grovPAx joined!',
     'rkmUjwwCx joined!',
     ] }

This worked indeed on the JS-Client. But the Unity/C#-Client gives the same error as described.
Maybe this helps while investigating ;)

from colyseus-unity-sdk.

endel avatar endel commented on June 18, 2024

@niklaswolf Do you have the project using the JavaScript client so I can have a look at? If you can also share your Unity/C# project would be great. I'd like to investigate further. Thanks

from colyseus-unity-sdk.

niklaswolf avatar niklaswolf commented on June 18, 2024

@endel
Server: https://mygit.th-deg.de/nw17904/colyseus-server
JS-Client: https://mygit.th-deg.de/jl01849/WebVR (actually maintained by a colleague of mine)
These two are hosted on our Universitys gitlab, but we made them public, so you should be able to clone them ;)

Unity: https://github.com/niklaswolf/colyseus-unity3d (this is adapted for UWP, but it works in Unity-Editor, too. The error is also showing up in Unity-Editor ;))

Sorry for the bad code in some places, but these projects are in very early development-stage (as you'll see)

from colyseus-unity-sdk.

endel avatar endel commented on June 18, 2024

@niklaswolf unfortunately, I don't have rights to clone these repositories. Do you mind sending them to me at endel.dreyer [at] gmail.com? Thanks!

from colyseus-unity-sdk.

niklaswolf avatar niklaswolf commented on June 18, 2024

@endel
I just sent you an email ;)

from colyseus-unity-sdk.

niklaswolf avatar niklaswolf commented on June 18, 2024

Any news on this? :)

from colyseus-unity-sdk.

endel avatar endel commented on June 18, 2024

Yup, the error is still happening. 😢

Here's a report of what I could find:

I've asked how to re-encode a MessagePackObject into byte[] here, as I couldn't find out how to do it: msgpack/msgpack-cli#234

Any help is very appreciated. :)

from colyseus-unity-sdk.

niklaswolf avatar niklaswolf commented on June 18, 2024

@endel I tried the suggestion the guy from msgpack made, and it seems to work! If you don't mind, I'll make a PR to include this solution! :)

from colyseus-unity-sdk.

endel avatar endel commented on June 18, 2024

@niklaswolf awesome. Sure, that'd be great! Thanks! :)

from colyseus-unity-sdk.

endel avatar endel commented on June 18, 2024

It's finally fixed! Thanks @niklaswolf for your pull-request! 🎉

from colyseus-unity-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.