Reading a TXT file on server

Posted By: Truth

Reading a TXT file on server - 04/26/20 16:39

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
Posted By: Uhrwerk

Re: Reading a TXT file on server - 04/26/20 20:13

You can use the HTTP and FTP commands to download the file and then open it as any other file.
Posted By: Truth

Re: Reading a TXT file on server - 04/26/20 20:43

Thanks, I'll look into that
Posted By: Truth

Re: Reading a TXT file on server - 06/05/20 18:22

I'm guessing there's no way to use ftp with c-script? frown
Posted By: Truth

Re: Reading a TXT file on server - 06/06/20 23:28

I done it by using the "exec" function to launch a silent batch file which downloads the txt from my FTP server using WinSCP
© 2024 lite-C Forums