first commit

This commit is contained in:
root 2023-11-06 17:50:32 +02:00
commit 709dda6f6a
53 changed files with 6126 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
tmp/*

60
WORDS.html Normal file
View File

@ -0,0 +1,60 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
html,
body,
#jsdos {
background: black;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-ms-touch-action: none;
-ms-content-zooming: none;
touch-action: none;
}
</style>
<script src="/static/js-dos/src/js-dos.js"></script>
<link href="/static/js-dos/src/js-dos.css" rel="stylesheet">
</head>
<body>
<div id="jsdos"></div>
<script>
let bundleUrl = "https://www.ngtech.co.il/static/js-dos/games/WORDS.zip";
let clientId = null;
emulators.pathPrefix = "/static/js-dos/src/";
Dos(document.getElementById("jsdos"), {
hardware: window.hardware,
withNetworkingApi: false,
withExperimentalApi: true,
clientId: (userGesture) => {
if (!userGesture) {
return Promise.resolve(clientId);
}
clientId = {
namespace: "test",
id: "ngtech1ltd@gmail.com",
};
return Promise.resolve(clientId);
}
}).run(bundleUrl);
</script>
</body>
</html>

60
aladdin.html Normal file
View File

@ -0,0 +1,60 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
html,
body,
#jsdos {
background: black;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-ms-touch-action: none;
-ms-content-zooming: none;
touch-action: none;
}
</style>
<script src="/static/js-dos/src/js-dos.js"></script>
<link href="/static/js-dos/src/js-dos.css" rel="stylesheet">
</head>
<body>
<div id="jsdos"></div>
<script>
let bundleUrl = "https://www.ngtech.co.il/static/js-dos/games/aladdin.jsdos";
let clientId = null;
emulators.pathPrefix = "/static/js-dos/src/";
Dos(document.getElementById("jsdos"), {
hardware: window.hardware,
withNetworkingApi: false,
withExperimentalApi: true,
clientId: (userGesture) => {
if (!userGesture) {
return Promise.resolve(clientId);
}
clientId = {
namespace: "test",
id: "ngtech1ltd@gmail.com",
};
return Promise.resolve(clientId);
}
}).run(bundleUrl);
</script>
</body>
</html>

109
dosbox.conf.default Normal file
View File

@ -0,0 +1,109 @@
[sdl]
autolock=false
fullscreen=false
fulldouble=false
fullresolution=original
windowresolution=original
output=surface
sensitivity=100
waitonerror=true
priority=higher,normal
mapperfile=mapper-jsdos.map
usescancodes=true
vsync=false
[dosbox]
machine=svga_s3
language=
captures=capture
memsize=16
[cpu]
core=auto
cputype=auto
cycles=auto
cycleup=10
cycledown=20
[mixer]
nosound=false
rate=44100
blocksize=1024
prebuffer=20
[render]
frameskip=0
aspect=false
scaler=none
[midi]
mpu401=intelligent
mididevice=default
midiconfig=
[sblaster]
sbtype=sb16
sbbase=220
irq=7
dma=1
hdma=5
sbmixer=true
oplmode=auto
oplemu=default
oplrate=44100
[gus]
gus=false
gusrate=44100
gusbase=240
gusirq=5
gusdma=3
ultradir=C:\ULTRASND
[speaker]
pcspeaker=true
pcrate=44100
tandy=auto
tandyrate=44100
disney=true
[joystick]
joysticktype=auto
timed=true
autofire=false
swap34=false
buttonwrap=false
[serial]
serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled
[dos]
xms=true
ems=true
umb=true
keyboardlayout=auto
[ipx]
ipx=true
[autoexec]
echo off
mount c .
c:
type jsdos~1/readme.txt
echo on
RUNME.BAT

BIN
games/WORDS.zip Normal file

Binary file not shown.

BIN
games/aladdin.jsdos Normal file

Binary file not shown.

BIN
games/points.zip Normal file

Binary file not shown.

24
index.html.in Normal file
View File

@ -0,0 +1,24 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
html, body, #jsdos {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="/v7/build/releases/latest/js-dos/js-dos.js"></script>
<link href="/v7/build/releases/latest/js-dos/js-dos.css" rel="stylesheet">
</head>
<body>
<div id="jsdos" />
<script>
emulators.pathPrefix = "/v7/build/releases/latest/js-dos/";
Dos(document.getElementById("jsdos"))
.run("https://cdn.dos.zone/original/2X/2/24b00b14f118580763440ecaddcc948f8cb94f14.jsdos");
</script>
</body>
</html>

60
jsdos-game.html.template Normal file
View File

@ -0,0 +1,60 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
html,
body,
#jsdos {
background: black;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-ms-touch-action: none;
-ms-content-zooming: none;
touch-action: none;
}
</style>
<script src="/static/js-dos/src/js-dos.js"></script>
<link href="/static/js-dos/src/js-dos.css" rel="stylesheet">
</head>
<body>
<div id="jsdos"></div>
<script>
let bundleUrl = "###GAME_URL###";
let clientId = null;
emulators.pathPrefix = "/static/js-dos/src/";
Dos(document.getElementById("jsdos"), {
hardware: window.hardware,
withNetworkingApi: false,
withExperimentalApi: true,
clientId: (userGesture) => {
if (!userGesture) {
return Promise.resolve(clientId);
}
clientId = {
namespace: "test",
id: "ngtech1ltd@gmail.com",
};
return Promise.resolve(clientId);
}
}).run(bundleUrl);
</script>
</body>
</html>

426
jsdos.json.default Normal file
View File

@ -0,0 +1,426 @@
{
"output": {
"name": "sdl",
"description": "This section contains all of the low level system settings for how DOSBox interacts with your real hardware. You can define what resolutions are emulated, how DOSBox should treat errors or listen to your keyboard and mouse. You can often achieve a fair level of optimization by working with these setting, though for the most part leaving them at their default settings will create the best experience. These settings are passed on to the SDL Library which handles low level things like input and thread priority.",
"options": {
"autolock": {
"name": "autolock",
"description": "Mouse will automatically lock, if you click on the screen.",
"value": true,
"allowedValues": [
true,
false
]
}
}
},
"dosbox": {
"name": "dosbox",
"description": "The [dosbox] section contains various settings that do not pertain to any other section (e.g. setting the language used in DOSBox help texts, where to store screen captures, etc.)",
"options": {
"machine": {
"name": "machine",
"description": "The type of machine tries to emulate.",
"value": "svga_s3",
"allowedValues": [
"hercules",
"cga",
"tandy",
"pcjr",
"ega",
"vgaonly",
"svga_s3",
"svga_et3000",
"svga_et4000",
"svga_paradise",
"vesa_nolfb",
"vesa_oldvbe"
]
}
}
},
"cpu": {
"name": "cpu",
"description": "The CPU section controls how DOSBox tries to emulate the CPU, how fast the emulation should be, and to adjust it. DOSBox offers 4 different methods of CPU emulation.",
"options": {
"core": {
"name": "core",
"description": "CPU Core used in emulation. auto will switch to dynamic if available and appropriate.",
"value": "auto",
"allowedValues": [
"auto",
"normal",
"simple"
]
},
"cputype": {
"name": "cputype",
"description": "CPU Type used in emulation. auto is the fastest choice.",
"value": "auto",
"allowedValues": [
"auto",
"386",
"386_slow",
"486_slow",
"pentium_slow",
"386_prefetch"
]
},
"cycles": {
"name": "cycles",
"description": "Amount of instructions DOSBox tries to emulate each millisecond. Setting this value too high results in sound dropouts and lags.\nCycles can be set in 3 ways:\n'auto' tries to guess what a game needs.\n It usually works, but can fail for certain games.\n'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails.\n (Example: fixed 4000).\n'max' will allocate as much cycles as your computer is able to handle.\n",
"value": "auto",
"allowedValues": [
"auto",
"fixed",
"max"
]
}
}
},
"mixer": {
"name": "mixer",
"description": "Here you can define the quality of emulated audio.",
"options": {
"rate": {
"name": "rate",
"description": "Frequency rate of sound",
"value": 44100,
"allowedValues": []
},
"nosound": {
"name": "nosound",
"description": "Enable silent mode, sound is still emulated though.",
"value": false,
"allowedValues": [
true,
false
]
}
}
},
"autoexec": {
"name": "autoexec",
"description": "Lines in this section will be run at startup",
"options": {
"script": {
"name": "lines",
"description": "Use \\n to separate lines",
"value": "ALADDIN.EXE",
"allowedValues": []
}
}
},
"layers": {
"default": {
"buttons": [
{
"action": "hold",
"mapTo": 341,
"position": {
"left": 1,
"bottom": 1
},
"symbol": "ATTACK"
},
{
"action": "hold",
"mapTo": 32,
"position": {
"left": 1,
"bottom": 2
},
"symbol": "UP"
},
{
"action": "hold",
"mapTo": 342,
"position": {
"left": 2,
"bottom": 1
},
"symbol": "THROW"
},
{
"action": "hold",
"mapTo": 0,
"symbol": "4",
"position": {
"left": 2,
"bottom": 2
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "5",
"position": {
"right": 1,
"bottom": 1
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "6",
"position": {
"right": 1,
"bottom": 2
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "7",
"position": {
"right": 2,
"bottom": 1
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "8",
"position": {
"right": 2,
"bottom": 2
}
},
{
"action": "hold",
"mapTo": 257,
"position": {
"left": 1,
"top": 1
},
"symbol": "EN"
},
{
"action": "hold",
"mapTo": 0,
"symbol": "10",
"position": {
"left": 1,
"top": 2
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "11",
"position": {
"left": 2,
"top": 1
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "12",
"position": {
"left": 2,
"top": 2
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "13",
"position": {
"right": 1,
"top": 1
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "14",
"position": {
"right": 1,
"top": 2
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "15",
"position": {
"right": 2,
"top": 1
}
},
{
"action": "hold",
"mapTo": 0,
"symbol": "16",
"position": {
"right": 2,
"top": 2
}
}
],
"gestures": [
{
"joystickId": 0,
"event": "dir:up",
"mapTo": 265
},
{
"joystickId": 0,
"event": "dir:down",
"mapTo": 264
},
{
"joystickId": 0,
"event": "dir:left",
"mapTo": 263
},
{
"joystickId": 0,
"event": "dir:right",
"mapTo": 262
},
{
"joystickId": 0,
"event": "tap",
"mapTo": 341
},
{
"joystickId": 0,
"event": "end:release",
"mapTo": 0
}
],
"mapper": {}
}
},
"layersConfig": {
"version": 2,
"layers": [
{
"grid": "square",
"title": "Layer#0",
"controls": [
{
"row": 0,
"column": 0,
"symbol": "⏎",
"type": "Key",
"mapTo": [
257
]
},
{
"row": 6,
"column": 0,
"symbol": "A",
"type": "Key",
"mapTo": [
341
]
},
{
"row": 5,
"column": 0,
"symbol": "T",
"type": "Key",
"mapTo": [
342
]
},
{
"row": 4,
"column": 8,
"symbol": "␠",
"type": "Key",
"mapTo": [
32
]
},
{
"row": 6,
"column": 8,
"symbol": "↓",
"type": "Key",
"mapTo": [
264
]
},
{
"row": 6,
"column": 7,
"symbol": "←",
"type": "Key",
"mapTo": [
263,
264
]
},
{
"row": 6,
"column": 9,
"symbol": "→",
"type": "Key",
"mapTo": [
262,
264
]
},
{
"row": 5,
"column": 7,
"symbol": "←",
"type": "Key",
"mapTo": [
263
]
},
{
"row": 5,
"column": 9,
"symbol": "→",
"type": "Key",
"mapTo": [
262
]
},
{
"row": 4,
"column": 7,
"symbol": "␠",
"type": "Key",
"mapTo": [
32,
263
]
},
{
"row": 4,
"column": 9,
"symbol": "␠",
"type": "Key",
"mapTo": [
32,
262
]
},
{
"row": 5,
"column": 8,
"type": "NippleActivator",
"symbol": "◯"
},
{
"row": 4,
"column": 0,
"symbol": "↑",
"type": "Key",
"mapTo": [
265
]
}
]
}
]
}
}

1
links.txt Normal file
View File

@ -0,0 +1 @@
https://github.com/caiiiycuk/js-dos/releases/download/v7.5.0/v7.5.0.zip

60
points.html Normal file
View File

@ -0,0 +1,60 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
html,
body,
#jsdos {
background: black;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-ms-touch-action: none;
-ms-content-zooming: none;
touch-action: none;
}
</style>
<script src="/static/js-dos/src/js-dos.js"></script>
<link href="/static/js-dos/src/js-dos.css" rel="stylesheet">
</head>
<body>
<div id="jsdos"></div>
<script>
let bundleUrl = "https://www.ngtech.co.il/static/js-dos/games/points.zip";
let clientId = null;
emulators.pathPrefix = "/static/js-dos/src/";
Dos(document.getElementById("jsdos"), {
hardware: window.hardware,
withNetworkingApi: false,
withExperimentalApi: true,
clientId: (userGesture) => {
if (!userGesture) {
return Promise.resolve(clientId);
}
clientId = {
namespace: "test",
id: "ngtech1ltd@gmail.com",
};
return Promise.resolve(clientId);
}
}).run(bundleUrl);
</script>
</body>
</html>

BIN
src/emulators-ui-loader.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

1690
src/js-dos.css Normal file

File diff suppressed because one or more lines are too long

17
src/js-dos.js Normal file

File diff suppressed because one or more lines are too long

1
src/js-dos.js.map Normal file

File diff suppressed because one or more lines are too long

48
src/scripts/pack-jsbox-game.sh Executable file
View File

@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -x
GAME_NAME="$1"
GAME_ROOT_PATH="$2"
ZIP_PATH="$3"
GAMES_MENU_PATH="/var/www/ngtech.co.il/static/js-dos"
GAMES_URL_ROOT="https://www.ngtech.co.il/static/js-dos/games"
for arg in GAME_NAME GAME_ROOT_PATH ZIP_PATH
do
echo "checking variable: ${arg}"
eval value=\$$arg
if [ -z "${value}" ];then
echo "You must have 3 cli arguments: GAME_NAME GAME_ROOT_PATH ZIP_PATH"
echo "You are missing one of them or more"
exit 1
fi
done
stat "${GAME_ROOT_PATH}/RUNME.BAT"
if [ "$?" -gt "0" ];then
echo "The file: \"${GAME_ROOT_PATH}/RUNME.BAT\" doesn't exist"
echo "This file must exist for the game to start."
exit 1
fi
mkdir -p "${GAME_ROOT_PATH}/.jsdos"
stat "${GAME_ROOT_PATH}/.jsdos/dosbox.conf"
if [ "$?" -gt "0" ];then
wget "https://www.ngtech.co.il/static/js-dos/dosbox.conf.default" -O "${GAME_ROOT_PATH}/.jsdos/dosbox.conf"
fi
stat "${GAME_ROOT_PATH}/.jsdos/jsdos.json"
if [ "$?" -gt "0" ];then
wget "https://www.ngtech.co.il/static/js-dos/jsdos.json.default" -O "${GAME_ROOT_PATH}/.jsdos/jsdos.json"
fi
cd "${GAME_ROOT_PATH}/" && zip -r "${ZIP_PATH}/${GAME_NAME}.zip" "./" && cd -
wget "https://www.ngtech.co.il/static/js-dos/jsdos-game.html.template" -O "${GAMES_MENU_PATH}/${GAME_NAME}.html"
sed -i -e "s@###GAME_URL###@${GAMES_URL_ROOT}/${GAME_NAME}.zip@g" "${GAMES_MENU_PATH}/${GAME_NAME}.html"
set +x

8
src/types/src/backend/v7/latency.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
export interface LatencyInfo {
region: string;
regionLatency: number;
estimation: {
[region: string]: number[];
};
}
export declare function getAutoRegion(onLatencyUpdate: (region: string) => void): Promise<LatencyInfo>;

View File

@ -0,0 +1,2 @@
export declare function getPersonalBundleUrl(namespace: string, id: string, bundleUrl: string): string;
export declare function putPersonalBundle(namespace: string, id: string, bundleUrl: string, data: Uint8Array): Promise<void>;

16
src/types/src/backend/v7/v7-config.d.ts vendored Normal file
View File

@ -0,0 +1,16 @@
export declare const endpointBase = "https://kdhkdsv558.execute-api.eu-central-1.amazonaws.com/dev";
export declare const personalPut: string;
export declare const personalAcl: string;
export declare const createTokenEndpoint: string;
export declare const tokeInfoGetEndpoint: string;
export declare const addFreeTimeTierEndpoint: string;
export declare const startIpx: string;
export declare const stopIpx: string;
export declare const checkoutCreateTokenEndpoint: string;
export declare const checkoutEndpoint = "https://js-dos.com/checkout/index.html";
export interface AwsRegion {
label: string;
name: string;
ok: string;
}
export declare const awsRegions: AwsRegion[];

View File

@ -0,0 +1,2 @@
import { Props } from "../player-app";
export declare function ActionBar(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,4 @@
import { Props } from "../player-app";
export declare function ActionHide(props: Props & {
class: string;
}): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,4 @@
import { Props } from "../player-app";
export declare function ActionSaveOrExit(props: Props & {
class: string;
}): import("preact").VNode<any> | import("preact").VNode<any>[];

6
src/types/src/components/client.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
import { Props } from "../player-app";
interface ClientProps extends Props {
class?: string;
}
export declare function Client(props: ClientProps): import("preact").VNode<any> | import("preact").VNode<any>[];
export {};

View File

@ -0,0 +1,8 @@
import { Props } from "../player-app";
interface ControlsProps extends Props {
class?: string;
column?: boolean;
portal: boolean;
}
export declare function Controls(props: ControlsProps): import("preact").VNode<any> | import("preact").VNode<any>[];
export {};

View File

@ -0,0 +1,2 @@
import { Props } from "../player-app";
export declare function SideBarCpuControl(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,13 @@
import { JSX } from "preact";
export interface HorizontalSliderProps {
class?: string;
minValue: number;
maxValue: number;
maxLabel?: string;
initialValue: number;
onChange: (value: number) => void;
icon: JSX.Element;
registerListner: (fn: (value: number) => void) => void;
removeListener: (fn: (value: number) => void) => void;
}
export declare function HorizontalSlider(props: HorizontalSliderProps): import("preact").VNode<any> | import("preact").VNode<any>[];

6
src/types/src/components/region.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
import { Props } from "../player-app";
interface RegionProps extends Props {
class?: string;
}
export declare function Region(props: RegionProps): import("preact").VNode<any> | import("preact").VNode<any>[];
export {};

View File

@ -0,0 +1,3 @@
import { Props } from "../player-app";
export declare function ActionBarScaleControl(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
export declare function SideBarScaleControl(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,3 @@
import { Props } from "../player-app";
export declare function ActionBarSensitivityControl(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
export declare function SideBarSensitivityControl(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

2
src/types/src/components/sidebar.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { Props } from "../player-app";
export declare function SideBar(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,7 @@
import { Props } from "../../player-app";
interface LatencyInfoProps extends Props {
class?: string;
asButton?: boolean;
}
export declare function LatencyInfo(props: LatencyInfoProps): import("preact").VNode<any> | import("preact").VNode<any>[];
export {};

View File

@ -0,0 +1,2 @@
import { Props } from "../../player-app";
export declare function Main(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,2 @@
import { Props } from "../../player-app";
export declare function Networking(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,2 @@
import { TokenProps } from "./token";
export declare function TokenAddTime(props: TokenProps): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,2 @@
import { TokenProps } from "./token";
export declare function TokenSelect(props: TokenProps): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,17 @@
import { Props } from "../../../player-app";
interface IpxProps {
arn: string | null;
setArn: (ipxArn: string | null) => void;
address: string | null;
setAddress: (ipxAddress: string | null) => void;
awaitingAddress: boolean;
setAwaitingAddress: (waitingIpx: boolean) => void;
awaitingConnection: boolean;
setAwaitingConnection: (waitingIpx: boolean) => void;
}
export interface TokenProps extends Props {
ipx: IpxProps;
update: () => void;
}
export declare function TokenConfiguration(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
export {};

View File

@ -0,0 +1,2 @@
import { Props } from "../player-app";
export declare function SyncMouseControl(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

2
src/types/src/components/tip.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { Props } from "../player-app";
export declare function Tips(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,12 @@
import { JSX } from "preact";
export interface VerticalSliderProps {
class?: string;
minValue: number;
maxValue: number;
initialValue: number;
onChange: (value: number) => void;
icon: JSX.Element;
registerListner: (fn: (value: number) => void) => void;
removeListener: (fn: (value: number) => void) => void;
}
export declare function VerticalSlider(props: VerticalSliderProps): import("preact").VNode<any> | import("preact").VNode<any>[];

View File

@ -0,0 +1,3 @@
import { Props } from "../player-app";
export declare function ActionBarVolumeControl(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];
export declare function SideBarVolumeControl(props: Props): import("preact").VNode<any> | import("preact").VNode<any>[];

8
src/types/src/dom.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
export declare const html: (strings: TemplateStringsArray, ...values: any[]) => import("preact").VNode<any> | import("preact").VNode<any>[];
export declare const goneClass = "jsdos-player-gone";
export declare const disabledClass = "jsdos-player-button-disabled";
export declare const primaryClass = "jsdos-player-button-primary";
export declare const activeClass = "jsdos-player-button-active";
export declare function createDiv(className: string | string[], innerHtml?: string): HTMLDivElement;
export declare function click(el: HTMLElement, callbackFn: (el: HTMLElement) => void): void;
export declare function downloadFile(data: Uint8Array, fileName: string, mimeType: string): void;

View File

@ -0,0 +1,18 @@
import { TransportLayer } from "emulators/dist/types/protocol/protocol";
export interface Hardware {
readConfig(): string;
sendMessage(payload: string): void;
addKey(key: number, pressed: number, timeMs: number): void;
mouseMove(x: number, y: number, relative: boolean, timeMs: number): void;
mouseButton(button: number, pressed: number, timeMs: number): void;
getFramePayload(): string;
createFile(path: string): string;
appendFile(blob: string): string;
closeFile(): string;
}
export declare class HardwareTransportLayerFactory {
private serverMessageHandler;
constructor();
createTransportLayer(realtime: Hardware): TransportLayer;
}
export declare const hardwareTransportLayerFactory: HardwareTransportLayerFactory;

95
src/types/src/icons.d.ts vendored Normal file
View File

@ -0,0 +1,95 @@
export declare const Icons: {
XCircle: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
UserCircle: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Mobile: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
SwithcHorizontal: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
EyeOff: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Pause: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Play: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
VolumeUp: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
VolumeOff: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
PencilAlt: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
ArrowsExpand: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
ArrowsCircleLeft: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
ArrowsCircleRight: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
ChevronLeft: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
ChevronRight: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
DotsHorizontal: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Download: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Upload: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Plus: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
CursorClick: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Cursor: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Refresh: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
CurrencyDollar: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
QuestionMarkCircle: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Discord: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Telegram: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Twitter: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
FloppyDisk: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Online: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
Offline: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
InformationCircle: (props: {
class: string;
}) => import("preact").VNode<any> | import("preact").VNode<any>[];
};

50
src/types/src/player-app.d.ts vendored Normal file
View File

@ -0,0 +1,50 @@
import { ClientId, DosPlayer, DosPlayerOptionsWithDefaults } from "./player";
import { LatencyInfo } from "./backend/v7/latency";
export declare type SidebarPage = "main" | "latency-info" | "networking";
export interface Props {
player: () => DosPlayer;
options: () => DosPlayerOptionsWithDefaults;
clientId: ClientId | null;
setClientId: (clientId: ClientId | null) => void;
requestClientId?: (userGesture: boolean) => Promise<ClientId | null>;
anonymousClientId: ClientId;
networkToken: string | null;
setNetworkToken: (token: string | null) => void;
mobileControls: boolean;
setMobileControls: (controls: boolean) => Promise<void>;
mirroredControls: boolean;
setMirroredControls: (mirrored: boolean) => Promise<void>;
autolock: boolean;
setAutolock: (autolock: boolean) => Promise<void>;
keyboard: boolean;
toggleKeyboard: () => void;
fullscreen: boolean;
toggleFullscreen: () => void;
pause: boolean;
setPause: (pause: boolean) => void;
mute: boolean;
setMute: (mute: boolean) => void;
actionBar: boolean;
setActionBar: (actionBar: boolean) => void;
sideBar: boolean;
openSideBar: () => void;
closeSideBar: () => void;
region: string | null;
setRegion: (region: string | null) => void;
estimatingRegion: string | null;
setEstimatingRegion: (region: string | null) => void;
latencyInfo: LatencyInfo | null;
setLatencyInfo: (latencyInfo: LatencyInfo) => void;
showTips: boolean;
setShowTips: (showTips: boolean) => void;
sideBarPage: SidebarPage;
setSideBarPage: (page: SidebarPage) => void;
ipxConnected: boolean;
setIpxConnected: (ipxConnected: boolean) => void;
}
export declare function PlayerApp(playerProps: {
player: () => DosPlayer;
options: () => DosPlayerOptionsWithDefaults;
setOnRun: (onRun: () => void) => void;
}): import("preact").VNode<any> | import("preact").VNode<any>[];
export declare function createPlayerApp(root: HTMLDivElement, player: DosPlayer, options: DosPlayerOptionsWithDefaults, setOnRun: (onRun: () => void) => void): void;

29
src/types/src/player.d.ts vendored Normal file
View File

@ -0,0 +1,29 @@
import { DosInstance, DosOptions } from "emulators-ui/dist/types/js-dos";
import { Hardware } from "./hardware-transport-layer";
export interface ClientId {
namespace: string;
id: string;
}
export declare type ClientIdSupplier = (userGesture: boolean) => Promise<ClientId | null>;
export interface DosPlayer extends DosInstance {
bundleUrl: string | null;
}
export interface DosPlayerOptions extends DosOptions {
style?: "default" | "none" | "hidden";
hardware?: Hardware;
clientId?: ClientIdSupplier;
onBeforeExit?: () => Promise<void>;
onExit?: () => void;
noSideBar?: boolean;
noFullscreen?: boolean;
noSocialLinks?: boolean;
preventUnload?: boolean;
withNetworkingApi?: boolean;
withExperimentalApi?: boolean;
windowOpen?: (url: string, target: string) => void;
}
export interface DosPlayerOptionsWithDefaults extends DosPlayerOptions {
windowOpen: (url: string, target?: string) => void;
}
export declare type DosPlayerFactoryType = (root: HTMLDivElement, options?: DosPlayerOptions) => DosPlayer;
export declare function DosPlayer(root: HTMLDivElement, optOptions?: DosPlayerOptions): DosPlayer;

1
src/types/src/request.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare function request(endpoint: string, method?: string, body?: BodyInit | null): Promise<any>;

6
src/types/src/xhr.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
export declare function send(method: "get" | "post" | "head" | "put", url: string, responseType: XMLHttpRequestResponseType, body?: string | ArrayBuffer, onprogress?: (progress: number) => void, headers?: {
[name: string]: string;
}): Promise<string | ArrayBuffer>;
export declare function postObject(url: string, data?: string | ArrayBuffer): Promise<any>;
export declare function getObject(url: string): Promise<any>;
export declare function post(url: string, responseType: XMLHttpRequestResponseType, data?: string | ArrayBuffer): Promise<string | ArrayBuffer>;

View File

@ -0,0 +1,3 @@
export declare const uploadsS3Bucket = "doszone-uploads";
export declare function getPersonalBundleKey(namespace: string, id: string, bundleUrl: string, publishToken: string | undefined): string;
export declare function getPersonalBundleUrl(namespace: string, id: string, bundleUrl: string, publishToken: string | undefined): string;

BIN
src/v7.5.0.zip Normal file

Binary file not shown.

55
src/wdosbox.js Normal file

File diff suppressed because one or more lines are too long

3174
src/wdosbox.js.symbols Normal file

File diff suppressed because it is too large Load Diff

BIN
src/wdosbox.wasm Normal file

Binary file not shown.