@2003scape/rsc-client 中文文档教程

发布于 3年前 浏览 25 项目主页 更新于 3年前

rsc-client

的一个港口 runescape classic 客户端 (mudclient 修订版 204) 从java到javascript。

此客户端旨在与 rsc-serverRSCGo

install

$ npm install @2003scape/rsc-client

usage

修改./src/后,运行$ npm install安装开发者 依赖项,然后 $ npm run build-dev./dist/ 中创建一个新包。

./dist/ 目录包含使用客户端所需的一切。 运行 $ npm start 以在 http://localhost:1337 启动一个简单的 HTTP 服务器。 您可以将可选参数放入 URL 的散列中:

http://localhost:1337/index.html#members,127.0.0.1,43595

或者,您可以在自己的画布上手动调用 mudclient

const mudclient = require('@2003scape/rsc-client');

const mc = new mudclient(document.getElementById('mudclient-canvas'));
mc.members = false;
mc.threadSleep = 10;

(async () => {
    await mc.startApplication(512, 346, 'Runescape by Andrew Gower');
})();

如果您不想托管单独的 websockets 服务器,您可以 传递一个 Web Worker rsc-server 的实例改为 .server 属性。

请参阅 https://github.com/2003scape/rsc-server#browser-usage

options

来自早期 mudclients 和/或受现代第三方客户端启发的功能 使用它们的默认值:

// hold down middle click and move the mouse to rotate the camera (only when
// camera is type manual)
mc.options.middleClickCamera = true;

// scroll panel lists and chatbox with the mouse wheel (and camera if zoom
// enabled)
mc.options.mouseWheel = true;

// click the compas to face north
mc.options.resetCompass = true;

// show roofs unless inside buildings
mc.options.showRoofs = false;

// use arrow keys (and mouse wheel if enabled) to zoom in and out
mc.options.zoomCamera = true;

// show the remaining experience until next level in skills tab
mc.options.remainingExperience = false;

// show your total experience in the skills tab
mc.options.totalExperience = false;

// censor chat and private messages
mc.options.wordFilter = true;

// support account registration, password changes and recovery within the
// client using jagex's older UIs
mc.options.accountManagement = true;

// display an "Fps: X" counter at the bottom right of the screen
mc.options.fpsCounter = false;

// retry logins when the server disconnects
mc.options.retryLoginOnDisconnect = true;

// experimental mobile support
mc.options.mobile = false;

assets

确保无论您在哪里托管它,它都能够访问 ./data204/ 通过 XHR 用于其缓存文件。

faq

  • | 的目的是什么? 0? 为什么不使用 Math.floor()

    <代码>编号 | 0 是一个 asm.js 将数字声明为 32 位整数的声明。 原本的 java客户端经常使用整数溢出技术,这是最常见的 性能方法来声明它们并完成正确的 行为(JavaScript 的 数字IEEE 754; A java 双)。

license

版权所有 2021 2003Scape Team

该程序是免费软件:您可以重新分发它和/或修改它 GNU Affero 通用公共许可证的条款由 自由软件基金会,许可证的第 3 版,或(由您选择) 任何更高版本。

分发该程序是希望它有用,但没有任何 保修单; 甚至没有适销性或适用性的默示保证 特殊用途。 有关详细信息,请参阅 GNU Affero 通用公共许可证。

您应该已经收到 GNU Affero 通用公共许可证的副本 有了这个程序。 如果没有,请参阅 http://www.gnu.org/licenses/。

rsc-client

a port of the runescape classic client (mudclient revision 204) from java to javascript.

this client is designed to work with rsc-server and RSCGo.

install

$ npm install @2003scape/rsc-client

usage

after making modifications to ./src/, run $ npm install to install developer dependencies, then $ npm run build-dev to create a new bundle in ./dist/.

the ./dist/ directory contains everything you need to use the client. run $ npm start to start a simple HTTP server at http://localhost:1337. you may put optional arguments into the hash of the URL:

http://localhost:1337/index.html#members,127.0.0.1,43595

alternatively, you can manually invoke mudclient on your own canvas:

const mudclient = require('@2003scape/rsc-client');

const mc = new mudclient(document.getElementById('mudclient-canvas'));
mc.members = false;
mc.threadSleep = 10;

(async () => {
    await mc.startApplication(512, 346, 'Runescape by Andrew Gower');
})();

if you don't want to host a separate websockets server, you can pass a Web Worker instance of rsc-server into the .server property instead.

see https://github.com/2003scape/rsc-server#browser-usage

options

features from earlier mudclients and/or inspired by modern third-party clients with their default values:

// hold down middle click and move the mouse to rotate the camera (only when
// camera is type manual)
mc.options.middleClickCamera = true;

// scroll panel lists and chatbox with the mouse wheel (and camera if zoom
// enabled)
mc.options.mouseWheel = true;

// click the compas to face north
mc.options.resetCompass = true;

// show roofs unless inside buildings
mc.options.showRoofs = false;

// use arrow keys (and mouse wheel if enabled) to zoom in and out
mc.options.zoomCamera = true;

// show the remaining experience until next level in skills tab
mc.options.remainingExperience = false;

// show your total experience in the skills tab
mc.options.totalExperience = false;

// censor chat and private messages
mc.options.wordFilter = true;

// support account registration, password changes and recovery within the
// client using jagex's older UIs
mc.options.accountManagement = true;

// display an "Fps: X" counter at the bottom right of the screen
mc.options.fpsCounter = false;

// retry logins when the server disconnects
mc.options.retryLoginOnDisconnect = true;

// experimental mobile support
mc.options.mobile = false;

assets

make sure that wherever you host it, it's able to access ./data204/ via XHR for its cache files.

faq

  • what is the purpose of | 0? why not use Math.floor()?

    number | 0 is an asm.js declaration for declaring a number as a 32-bit integer. the original java client used integer overflow techniques often, and this is the most performant method to declare them and accomplish the correct behaviour (javascript's Number is an IEEE 754; a java double).

license

Copyright 2021 2003Scape Team

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文