Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Client server system help  (Read 2386 times)

0 Members and 1 Guest are viewing this topic.

samppaa

  • Newbie
  • *
  • Posts: 9
    • View Profile
Client server system help
« on: July 18, 2010, 03:21:43 pm »
So I got a system where the clients send their position to the server when they move and the server adds them to vector and should deliver the vector of all players back to player. So the sending system is ready, but how do I actually return the vector should I use udp sockets to send it back or something? Thanks in advance

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Client server system help
« Reply #1 on: August 02, 2010, 11:27:08 am »
What do you use to send from clients ?
The cients should never send their position, just their wanteed movement. The server has to calculate and fix the positions. Because in your case, if I modify your client, I can, for example, ignore walls or never falling, etc...
Mindiell
----

e_barroga

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Client server system help
« Reply #2 on: August 13, 2010, 04:39:36 pm »
A better way to manage movement in a "client-server" architecture is to think of the server as the host that simply relays information and authenticates whether the client can do something or not. The client should simply perform requests to the server.

When the client wishes to move left, it should simply tell the server that it wants to move left. The server will receive a message that says the client wishes to move left. The server should decide whether this is possible and if so, update its information about the client and also inform other players that the client wishes to move left.

This not only saves bandwidth, it is also more secure.

 

anything