Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
A8. 03 SendVar #334449
07/23/10 12:31
07/23/10 12:31
Joined: Nov 2009
Posts: 37
X
XuserTM Offline OP
Newbie
XuserTM  Offline OP
Newbie
X

Joined: Nov 2009
Posts: 37
No AneT This is 3DGS Standart network.
Hi,
My multiplayer project
Client and Server In separate files.Bud I cant send string.
Pls Help me.
This is client code
Code:
/*
UzakDiyarlar oyununun 3D MMORPG 
haline çevrilmesidir.Tüm kullanılan Plugin,Kütüphane ve diğer yazılımların lisanları alınmıştır.
ProjeYönetimi 
ByFabs Ve ByXuserTM ye Aitdir.Tüm Hakları Saklıdır.
CLİENT!!!
*/
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
#include <mtlView.c>
STRING* ip = "127.0.0.1";
player_name = "game"; 
///////////////////////////////
#define PRAGMA_PATH "Data";
#define PRAGMA_PATH "Data\\Ses";
#define PRAGMA_PATH "Data\\MDL";
#define PRAGMA_PATH "Data\\2D";
#define PRAGMA_PATH "Data\\Script";
#define PRAGMA_PATH "Data\\Maps";
#define PRAGMA_PATH "Data\\CSKins";
#define PRAGMA_PATH "Data\\AneT";

//Oyunumuz &#304;çin Olan Temel motorlar&#305; yükliyelim ...
#include "grs.c" // giri&#351; ayarlar&#305;
BMAP* fare  = "Data\2D\arrow.pcx";
FONT* arial_font = "Arial#20b";
STRING* loginname = "asdasdasdasdasd";
STRING* datasend = "asdasdasdasdasd";



#include "Data\Script\client.c";
function main()
{
	session_connect("testserver","127.0.0.1");
video_window(NULL,NULL,1,"UzakDiyarlar3D");
wait(1);
 mouse_map = fare;
 mouse_mode = 3;
wait(1);
dplay_localfunction = 2;
on_client = on_client_event;
while(1)
{
if (!connection) 
{
    error("Sunucu ile olan ba&#287;lant&#305; kesildi.");
    session_connect("testserver","127.0.0.1");
    }
    else
    {
    	  var abc=110;
    	send_var_to(abc,0); 
}
    wait(1);
}
}



Code:
/*
UzakDiyarlar oyununun 3D MMORPG 
haline çevrilmesidir.Tüm kullan&#305;lan Plugin,Kütüphane ve di&#287;er yaz&#305;l&#305;mlar&#305;n lisanlar&#305; al&#305;nm&#305;&#351;t&#305;r.
ProjeYönetimi 
ByFabs Ve ByXuserTM ye Aitdir.Tüm Haklar&#305; Sakl&#305;d&#305;r.
SERVER !!!
*/
///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
#include <mtlView.c>

///////////////////////////////
#define PRAGMA_PATH "Data";
#define PRAGMA_PATH "Data\\Ses";
#define PRAGMA_PATH "Data\\MDL";
#define PRAGMA_PATH "Data\\2D";
#define PRAGMA_PATH "Data\\Script";
#define PRAGMA_PATH "Data\\Maps";
#define PRAGMA_PATH "Data\\CSKins";


var abc = 403;
FONT* arial_font = "Arial#20b";

//Oyunumuz &#304;çin Olan Temel motorlar&#305; yükliyelim ...
#include "ackmysql.h" // mysql kütüphanesi ...

PANEL* aircraft_pan =
{
  digits(40,30,4,arial_font,1,abc);
  flags = SHOW;
}


#include "Data\Script\server.c";
function main()
{
ackmysql_init();
	session_open("testserver"); // server olu&#351;turuldu.
	dplay_localfunction = 2;
wait(1);
if(ackmysql_connect("localhost", "root", "") == ACKMYSQL_FAILURE) 
	{
		error("Mysql Server&#305;na ba&#287;lan&#305;lamad&#305;");
		return;
	}
	//databeseyi seçelim
		if(ackmysql_select_db("server") == ACKMYSQL_FAILURE)
	{
		error("Tablo seçim hatas&#305; oldu.");
		return;
	}	
	//Sunucuu kuruluyor
	on_server = server_event; // server olaylar&#305;...
	
}



Bud dont change abc in server.
I send Client To Server

Re: A8. 03 SendVar [Re: XuserTM] #334457
07/23/10 13:20
07/23/10 13:20
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline
User
SchokoKeks  Offline
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
Hi,

with the "3DGS standart network" you can not have separate code files for server and client. That is because it uses so-called handles of variables as identification. In a different script (even when only one line is different), variables and pointer with the same name get a different handle, and sending them fails.

With Anet this is possible, but only when you set "anet_use_handles(0);" before connection. It sends the full variable names then. This might also be possible with the completely free GSTNET plugin, but I'm not sure about this.

Re: A8. 03 SendVar [Re: SchokoKeks] #334458
07/23/10 13:40
07/23/10 13:40
Joined: Jun 2001
Posts: 1,004
Dossenbach
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

Joined: Jun 2001
Posts: 1,004
Dossenbach
GSTNet sends var names and values


Andreas
GSTools - Home of
GSTScript 0.9.8: lua scripting for A6/7/8
GSTNet 0.7.9.20: network plugin for A6/7/8
GSTsqlite 1.3.7: sql database plugin for A6/7/8
3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
Re: A8. 03 SendVar [Re: nfs42] #334477
07/23/10 15:44
07/23/10 15:44
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Quote:
With Anet this is possible, but only when you set "anet_use_handles(0);" before connection. It sends the full variable names then. This might also be possible with the completely free GSTNET plugin, but I'm not sure about this.


But this creates a lot of unnecessary traffic, and shouldn't be used if not absolutely needed. If you use it, try to use short variable names for saving traffic.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1