0 registered members (),
683
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[Anet] I´ve a VServer.. but how to connect?
#352188
01/01/11 21:20
01/01/11 21:20
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
Hi there, i´ve a small big problem.. I own a Virtual Server at Hosteurope. Now, with the help of the manual, i created an ANet Testproject:
#include <acknex.h>
#include "anet.h"
#include "default_anet.c"
#include "dr_template.c"
#include "players.c"
#define PRAGMA_PATH "ANetTemplatesProfessional/internetserverlist"
#include "inet_template.c"
FONT* arialer = "Arial#32b";
PANEL* digitaler =
{
pos_x = 10;
pos_y = 500;
flags = SHOW;
digits(0,0,"Drücke [1] für Server erstellen oder [2] für Client erstellen", arialer, 1, 0);
digits(0,34,"Drücke [F11] um das Anet Debug anzuzeigen", arialer, 1, 0);
}
//======================================================================================================================================
// ALLGEMEINE VARIABLEN
//======================================================================================================================================
var i;
var max_players = 32;
var players[33];
var glob_port = 2300;
//======================================================================================================================================
// SERVER AUFBAUEN
//======================================================================================================================================
function connected(var sender, STRING* msg)
{
//...
error("Server hergestellt");
}
function disconnected(var sender, STRING* msg)
{
//...
}
function initial_server()
{
enet_svset_event(EVENT_CONNECTED,"connected");
enet_svset_event(EVENT_DISCONNECTED,"disconnected");
enet_init_server(2300,4,""); // Port, Spielerzahl, Passwort
}
//======================================================================================================================================
// CLIENT AUFBAUEN
//======================================================================================================================================
function client_connected(var sender, STRING* msg)
{
//...
error("Client hergestellt");
}
function client_disconnected(var sender, STRING* msg)
{
//...
}
function initial_client()
{
enet_clset_event(EVENT_CONNECTED,"client_connected");
enet_clset_event(EVENT_DISCONNECTED,"client_disconnected");
enet_init_client("178.77.69.66",2300,""); // Host, Port, Passwort - 178.77.69.66
}
//======================================================================================================================================
// SPIELSTART
//======================================================================================================================================
void main()
{
fps_max = 50;
video_mode = 8;
d3d_antialias = 9;
wait(1);
enet_init();
for(i=0;i<max_players;i++) {players[i] = 0;}
level_load(NULL);
wait(3);
while(1)
{
if(key_1 == 1)
{
initial_server();
// enet_init_server(glob_port,4,""); // Port, Spielerzahl, Passwort
}
else if(key_2 == 1)
{
initial_client();
// enet_init_client("localhost",glob_port,""); // Host, Port, Passwort
}
wait(1);
}
}
1 = Start Server 2 = Start Client Like you see, i added the IP of my VServer to this Thing. Published, added the Anet keyfile and OpenGL32..something.. and sent it to my friend. But it doesn´t matter what we are doing.. We can´t get a connection to each other... Question: How am i able to connect via server (there´s nearly nothing to it in the manual...) Ps.: The Anet manual is extremely.. meagerly in infos...
|
|
|
Re: [Anet] I´ve a VServer.. but how to connect?
[Re: Espér]
#352190
01/01/11 21:48
01/01/11 21:48
|
Joined: Jun 2008
Posts: 428
Rasch
Senior Member
|
Senior Member
Joined: Jun 2008
Posts: 428
|
Have you started the .exe file on your "VirtualServer"? Because if nothing is running on your VirtualServer there´s no server. Are you allowed to run this application ona VServer on Hosteurope? I´m sure you need to ask them if this is possible and allowed. Maybe they need to forward the ports for you.. More informations please
|
|
|
Re: [Anet] I´ve a VServer.. but how to connect?
[Re: Rasch]
#352191
01/01/11 21:50
01/01/11 21:50
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
nope.. didn´t started it there... But i tried.. and it says "no mouse found"
I´ve not really an idea what i need to do.. it´s the first try on MP for me.
Last edited by Espér; 01/01/11 21:51.
|
|
|
Re: [Anet] I´ve a VServer.. but how to connect?
[Re: Espér]
#352206
01/01/11 23:11
01/01/11 23:11
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Your problem has nothing to do with ANet. If Gamestudio can't start on your Virtual Server because no mouse is found ANet isn't even loaded You could try to run the engine in console mode. Look into the manual under video_mode (set it to 0). This was also mentioned in the manual under enet_init_server(). Also why you need to do port forwarding is described in the manual (see introduction). Just read through it. And if you are new to MP programming, also give the workshops on the ANet homepage a try. Is there a way to create something like a list of Games (servers) from other players.. so the clients don´t need to type in the server ip everytime..? Yes. Just open a Webserver (like Apache) on your virtual server and implement a server list database (SQL) that is accessed via HTTP (PHP). You can make use of ANet's built in htttp functions. ANet also has a ready to use template that does the work for you. But I would advice you to do this in the last step of your game. First try to make the basics working (connecting, smooth playermovement,...). Then try to extend it with more advanced features.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [Anet] I´ve a VServer.. but how to connect?
[Re: Dark_samurai]
#352207
01/01/11 23:14
01/01/11 23:14
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
ah.. ok... Uhmm. actually.. i can connect local.. but still not to my friend (written my ip into enet_init_client)... i found my ip via > http://www.wieistmeineip.de/ <, but i can´t connect..
#include <acknex.h>
#include "anet.h"
#include "default_anet.c"
FONT* arialer = "Arial#32b";
PANEL* digitaler =
{
pos_x = 10;
pos_y = 500;
flags = SHOW;
digits(0,0,"Drücke [1] für Server erstellen oder [2] für Client erstellen", arialer, 1, 0);
digits(0,34,"Drücke [F11] um das Anet Debug anzuzeigen", arialer, 1, 0);
}
//======================================================================================================================================
// ALLGEMEINE VARIABLEN
//======================================================================================================================================
var i;
var max_players = 32;
var players[33];
var glob_port = 2300;
//======================================================================================================================================
// SERVER AUFBAUEN
//======================================================================================================================================
function initial_server()
{
enet_svset_event(EVENT_CONNECTED,"svevent_connected");
enet_svset_event(EVENT_DISCONNECTED,"svevent_disconnected");
enet_init_server(glob_port,max_players,""); // Port, Spielerzahl, Passwort
level_load("test.wmb");
wait(3);
enet_set_level("test.wmb"); //Levelfilename an Enet übertragen
}
function svevent_connected(var sender, STRING* msg, var length)
{
//...
wait(1);
}
function svevent_disconnected(var sender, STRING* msg, var length)
{
//...
wait(1);
}
//======================================================================================================================================
// CLIENT AUFBAUEN
//======================================================================================================================================
function initial_client()
{
enet_clset_event(EVENT_CONNECTED,"clevent_connected");
enet_clset_event(EVENT_DISCONNECTED,"clevent_disconnected");
enet_init_client("localhost",glob_port,""); // Host/IP, Port, Passwort
// local - localhost
// Server - 178.77.69.66
// My - 84.57.165.124
}
function clevent_connected(var sender, STRING* msg, var length)
{
//...
if(enet_get_connection() == CLIENT_MODE)
{
//Serverlevel laden (msg = vom Server gegebener Levelfilename)
level_load(msg);
wait(3);
enet_ent_synchronize(); //synchronisiere entities
}
}
function clevent_disconnected(var sender, STRING* msg, var length)
{
//...
wait(1);
}
//======================================================================================================================================
// SPIELSTART
//======================================================================================================================================
void main()
{
fps_max = 500;
video_mode = 8;
d3d_antialias = 9;
wait(1);
enet_init();
for(i=0;i<max_players;i++) {players[i] = 0;}
var testings = 0;
wait(1);
while(testings == 0)
{
if(key_1 == 1)
{
initial_server();
testings = 1;
}
else if(key_2 == 1)
{
initial_client();
testings = 1;
}
wait(1);
}
}
any idea why?
Last edited by Espér; 01/02/11 00:21.
|
|
|
Re: [Anet] I´ve a VServer.. but how to connect?
[Re: Espér]
#352233
01/02/11 12:05
01/02/11 12:05
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
User
|
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
Your router is blocking the incomming connection of your friend because of NAT. You need to forward all traffic from the port you are using (glob_port = 2300) to the computer you have the server running on. For doing this, you need the local LAN-IP of that computer and have access to your router webinterface. Unfortunately I can't give you a step-to-step guide as nearly every routers menu is different. Try this page, it has instructions for nearly every model: http://portforward.com/
|
|
|
Re: [Anet] I´ve a VServer.. but how to connect?
[Re: SchokoKeks]
#352235
01/02/11 12:08
01/02/11 12:08
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
Port 2300 has port forwarding (done this a few weeks ago) Port check says that the port 2300 is open ^.^ Ps.: On that site.. there´s nothing for an easyBox from Vodafon xD actual code:
#include <acknex.h>
#include "anet.h"
#include "default_anet.c"
FONT* arialer = "Arial#32b";
PANEL* digitaler =
{
pos_x = 10;
pos_y = 500;
flags = SHOW;
digits(0,0,"Drücke [1] für Server erstellen oder [2] für Client erstellen", arialer, 1, 0);
digits(0,34,"Drücke [F11] um das Anet Debug anzuzeigen", arialer, 1, 0);
}
//======================================================================================================================================
// ALLGEMEINE VARIABLEN
//======================================================================================================================================
var i;
var max_players = 32;
var players[33];
var glob_port = 2300;
//======================================================================================================================================
// SERVER AUFBAUEN
//======================================================================================================================================
function svevent_connected(var sender, STRING* msg, var length)
{
//...
wait(1);
}
function svevent_disconnected(var sender, STRING* msg, var length)
{
//...
wait(1);
}
function start_server()
{
enet_svset_event(EVENT_CONNECTED,"svevent_connected");
enet_svset_event(EVENT_DISCONNECTED,"svevent_disconnected");
enet_init_server(glob_port,max_players,""); // Port, Spielerzahl, Passwort
level_load("test.wmb");
wait(3);
enet_set_level("test.wmb"); //Levelfilename an Enet übertragen
}
//======================================================================================================================================
// CLIENT AUFBAUEN
//======================================================================================================================================
function clevent_connected(var sender, STRING* msg, var length)
{
//...
if(enet_get_connection() == CLIENT_MODE)
{
//Serverlevel laden (msg = vom Server gegebener Levelfilename)
level_load(msg);
wait(3);
enet_ent_synchronize(); //synchronisiere entities
}
}
function clevent_disconnected(var sender, STRING* msg, var length)
{
//...
wait(1);
}
function start_client()
{
enet_clset_event(EVENT_CONNECTED,"clevent_connected");
enet_clset_event(EVENT_DISCONNECTED,"clevent_disconnected");
enet_init_client("84.57.165.124",glob_port,""); // Host/IP, Port, Passwort
// local - localhost
// Server - 178.77.69.66
// My - 84.57.165.124
}
//======================================================================================================================================
// SPIELSTART
//======================================================================================================================================
void main()
{
fps_max = 500;
video_mode = 8;
d3d_antialias = 9;
wait(1);
enet_init();
for(i=0;i<max_players;i++) {players[i] = 0;}
var testings = 0;
wait(1);
while(testings == 0)
{
if(key_1 == 1)
{
start_server();
testings = 1;
}
else if(key_2 == 1)
{
start_client();
testings = 1;
}
wait(1);
}
}
Last edited by Espér; 01/02/11 12:51.
|
|
|
Re: [Anet] I´ve a VServer.. but how to connect?
[Re: Espér]
#352237
01/02/11 13:15
01/02/11 13:15
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
If you can connect local and you have the correct internet ip used for the connection than the problem is not ANet related. It's a networking problem caused by your router and/or firewall.
What protocol is forwarded? UDP or TCP? You should allow port 2300 over UDP.
Also try to turn off your firewall (on the client and the server).
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
|