2 registered members (AndrewAMD, howardR),
472
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: ANET; please save me!!
[Re: slacer]
#256152
03/14/09 22:38
03/14/09 22:38
|
Joined: Mar 2009
Posts: 16
xxGOTARxx
OP
Newbie
|
OP
Newbie
Joined: Mar 2009
Posts: 16
|
Ok here is what I am working with. Basically I am just trying to make a server, then make a client that connects to that server, once connected the enet_server_event kicks in and the server tells my that a client connected.
#include <acknex.h>
#include <default.c>
#include "anet.h"
STRING* str_message = "NULL";
void check_mode()
{
if(enet_get_connection() == 0) {printf("No connection!");}
if(enet_get_connection() == 1) {printf("server!");}
if(enet_get_connection() == 2) {printf("client!");}
if(enet_get_connection() == 3) {printf("client-server!");}
}
void start_server()
{
enet_init();
enet_init_server(2300,4,_str(""));
str_cpy(str_message,"starting server");
wait(500);
check_mode();
}
void start_client()
{
enet_init();
enet_init_client(_str("76.215.138.102"),2300,_str(""));
str_cpy(str_message,"starting client");
wait(500);
check_mode();
}
void sv_client_connected(var sender, STRING* msg)
{
printf("A new client connected!");
}
void main()
{
// Set Video Mode
video_mode = 7;
while(1)
{
if(key_s)
{
start_server();
return;
}
if(key_c)
{
start_client();
return;
}
wait(1);
}
while(1)
{
enet_set_event(1,_str("sv_client_connected")); //sets the client connected event
}
}
TEXT* display =
{
string(str_message);
flags = VISIBLE;
}
The following is the last -diag i got from the client Log of A7 Engine 7.70.0 run at Sat Mar 14 17:35:53 2009 GotaR on Windows NT/2000/XP version 5.1 Build 2600 Options KAT.c -diag -tA App C:\Program Files\GStudio7\acknex.exe in C:\Kingdoms at War\ MM mixer opened DSOUND device opened DI interface opened Start Window opened (c)Conitec . Dieburg . San Diego . www.3dgamestudio.comA7 Engine - Trial Edition V7.70.0 - Feb 5 2009 Development version 26 days left DI Microsoft PC-joystick driver 4 axes 8 buttons initialized Mouse found Joystick found SB Live! Wave Device opened NVIDIA GeForce 6200 pure T&L device 1ff9 detected D3D device NVIDIA GeForce 6200 1ff9 selected. ANet.dll opened ackwii.dll opened t7.dll opened Compiling KAT.C - [Esc] to abort..... .... .. 0.467 sec Running KAT.C. 2 objects Main started at 2.635 def_startup started anet_main_loop_startup started D3D_Init Window: 800x600 -> Window: 1x800x600x32 Video memory found: 161 MB Main loop at 2.760... Server started at 2.761 Client started at 2.761. 1st frame with 161 MB at 2.789
|
|
|
Re: ANET; please save me!!
[Re: Spirit]
#256224
03/15/09 12:42
03/15/09 12:42
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
I would even start with 3DGS network before you try ANET. 3DGS network is easier to use, you need less commands. Once that works on your LAN then you can connect through Internet or try ANET. No! ANet needs less commands to send data and in my eyes it's much easier to understand. That's why I created it If you want to send data with GS Network, you have to send it to the server and forward it to the client. ANet is doing all that for you. The next plus is that you won't need to use the enoying command lines! ANet offers you a lot of functions that would need a lot of time and understanding if you want to do the same with the GS networksystem. @xxGOTARxx: There is an mistake in your main function! You program will never set the event! If you start a server or a client, the main program is shut down and won't call the enet_set_event() function Correct would be:
void main()
{
// Set Video Mode
video_mode = 7;
enet_set_event(1,_str("sv_client_connected")); //sets the client connected event
while(1)
{
if(key_s)
{
start_server();
return;
}
if(key_c)
{
start_client();
return;
}
wait(1);
}
} Try to run this program:
#include <acknex.h>
#include <default.c>
#include "anet.h"
function client_connected(var sender, STRING* msg);
void main()
{
level_load("");
wait(3);
enet_init();
enet_set_event(1,_str("client_connected"));
while(1)
{
if(key_s == ON) {enet_init_server(2300,4,_str(""));return;}
if(key_c == ON) {enet_init_client(_str("localhost"),2300,_str("");return;}
wait(1);
}
}
function client_connected(var sender, STRING* msg)
{
error("Client connected!");
}
You have to start the application 2 times (on the same computer!). First you have to open a server and after that you have to open a client. If everything works, on the server an error message will popup with the content "Client connected!". Tell me if this is working for you. You can also contact me on ICQ. My ICQ number is in my profil. regards, Peter
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: ANET; please save me!!
[Re: Dark_samurai]
#256675
03/18/09 08:59
03/18/09 08:59
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
I was just about to start a new thread when I noticed this one. I get a very similar Problem when trying the Chat-Tutorial. Also, with the Pong demo, I have no luck. In the Chat tutorial's LiteC version, I can start a host, then I start a client, type in "localhost" and then it just sits there and does nothing. Another thing I noticed that even when I start the host, I don't see the character that I chose, I only have the camera sitting just above the ground, like it's still at 0,0,0 without having moved to the position behind the character... ?
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: ANET; please save me!!
[Re: Germanunkol]
#256707
03/18/09 14:48
03/18/09 14:48
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Hmmm... maybe the dll isn't loaded. Can you download this small program and tell me what it displays in the window on the bottom. What GS Version do you use?
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: ANET; please save me!!
[Re: Dark_samurai]
#256711
03/18/09 15:06
03/18/09 15:06
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
I was using LiteC, free version. But for trying the simple_3dchat_1.1 I shouldn't need any 3dgs version installed, or do I?
yes, it seems like it can't open the dll:
" ... anet_callback: function not found anet_reset_queue: function not found anet_set_compatibility: function not found anet_set_encryption: function not found anet_set_warning: function not found enet_abort_fsending: function not found enet_check_client: function not found enet_clsend_event: function not found enet_clsend_file: function not found enet_connected_clients: function not found enet_deinit: function not found enet_destroy_host: function not found enet_disconnect_client: function not found enet_ent_create: function not found enet_ent_creator: function not found enet_ent_globpointer: function not found enet_ent_locpointer: function not found ... "
is what it says in the acklog.txt. I just noticed that it may be my windows though, I think I need to reinstall it, it's messed up. There's other things that haven't been working, but I didn't associate it with that at first. Sorry, I'll try repairing my windows and then try again...
[edit] what's weird though is that my game that's based on GSTNET works fine, using a local host and local client... GSTNET.dll can be loaded... [/edit]
Last edited by Germanunkol; 03/18/09 15:10.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: ANET; please save me!!
[Re: Dark_samurai]
#256865
03/19/09 11:50
03/19/09 11:50
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Hm...even with VC++ installed I can't get it to work. I just setup my whole PC anew because of the Virus I had. I get an Error E1512 Upon startup of the chat Multiplayer "Empty prototype called in main" and still the same output in the acklog.txt... Of course, since none of these funktions are loaded I still can't connect to a local host.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: ANET; please save me!!
[Re: Germanunkol]
#256910
03/19/09 14:11
03/19/09 14:11
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Please download the Dependency Walker and open the dll with this program. After that tell me what it displays in the window on the bottom.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
|