Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/sculpting
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Dec 22, 2024
2 parents 7ce55f4 + cbb54d6 commit dfa224f
Show file tree
Hide file tree
Showing 176 changed files with 24,067 additions and 1,961 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ indent_size = 2
[*.{cs,py}]
indent_style = space
indent_size = 4
end_of_line = lf

# Microsoft .NET properties
csharp_new_line_before_members_in_object_initializers = false
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ updates:
- "mikeage"
assignees:
- "mikeage"
groups:
all-actions-updates:
patterns:
- "**"
21 changes: 13 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
env:
PRERELEASE: ${{ steps.version.outputs.prerelease }}
run: |
# For a PR action (i.e., syncronize / open), the value of github.ref will be refs/pull/1234/merge
# For a PR action (i.e., synchronize / open), the value of github.ref will be refs/pull/1234/merge
# For a push action, it will be either refs/heads/foo_branch_name OR refs/tags/v1234.
# We want to use the base name for pushes of tags or to main, the PR number for PRs, and the branch name for named branches.
if [[ "$PRERELEASE" == "false" || ${{ github.ref }} == refs/heads/main ]]
Expand All @@ -146,7 +146,7 @@ jobs:
else
if [[ ${{ github.ref }} == refs/pull/* ]]
then
DESCRIPTION="PR#$(echo ${{ github.ref }} | sed -e 's#refs/pull/##' -e 's#/merge##')"
DESCRIPTION="PR$(echo ${{ github.ref }} | sed -e 's#refs/pull/##' -e 's#/merge##')"
elif [[ ${{ github.ref }} == refs/heads/* ]]
then
DESCRIPTION="$(echo ${{ github.ref }} | sed -e 's#refs/heads/##')"
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
echo "Initial free space"
df -h /
echo "Removing all pre-loaded docker images"
docker rmi $(docker image ls -aq) # Removes ~3GB
docker image ls -aq | xargs -r docker rmi # Removes ~3GB
df -h /
echo "Listing 100 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -n 100
Expand Down Expand Up @@ -352,6 +352,7 @@ jobs:
with:
token: ${{ env.PHOTON_PAT }}
repository: icosa-mirror/photon-fusion
ref: Fusion_v2_Voice_2
path: photon-fusion-mirror/

- name: Copy photon files
Expand Down Expand Up @@ -448,6 +449,11 @@ jobs:
run: |
sed -e 's/androidUseCustomKeystore.*$/androidUseCustomKeystore: 1/' -i ProjectSettings/ProjectSettings.asset
- name: Add PHOTON_PAT specific define
if: ${{ env.PHOTON_PAT }}
run: |
echo -e "\n -define:MP_PHOTON \n -define:PHOTON_UNITY_NETWORKING \n-define:PUN_2_0_OR_NEWER \n-define:PUN_2_OR_NEWER \n-define:PUN_2_19_OR_NEWER \n-define:FUSION_WEAVER \n-define:FUSION2 \n-define:CROSS_PLATFORM_INPUT \n-define:MOBILE_INPUT \n-define:PHOTON_VOICE_DEFINED" | tee -a Assets/csc.rsp
- name: Update build matrix specific defines in csc.rsp
if: ${{ matrix.extra_defines }}
run: |
Expand Down Expand Up @@ -532,7 +538,7 @@ jobs:
du -mcsh Library/*
find Library -size +50M -exec ls -altrh {} \;
# chown all files, since some are owned by root after the docker run
docker run -v $(pwd)/Library:/mnt alpine chown $(id -u).$(id -g) -R /mnt/
docker run -v $(pwd)/Library:/mnt alpine chown $(id -u):$(id -g) -R /mnt/
# Print the files to be deleted
find Library/Bee/ -name 'symbols.zip' -or -name 'libil2cpp*.so' -or -name 'launcher-release.apk' | tee todelete.txt
cat todelete.txt | xargs -r rm
Expand Down Expand Up @@ -801,14 +807,13 @@ jobs:
- name: Publish
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: ${{ steps.changelog.outputs.changelog }}
prerelease: ${{ needs.configuration.outputs.prerelease }}
target_commitish: ${{ needs.configuration.outputs.currentrelease }}
tag_name: ${{ needs.configuration.outputs.version }}
files: releases/*
token: ${{ secrets.RELEASE_TOKEN }}

publish_gitbook:
name: Publish changelog from last major build to open-brush-docs
Expand Down Expand Up @@ -907,7 +912,7 @@ jobs:
- name: Restore steam login config
run: |
mkdir -p /home/runner/Steam/config
echo "${{ secrets.STEAM_CONFIG_VDF}}" | base64 -d - > /home/runner/Steam/config/config.vdf
echo "${{ secrets.STEAM_CONFIG_VDF}}" | base64 -d - | gunzip - > /home/runner/Steam/config/config.vdf
md5sum /home/runner/Steam/config/config.vdf
- name: Download Build Artifacts (Windows OpenXR)
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -948,7 +953,7 @@ jobs:
CHANNEL: beta
- name: Update steam login secret
run: |
base64 -i /home/runner/Steam/config/config.vdf | gh secret set --visibility all --org icosa-foundation STEAM_CONFIG_VDF
gzip /home/runner/Steam/config/config.vdf -c | base64 | gh secret set --visibility all --org icosa-foundation STEAM_CONFIG_VDF
md5sum /home/runner/Steam/config/config.vdf
env:
GITHUB_TOKEN: ${{ secrets.SECRET_UPDATER_PAT }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5.2.0
- uses: actions/setup-python@v5.3.0
with:
python-version: '3.12'
- uses: actions/setup-dotnet@v4.0.1
- uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: '8.0.x'
- name: Install pre-commit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/third_party_notices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5.2.0
- uses: actions/setup-python@v5.3.0
with:
python-version: '3.12'
- name: Run the generator
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Packages/com.unity.xr.picoxr
/Assets/Photon/**
/Assets/Photon.meta
!/Assets/Photon/Fusion/Resources/NetworkProjectConfig.fusion*
!/Assets/Photon/Fusion/Resources/PhotonAppSettings.asset*
!/Assets/Photon/Fusion/User/NetworkPrefabAssetCollection.asset*

# Cache files
*.cache
1 change: 1 addition & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
line_ending: lf
formatter:
include_document_start: true
indent: 2
Expand Down
8 changes: 4 additions & 4 deletions Assets/Editor/BuildTiltBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static void CommandLine()
// Call these once to create the files. Normally (i.e., in a GUI build), they're created with
// [UnityEditor.InitializeOnLoad], but in case they're missing, like in CI, make sure they're
// there!
OVRProjectConfig defaultOculusProjectConfig = OVRProjectConfig.GetProjectConfig();
OVRProjectConfig defaultOculusProjectConfig = OVRProjectConfig.CachedProjectConfig;
string useless_app_id = Assets.Oculus.VR.Editor.OVRPlatformToolSettings.AppID;
#endif

Expand Down Expand Up @@ -1032,7 +1032,7 @@ public TempSetAppNames(BuildTarget target, string Description)
#endif
if (!String.IsNullOrEmpty(Description))
{
new_name += "-(" + Description + ")";
new_name += "-(" + Description.Replace("#", "") + ")";
new_identifier += "-" + Description.Replace("_", "").Replace("#", "").Replace("-", "");
}
if (m_IsAndroidOrIos)
Expand Down Expand Up @@ -1435,7 +1435,7 @@ static void ShowBrushExportTextures()
using (var unused = new TempHookUpSingletons())
{
// Set consultUserConfig = false to keep user config from affecting the build output.
TiltBrushManifest manifest = App.Instance.GetMergedManifest(forceExperimental: true);
TiltBrushManifest manifest = App.Instance.ManifestFull;

StringBuilder s = new StringBuilder();
foreach (BrushDescriptor desc in manifest.UniqueBrushes())
Expand Down Expand Up @@ -1547,7 +1547,7 @@ public static void DoBuild(TiltBuildOptions tiltOptions)
// to be run at build-time (ie when nobody has called Start(), Awake()).
// TempHookupSingletons() has done just enough initialization to make it happy.
// Also set consultUserConfig = false to keep user config from affecting the build output.
TiltBrushManifest manifest = App.Instance.GetMergedManifest(forceExperimental: true);
TiltBrushManifest manifest = App.Instance.ManifestFull;

// Some sanity checks
{
Expand Down
189 changes: 189 additions & 0 deletions Assets/Editor/MultiplayerManagerEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
// MultiplayerManagerInspector.cs
using UnityEditor;
using UnityEngine;
using OpenBrush.Multiplayer;
using System.Threading.Tasks;
using System.ComponentModel.Composition;

#if UNITY_EDITOR
[CustomEditor(typeof(MultiplayerManager))]
public class MultiplayerManagerInspector : Editor
{
private MultiplayerManager multiplayerManager;
private string roomName = "1234";
private bool isPrivate = false;
private int maxPlayers = 4;
private bool voiceDisabled = false;

public override void OnInspectorGUI()
{
multiplayerManager = (MultiplayerManager)target;

DrawDefaultInspector();

GUILayout.Space(10);
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
GUILayout.Space(10);

roomName = EditorGUILayout.TextField("Room Name", roomName);

//State
string connectionState = "";
if (multiplayerManager != null) connectionState = multiplayerManager.State.ToString();
else connectionState = "Not Assigned";

GUILayout.Space(10);
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
EditorGUILayout.BeginHorizontal();
GUILayout.Label("Connection State: ", EditorStyles.boldLabel);
EditorGUILayout.LabelField($"{connectionState}");
EditorGUILayout.EndHorizontal();
GUILayout.Space(5);

if (GUILayout.Button("Connect"))
{
ConnectToLobby();
EditorUtility.SetDirty(target);
}


if (GUILayout.Button("Join Room"))
{
ConnectToRoom();
EditorUtility.SetDirty(target);
}


if (GUILayout.Button("Exit Room"))
{
DisconnectFromRoom();
EditorUtility.SetDirty(target);
}


if (GUILayout.Button("Disconnect"))
{
Disconnect();
EditorUtility.SetDirty(target);
}

if (GUILayout.Button("Refresh Room List"))
{
CheckIfRoomExists();
EditorUtility.SetDirty(target);
}

//Local Player Id
string localPlayerId = "";
if (multiplayerManager.m_LocalPlayer != null) localPlayerId = multiplayerManager.m_LocalPlayer.PlayerId.ToString();
else localPlayerId = "Not Assigned";

GUILayout.Space(10);
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
EditorGUILayout.BeginHorizontal();
GUILayout.Label("Local Player ID: ", EditorStyles.boldLabel);
EditorGUILayout.LabelField($"{localPlayerId}");
EditorGUILayout.EndHorizontal();

//Room Ownership
string ownership = "";
if (multiplayerManager != null && multiplayerManager.IsUserRoomOwner()) ownership = "Yes";
else if (multiplayerManager != null && !multiplayerManager.IsUserRoomOwner()) ownership = "No";
else ownership = "Not Assigned";

EditorGUILayout.BeginHorizontal();
GUILayout.Label("Is Local Player Room Owner:", EditorStyles.boldLabel);
EditorGUILayout.LabelField($"{ownership}");
EditorGUILayout.EndHorizontal();

//Remote Users
string remoteUsersRegistered = "";
if (multiplayerManager.m_RemotePlayers != null && multiplayerManager.m_RemotePlayers.Count > 0)
{
remoteUsersRegistered = "UserIds:[ ";
foreach (var remotePlayer in multiplayerManager.m_RemotePlayers)
{
remoteUsersRegistered += remotePlayer.PlayerId.ToString() + ",";
}
remoteUsersRegistered += "]";
}
else remoteUsersRegistered = "Not Assigned";

//Registered remote players

EditorGUILayout.BeginHorizontal();
GUILayout.Label("Registered Remote Players IDs:", EditorStyles.boldLabel);
EditorGUILayout.LabelField($"{remoteUsersRegistered}");
EditorGUILayout.EndHorizontal();

// Display and edit Nickname
GUILayout.Space(10);
EditorGUILayout.LabelField("Nickname", GUI.skin.horizontalSlider);
string currentNickname = multiplayerManager.UserInfo.Nickname;
GUILayout.Label("Nickname", EditorStyles.boldLabel);
string newNickname = EditorGUILayout.TextField("Edit Nickname", currentNickname);
if (newNickname != currentNickname)
{
ConnectionUserInfo updatedUserInfo = multiplayerManager.UserInfo;
updatedUserInfo.Nickname = newNickname;
multiplayerManager.UserInfo = updatedUserInfo;
EditorUtility.SetDirty(target); // Mark the target as dirty to apply changes
}


Repaint();

}

private async void ConnectToLobby()
{
if (multiplayerManager != null)
{
bool success = await multiplayerManager.Connect();
}
}

private async void ConnectToRoom()
{
if (multiplayerManager != null)
{
RoomCreateData roomData = new RoomCreateData
{
roomName = roomName,
@private = isPrivate,
maxPlayers = maxPlayers,
voiceDisabled = voiceDisabled
};

bool success = await multiplayerManager.JoinRoom(roomData);

}
}

private async void DisconnectFromRoom()
{
if (multiplayerManager != null)
{
bool success = await multiplayerManager.LeaveRoom();

}
}

private async void Disconnect()
{
if (multiplayerManager != null)
{
bool success = await multiplayerManager.Disconnect();

}
}

private void CheckIfRoomExists()
{
if (multiplayerManager != null)
{
bool roomExists = multiplayerManager.DoesRoomNameExist(roomName);
}
}
}
#endif
11 changes: 11 additions & 0 deletions Assets/Editor/MultiplayerManagerEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Assets/Oculus/OculusProjectConfig.asset
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ MonoBehaviour:
systemSplashScreen: {fileID: 0}
systemSplashScreenType: 0
_systemLoadingScreenBackground: 0
ovrPluginMd5Win64: 33685b25e1b4f2b6c1632069bc88783632496c19eda9b55641c321c119bdf68c
ovrPluginMd5Android: b9e59102e373e2d7a97cd1dbe38cac15e89ec54c0a32b98491b3d09d93ccda7d
ovrPluginMd5Win64: d72fb658f3d9064293fb2241e55259057f9ac34a260fafcf32f36c4a3005911c
ovrPluginMd5Android: 5ef6da3aad630673da6447f50e1b2d8ae14dbda69fd9877bc13b87ed87f3752b
Loading

0 comments on commit dfa224f

Please sign in to comment.