|
Re: ANet 1.4.0.0 public Beta
[Re: TechMuc]
#379640
08/05/11 12:36
08/05/11 12:36
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Thanks for your nice words Timo I always try to get my whole knowledge into the project and so it grows with my experience. There are still some things I would do different if I would start the project from scratch again, but I think it's currently in a stage where it can be easily used.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: ANet 1.4.0.0 public Beta
[Re: Dark_samurai]
#379692
08/06/11 12:58
08/06/11 12:58
|
Joined: May 2008
Posts: 2,113 NRW/Germany
alibaba
Expert
|
Expert
Joined: May 2008
Posts: 2,113
NRW/Germany
|
Okay, now i found a bug. Clients cant send events.I´m 100% sure it´s a bug, because because this code works with the old version. Here is an example:
#include <acknex.h>
#include "anet.h"
void conn(var sender, STRING* msg, var length)
{
error("cl. connected");
}
void dconn(var sender, STRING* msg, var length)
{
error("cl. disconnected");
}
void clevent(var sender, STRING* msg, var length)
{
error("client send event");
}
void sendev()
{
enet_clsend_event(25,"",0,BROADCAST);
}
void main()
{
wait(3);
enet_init();
enet_svset_event(EVENT_DISCONNECTED, dconn);
enet_svset_event(EVENT_CONNECTED, conn);
enet_svset_event(25, clevent);
while(!key_s&&!key_c)wait(1);
if(key_s)
enet_init_server(2300, 4, "");
if(key_c)
enet_init_client("localhost",2300,"");
while(enet_get_connection()==NO_CONNECTION)wait(1);
if(enet_get_connection()==SERVER_MODE)
error("server started");
if(enet_get_connection()==CLIENT_MODE)
error("client started");
on_a=sendev;
while(1)
{
if(enet_get_connection()==CLIENT_SERVER_MODE)
draw_text("cl/srv",0,0,COLOR_WHITE);
if(enet_get_connection()==CLIENT_MODE)
draw_text("client",0,0,COLOR_WHITE);
if(enet_get_connection()==SERVER_MODE)
draw_text("server",0,0,COLOR_WHITE);
if(enet_get_connection()==NO_CONNECTION)
draw_text("no conn.",0,0,COLOR_WHITE);
wait(1);
}
}
Open two windows. At the first window press s for a server. At the other one press c for client. You´ll recieve a message from server, that a client connected. Then as client press "a" to send an event. Nothing happens. But with old version you´ll get the message as expected. To use this code with the other version you have to set the events in "". Hope it helps to improve your üroduct
|
|
|
Re: ANet 1.4.0.0 public Beta
[Re: alibaba]
#379783
08/08/11 09:04
08/08/11 09:04
|
Joined: Oct 2005
Posts: 57
picoder
Junior Member
|
Junior Member
Joined: Oct 2005
Posts: 57
|
void enet_svsend_event(var type, char* msg, var length, var receiver)
void enet_svsend_event(var type, STRING* msg, var receiver)
void enet_clsend_event(var type, char* msg, var length, var receiver)
void enet_clsend_event(var type, STRING* msg, var receiver);
When you send a string by enet_clsend_event, you should not write length of string in it.
void sendev()
{
enet_clsend_event(25,"",BROADCAST);
}
|
|
|
Re: ANet 1.4.0.0 public Beta
[Re: picoder]
#379786
08/08/11 09:41
08/08/11 09:41
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
@alibaba: Thanks for reporting! This was indeed a bug and I already fixed it, but I want to wait for possible other bugs before I release the new version.
As a workaround use picoder's code, please.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: ANet 1.4.0.0 public Beta
[Re: alibaba]
#380232
08/14/11 21:36
08/14/11 21:36
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
ah okay, i'll try to use it in c#
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: ANet 1.4.0.0 public Beta
[Re: darkinferno]
#381563
08/29/11 20:27
08/29/11 20:27
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: ANet 1.4.0.0 public Beta
[Re: Dark_samurai]
#381566
08/29/11 20:48
08/29/11 20:48
|
Joined: May 2009
Posts: 1,816 at my pc (duh)
darkinferno
Serious User
|
Serious User
Joined: May 2009
Posts: 1,816
at my pc (duh)
|
@alibaba: Thanks for reporting! This was indeed a bug and I already fixed it, but I want to wait for possible other bugs before I release the new version.
As a workaround use picoder's code, please. my reply was based on this post
|
|
|
|