remove global

This commit is contained in:
2025-12-18 18:43:23 -06:00
parent aa18a8c8d2
commit d50f4119ee
60 changed files with 378 additions and 282 deletions

View File

@@ -48,7 +48,7 @@ function get_status() {
}
// Main message receiver
$_.receiver(function(msg) {
$receiver(function(msg) {
switch (msg.type) {
case 'download':
if (state.downloading) {
@@ -86,7 +86,7 @@ $_.receiver(function(msg) {
}
// Schedule the first chunk read
$_.delay(read_next_chunk, 0);
$delay(read_next_chunk, 0);
} catch (e) {
state.error = e.toString();
@@ -167,7 +167,7 @@ function read_next_chunk() {
}
// Schedule next chunk read
$_.delay(read_next_chunk, 0);
$delay(read_next_chunk, 0);
} catch (e) {
// Error during download

View File

@@ -7,7 +7,7 @@ var json = use('json');
var waiting_client = null;
var match_id = 0;
$_.portal(e => {
$portal(e => {
log.console("NAT server: received connection request");
if (!isa(e.actor, actor))

View File

@@ -1,6 +1,6 @@
log.console(`nat client starting`)
$_.contact((actor, reason) => {
$contact((actor, reason) => {
if (actor) {
log.console(`trying to message ${actor}`)
send(actor, {type:"greet"})
@@ -10,10 +10,10 @@ $_.contact((actor, reason) => {
}, {
address: "108.210.60.32", // NAT server's public IP
port: 4000,
actor: $_
actor: $self
})
$_.receiver(e => {
$receiver(e => {
switch(e.type) {
case 'greet':
log.console(`hello!`)