venerdì 30 settembre 2016

Day 170: A working connection

Today I finally managed to connect a client with a server.
To do so I added commands to the shell. By typing \server a server is created and vice versa.

I also removed the Server and Client classes by replacing them with the ServerSocket and ClientSocket. I'll have to think carefully about where I want to have the network logic. Right now it is in a Network class, but that's not a definitive solution.

I also wrote some ugly-looking code to obtain an error message from WinSock2 when something goes wrong, so I will have access to very important information during developement.

In the picture, on top, a server is created, then in the bottom process a client is created, and finally the server accept the connection.




mercoledì 28 settembre 2016

Day 169: Multiple windows and basic networking

Today I started by finding a way to spawn multiple windows in visual studio. This required creating a multiple startup project and a few extra tweaks. This is required to be able to easily play with different client and servers.
Then I implemented the client and server classes, which are high level views of the base networking class, and I managed to implement a small server and send it into "accept" mode.
Finally I wrote a Thread class which wraps the c++ threads, and I managed to launch the server in a thread and avoid a blocking call.

domenica 25 settembre 2016

Day 168: Better mouse input

I've been in Scotland for about a month, and I really had no time to work on the engine and finish the physics, and I probably won't continue to do that in the future. However for a networking class I'm required to implement a networking application, and I'd really like to add a simple networking engine to the Ryno, and present it as the project.
Right now it's still early, and I've no idea yet of what I'll be implementing, but if there's one thing I leaned about networking, is that you should be able to run at least a server and client application. This is impossible right now, because the mouse position got locked to the center of the screen, making it impossible to handle multiple windows properly.
So today I fixed this problem, and now it's possible to look around the screen by pressing the right button of the mouse, and then moving the mouse. The input will not be detected outside the window, but it's still a much better solution than before.