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