dns_server Report post Posted November 22, 2005 (edited) As we already have an encyclopedia how about haveing a custom tab for displaying a news papaer ingame. This would involve someone takeing the encyclopedia window and adding a new tab called 'News' to the same window that holds the encyclopedia. This tab would take it's data from'eldir/languages/language/news/index.xml' as it's starting page. As the game does not have a proper HTTP web browser it would be the responsability for the user to ether download and extract the news paper manually, get a shell script to download it or write a simple program to download the encyclopedia's for you. This program/script would first download a simple file containing lists of issues of the paper. it would then go and download these issues and extract the zip files to 'eldir/languages/language/news/paper_issue/'. after it has downloaded and extracted all issues of the paper it would recreate the new index.xml to contain links to all the issues of the paper stored. So the user would simply need to run this script/application every fiew days/weeks to get the latest news. Edited November 22, 2005 by dns_server Share this post Link to post Share on other sites
ttlanhil Report post Posted November 22, 2005 the help window? hmm... that could work... I had looked at the in-game books, but those are too small (though currently they're also easier to make) because I'm in the middle of exam time at university I haven't been able to get the paper running as quick as I'd liked (I had hoped to have an edition out by now, but it should be soon). once the first is done, I'm hoping more will be easier I think there actually is a HTTP file getter in the client, as part of progress toards getting updating happening, but the whole updating situation isn't finished yet (obviously). since we already have that, it wouldn't be too hard to get the client to download new editions as they come out, but that will require a patch. shouldn't be much work there'd also be two downloads each time a new edition comes out, the new edition, and a new index page (the first page you see, so it can list all the previous ones as well) getting the paper to be part of all that's translated might be a bit of a hassle, but that's an issue for later Share this post Link to post Share on other sites
dns_server Report post Posted November 22, 2005 The index file is updated by the script, it looks for directories. if it found a directory called elTimes_1 it would create a link in the index.xml file to point to eltimes_1/index.xml with the name "el times 1". that way it should allow for back issues to still have links. I wasn't shure if there was a http getter in the client if there is then the client should be able to update itself. if there is no getter it should not be too much work in createing a simple java application or bash script that uses wget to download the files and another simple script or application to generate the new index file. Share this post Link to post Share on other sites
ttlanhil Report post Posted November 22, 2005 generating the index file itself could work, saves hassle if they deleted old ones. doing it in java or bash will not happen however. you can't rely on either to be available. if this is not done in the client itself, it will be done in c/c++ (to be able to compile cal3d_wrapper.cpp we know the person compiling has a c++ compiler as well) there's a HTTP getter in the client, but it's not much used (I think it was used in TC client for the #stats command to parse the player stats page... maybe not). there's other issues with auto update though, like version control, what if the user doesn't want files changed, where to host the file(though I suspect this will be the same places as the client installer), etc. there's also an issue in that if the client is already running, then it has to reload any changed data files (the ones that stay in memory, anyway. stuff like the BMP maps is loaded on demand, so those are safe) with the current rate of release of newspaper and client... well... waiting for official client releases if needed isn't too harsh Share this post Link to post Share on other sites
LabRat Report post Posted November 23, 2005 There's a HTTP getter in the client, but it's not much used (I think it was used in TC client for the #stats command to parse the player stats page... maybe not). Yup the TC client did use the HTTP_GET_FILE function, and it was actually very easy to do, the only problem with it was that it was single-threaded, and stopped the game execution until download (or timeout) was complete. The biggest problem I had with that method was that I couldn't update el.exe while el.exe was running (for obvious reasons), hence the installer. For an ingame document (bitmap, XML file, map), the client reads the file in then closes it immediately, thus simplifying matters greatly, the file can be overwritten on the fly, thus ensuring an updated newspaper is always available. The way I did the update was: http_get_file "update.txt" parse the file for the version number compare the version number with the client version number if the update was newer, download the updated installer, spawn it upon completion of the download, and immediately exit the el client. That method will work just fine to update any part of the game except the el.exe if you just copy the file to the desired location upon download completion, with no need to exit the client: http_get_file "newsver.txt" parse newsver.txt for the version number if newer than the existing newspaper version, download newspaper.zip (or whatever file format) and uncompress to the newspaper subdirectory ingame. A quick click on the newspaper tab to update it and bingo, instant newspaper If I think hard about it I will knock something up to make the backend functional, and leave the XML stuff to you guys. Share this post Link to post Share on other sites
Derin Report post Posted November 23, 2005 (edited) Sounds good LabRat Is it a txt-file that is updated? and if so, does that mean that we cannot have any pictures in the ingame newspaper? Edited November 23, 2005 by Derin Share this post Link to post Share on other sites
ttlanhil Report post Posted November 23, 2005 Sounds good LabRat Is it a txt-file that is updated? and if so, does that mean that we cannot have any pictures in the ingame newspaper? it won't be plain text, because then you can't do links like "continued on page three" and stuff... well, since we don't have set size pages, we probably wouldn't use that example, but we could do "as a followup to the article in last edition" as a link back I expect it'll be XML of some sort (hopefully similar to what's used for the books, as opposed to the encyclopedia, book-XML is a lot easier and more usefull... not sure if it's possible to do that way though) as to pictures going in the in-game version... I'm unsure about this. when I was considering doing the Times in the reading books, I figured that there wasn't a lot of space anyway, and it's a fair bit to download. with the help window or similar, we have more space, but downloading a half dozen screenshot-sized pictures is still a no-go and yes, we can make an archive with all the files (since we link with zlib I imagine that wouldn't be hard to add to the downloader), but for someone on dial-up that'll still be a fair while hrum... maybe on the index page where there's the option to update(and I don't see why updating can't be done in a new SDL thread if you don't need to know when it's finished), the user gets the option of piccies or not. we still can't cram a full-sized screenshot into the window, but we can add some graphics. and if the user has the text-only version, the link to that edition can also have an option to 'upgrade' oh, and labrat... if you're going to work on it, make sure the fetch/update thing is as generic as possible, so it can be used for other stuff too ^_^ Share this post Link to post Share on other sites
Cycloonx Report post Posted November 23, 2005 This sounds like a good idea, the news might contain things they are working on and new updates I like this idea, I hope it might be implented in the game Share this post Link to post Share on other sites
trollson Report post Posted November 23, 2005 Incorporating a lightweight 'browser' into the client could be used to render the NPC dialogs and books. This doesn't need to be capable of rendering HTML; a simple/specialised XML scheme would be sufficient -- a few layout schemes, limited image rendering etc. This would be a great boon to quest development. There is no reason why the game server should provide anything other than the URL; the actual file server could be a seperate host to limit the loading. Share this post Link to post Share on other sites
LabRat Report post Posted November 24, 2005 (edited) http_get_file can not run in a separate SDL thread, it hangs the game immediately when attempted. I can't figure out the best way to do this safely.. are there any security concerns with player X telling people "Getcha EL paper at h**p://news.paper.address", the parser seeing the trigger phrase and downloading a (shall we say) adult (ahem) themed newspaper? I would suggest only allowing file download on #bc announcements with a trigger phrase or keyword: #bc newspaper 25/12/2005 released! Press shift-F2 to download it paper://news.paper.address/filename Broken down : I would like to propose shift-F2 as the dedicated newspaper download key (user configurable as per standard F2 key for web page) Trigger is paper:// Web address is news.paper.address filename is filename version would be at filename.ver newspaper would be at filename.zip If the filename was date based, with trailing characters for revision (spelling corrections etc), udpating would just be a case of making a directory (if needed) news\[date] and overwriting files in that folder. As for hotlinking to other papers, that shouldn't be a problem as long as the paper being linked to exists in the client folder, if not "Problems May Ensue" TM If that makes sense to anyone, then good if not, correct the error of my ways and highlight flaws in my methodology. I'll give it a few days or so for input and come up with a rough draft of the source code (I still can't compile so it will need to be picked at by the #devs to ensure their arrgh know earroars hin miy sauce cawde). Edited November 24, 2005 by LabRat Share this post Link to post Share on other sites
Placid Report post Posted November 24, 2005 Can't you use libCURL? And isnt your method somewhat overkill, considering there could just be the url sent by the server in a packet? OR #paper would retrieve the latest paper? OR ? Share this post Link to post Share on other sites
Derin Report post Posted November 24, 2005 (edited) I hope that you will be able to figure this one out guys. It would be really nifty to have a newspaper ingame. Edited November 24, 2005 by Derin Share this post Link to post Share on other sites
Learner Report post Posted November 24, 2005 I hope that you will be able to figure this one out guys. It would be really nifty to have a newspaper ingame. Th threading support will be needed for more then just the paper as well. Share this post Link to post Share on other sites
Cycloonx Report post Posted November 24, 2005 Couldn't there be like a button underneath the newspaper like [update] ? Instead of trigger it with a command ? Share this post Link to post Share on other sites
Wytter Report post Posted November 27, 2005 Will be easy to do once the new encyclopedia format is functional... Share this post Link to post Share on other sites
Wicca Report post Posted November 27, 2005 A twisted variation of this is just to allow a special TO-SERVER packet that lets approved bots pop up a window on the client. Just like the NPC's do. Then not only can you have a newspaper as a pop-up like the NPC's have, but maybe other bots can use it as well for cleaner trading. All sorts of things are then possible, like the foundation of warning bulletins, guild map welcomes, better away-messages. I dunno. As we already have an encyclopedia how about haveing a custom tab for displaying a news papaer ingame. This would involve someone takeing the encyclopedia window and adding a new tab called 'News' to the same window that holds the encyclopedia. This tab would take it's data from'eldir/languages/language/news/index.xml' as it's starting page. As the game does not have a proper HTTP web browser it would be the responsability for the user to ether download and extract the news paper manually, get a shell script to download it or write a simple program to download the encyclopedia's for you. This program/script would first download a simple file containing lists of issues of the paper. it would then go and download these issues and extract the zip files to 'eldir/languages/language/news/paper_issue/'. after it has downloaded and extracted all issues of the paper it would recreate the new index.xml to contain links to all the issues of the paper stored. So the user would simply need to run this script/application every fiew days/weeks to get the latest news. Share this post Link to post Share on other sites
dns_server Report post Posted November 28, 2005 i'm involved in writeing a server for another game and am planning to create a really basic web browser for handleing just about everything. it will be used for npc's, books and item information, possibly in game player information etc. By useing something like this for npc's it should make it easyer to program and test npc's as they can be programed in any server side language like php but could be a bit more compex to implement this in el as the server is not database driven so manipulateing user data is a little more difficult. Share this post Link to post Share on other sites
Learner Report post Posted November 28, 2005 I hope that you will be able to figure this one out guys. It would be really nifty to have a newspaper ingame. Th threading support will be needed for more then just the paper as well. And I've just given Labrat a version of the download which can run in a seperate thread. Once he has done additional testing I'll be checking that in. Share this post Link to post Share on other sites