Advertisement

sdl server/client

Started by May 09, 2005 03:16 PM
0 comments, last by basement 19 years, 9 months ago
I'm new to this so i need a little help i can get the client to send data to the server, but i can't get the server to send to the client.How would you go about this using SDL_Net. The game i am doing is a car racing game i send the x and y pos of the car and the direction it is facing. The client connects to the server and if the car moves it shows up on the server side and client side. If i move a car on the server side it only moves on that side. I followed the chat program to do the code but it doesn't seem to tell you how the server sends data to the clients. It is using TCP. Thanks in advance for any info given.
sending from server to client should be excactly the same as from client to server.
the server would just have to call SDLNet_TCP_Send() on the socket it got from a previous call to SDLNet_Accept() (i.e when the client joined)

hope it works

This topic is closed to new replies.

Advertisement