1 registered members (AndrewAMD),
1,310
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[ANET- MMORPG Project} Remote Connectivity Proplem... (Cant see)
#346127
11/01/10 16:06
11/01/10 16:06
|
Joined: Nov 2009
Posts: 37
XuserTM
OP
Newbie
|
OP
Newbie
Joined: Nov 2009
Posts: 37
|
My project work on my local network. 127.0.0.1 - 192.168.2.x is good no proplem. Bud My friend try connect my server.They cant see my char and other clients char. My Client And Server files have different file. My Char Create Code
#include "player_setup.c"
var char_secme = 0;
var islev_sync__status = 0;
function char_create_in_game()
{
//Karekteri oluşturuyoruz....
char_load_from_menu(char_secme);
if(char_class_oyuncu == 1 && char_cins_oyuncu == 1) enet_ent_create("Data/3D/Player/erkek.mdl",vector(0,0,20),"player_move");
if(char_class_oyuncu == 2 && char_cins_oyuncu == 1) enet_ent_create("Data/3D/Player/erkek_cin.mdl",vector(0,0,20),"player_move");
//Karekterin Gözleri Oluşturuluyor...
enet_ent_create("Data/3D/Player/goz.mdl",nullvector,"goz_a");
enet_ent_create("Data/3D/Player/goz.mdl",nullvector,"goz_b");
//Saçı oluşturalım
if(char_class_oyuncu == 2 && char_cins_oyuncu == 1)
{
STRING* char_sac_oyuncu = "#90";
STRING* sac_id_t_oyuncu = "#10";
str_cpy(char_sac_oyuncu,"Data/3D/Player/esac/c_m_");
str_for_num(sac_id_t_oyuncu,sactype_oyuncu);
str_cat(char_sac_oyuncu,sac_id_t_oyuncu);
str_cat(char_sac_oyuncu,".mdl");
enet_ent_create(char_sac_oyuncu,nullvector,"sac_model");
}
}
function start_game_1() // THİS EVENT START GAME
{
char_secme =1;
//Oyunu Başlat 1.Karekterle...
inkey_active = 0;
wait(5);
char_load_from_menu(1); // bir numaralı karekterle giriş yapıldı...
wait_for(char_load_from_menu);
reset(charpan,SHOW);
reset(char_delete_1_pan,SHOW);
reset(start_1_pan,SHOW);
reset(eyvah_1,SHOW);
reset(cancel_delete_1_pan,SHOW);
reset(char_yarat,SHOW);
level_load("Data/Level/town.wmb");
wait(10);
STRING* game_id = "#15";
str_for_num(game_id,cluser);
enet_clsend_event(21,game_id,10,SERVER);
//THİS EVENT GET SYNC SERVER...
while(islev_sync__status == 0) {wait(1);}
char_create_in_game();
}
This is server code for char create...
function main()
{
wait(1);
//warn_level = 0;
mouse_sync = 1;
video_window(nullvector,nullvector,0,"Server");
anet_set_compatibility(0);
anet_use_handles(0);
anet_set_warning(0);
wait(1);
ackmysql_init();
wait(1);
enet_init();
wait(1);
enet_svset_event(EVENT_CONNECTED,"baglanma_event");
enet_svset_event(EVENT_DISCONNECTED, "event_dc");
enet_svset_event(16, "login_event");
enet_svset_event(17, "char_respond");
enet_svset_event(18, "create_char");
enet_svset_event(19, "char_delete");
enet_svset_event(20, "char_delete_cancel");
enet_svset_event(21, "baslat_event");
enet_svset_event(EVENT_SYNCHRONIZED,"sync_okey");
enet_init_server(2300,4,"Refleks2010");
//Burda Serverı Mysql Sunucumuza bağlıyacağız
if(ackmysql_connect("localhost", "root", "") == ACKMYSQL_FAILURE)
{
error("Mysql Sunucusuna Erişim Sağlanamadı...");
sys_exit("Mysql");
return;
}
if(ackmysql_select_db("gameserver") == ACKMYSQL_FAILURE)
{
error("Oyun Sunucu tablosuna Erişim Sağlanamadı...");
sys_exit("Tablo");
return;
}
level_load("town.wmb");
wait(3);
enet_set_level("town.wmb");
alluser_ofline(); //tüm oyuncular ofline
cron_job_init(); // CronJob sistemi devrede...
}
var sync_emr = 1;
function baslat_event(var sender, STRING* msg) // THİS İS //sync request
{
//oyuncu start tusuna bastı ve senkorize olmayı bekliyor demektir...
sync_emr = 1;
enet_send_var("sync_emr",sender);
}
And this is my player code İN CLİENT
function goz_a()
{
var play_no = enet_get_clientid();
while(enet_ent_globpointer(my) == ANET_ERROR) {wait(1);}
// player_ent_goz_a[enet_ent_creator(enet_ent_globpointer(my))] = my;
set(my,PASSABLE);
my.scale_x -= 0.5;
my.scale_y -= 0.5;
my.scale_z -= 0.5;
while(1)
{
my.x = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill1;
my.y = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill2;
my.z = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill3;
my.pan = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill4;
enet_send_pos(enet_ent_globpointer(my),SERVER,0);
enet_send_angle(enet_ent_globpointer(my),SERVER,0);
wait(1);
}
}
function goz_b()
{
var play_no = enet_get_clientid();
while(enet_ent_globpointer(my) == ANET_ERROR) {wait(1);}
// player_ent_goz_b[enet_ent_creator(enet_ent_globpointer(my))] = my;
set(my,PASSABLE);
my.scale_x -= 0.5;
my.scale_y -= 0.5;
my.scale_z -= 0.5;
while(enet_ent_creator(enet_ent_globpointer(my)) == enet_get_clientid())
{
my.x = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill6;
my.y = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill7;
my.z = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill8;
my.pan = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill4;
enet_send_pos(enet_ent_globpointer(my),SERVER,0);
enet_send_angle(enet_ent_globpointer(my),SERVER,0);
wait(1);
}
}
MATERIAL* sac_renk ={
ambient_blue = 0;
ambient_green = 0;
ambient_red = 255;
diffuse_blue = 0;
diffuse_green = 0;
diffuse_red = 255;
specular_blue = 255;
specular_green = 255;
specular_red = 255;
power = 10;
}
function sac_model()
{
var play_no = enet_get_clientid();
while(enet_ent_globpointer(my) == ANET_ERROR) {wait(1);}
// sac_ent[enet_ent_creator(enet_ent_globpointer(my))] = my;
set(my,PASSABLE);
my.scale_x -= 0.3;
my.scale_y -= 0.3;
my.scale_z -= 0.3;
my.material = sac_renk;
sac_renk.ambient_red = sac_red_oyuncu;
sac_renk.ambient_green = sac_green_oyuncu;
sac_renk.ambient_blue = sac_blue_oyuncu;
sac_renk.diffuse_red = sac_red_oyuncu;
sac_renk.diffuse_green = sac_green_oyuncu;
sac_renk.diffuse_blue = sac_blue_oyuncu;
sac_renk.specular_red = sac_red_oyuncu;
sac_renk.specular_green = sac_green_oyuncu;
sac_renk.specular_blue = sac_blue_oyuncu;
while(enet_ent_creator(enet_ent_globpointer(my)) == enet_get_clientid())
{
my.x = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill9;
my.y = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill10;
my.z = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill11;
my.pan = player_ent[enet_ent_creator(enet_ent_globpointer(my))].skill4;
enet_send_pos(enet_ent_globpointer(my),SERVER,0);
enet_send_angle(enet_ent_globpointer(my),SERVER,0);
wait(1);
}
}
function player_move()
{
var play_no = enet_get_clientid();
while(enet_ent_globpointer(my) == ANET_ERROR) {wait(1);}
player_ent[enet_ent_creator(enet_ent_globpointer(my))] = my;
set(my,PASSABLE);
VECTOR goz_a_pos;
VECTOR goz_b_pos;
VECTOR kafa_pos;
var bendegil = 0;
while(enet_ent_creator(enet_ent_globpointer(my)) == enet_get_clientid())
{
bendegil = 1;
if(char_class_oyuncu == 1 && char_cins_oyuncu == 1)
{
vec_for_vertex(kafa_pos,my,392);
vec_for_vertex(goz_a_pos,my,1145);
vec_for_vertex(goz_b_pos,my,1146);
}
if(char_class_oyuncu == 2 && char_cins_oyuncu == 1)
{
vec_for_vertex(kafa_pos,my,593);
vec_for_vertex(goz_a_pos,my,1141);
vec_for_vertex(goz_b_pos,my,1140);
}
if(key_w) my.skill12 = 1;
//Göz 1
my.skill1 = goz_a_pos.x;
my.skill2 = goz_a_pos.y;
my.skill3 = goz_a_pos.z;
//Göz 2
my.skill6 = goz_b_pos.x;
my.skill7 = goz_b_pos.y;
my.skill8 = goz_b_pos.z;
//Saç
my.skill9 = kafa_pos.x;
my.skill10 = kafa_pos.y;
my.skill11 = kafa_pos.z;
enet_send_pos(enet_ent_globpointer(my),SERVER,0);
enet_send_skills(enet_ent_globpointer(my),0,100,SERVER);
enet_send_angle(enet_ent_globpointer(my),SERVER,0);
wait(1);
}
}
function char_load_from_menu(var num)
{
if(num == 1)
{
idforchar_oyuncu = idforchar;
char_class_oyuncu = char_class;
char_cins_oyuncu = char_cins;
STRING* char_name_oyuncu = "#13";
str_cpy(char_name_oyuncu,char_name);
char_level_oyuncu = char_level;
char_items_oyuncu[12] = char_items[12];
sactype_oyuncu = sactype ;
sac_red_oyuncu = sac_red ;
sac_green_oyuncu = sac_green;
sac_blue_oyuncu = sac_blue ;
char_renks_oyuncu = char_renks;
char_type_oyuncu = char_type ;
sakal_t_oyuncu = sakal_t;
dovme_t_oyuncu = dovme_t;
dovme_x_oyuncu = dovme_x;
dovme_y_oyuncu = dovme_y;
}
}
And this is player code in my server
function player_move()
{
set(my,PASSABLE);
//player_ent[enet_ent_creator(enet_ent_globpointer(my))] = my;
while(1)
{
ANGLE bone_ang_ent_c;
//bone adresleri
ang_for_bone(bone_ang_ent_c,my,"Bip001 Head");
// bone adresleri...
my.skill4 = bone_ang_ent_c.pan;
if(my.skill12 == 1) my.x +=0.5;
my.skill16 = 1;
enet_send_pos(enet_ent_globpointer(me),BROADCAST,0);
enet_send_skills(enet_ent_globpointer(me),0,100,BROADCAST);
enet_send_angle(enet_ent_globpointer(me),BROADCAST,0);
wait(1);
}
}
function goz_a()
{
set(my,PASSABLE);
while(1)
{
enet_send_pos(enet_ent_globpointer(me),BROADCAST,0);
enet_send_angle(enet_ent_globpointer(me),BROADCAST,0);
wait(1);
}
}
function goz_b()
{
set(my,PASSABLE);
while(1)
{
enet_send_pos(enet_ent_globpointer(me),BROADCAST,0);
enet_send_angle(enet_ent_globpointer(me),BROADCAST,0);
wait(1);
}
}
function sac_model()
{
set(my,PASSABLE);
while(1)
{
enet_send_pos(enet_ent_globpointer(me),BROADCAST,0);
enet_send_angle(enet_ent_globpointer(me),BROADCAST,0);
wait(1);
}
}
if you cant understand this code , pls Prepare 3D Multiplayer Move Box game. in difrent client and server files. Becouse All sample is client and server same file. My engilish bad.I hope I win Sorrow to tell... thanks you and
Last edited by XuserTM; 11/01/10 16:07.
|
|
|
Re: [ANET- MMORPG Project} Remote Connectivity Proplem... (Cant see)
[Re: XuserTM]
#346128
11/01/10 16:12
11/01/10 16:12
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
Kodunuzla bir alakasi yok, portlarinizi yonlendirmeniz yeterli. Pmden yardimci olayim istersen.
---- If anyone else has the same problem He needs to forward ports ^^.
3333333333
|
|
|
Re: [ANET- MMORPG Project} Remote Connectivity Proplem... (Cant see)
[Re: Quad]
#346129
11/01/10 16:17
11/01/10 16:17
|
Joined: Nov 2009
Posts: 37
XuserTM
OP
Newbie
|
OP
Newbie
Joined: Nov 2009
Posts: 37
|
Not proplem port,I can connect my friend and thet connect my server bud he cant see orhet client I hope proplem in sync. __ Pm de yolladım
|
|
|
Re: [ANET- MMORPG Project} Remote Connectivity Proplem... (Cant see)
[Re: XuserTM]
#346205
11/02/10 18:37
11/02/10 18:37
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
You tested your code using 2 PCs in your lan and both could see the characters. And then you tested it over the internet (exactly the same versions) and your friend couldn't see the characters?
Are you sure that your friend could connect to your server (the connected event was called on the server and the clientid of your friends PC was greater -1)? Additionally you should check if you are really using exaclty the same version you tested in the lan and if client and server are running the same application (it's not allowed that client and server are different applications, only when setting anet_use_handles(0); (with all the disadvantages)).
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [ANET- MMORPG Project} Remote Connectivity Proplem... (Cant see)
[Re: Dark_samurai]
#346314
11/04/10 07:18
11/04/10 07:18
|
Joined: Nov 2009
Posts: 37
XuserTM
OP
Newbie
|
OP
Newbie
Joined: Nov 2009
Posts: 37
|
I Settled code looking to example 3DChat. And work...Sory I figured out proplemç Thanks agian and thanks quad for affine...
|
|
|
|