Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.

Player should send his initial location to the server before moving #21

Open
gioragutt opened this issue Nov 12, 2018 · 1 comment
Open
Labels
bug Something isn't working client-side This issue is related to something on the client side colyseus This issue is related to colyseus client-server communication

Comments

@gioragutt
Copy link
Member

Currently, due to how I prevent the client from spamming the server with data even if the player doesn't move, when the game starts, the player's position is 0,0,0 until he moves.

This is done in Assets/Scripts/Game/ColyseusLocalPlayer.cs. A simple boolean flag of wasSentAlready or something like that would suffice.

In order to test this:

  1. Open two clients
  2. Join the lobby
  3. Start the game
  4. One client should move
  5. That client should see the second client without him moving (and in turn sending his position).
@gioragutt gioragutt added bug Something isn't working client-side This issue is related to something on the client side labels Nov 12, 2018
@gioragutt
Copy link
Member Author

Also, a possible fix would also be using

    void Start()
    {
        game.OnPlayerMove(transform);
    }

in the script, instead of the boolean flag.

@gioragutt gioragutt added the colyseus This issue is related to colyseus client-server communication label Nov 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working client-side This issue is related to something on the client side colyseus This issue is related to colyseus client-server communication
Projects
None yet
Development

No branches or pull requests

1 participant