-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes! #30
Fixes! #30
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ mergeInto(LibraryManager.library, { | |
// onLaunchCallback | ||
) { | ||
function embedScript(src) { | ||
script.crossOrigin = 'anonymous'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tested this? does this cause any issues? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
return new Promise((resolve, reject) => { | ||
var script = document.createElement("script"); | ||
script.src = src; | ||
|
@@ -23,7 +24,6 @@ mergeInto(LibraryManager.library, { | |
} | ||
|
||
var options = optionsJson ? JSON.parse(UTF8ToString(optionsJson)) : {}; | ||
// console.log(options) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove, don't comment. |
||
|
||
Promise.all([ | ||
embedScript("https://unpkg.com/[email protected]/umd/react.development.js"), | ||
|
@@ -713,23 +713,17 @@ mergeInto(LibraryManager.library, { | |
} | ||
|
||
const players = window._multiplayer.getPlayers(); | ||
console.log(players) | ||
|
||
if (typeof players !== "object" || players === null) { | ||
console.error('The "players" variable is not an object:', players); | ||
return null; | ||
} | ||
const playerState = players[UTF8ToString(playerID)]; | ||
console.log(playerState) | ||
|
||
if (!playerState) { | ||
console.error("Player with ID", UTF8ToString(playerID), "not found."); | ||
return null; | ||
} | ||
|
||
const p = playerState.kick() | ||
console.log(p) | ||
|
||
playerState.kick().then(() => { | ||
dynCall('v', onKickCallBack, []) | ||
}).catch((error) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this done everywhere where
ToString
is used? If yes, has it been tested to not have any negative effects?