{"id":24859688,"url":"https://github.com/lesleyrs/client3","last_synced_at":"2025-08-13T17:21:25.950Z","repository":{"id":274115963,"uuid":"921944858","full_name":"lesleyrs/Client3","owner":"lesleyrs","description":"RuneScape 2 client ported to C","archived":false,"fork":false,"pushed_at":"2025-08-02T22:50:06.000Z","size":54493,"stargazers_count":11,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-02T23:33:55.652Z","etag":null,"topics":["runescape"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lesleyrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-24T23:22:21.000Z","updated_at":"2025-08-02T22:50:09.000Z","dependencies_parsed_at":"2025-08-02T23:38:24.039Z","dependency_job_id":null,"html_url":"https://github.com/lesleyrs/Client3","commit_stats":null,"previous_names":["lesleyrs/client3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lesleyrs/Client3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesleyrs%2FClient3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesleyrs%2FClient3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesleyrs%2FClient3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesleyrs%2FClient3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesleyrs","download_url":"https://codeload.github.com/lesleyrs/Client3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesleyrs%2FClient3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270278704,"owners_count":24557184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["runescape"],"created_at":"2025-01-31T20:59:43.842Z","updated_at":"2025-08-13T17:21:25.928Z","avatar_url":"https://github.com/lesleyrs.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RuneScape 2 revision #225 (18 May 2004) C99 port\nPortable single-threaded C client for early RS2, the last update before a new cache format and ondemand protocol.\n\nCompatible with [2004Scape](https://github.com/2004Scape/Server), the most accurate runescape remake\n\nFeatures:\n- should work on any 32 bit system with 64 MB of RAM on lowmem, networking and a (read-only) filesystem.\n- webassembly build to avoid javascript code being optimized out by the browser.\n- WIP ports for most game consoles from 1998 until 2013! Ones with incomplete input are set up to auto-connect.\n- optional [config.ini](example.ini) file to change client behaviour. Create an empty config.ini to avoid passing cli args.\n\nSee [docs](/docs) for more info, media, and TODOs.\n\n## known issues\n```\n(non-wasm): server cache changes requires manual cache+archive_checksums update in the client since it doesn't download, also the server has an issue with client map crcs changing when only server maps get updated.\n\nno midi fading, old js code for IE: https://github.com/2004Scape/Server/blob/61bf21fb3755c14b5cf6d47c9d974dee5783beda/view/javaclient.ejs new ts code: https://github.com/2004Scape/Client2/commit/92e74f1f134ea82e48dd608dcca3422777a7a986 https://github.com/LostCityRS/Client-TS/pulls?q=is%3Apr+is%3Aclosed+midi\n\nlocs like fires have no animations as pushLocs is disabled for now, it constantly allocates memory due to always calling model_copy_faces in loctype which requires a different approach. The leaks get worse if the dynamic model cache can't fit all sequences (animations) of the models in an area, disable the allocator to see origins.\n```\n\n## quickstart for windows\nAll you need to build for 32 bit windows is included:\n* tinycc (C compiler, built with `TCC_C=..\\tcc.c` env var and removed bcheck lib)\n* all 32 bit SDL dlls, only SDL1 works prior to windows XP and is always 32 bit unlike the others\n\nTo build simply run `build.bat` in cmd to get the client.exe, optionally set SDL ver `-v 1|2|3` and C compiler `-c tcc|gcc|emcc`.\n\nSDL1 is default for tcc and old mingw-gcc to target windows 9x, but only SDL2/3 have sfx right now. This (unofficial) release doesn't require msys install: https://github.com/fsb4000/gcc-for-Windows98/releases. mingw-gcc 11 optimizations seem to only be slightly faster than tcc though.\n\nIf the client fails to start you either aren't passing cli args and don't have a config.ini OR you are using a SDL dll for the wrong architecture. Delete it and it'll be copied during next build\n\n## Platforms and Compilers\nTo move the executable you have to take the correct `SDL.dll`, `cache/` and optionally `config.ini`, `SCC1_Florestan.sf2` and `Roboto/` along with it. The consoles will load it from sdcard if they don't embed the files already.\n\ntype `::perf` command ingame to see fps and lrucache size\n\nall home consoles (wii, dreamcast, xbox) should be able to run the game at higher res or even full res on PAL TVs so you don't have to pan, but this isn't set up and emulators don't support many video modes.\n\nWhen adding a new platform also add system ttf font closest to helvetica in gameshell_draw_string when available to avoid Roboto dependency.\n\nTo be able to run some emulators on WSL2 you may need to prefix `MESA_GL_VERSION_OVERRIDE=4.6 MESA_GLSL_VERSION_OVERRIDE=460`.\n\nIf tcc from your package manager isn't working you should build latest [tcc](#tools) from source\n\n[v86](#tools) is a x86 PC emulator running in the browser, including older windows.\n\n### Windows 95 to Windows 11\nbuild.bat(32 bit): tcc (included), mingw-gcc, emcc\n\nrun.ps1: cl, clang, tcc, mingw-gcc, emcc\n\nYou might want the updated [PowerShell](#tools) for run.ps1\n\n```\nTODO: add wav sfx to complete SDL1 platform for win9x\nTODO: make win9x compatible batch file (no delayed expansion?) right now needs to build from more modern system\nTODO: clean up ps1 script so it doesn't need to be modified\n\nNOTE: on v86 PC emulator the cursor flickers on win95, and colours on win9x are wrong? win2k is fine\n```\n\n### Linux GNU or musl\nMakefile: gcc, clang, tcc, mingw-gcc, emcc\n\n### FreeBSD\nInstall sdl1/sdl2 or sdl3+pkgconf and run `gmake SDL=1/2/3`\n\n### MacOS\nTODO\n\n### Web (clang)\nInstall clang and get [wasmlite](#tools) (you need the libc and generated index.html)\nthen run `make -f wasm.mk run DEBUG=0` with correct sysroot path.\n\nYou must add `?client` to the URL and optionally append `\u0026arg 1\u0026arg 2\u0026arg 3\u0026arg 4`.\n\nYou can configure ip and port in config.ini.\n\nThe only needed files are the index.html + client.wasm and optionally the soundfont/config.ini relative to it.\n\nenable cors in server web.ts with `res.setHeader('Access-Control-Allow-Origin', '*');`\n\n```\nTODO nuke emscripten full sdl2 targets makefile+readme+fix emscripten defines to apply to just wasm not sdl\nTODO midi, game speedup onblur (how to make wasm not pause with current jspi setup)\n\nTODO add to build.bat/ps1\nNOTE: wasm output can be made smaller by using js bigints instead of mpi.c\n```\n\n### Web (emscripten)\nInstall [emsdk](#tools)\nrun `emmake make`/`make CC=emcc` or `build.bat -c emcc` for windows\n\nFor make you can append `run` to start a http server and `DEBUG=0` to optimize. Then go to `ip:port/client.html` (or another entrypoint)\n\nPass 4 args in shell.html to use the ip + port from URL instead of config, otherwise set http_port to 8888 in config for linux servers.\n\nThe only needed files are the index.`html,js,wasm` and optionally the soundfont/config.ini relative to it.\n\nenable cors in server web.ts with `res.setHeader('Access-Control-Allow-Origin', '*');`\n\n```\nTODO: JSPI decreases output size a lot, but is locked behind browser flag for now on for firefox\nTODO: midi fading + scape_main stutters during load so it's moved to post load + maybe replace SDL2 audio (check tinymidipcm) but it fixes inactive tab speedup\nTODO: use emscriptens indexeddb api to store data files (add cacheload and cachesave)\nTODO: try adding web worker server compat again: https://emscripten.org/docs/api_reference/wasm_workers.html\nTODO: fullscreen option button\nTODO: mobile controls: touch + rotate + osk + mice, PWA manifest\n\nNOTE: Windows and Linux output size might differ and sigint on Windows will cause terminate batch job message if using emrun.\nNOTE: SDL2/3 audio prevents the tab from speeding up when changing focus even in lowmem, the typescript client uses absolute time for idlecycles.\nNOTE: SDL2/3 emscripten ports have setTimeout lag issues, block browser shortcuts in generated js, and memleaks on firefox that get cleaned up by pressing GC in about:memory but why does this happen? (not if only using audio)\nNOTE: maybe bring back worldlist loading in [shell.html](https://github.com/lesleyrs/Client3/commit/5da924b9f766005e82163d899e52a5df2f771584#diff-c878553ed816480a5e85ff602ff3c5d38788ca1d21095cd8f8ebc36a4dbc07ee) if it gets re-added for live servers\n```\n\n### Android\n1. `mkdir ~/android \u0026\u0026 cd ~/android` and download [android command line tools](#tools) to it + accept licenses whenever it asks\n2. enable developer options by tapping build number, then you can pair and connect to the device through wifi:\n`$HOME/android/platform-tools/adb pair IP:PORT`\n`$HOME/android/platform-tools/adb connect IP:PORT`\n3. In Client3/android-project run `ANDROID_HOME=\"$HOME/android/\" ./gradlew installDebug`\n4. The APK will be in android-project/app/build/outputs/apk/debug/ and installed on the device\n\n- you can also start it remotely: `$HOME/android/platform-tools/adb shell am start -n org.libsdl.app/.SDLActivity`\n- show error/fatal logging with:  `$HOME/android/platform-tools/adb logcat *:E | grep 'org.libsdl.app'`\n\n#### Steps to update/reproduce the current android setup:\n1. in Client3/android-project/app/jni run `mkdir SDL`\n2. git clone SDL, git checkout SDL2 branch and run `cp -r Android.mk include src SDL`\n3. symlink src and rom directories:\n```sh\ncd android-project/app/jni/src \u0026\u0026 ln -s ../../../../src src\ncd android-project/app/src/main \u0026\u0026 ln -s ../../../../rom assets\n```\n5. set Client LOCAL_CFLAGS and LOCAL_SRC_FILES app/jni/src/Android.mk\n6. enable networking in app/src/main/AndroidManifest.xml `\u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e`\n\nhttps://github.com/libsdl-org/SDL/blob/SDL2/docs/README-android.md - from \"For more complex projects\"\n\nhttps://github.com/libsdl-org/SDL/blob/SDL2/docs/README-touch.md\n```\nTODO: long press right click? click on touch release? hold in viewport to rotate? share code with postmarketos/vita\n```\n### Nintendo consoles (devkitPro)\nInstall [devkitpro](#tools) with (nds/wii/3ds/wiiu/switch)-dev package and run `make -f (nds/wii/3ds/wiiu/switch).mk -j$(nproc) -B`.\n\nWii U and Switch also need the (wiiu/switch)-sdl2 package.\n\n#### Wii\nin dolphin emulator you can find the sdcard path in `options\u003econfiguration\u003ewii\u003esd card` settings and after moving the files there you have to click `Convert Folder to File Now` to format it.\n\nControls: wiimote IR pointer works as mouse, A for left click, B for right click, Dpad works as arrow keys, minus for control, plus to pan by moving your wiimote to a side of the screen, 1 to center screen, home button to exit. The nunchuck joystick can also be used as arrow keys.\n\n```\nTODO: support usb keyboard (dolphin doesn't emulate it yet)\nTODO: add game offset expected for real hardware?\n```\n\n#### NDS (not yet functional)\nThe NDS target only works on a 2DS/3DS using `TWiLight Menu++` as it exposes the additional 16 MB of RAM.\n\nmelonDS doesn't yet emulate 3ds/debugger ram.\n\nTODO: make nds playable by manually writing to 0x0D000000-0x0E000000 on client_load https://blocksds.skylyrac.net/docs/technical/memory_map/#4-main-ram\n\n#### 3DS\nin citra emulator click `file\u003eopen citra folder` for sdmc dir https://citra-emulator.com/wiki/user-directory/\n\non real hardware move the contents of the rom/ dir next to the 3dsx file.\n\nControls: Touch to left click, L + touch to right click, Dpad for arrow keys, X for control, R to toggle ::perf\n\n```\nTODO: somehow make it playable with screen panning\nTODO: possible to toggle top screen console?\nTODO: The \"New\" 3ds/2ds line for higher cpu clock rate does not seem to make much difference in citra?\n```\n\n#### Wii U\nin cemu emulator click `file\u003eopen mlc folder`, go 1 directory up to see sdcard dir\n\n```\nTODO: Touch input not working yet, might be fixed by last wiiu-sdl2 commit.\nNOTE: libtom encryption fails when it works on old wii? (tiny-bignum is ok)\nNOTE: highmem doesn't start due to tinysoundfont not working on powerpc\n```\n\n#### Switch\nin suyu emulator (yuzu fork) click `file-\u003eopen suyu folder` for sdmc dir\n\n### Sony PSP\nInstall [pspdev](#tools) and run `make -f psp.mk -j$(nproc) -B`.\n\nppsspp emulator loads relative dir as memstick, so the filesystem works automatically. Also you should probably enable printf logging with `settings\u003etools\u003edeveloper tools\u003elogging channels\u003eprintf` to EG verbose\n\nControls: move cursor with analog stick, O for left click, X for right click, /\\ for control, Dpad as arrow keys, Rtrigger + analog stick to pan, Ltrigger to reset screen position\n\nWorks on real hardware but requires at least model 2000 due to only 24MB (28MB with kernel mode not sure if safe to use?) being accessible on model 1000, only lowmem fits in memory so we force lowmem in custom.c\n\n```\nNOTE: Could add sfx and/or midi in lowmem, since it's the most important highmem feature\n```\n\n### Sony PS Vita\nInstall [vitasdk](#tools) and run `make -f vita.mk -j$(nproc) -B`. Add `SDL=0` to use vita.c.\n\ncan test with Vita3K, and to avoid waiting for the vpk to decompress all files you can just copy them manually\n\nControls: touch as mouse, X for right click, /\\ for control, Dpad as arrow keys\n\n```\nTODO: check if vita.c native touch fixes minimap offset, check if osk works on real hw\nTODO: find minimap touch offset issue, center game+offset touch input after.\nTODO: vitagl\nTODO: use touch input on the back?\nTODO: allow setting sdl version to 3 in makefile when sdl2 is complete\nTODO: update sce_sys assets\n```\n\n### Sega Dreamcast\nInstall [kallistios and mkdcdisc](#tools) and run `make -f dreamcast.mk -j$(nproc) -B`. Necessary files are built into the cdi.\n\nTo try on real hardware you'd need networking support and the 32 MB ram expansion mod, which seems involved and maybe less compatible with some other games. Flycast seems to be the best emulator and supports both.\n\nSee defines.h for inauthentic changes to get below 32MB RAM usage. The city of Ardougne isn't accessible as it uses up to 12MB ram in allocator.\n\nControls: joystick = move cursor, Dpad = arrow keys, B = left click, A = right click, Y = control, Ltrig = center screen, Rtrig+joystick = pan screen\n\nThere's currently no way to type. But it's not required to play the game and you can set your login details in rom/config.ini\n\n```\nTODO: try to make use of dreamcast vram or aram\nTODO: support mouse/keyboard for dreamcast. For mouse and keyboard in flycast you have to set the physical device ports to dreamcast device port, but mouse is not very useful in emu until they hide the system cursor.\n\nNOTE: if the cdi doesn't load you might have to remove --no-padding in Makefile? untested on hardware\nNOTE: local servers don't work on emulator? only remote servers work\nNOTE: fopen path was changed due to the mkdcdisc tool adding dots to files without extension https://gitlab.com/simulant/mkdcdisc/-/issues/14\n```\n\n### Microsoft Xbox\nInstall [nxdk](#tools) and run `make -f xbox.mk -j$(nproc) -B`. Necessary files are built into the iso.\n\nTo run with xemu use `-dvd_path client.iso` as args.\n\nControls: right analog stick to move the mouse, dpad to rotate camera, B = left click, A = right click, Y = control, X = toggle fps, back = logout, start = login, white = center screen pan, black = pan with right analog stick\n\n```\nTODO: audio on highmem (for 128mb ram expansion?)\n\nNOTE: local servers don't work on emulator? only remote servers work\nNOTE: default.xbe stays around in rom dir when it's junk for other consoles that embed that directory. Can remove it after building.\nNOTE: fopen had to be separated due to the need for backwards slashes, also there's no chdir equivalent?\n```\n\n## Java client\nThe 2004 jar is stored for comparisons, run with EG: `java -cp bin/runescape.jar client 10 0 highmem members` but:\n- there is no audio, it saves audio files for the browser to play which is no longer applicable\n- right clicking breaks past java 8\n- window insets on modern systems are causing the sides of the game to be cut off slightly\n- outside of windows it saves the cache to `/tmp` so every reboot you may have to redownload it\n- it only connects to localhost if it's not running as applet\n- server http port needs to be set to 80 (2004scape on linux defaults to 8888 right now to avoid sudo)\n- TODO confirm: to connect to local java servers on WSL from Windows you might need to add `-Djava.net.preferIPv6Addresses=true` when running client\n\n## libraries\n* [micro-bunzip](https://landley.net/code/) | https://landley.net/code/bunzip-4.1.c\n* [isaac](https://burtleburtle.net/bob/rand/isaacafa.html) | https://burtleburtle.net/bob/c/readable.c\n* [TinySoundFont](https://github.com/schellingb/TinySoundFont) - with fix for attack1.mid by skipping RIFF header and android support\n* [tiny-bignum-c](https://github.com/kokke/tiny-bignum-c) - prefer libtom/openssl/bigint, but works fine with smaller exponent\n* [LibTomMath](https://github.com/libtom/libtommath) | mpi.c is from gen.pl script in [releases](https://github.com/libtom/libtommath/releases/latest). with added ifdefs to fix non-gcc builds.\n* [ini](https://github.com/rxi/ini)\n* [stb_image and stb_truetype](https://github.com/nothings/stb)\n\n## optional libraries\n* [OpenSSL](https://github.com/openssl/openssl) | https://wiki.openssl.org/index.php/Binaries\n\n* [SDL-1.2](https://github.com/libsdl-org/SDL-1.2) | [SDL-2/SDL-3](https://github.com/libsdl-org/SDL) | https://libsdl.org/release/\n\nUsing prebuilt SDL but removed tests, SDL1 mingw dotfiles + SDL1 tcc fixes in VC (fixed upstream but no new releases since 2012)\n\n## tools\n* [tcc](https://github.com/TinyCC/tinycc) | https://bellard.org/tcc/\n* [emsdk](https://github.com/emscripten-core/emsdk) | https://emscripten.org/docs/getting_started/downloads.html\n* [devkitpro](https://github.com/devkitPro) | https://devkitpro.org/\n* [pspdev](https://github.com/pspdev/pspdev) | https://pspdev.github.io/\n* [vitasdk](https://github.com/vitasdk/vdpm) | https://vitasdk.org/\n* [kallistios](https://github.com/KallistiOS/KallistiOS) | [mkdcdisc](https://gitlab.com/simulant/mkdcdisc)\n* [nxdk](https://github.com/XboxDev/nxdk)\n* [android command line tools](https://developer.android.com/studio)\n* [powershell](https://github.com/PowerShell/PowerShell)\n* [v86](https://github.com/copy/v86.git) | https://copy.sh/v86/\n* [wasmlite](https://github.com/lesleyrs/wasmlite)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesleyrs%2Fclient3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesleyrs%2Fclient3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesleyrs%2Fclient3/lists"}