Skip to content

Commit

Permalink
add discord and gameId flags
Browse files Browse the repository at this point in the history
  • Loading branch information
asadm committed Apr 3, 2024
1 parent c76ac84 commit a16abd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Assets/PlayroomKit/PlayroomKit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class InitOptions
public bool skipLobby = false;
public int reconnectGracePeriod = 0;
public int? maxPlayersPerRoom;
public string? gameId;
public bool discord = false;

public Dictionary<string, object> defaultStates = null;
public Dictionary<string, object> defaultPlayerStates = null;
Expand Down Expand Up @@ -137,6 +139,13 @@ private static string SerializeInitOptions(InitOptions options)
node["maxPlayersPerRoom"] = options.maxPlayersPerRoom.Value;
}

if (options.gameId != null)
{
node["gameId"] = options.gameId;
}

node["discord"] = options.discord;

if (options.defaultStates != null)
{
JSONObject defaultStatesObject = new JSONObject();
Expand Down
2 changes: 1 addition & 1 deletion Assets/Plugins/PlayroomPlugin.jslib
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ mergeInto(LibraryManager.library, {
onDisconnectCallback
) {
function embedScript(src) {
script.crossOrigin = 'anonymous';
return new Promise((resolve, reject) => {
var script = document.createElement("script");
script.crossOrigin = 'anonymous';
script.src = src;
script.async = false;
script.onload = resolve;
Expand Down

0 comments on commit a16abd3

Please sign in to comment.