ENet Library

Posted By: AceX

ENet Library - 08/08/14 09:23

I want to make a network plugin for A7 using ENet.
But I have no idea,how to create a entity to be visible for all clients.

Also,I have some experience with ENet.But I never used it with 3DGS.
Posted By: nfs42

Re: ENet Library - 08/09/14 17:36

http://tools.gstools.de/helpfiles/GSTNet/GSTNet.html
http://projects.gstools.de/gstnet/releases
Posted By: AceX

Re: ENet Library - 08/10/14 11:30

GSTNet isn't working for me :|

I want somebody to help me with a C++ code.

My plugin have only server/client init and I have a function to create a entity,but this entity is only visible in server :|.
Posted By: Ch40zzC0d3r

Re: ENet Library - 08/10/14 12:42

I guess you dont know the whole server-client concept...
Try coding something small first like a chat or whatever.
Also try ANet, its based on ENet and its perfectly fine for coding a game (also for beginners)
Posted By: AceX

Re: ENet Library - 08/10/14 14:26

I know ANet,but ít's not free..
What I want to know,is how I can send created entities on server to client.

I know how to send a packet with a text,in Enet.but to send a entity not.
Posted By: Ch40zzC0d3r

Re: ENet Library - 08/10/14 14:31

Man...
There is no pre-defined thing for something like an "Entity". Its opensource library for all kinds of shit not just for 3DGS.
If you really want to do this then send the whole struct data of the entity and a byte infront of it to dertiminate what you want to do with it (something like the packet id, 1 == create entity, 2 == delete entity and so on)
I guess you should just pay the little money to get a good working plugin...
Posted By: AceX

Re: ENet Library - 08/10/14 14:53

I will try to send the whole struct data,and to see if works.
Posted By: Ch40zzC0d3r

Re: ENet Library - 08/10/14 15:19

You still have to call ent_create.
If you dont need all struct data then only send relevant informations to keep traffic small.
Posted By: AceX

Re: ENet Library - 08/11/14 10:43


This is the code that I have:
Code:
...
DLLFUNC void AddEntity(ENTITY* ent,char* mdl)
{
ent = ent_create(mdl,vector(0,0,0),NULL);
}


I need to do something to send relevant information.
Posted By: Ch40zzC0d3r

Re: ENet Library - 08/11/14 13:08

Now you send an ID for example 1 for entity creation, or 2 for delete or whatever..
Then you send the model name and creation pos for example. On the cleints you receive that info and create an entity there too...
Posted By: WretchedSid

Re: ENet Library - 08/12/14 13:43

Putting aside for a second that you need to define your own protocol and that Enet just takes care of pushing packages around:

Your AddEntity() method does not what you think it does, the pointer will not be transferred out of the function. You assign it a new value, but that's not visible to the caller. Either go with pointer to pointer, or better, return it as a return value.
© 2024 lite-C Forums