Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 10:01 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Aug 04, 2007 5:48 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I want to read from raydium a text file giving the full url of the file but i have no clue.
raydium_file_fopen don't works


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 7:55 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Perhaps using a php script will be "easier' ?

Bye
Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 8:58 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
The file has to be read, under petition, during the execution of an aaplication. I'm not sure about if PHP method could help in this case.

I have think that libcurl could be an option. If I'm not wrong, it is already a dependancy in Raydium.

UPDATED:
I have success using libcurl, but i don't like it. Maybe PHP method could be cleaner and beautiful.
Can you give me a few hints about its use for this?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 10:53 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
PHP is probably the simplest way to do it, for sure. You have to know a bit the language, but a simple $text=file("http://foobar.com/thing.txt") can do the job for example.
In facts, you can even use a RayPHP function available in "libfile.php" (you'll have to require it from your script) named http_download(), with proxy support (using Raydium settings). This function takes an URL as parameter and returns a string.

For passing variables to the PHP script (URL ?) and back to the application, you can have a look to ManiaDrive, it use a few PHP scripts.

As a quick test, or for very simple uses, you will also find a function in the Raydium API ("signed char raydium_web_client_get(char *filename)"), in web.c. This is a very minimalist HTTP (1.0) client that will download the file. This client was coded to run only with Raydium internal HTTP server, so there no vhost support, no proxy, no headers, ... It's probably a bad idea to use this to fetch a file from a regular webserver, IMHO.

I may post here a small PHP example if you want.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group