ID:165359
![]() Jan 7 2007, 5:12 pm
|
|
Even I'm stumped. Just thought it'd be interesting to try. But whenever I try to do it, it keeps telling me that the class can not be found.
|
Nope, it seems to not be working. >_> I can run it in a real browser. but not on byond. I seriously doubt I can screw up this code. :p
import java.awt.*; |
I'm not sure how java applets work, but maybe you have to cache the applet or stream the data or something. Maybe your browse() html is messed up.
|
mob/Login()
usr << browse(file("classes/JavaTesting.htm")) and this is JavaTesting.htm <HTML> At the bottom left of dream maker, it displays this error load: class JavaTesting not found Could it possibly be because it's in the classes folder? |
You didn't send the "JavaTesting.class" file to the player.
mob/Login() |
That doesn't seem to help it. If we had to use browse_rsc on class files, noone would be able to play Runescape and other java games on the BYOND browser. So that clearly isn't the problem. Nice try though.
|
Buzzyboy wrote:
That doesn't seem to help it. If we had to use browse_rsc on class files, noone would be able to play Runescape and other java games on the BYOND browser. Sure they can. You'd have to directly link to the file but it should work (assuming RuneScape's security thingmabobs don't prevent you to). So that clearly isn't the problem. Nice try though. It clearly seems to be the problem. As I can see from your HTML code, you want to run the "JavaTesting.class" file. But when the player views the page, it will try to locate the file in C:\Documents and Settings\<their Windows username>\Application Data\BYOND\cache, which is the location for the BYOND cache. Since you never used browse_rsc() to send the file, it cannot find it in the cache and therefor gives you an error. It's impossible to just use browse() on the file and hope it works. It won't send anything other than the HTML code stored in the file. It sends the HTML code which the client gets, and then a temporary HTML file is made in the BYOND cache which is then opened in the browser window. This uses IE, by the way, and this preference unfortunately cannot be changed, although they do have "bring in Gecko (FireFox) support" on their list. |
Runescape did work, I'm not saying possibly it did, it did work! And I've tried running the htm file on my website, using the BYOND browser, and it still didn't work. Which is very odd. I HIGHLY, I repeat, HIGHLY doubt I need to use browse_rsc. My game has over 314 class files! I'm not going to use browse_rsc on ALL of them, if that even were the case.
And as for firefox, Firefox doesn't have a built in java feature, but IE does, it's better that it uses internet explorer's sun java console. Android Data wrote: It clearly seems to be the problem. As I can see from your HTML code, you want to run the "JavaTesting.class" file. But when the player views the page, it will try to locate the file in C:\Documents and Settings\<their Windows username>\Application Data\BYOND\cache, which is the location for the BYOND cache. Since you never used browse_rsc() to send the file, it cannot find it in the cache and therefor gives you an error. If that were the case, I wouldn't have been able to run runescape, since it'd be trying to find the class files for that in that same folder. So that's out of the question. What my guess would be right now is, is that it won't let me run it on a localhost machine. Which is why I can run java applets on other sites, but not my own. So others would be able to run the java applet in my BYOND game, but I am not. |
Buzzyboy wrote:
My game has over 314 class files! I'm not going to use browse_rsc on ALL of them, if that even were the case. you're probably better off hosting the java applet on a web server and redirect or link the players in your game to that. sending 314 files to every client will bog down the host's machine, but having the clients download the class files from a web server will not. |
I am hosting them off a site. My own site. Maybe it's because I'm using localhost to reach my site instead of the actual address?
|
Buzzyboy wrote:
I am hosting them off a site. My own site. Maybe it's because I'm using localhost to reach my site instead of the actual address? <HTML> <HEAD> </HEAD> <BODY BGCOLOR="000000"> <CENTER> <APPLET code = "JavaTesting.class" width = "500" height = "300" </APPLET> </CENTER> </BODY> </HTML> This block of code you gave me clearly indicates how the file "JavaTesting.class" has to be run. Your lack of including any "http://www.mydomain.com/JavaTesting.class" or anything like that indicates that it should search for this file in the same folder as the HTML file is. This won't work with BYOND since it will only send the HTML to the player; not the entire directory tree. The HTML is received by the player and a temporary file is made in the BYOND cache, where an error occurs because it can't find the file you specified that way. The only way to remedy this would be to use browse_rsc() to send this JavaTesting.class file to the player so it ends up in the cache, ready to be used. OneFishDown has a much better solution which you may want to use if you know that your users will always be connected to the internet no matter what: store the .class files off-site and then simply link to them. |
Maybe it'd be smart to package the java program, perhaps you could jar it and then just have to cache that one file.
|
That's the code on the website. THE game is in c:/site! Okay? :p You get redirected to the site now, I changed it. I thought that'd be self explanatory.
Anyway, Android Data. Not to seem rude or anything, but do you have a lot of java experience? |
I could do that, but why, it's already all on my site? You guys seem to be missing my point entirely. >_>
|
Ahah. I found the problem. Just like I had thought, it could not be run on a local machine. So I suppose I could turn it into a jar, like Crashed said, and upload it to a remote site. Even use my BYOND member site if I have to. :p
|
Buzzyboy wrote:
If that were the case, I wouldn't have been able to run runescape, since it'd be trying to find the class files for that in that same folder. So that's out of the question. You're wrong here. Runescape is on it's own website. If the HTML file is in the user's cache (which the java html class file thing was), it will try to locate the file on the user's machine. Same as on the internet: It can cache pages from the internet, but it doesn't try to get the files from the cache, it tries to get it from the website, where it directs the browser to. Anytime you send text to browse(), it is cached as a file. That means the the HTML containing javascript or meta tag redirection is saved on the user's computer as an html file. You can use your own files via browse_rsc() that can be accessed through browse() later as well. You cannot expect to access a file that is not there, though. |
Buzzyboy wrote:
Anyway, Android Data. Not to seem rude or anything, but do you have a lot of java experience? I have no experience with Java whatsoever, but I do have experience with DM, and I already gave you the answer from the beginning. You can't send the player that bit of HTML you gave me and expect it to work. The player is unable to open the .class file since it's not on their local PC. That's the code on the website. THE game is in c:/site! Okay? :p You get redirected to the site now, I changed it. I thought that'd be self explanatory. It is not. Your code clearly indicates you're trying to run the .class file straight from the cache. Do you even have a webserver running serving files from c:\site? If so, you probably linked to it wrong. If not, that explains it right there: the player can't download the .class file! |
[Thread closed] - some moderator, please?
Anyway! I already figured out the problem! It's not the cache problem. It's that I can't run it off my own machine on BYOND. But others can. It has abso-lu-hu-lu-hu-tely NOTHING to do with BYOND's cache! THEY can download it! I can't on a local machine. Now please. The problem has been resolved. Please stop posting. :p |
Lummox said he did it but it slowed everything right down- it wasn't much fun.