Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 945 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Reading a TXT file on server #479790
04/26/20 16:39
04/26/20 16:39
Joined: Jun 2008
Posts: 146
London
T
Truth Offline OP
Member
Truth  Offline OP
Member
T

Joined: Jun 2008
Posts: 146
London
Hi,

Is there a way to read a text file on a server into a STRING object? I need to be able to be able to change or add another "session_connect" ip address after I've released my game just by modifying a text file.

Currently I'm using a local text file

STRING Server = null;
var FileServerTxt;

function multiplayer
{
FileServerTxt = file_open_read("Server.txt"); <-------I thought I could just change this txt to the URL of the server but it doesn't work
file_str_read(FileServerTxt, Server);
session_connect("highroad", Server);
file_close(FileServerTxt);
}

thanks

Re: Reading a TXT file on server [Re: Truth] #479796
04/26/20 20:13
04/26/20 20:13
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You can use the HTTP and FTP commands to download the file and then open it as any other file.


Always learn from history, to be sure you make the same mistakes again...
Re: Reading a TXT file on server [Re: Uhrwerk] #479798
04/26/20 20:43
04/26/20 20:43
Joined: Jun 2008
Posts: 146
London
T
Truth Offline OP
Member
Truth  Offline OP
Member
T

Joined: Jun 2008
Posts: 146
London
Thanks, I'll look into that

Re: Reading a TXT file on server [Re: Uhrwerk] #480421
06/05/20 18:22
06/05/20 18:22
Joined: Jun 2008
Posts: 146
London
T
Truth Offline OP
Member
Truth  Offline OP
Member
T

Joined: Jun 2008
Posts: 146
London
I'm guessing there's no way to use ftp with c-script? frown

Re: Reading a TXT file on server [Re: Truth] #480446
06/06/20 23:28
06/06/20 23:28
Joined: Jun 2008
Posts: 146
London
T
Truth Offline OP
Member
Truth  Offline OP
Member
T

Joined: Jun 2008
Posts: 146
London
I done it by using the "exec" function to launch a silent batch file which downloads the txt from my FTP server using WinSCP


Gamestudio download | chip programmers | 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