Official Soldat Forums

Soldat Fans => Developers Corner => Topic started by: chrisgbk on June 09, 2009, 02:39:10 am

Title: 1.5.0/2.5.0 Server File Transfer sample code - Delphi
Post by: chrisgbk on June 09, 2009, 02:39:10 am
This is a Delphi sample for working with the new file transfer code in 1.5.0/server 2.5.0. Includes a prebuilt executable which can download files from any server.

Creates a 'downloaded' folder where the EXE is run, and all downloaded files are placed in there.

For reference, the allowed file types are:
.png
.jpg
.bmp
.gif
.pms
(from the main server directory or any subfolder thereof)

with exceptions for:
logs/gamestat.txt
logs\gamestat.txt

Linux servers are, of course, case sensitive for filenames.

Protocol:
Code: [Select]
To server:

STARTFILES\r\n
<filename 1>\r\n
<filename 2>\r\n
...
<filename n>\r\n
ENDFILES\r\n

From server:

STARTFILES\r\n
<total size of all files as 4 byte integer>
<filename 1>\r\n
<size of file 1 as 4 byte integer>
<file 1 data>
<filename 2>\r\n
<size of file 2 as 4 byte integer>
<file 2 data>
...
<filename n>\r\n
<size of file n as 4 byte integer>
<file n data>
ENDFILES\r\n
Title: Re: 1.5.0/2.5.0 Server File Transfer sample code - Delphi
Post by: ManSoft|Warlord on June 12, 2009, 04:25:05 am
nice! thank you!
Title: Re: 1.5.0/2.5.0 Server File Transfer sample code - Delphi
Post by: Bloo on June 13, 2009, 11:02:30 pm
Er, is there a way to download .txt files from the server using this or any method other than FTP? (for example, banned.txt).
Title: Re: 1.5.0/2.5.0 Server File Transfer sample code - Delphi
Post by: pavliko on June 13, 2009, 11:07:15 pm
Wow this is exactly what i was waiting for!
THank you!
Title: Re: 1.5.0/2.5.0 Server File Transfer sample code - Delphi
Post by: chrisgbk on June 14, 2009, 01:56:17 am
Er, is there a way to download .txt files from the server using this or any method other than FTP? (for example, banned.txt).
No; the server restricts access to these types of files due to their contents.