Skip to content

Commit

Permalink
update networking docs
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Nov 18, 2024
1 parent b18e280 commit 07d9892
Show file tree
Hide file tree
Showing 42 changed files with 172 additions and 172 deletions.
2 changes: 1 addition & 1 deletion advanced-topics.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-11-18T13:11:56.627360896"><script type="text/javascript" >
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-11-18T13:19:02.395103593"><script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
Expand Down
16 changes: 8 additions & 8 deletions browser.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-11-18T13:11:56.62921413"><script type="text/javascript" >
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-11-18T13:19:02.400279012"><script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
Expand All @@ -26,21 +26,21 @@
"url": "https://js-dos.com/",
"name": "js-dos Help"
}</script><!-- End Schema.org --></head><body data-id="Browser" data-main-title="Browser" data-article-props="{&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs="emulators.md|emulators///threejs.md|How-to use"><noscript><div><img src="https://mc.yandex.ru/watch/27763311" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>js-dos 8.xx Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="Browser" id="Browser.md">Browser</h1><p id="z1p2yoy_3">In this example, you will learn how to use <code class="code" id="z1p2yoy_15">emulators</code> with <code class="code" id="z1p2yoy_16">three.js</code> renderer. We will create a rotating cube with a digger game.</p><figure id="z1p2yoy_4"><img alt="threejs.jpg" src="images/threejs.jpg" title="threejs.jpg" width="545" height="545"></figure><p id="z1p2yoy_5">First, you need to include <code class="code" id="z1p2yoy_17">emulators.js</code>:</p><div class="tabs" id="z1p2yoy_6" data-anchors="[z1p2yoy_18,z1p2yoy_19]"><div class="tabs__content" data-gtm="tab" id="z1p2yoy_18" data-title="v8"><div class="code-block" data-lang="ts" data-title="TypeScript">
<div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>js-dos 8.xx Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="Browser" id="Browser.md">Browser</h1><p id="-cuerje_3">In this example, you will learn how to use <code class="code" id="-cuerje_15">emulators</code> with <code class="code" id="-cuerje_16">three.js</code> renderer. We will create a rotating cube with a digger game.</p><figure id="-cuerje_4"><img alt="threejs.jpg" src="images/threejs.jpg" title="threejs.jpg" width="545" height="545"></figure><p id="-cuerje_5">First, you need to include <code class="code" id="-cuerje_17">emulators.js</code>:</p><div class="tabs" id="-cuerje_6" data-anchors="[-cuerje_18,-cuerje_19]"><div class="tabs__content" data-gtm="tab" id="-cuerje_18" data-title="v8"><div class="code-block" data-lang="ts" data-title="TypeScript">
&lt;script src=&quot;https://v8.js-dos.com/latest/emulators/emulators.js&quot;&gt;&lt;/script&gt;
</div></div><div class="tabs__content" data-gtm="tab" id="z1p2yoy_19" data-title="v7"><div class="code-block" data-lang="ts" data-title="TypeScript">
</div></div><div class="tabs__content" data-gtm="tab" id="-cuerje_19" data-title="v7"><div class="code-block" data-lang="ts" data-title="TypeScript">
&lt;script src=&quot;https://v8.js-dos.com/v7/emulators/emulators.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://v8.js-dos.com/v7/emulators-ui/emulators-ui.js&quot;&gt;&lt;/script&gt;
</div></div></div><p id="z1p2yoy_7">Then set <code class="code" id="z1p2yoy_22">emulators.pathPrefix</code> pointing to the correct location:</p><div class="tabs" id="z1p2yoy_8" data-anchors="[z1p2yoy_23,z1p2yoy_24]"><div class="tabs__content" data-gtm="tab" id="z1p2yoy_23" data-title="v8"><div class="code-block" data-lang="ts" data-title="TypeScript">
</div></div></div><p id="-cuerje_7">Then set <code class="code" id="-cuerje_22">emulators.pathPrefix</code> pointing to the correct location:</p><div class="tabs" id="-cuerje_8" data-anchors="[-cuerje_23,-cuerje_24]"><div class="tabs__content" data-gtm="tab" id="-cuerje_23" data-title="v8"><div class="code-block" data-lang="ts" data-title="TypeScript">
&lt;script type=&quot;module&quot;&gt;
emulators.pathPrefix = &quot;https://v8.js-dos.com/latest/emulators/&quot;;
</div></div><div class="tabs__content" data-gtm="tab" id="z1p2yoy_24" data-title="v7"><div class="code-block" data-lang="ts" data-title="TypeScript">
</div></div><div class="tabs__content" data-gtm="tab" id="-cuerje_24" data-title="v7"><div class="code-block" data-lang="ts" data-title="TypeScript">
&lt;script type=&quot;module&quot;&gt;
emulators.pathPrefix = &quot;https://v8.js-dos.com/v7/emulators/&quot;;
</div></div></div><p id="z1p2yoy_9">Then you need to download js-dos bundle (for example, Digger game), and instantiate emulators:</p><div class="code-block" data-lang="ts">
</div></div></div><p id="-cuerje_9">Then you need to download js-dos bundle (for example, Digger game), and instantiate emulators:</p><div class="code-block" data-lang="ts">
const bundle = await fetch(&quot;https://cdn.dos.zone/original/2X/9/9ed7eb9c2c441f56656692ed4dc7ab28f58503ce.jsdos&quot;);
const ci = await emulators.dosWorker(new Uint8Array(await bundle.arrayBuffer()));
</div><p id="z1p2yoy_11">Now the DOS program is started in worker, and we need to render it on the screen. To do this, we need to subscribe to <code class="code" id="z1p2yoy_27">frame</code> event and update texture:</p><div class="code-block" data-lang="ts">
</div><p id="-cuerje_11">Now the DOS program is started in worker, and we need to render it on the screen. To do this, we need to subscribe to <code class="code" id="-cuerje_27">frame</code> event and update texture:</p><div class="code-block" data-lang="ts">
const rgba = new Uint8ClampedArray(320 * 200 * 4);

ci.events().onFrame((rgb) =&gt; {
Expand All @@ -54,7 +54,7 @@
ctx?.putImageData(new ImageData(rgba, 320, 200), 0, 0);
// ...
}
</div><p id="z1p2yoy_13">Where <code class="code" id="z1p2yoy_28">rgb</code> is an actual DOS screen frame.</p><div class="code-collapse" data-lang="ts" data-is-expanded="false" data-synopsis="Source code" data-disable-link-processing="true">&lt;!doctype html&gt;
</div><p id="-cuerje_13">Where <code class="code" id="-cuerje_28">rgb</code> is an actual DOS screen frame.</p><div class="code-collapse" data-lang="ts" data-is-expanded="false" data-synopsis="Source code" data-disable-link-processing="true">&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
Expand Down
4 changes: 2 additions & 2 deletions cloud-overview.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-11-18T13:11:56.628031133"><script type="text/javascript" >
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="built-on" content="2024-11-18T13:19:02.395103173"><script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
Expand All @@ -26,4 +26,4 @@
"url": "https://js-dos.com/",
"name": "js-dos Help"
}</script><!-- End Schema.org --></head><body data-id="cloud-overview" data-main-title="js-dos cloud" data-article-props="{&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs=""><noscript><div><img src="https://mc.yandex.ru/watch/27763311" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>js-dos 8.xx Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="cloud-overview" id="cloud-overview.md">js-dos cloud</h1><p id="o33aq7_3">js-dos offers cloud services that improve user experience. They include:</p><ul class="list _bullet" id="o33aq7_4"><li class="list__item" id="o33aq7_8"><p>Storing saves in the cloud, that means you can restore your progress on any browser.</p></li><li class="list__item" id="o33aq7_9"><p>Networking that allows you to play multiplayer dos games.</p></li><li class="list__item" id="o33aq7_10"><p>Fat16, Fat32 network drives (sockdrive)</p></li></ul><p id="o33aq7_5">To activate cloud services, you need to provide your secret key.</p><ol class="list _decimal" id="o33aq7_6" type="1"><li class="list__item" id="o33aq7_11"><p id="o33aq7_13">In UI of player (type key in input):</p><figure id="o33aq7_14"><img alt="Enter key" src="images/enter-key.jpg" title="Enter key" width="2051" height="1047"></figure></li><li class="list__item" id="o33aq7_12"><p id="o33aq7_15">Using player <a href="player-api.html#options" id="o33aq7_16" data-tooltip="All options are optional">options</a></p></li></ol><section class="chapter"><h2 id="secret-key" data-toc="secret-key">Secret key</h2><p id="o33aq7_17">You can get secret key <a href="https://v8.js-dos.com/key/" id="o33aq7_19" data-external="true" rel="noopener noreferrer">here</a></p><aside class="prompt" data-type="tip" data-title="" id="o33aq7_18"><p id="o33aq7_20">You can disable cloud features in player using <a href="player-api.html#options" id="o33aq7_21" data-tooltip="All options are optional">options</a></p></aside></section><div class="last-modified">Last modified: 18 ноября 2024</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="need-help.html" class="navigation-links__prev">Need help?</a><a href="subscription.html" class="navigation-links__next">Subscription</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b518/app.js"></script></body></html>
<div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>js-dos 8.xx Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="cloud-overview" id="cloud-overview.md">js-dos cloud</h1><p id="-v8155x_3">js-dos offers cloud services that improve user experience. They include:</p><ul class="list _bullet" id="-v8155x_4"><li class="list__item" id="-v8155x_8"><p>Storing saves in the cloud, that means you can restore your progress on any browser.</p></li><li class="list__item" id="-v8155x_9"><p>Networking that allows you to play multiplayer dos games.</p></li><li class="list__item" id="-v8155x_10"><p>Fat16, Fat32 network drives (sockdrive)</p></li></ul><p id="-v8155x_5">To activate cloud services, you need to provide your secret key.</p><ol class="list _decimal" id="-v8155x_6" type="1"><li class="list__item" id="-v8155x_11"><p id="-v8155x_13">In UI of player (type key in input):</p><figure id="-v8155x_14"><img alt="Enter key" src="images/enter-key.jpg" title="Enter key" width="2051" height="1047"></figure></li><li class="list__item" id="-v8155x_12"><p id="-v8155x_15">Using player <a href="player-api.html#options" id="-v8155x_16" data-tooltip="All options are optional">options</a></p></li></ol><section class="chapter"><h2 id="secret-key" data-toc="secret-key">Secret key</h2><p id="-v8155x_17">You can get secret key <a href="https://v8.js-dos.com/key/" id="-v8155x_19" data-external="true" rel="noopener noreferrer">here</a></p><aside class="prompt" data-type="tip" data-title="" id="-v8155x_18"><p id="-v8155x_20">You can disable cloud features in player using <a href="player-api.html#options" id="-v8155x_21" data-tooltip="All options are optional">options</a></p></aside></section><div class="last-modified">Last modified: 18 ноября 2024</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="need-help.html" class="navigation-links__prev">Need help?</a><a href="subscription.html" class="navigation-links__next">Subscription</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b518/app.js"></script></body></html>
Loading

0 comments on commit 07d9892

Please sign in to comment.