-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gallery): Update gallery samples and registrations
- Refactor loading in app.tsx
- Loading branch information
Showing
8 changed files
with
226 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
{ | ||
"getPlayerProfile": { | ||
"description": "Uses secrets and variables from dedicated server configuration files to further parameterize web requests. See https://learn.microsoft.com/minecraft/creator/scriptapi/minecraft/server-admin/serversecrets", | ||
"prefix": ["mc"], | ||
"body": [" const serverUrl = mcsa.variables.get('serverEndpoint');", | ||
" const req = new HttpRequest(serverUrl + 'getPlayerProfile');", | ||
" req.body = JSON.stringify({", | ||
" playerId: 'johndoe',", | ||
" });", | ||
" const authTokenSec = mcsa.secrets.get('authtoken');", | ||
" if (!authTokenSec) {", | ||
" log('authtoken secret not defined.', -1);", | ||
" return;", | ||
" }", | ||
" req.method = HttpRequestMethod.Post;", | ||
" req.headers = [new HttpHeader('Content-Type', 'application/json'), new HttpHeader('auth', authTokenSec)];", | ||
" await http.request(req);" | ||
]} | ||
} | ||
"getPlayerProfile": { | ||
"description": "Uses secrets and variables from dedicated server configuration files to further parameterize web requests. See https://learn.microsoft.com/minecraft/creator/scriptapi/minecraft/server-admin/serversecrets", | ||
"prefix": ["mc"], | ||
"body": [ | ||
"// Note this code will only run on Bedrock Dedicated Server.", | ||
" const serverUrl = mcsa.variables.get('serverEndpoint');", | ||
" const req = new HttpRequest(serverUrl + 'getPlayerProfile');", | ||
" req.body = JSON.stringify({", | ||
" playerId: 'johndoe',", | ||
" });", | ||
" const authTokenSec = mcsa.secrets.get('authtoken');", | ||
" if (!authTokenSec) {", | ||
" log('authtoken secret not defined.', -1);", | ||
" return;", | ||
" }", | ||
" req.method = HttpRequestMethod.Post;", | ||
" req.headers = [new HttpHeader('Content-Type', 'application/json'), new HttpHeader('auth', authTokenSec)];", | ||
" await http.request(req);" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
{ | ||
"updateScore": { | ||
"description": "Updates score on a local server. See https://learn.microsoft.com/minecraft/creator/scriptapi/minecraft/server-net/httprequest", | ||
"prefix": ["mc"], | ||
"body": [" const req = new HttpRequest('http://localhost:3000/updateScore');", | ||
" req.body = JSON.stringify({", | ||
" score: 22,", | ||
" });", | ||
" req.method = HttpRequestMethod.Post;", | ||
" req.headers = [", | ||
" new HttpHeader('Content-Type', 'application/json'),", | ||
" new HttpHeader('auth', 'my-auth-token'),", | ||
" ];", | ||
" await http.request(req);" | ||
]} | ||
} | ||
"updateScore": { | ||
"description": "Updates score on a local server. See https://learn.microsoft.com/minecraft/creator/scriptapi/minecraft/server-net/httprequest", | ||
"prefix": ["mc"], | ||
"body": [ | ||
"// Note this code will only run on Bedrock Dedicated Server.", | ||
" const req = new HttpRequest('http://localhost:3000/updateScore');", | ||
" req.body = JSON.stringify({", | ||
" score: 22,", | ||
" });", | ||
" req.method = HttpRequestMethod.Post;", | ||
" req.headers = [", | ||
" new HttpHeader('Content-Type', 'application/json'),", | ||
" new HttpHeader('auth', 'my-auth-token'),", | ||
" ];", | ||
" await http.request(req);" | ||
] | ||
} | ||
} |
Oops, something went wrong.