简体   繁体   English

Java小程序:像Runescape这样的游戏如何预加载和保存资源,以便用户以后不必再次下载它们?

[英]Java applets: How do games like Runescape preload and save resources so the user doesn't have to download them again later?

The first time a user plays Runescape (which is played via Java applet), the applet takes a few minutes to download a large amount of data. 用户第一次玩Runescape(通过Java applet播放)时,applet需要几分钟才能下载大量数据。 On subsequent plays, this data is retrieved not from the server, but from somewhere on the client's PC. 在后续播放中,此数据不是从服务器检索,而是从客户端PC上的某个位置检索。

Where is this data saved to, and how is it done? 这些数据保存在哪里,以及如何完成?

Alternatively to signing your applet, you could give your applet a JNLP file , which will give it access to the javax.jnlp package. 作为对applet进行签名的替代方法,您可以为applet提供一个JNLP文件 ,这样可以访问javax.jnlp包。 You can then use DownloadService to do caching of data you download. 然后,您可以使用DownloadService对您下载的数据进行缓存。 This will cause Java Web Start to cache your files. 这将导致Java Web Start缓存您的文件。

RuneScape uses a signed applet which gives them access to the file system. RuneScape使用签名的applet,使他们可以访问文件系统。

If you look in c:\\.jagex_cache_32 or something like that, you'll find the data files. 如果你查看c:\\.jagex_cache_32或类似的东西,你会找到数据文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM