Closed fosheus closed 6 years ago
Try using a loop back server. This is what it’s designed for. See loopback.cpp for an example
I found why the client wasn't connecting to the server. Actually when I entered in my Update method for each server and client, I gave the delta time since last frame to the AdvanceTime instead of the total time passed since the start of the application. I miss understood how to use this method. I found it while implemening the loopback server 😅. Thank you Glenn for your quick response.
No worries! Glad you found it!
Hello there,
Firstly, thank you to Glenn for his incredible work on yojimbo library and the differents articles for gafferongames.
Secondly, I'm trying to work with yojimbo for 2 days and I can't make it work in my SFML project. I've a simple game that permit clients to connect to a host client and every body see each other on the screen. I
My application is composed of a server and a client. If the player wants to host the game then a server is instantiated in addition to the client.
The problem I have is when I run my code as host or client, nothing happens. Both server and client seam to initialize correctly and I have no error message nor timeout from the client and no connection detected. I've tried to run the server and client separatly using the test client and server provided in the yojimbo solution. It appears that the server is able to accept the yojimbo client but the yojimbo server does not accept the client of my application. I deduced the problem was coming from my client. I tried running my client with minimal code but nothing happens. He still tries to connect indefinitely without timeout.
I really don't understand what I did wrong so if anyone could help me on that I would be very glade.
Here you can find my minimal code of the client : My shared.h really looks like the one in USAGE file, so just add 1 or 2 messages types and bam, you have my shared.h
GameState.h
GameState.cpp