celestia networking-patch (http/ftp)

The place to discuss creating, porting and modifying Celestia's source code.
hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #21by hank » 11.09.2006, 14:04

phoenix wrote:I made a new update which now makes "real" addon support possible.
meaning it can now create directorys under the "extras" folder and supports multiple URLs provided by the celestia.cfg

I also updated my original post with a detailed description of this patch.

phoenix,

How much of your patch could be implemented using Lua?

- Hank

Topic author
phoenix
Posts: 214
Joined: 18.06.2002
With us: 22 years 5 months
Location: Germany - Berlin

Post #22by phoenix » 11.09.2006, 14:24

uhm I have no idea about lua and its possibilites so I'm only guessing here ;)
but the basic changes to the celestia-code are insignificant.

considering only my http-patch (not the gzip-stuff) 99% of the new code is in http.cpp and md5.c which eventually can be compiled to be called with lua, i think :?:

the hardcoded stuff in celestiacore.cpp is just 3 lines: calling the http-class and executing the download-process.
naturally the new config-options are included in configfile.cpp + header

so if this would be possible to be called with lua, how do we get the lua-stuff executed "before" file-parsing?
most recent celestia win32-SVN-build - use at your own risk (copy over existing 1.5.1 release)

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #23by hank » 11.09.2006, 15:12

phoenix wrote:uhm I have no idea about lua and its possibilites so I'm only guessing here ;)
but the basic changes to the celestia-code are insignificant.

considering only my http-patch (not the gzip-stuff) 99% of the new code is in http.cpp and md5.c which eventually can be compiled to be called with lua, i think :?:

the hardcoded stuff in celestiacore.cpp is just 3 lines: calling the http-class and executing the download-process.
naturally the new config-options are included in configfile.cpp + header

so if this would be possible to be called with lua, how do we get the lua-stuff executed "before" file-parsing?

It should be possible to hook into Lua immediately after the configuration file is read. Also, the hash table of configuration file entries could be retained and made accessible from Lua so that new configuration file entries could be processed via Lua. If the rest of your new code could be compiled externally and dynamically loaded from Lua, I think that might do it. Would you be willing to give it a try?

- Hank

Topic author
phoenix
Posts: 214
Joined: 18.06.2002
With us: 22 years 5 months
Location: Germany - Berlin

Post #24by phoenix » 11.09.2006, 15:20

hank wrote:It should be possible to hook into Lua immediately after the configuration file is read. Also, the hash table of configuration file entries could be retained and made accessible from Lua so that new configuration file entries could be processed via Lua. If the rest of your new code could be compiled externally and dynamically loaded from Lua, I think that might do it. Would you be willing to give it a try?

- Hank


sure, why not.
I'll have my source-patchfile up in a few minutes and then will start looking for nice lua howtos and reference-pages.

I already found a libcurl-lua-port here.
but thats probably not the right approach to do this... i think
most recent celestia win32-SVN-build - use at your own risk (copy over existing 1.5.1 release)

Topic author
phoenix
Posts: 214
Joined: 18.06.2002
With us: 22 years 5 months
Location: Germany - Berlin

Post #25by phoenix » 11.09.2006, 18:10

the sources are up now including a few linux related bugfixes.

hank, by using lua I assume you refer to your posting about loadlib?
most recent celestia win32-SVN-build - use at your own risk (copy over existing 1.5.1 release)

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #26by hank » 11.09.2006, 18:34

phoenix wrote:hank, by using lua I assume you refer to your posting about loadlib?

That's part of it. I've also been experimenting with a scheme for hooking Lua code into Celestia at strategic points. To do this I've added a "LuaHook" entry in the Celestia configuration file which specifies a file containing Lua code to be run when Celestia starts up. The Lua code installs a table of Lua functions (a Lua object, actually) that can be called from Celestia at various points. For example, I put a call into Lua in CelestiaCore::draw() to implement custom overlays. I think this scheme can be made to work for your purposes without too much trouble. For now it still requires building a custom version of Celestia, but I'm hoping that Chris will consider including something like this in the 1.5 release.

I've started a new thread here to explain this in more detail.
- Hank


Return to “Development”