|
0 registered members (),
631
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
doubts with send_data and struct list
#414476
01/03/13 00:09
01/03/13 00:09
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
I'm working on a multi Massive Game ONLINE and came across the following problem. Below a picture of the game running ONLINE. I believe that is not possible I send data packets using different (structs lists) in client and server, if I'm wrong, please correct me! So I'm a great difficulty to developing a communication in order to maintain an updated LIST of the Online Players in clients. Below is another picture showing how I am working with structs communication on client and server When the player enters the game, the server sends to him an updated list with all players online in moment. On Client This struct list contains only one variable to the entity (handle) of the players. Because this way, I can set all entities for you, and apply individual actions for (players entitys); My problem is send this struct list to customers. because I can only send the same list of communication that I already use to send the information: (path, angle, messages etc ...). someone could tell me some suggestion? How can I keep this list updated on the clients?
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
Re: doubts with send_data and struct list
[Re: Superku]
#414520
01/03/13 19:22
01/03/13 19:22
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
ohh mannn. Thanks for the explanation! I really knew not handle the "void * buffer" in this way. I am also grateful for the tip to use local entities!
if be done this way, security would not be more vulnerable?
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
Re: doubts with send_data and struct list
[Re: Superku]
#414709
01/06/13 23:19
01/06/13 23:19
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
I did some tests using local entities. I used the "cheat engine" to do some basic hacks of the speed and position and noticed that with this is very easy to cheat the game.
Create validations on the server for each transmission of information would be very labor intensive and cost more processing time.
I'll make some tests using global entities and report the result
Could you give me more some informations? doing this way you taught me. How could I send data packets containing struc array?
Last edited by NeoNeper; 01/06/13 23:59.
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
Re: doubts with send_data and struct list
[Re: NeoNeper]
#414744
01/07/13 11:20
01/07/13 11:20
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Well I don't know about that program or multiplayer/ network security but a very simple yet maybe effective check on the server could be if the entity moved more than his maximum speed in the last frames (the server should then of course save the old position of every player). How could I send data packets containing struc array? I don't know what you mean, could you explain in detail? Sending something like PL_INFO player_info[16]; could be realized as simple as for(i = 0; i < max_player; i++) send_data_to(NULL,player_info[i],sizeof(PL_INFO));
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: doubts with send_data and struct list
[Re: Superku]
#414784
01/07/13 16:09
01/07/13 16:09
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
PLAYERS* players[100];
...
players[0]=new(PLAYERS);
players[0].id = id;
players[0].sampla= sample;
...
send_data_to(NULL,players,sizeof(PLAYERS));
this way I did up there, it works, but I have no way of knowing what kind of data is being sent. no have "_type" variable for *void in on receive. So I need to send a simple struct containing an struct array within another struct Sample:
typedef struct _PLAYERS
{
var id;
var sample;
...
}PLAYERS
typedef struct _clients
{
int _type;
struct _PLAYERS client[100]
}clients
...
send data
...
clients* players=new(clients);
players._type = PLAYERS_LIST;
players->client[0]=new(PLAYERS);
players->client[0].id = id;
players->client[0].id = id;
players->client[1]=new(PLAYERS);
players->client[1].id = id;
players->client[1].id = id;
...etc
send_data_to(NULL,players,sizeof(clients));
Its no work (T.T)
Last edited by NeoNeper; 01/07/13 16:12.
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
Re: doubts with send_data and struct list
[Re: Superku]
#415394
01/18/13 00:42
01/18/13 00:42
|
Joined: Nov 2007
Posts: 318 Brasil, Paraná
NeoNeper
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2007
Posts: 318
Brasil, Paraná
|
Superku! I'm working the way you taught me, usando using _type to identify data packets. This works very well!. But I still need learn to send and receive this type of list:
typedef struct _DATA_CLIENTS
{
int _type;
struct _PLAYERS* client[100];
}DATA_CLIENTS;
I did not want to use a "for()" loop to this because it will be the server that will send this data packet. I do not want to overload the server with many send_data_to inside a "for()" loop. could you give me more this help? . Tanks Superku! You is Brother (^.~)
Last edited by NeoNeper; 01/18/13 00:42.
Please! Use easy words to be translated. because my English is not very good! Grateful. _______________________________________________________
|
|
|
|