Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket: Problem in transferring data #109

Closed
318097 opened this issue Mar 29, 2019 · 4 comments
Closed

Socket: Problem in transferring data #109

318097 opened this issue Mar 29, 2019 · 4 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@318097
Copy link
Contributor

318097 commented Mar 29, 2019

PR #107 includes the code to transfer the updates from client to server & back again.
Screenshot from 2019-03-29 11-31-08
This problem occurs when the whole 'room' object is sent back.

It works fine when 'pacmanOne' & 'pacmanTwo' is sent. (In short, there is a problem when huge data is sent)

Please come to a conclusion about this problem.

@318097 318097 added help wanted Extra attention is needed invalid This doesn't seem right labels Mar 29, 2019
@shivangg
Copy link
Contributor

@318097 Can you give the exact steps to reproduce this issue.

@shivangg
Copy link
Contributor

Check for circular references in the room object.
Try stringifying the whole room object before sending. stringify will fail and tell if room has some circular references.

Take a look here

@Shalinit3
Copy link
Contributor

Shalinit3 commented Mar 29, 2019

@318097 the event for sending new game state from server to client was already there. Please go through the startGame method in game controller. It sends the current game state to all the clients in the room. You just have to update the game state in the calculateNextGameState method. All the other things like sending game info at regular intervals from server to client, starting the game after 3 seconds and leaving the room have been done in my PR.

@kaushikb11 kaushikb11 added work harder and removed invalid This doesn't seem right work harder labels Mar 29, 2019
@318097
Copy link
Contributor Author

318097 commented Mar 29, 2019

@Shalinit3 Ok, will check.

@318097 318097 closed this as completed Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants