remove global
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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!`)
|
||||
|
||||
Reference in New Issue
Block a user