Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
54bc04c
added mesh extension skelton.
takaokouji Apr 6, 2020
0b01aff
select variable name.
takaokouji Apr 7, 2020
c7192e9
connect WebRTC and send broadcast handly.
takaokouji Apr 11, 2020
a6c32e2
broadcast on Client when received broadcast message from Host.
takaokouji Apr 11, 2020
14ad24b
receive broadcast from Client.
takaokouji Apr 11, 2020
accec06
fix send broadcast from Client.
takaokouji Apr 11, 2020
1e5004c
ignore error.
takaokouji Apr 11, 2020
01ad638
get all global variables on Host.
takaokouji Apr 11, 2020
c9f9e1b
create and rename global variable.
takaokouji Apr 11, 2020
834e155
use uid() instead of uuid().
takaokouji Apr 11, 2020
e3f799b
revert package-lock.json.
takaokouji Apr 11, 2020
18b5c14
change variable value by slider.
takaokouji Apr 11, 2020
3251a3b
refactor.
takaokouji Apr 11, 2020
122418d
use signaling server.
takaokouji Apr 12, 2020
aa82af5
use signaling server.
takaokouji Apr 12, 2020
efc902a
check variable type.
takaokouji Apr 12, 2020
6b2f083
refactor and scan hook.
takaokouji Apr 12, 2020
aa2b3d9
scan.
takaokouji Apr 12, 2020
2fd0c58
fixed scan.
takaokouji Apr 12, 2020
462ecde
connect.
takaokouji Apr 12, 2020
f33128d
removed unused block.
takaokouji Apr 12, 2020
7773090
disconnect.
takaokouji Apr 12, 2020
f327eea
connected message.
takaokouji Apr 12, 2020
b54d745
fixed register own variable when reconnect client.
takaokouji Apr 12, 2020
2ae5127
error handling.
takaokouji Apr 12, 2020
18ad33c
use aws.
takaokouji Apr 14, 2020
fca2dd0
ignore offer and answer response.
takaokouji Apr 14, 2020
e1f3aa5
fixed when received broadcast from Mesh never run blocks.
takaokouji Apr 14, 2020
f2ed1c5
use formatMessage format.
takaokouji Apr 14, 2020
0ee001f
fixed lint
takaokouji Apr 14, 2020
735a103
fixed lint.
takaokouji Apr 14, 2020
2dc8a05
fixed for lint.
takaokouji Apr 14, 2020
bc99e56
use stun servers.
takaokouji Apr 15, 2020
409d2e3
use uuid instead uid.
takaokouji Apr 15, 2020
55f50c4
updated WSS_URL.
takaokouji Apr 16, 2020
75b8067
use custom domain.
takaokouji Apr 16, 2020
b6b4baa
use Mesh Chrome Extension.
takaokouji Apr 18, 2020
382db3c
refactor.
takaokouji Apr 19, 2020
49206e4
changed wss url to api.smalruby.app.
takaokouji Apr 23, 2020
5f70ec3
fixed.
takaokouji May 9, 2020
6a3e230
fixed.
takaokouji May 9, 2020
b68eea8
fixed heartbeat period.
takaokouji May 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/engine/block-utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const Timer = require('../util/timer');
* runtime, thread, target, and convenient methods.
*/

let lastInstance;

class BlockUtility {
constructor (sequencer = null, thread = null) {
/**
Expand All @@ -25,6 +27,8 @@ class BlockUtility {
this._nowObj = {
now: () => this.sequencer.runtime.currentMSecs
};

lastInstance = this;
}

/**
Expand Down Expand Up @@ -235,6 +239,14 @@ class BlockUtility {
return devObject[func].apply(devObject, args);
}
}

/**
* Returns BlockUtility instance to use same instance in runtime and extension.
* @return {BlockUtility} The BlockUtility instance.
*/
static lastInstance () {
return lastInstance;
}
}

module.exports = BlockUtility;
14 changes: 14 additions & 0 deletions src/engine/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,20 @@ class Runtime extends EventEmitter {
return isConnected;
}

/**
* Returns the connected message.
* @param {string} extensionId - the id of the extension.
* @return {string|null} - the connected message.
*/
getPeripheralConnectedMessage (extensionId) {
if (this.getPeripheralIsConnected(extensionId) &&
this.peripheralExtensions[extensionId] &&
this.peripheralExtensions[extensionId].connectedMessage) {
return this.peripheralExtensions[extensionId].connectedMessage();
}
return null;
}

/**
* Emit an event to indicate that the microphone is being used to stream audio.
* @param {boolean} listening - true if the microphone is currently listening.
Expand Down
14 changes: 14 additions & 0 deletions src/engine/target.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,20 @@ class Target extends EventEmitter {
}
}

/**
* Sets the variable value with the given id to newValue.
* @param {string} id Id of variable to set value.
* @param {object} newValue New value for the variable.
*/
setVariableValue (id, newValue) {
if (this.variables.hasOwnProperty(id)) {
const variable = this.variables[id];
if (variable.id === id) {
variable.value = newValue;
}
}
}

/**
* Renames the variable with the given id to newName.
* @param {string} id Id of variable to rename.
Expand Down
3 changes: 2 additions & 1 deletion src/extension-support/extension-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const builtinExtensions = {
ev3: () => require('../extensions/scratch3_ev3'),
makeymakey: () => require('../extensions/scratch3_makeymakey'),
boost: () => require('../extensions/scratch3_boost'),
gdxfor: () => require('../extensions/scratch3_gdx_for')
gdxfor: () => require('../extensions/scratch3_gdx_for'),
mesh: () => require('../extensions/scratch3_mesh')
};

/**
Expand Down
Loading