Player's sprite customization support & server list

Post Reply
User avatar
darkhog
Member
Posts: 19
Joined: Sat May 28, 2011 13:35

Player's sprite customization support & server list

by darkhog » Post

Two suggestions.

First, player sprite customization support, so all people won't look the same. Algorithm is simple.

On Client side:
1. When player connecting to server, playerspritefront.png and playerspriteback.png (or whatever they're called) are sent to server (see On Server side, 1 to see what server do with it)
2. Client get all sprites of other connected players and save them to temporary directory so they'll be deleted after disconnect of specified player.
3. When another client connects to server, server send info with player name and his/her/its sprite. It'll be loaded in function which say "Player X joined the server".

On Server side:

1. When player connects to server, after connection server wait for client sprite image (if none get e.g. when connecting with old version it set is as fallback image found in server's data directory), then send it to all clients excluding the one which is connecting (he doesn't need it)
2. When client connects (other than player) server send player sprite of client (or "fallback image") to the player then on client side it is handled as on On Client side 3. Probably along with message saying that client connected to server.

Now for second suggestion. I think it would be good to have server list (as newest Manic Digger build has), which will among the others enable making server for people without static ip (and without playing with no-ip.org). Algorithm is simple:

1. When starting Game server there is sending packet of data with server name, its ip and possibly other things to the "Main server" (this is server which will keep track of all servers and their IPs).
2. Main server (see above for explanation) then in its database set record for this server and send ServerID to the server.
3. Client when displaying serverlist "asks" Main Server for list of available servers and Main server send it to the client.
4. Game server every specified amount of time send "heartbeats" to the Main server which contains its ServerID and the current IP (this one allow to make server for people with dynamic IP without playing with things like no-ip).

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests