Skip to content
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

Fork/refactor and testing #106

Merged
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
05f35ce
chore: test commit
aarijimam Oct 25, 2024
640fa61
refactor: added new PlayroomKit.cs
aarijimam Oct 25, 2024
86860dc
refactor: added di params
aarijimam Oct 25, 2024
b16ec42
refactor: some player functions and playeroomkit
aarijimam Oct 25, 2024
a2ea65a
refactor: playroomkit functions
aarijimam Oct 25, 2024
4aaa578
refactor: added start matchmaking, isRunningBrowser and GetPlayers
aarijimam Oct 25, 2024
edbcde8
refactor: added playroom services
aarijimam Oct 25, 2024
019ab4d
refactor: added new rpc
aarijimam Oct 25, 2024
2f2eeb1
refactor: remove dedundant functions from playroom kit
aarijimam Oct 25, 2024
1ebc238
feat: implemented ondisconnect with di
aarijimam Oct 25, 2024
4475dfe
refactor: added rpc and removed player constructor
aarijimam Oct 25, 2024
9844619
refactor: added totalObjects, from og constructor but never used
aarijimam Oct 25, 2024
6f1a9d4
refactor: remove localrpc temporarily out of folder
aarijimam Oct 25, 2024
0e786f9
refactor: updated 2d-platformer
aarijimam Oct 25, 2024
d8f466f
refactor: remove myplayer from player to kit
aarijimam Oct 25, 2024
265a85f
refactor: updated discord-activity
aarijimam Oct 25, 2024
f1e01d2
refactor: updated GameManager.cs
aarijimam Oct 25, 2024
6391cf8
refactor: updated lobby.cs
aarijimam Oct 25, 2024
4582a1b
refactor: added playroomkit constructor
aarijimam Oct 25, 2024
4983622
feat: added tests
aarijimam Oct 25, 2024
9a39d25
feat: added rpc interop to wrapper
aarijimam Oct 25, 2024
6fc3ecf
feat: added tests for rpc
aarijimam Oct 25, 2024
0374553
chore: moved files
momintlh Oct 28, 2024
08165f3
fix: fixed failed tests, fixed editor ui
momintlh Oct 28, 2024
c8e71d8
feat: removing dev manager script to get into builds
momintlh Oct 28, 2024
feddf85
Merge branch 'tests/rpc' into refactor/kit-functions
aarijimam Oct 28, 2024
a981872
refactor: removed redundant functions from main playroomkit file
aarijimam Oct 28, 2024
6139afd
feat: added IsStreamScreen function with new imp
aarijimam Oct 28, 2024
56ac6a4
feat: test for IsStreamScreen build
aarijimam Oct 28, 2024
b1fbcc3
feat: test for IsStreamScreen local
aarijimam Oct 28, 2024
07d7165
refactor: removed redundant OnPlayJoinCallbacks list, removed repende…
aarijimam Oct 28, 2024
75a93d5
feat: updated WaitForState with DI
aarijimam Oct 28, 2024
a5b9797
feat: test for Wait for State and exposed function
aarijimam Oct 28, 2024
9bcc091
refactor: removed unused function
aarijimam Oct 28, 2024
cc9c360
feat: wait for player state updated
aarijimam Oct 28, 2024
830a95b
feat: test for wait for player state
aarijimam Oct 28, 2024
a46aeac
feat: ResetStates
aarijimam Oct 28, 2024
6c68de8
feat: test for reset states build
aarijimam Oct 28, 2024
8856565
feat: test for reset states local
aarijimam Oct 28, 2024
35c462c
feat: reset player states updated
aarijimam Oct 28, 2024
551bb1d
feat: reset player states test build
aarijimam Oct 28, 2024
aae620e
feat: reset player states test local
aarijimam Oct 28, 2024
bfd9602
feat: joystick functions updated
aarijimam Oct 28, 2024
11a05ed
feat: joystick functions test
aarijimam Oct 28, 2024
3aa9748
refactor: move matchmaking options
aarijimam Oct 28, 2024
67d71e0
feat: my player updated
aarijimam Oct 28, 2024
f096009
feat: move ParseJsonToDict ot helpers
aarijimam Oct 28, 2024
b38d65d
feat: unsubscribe on quit updated
aarijimam Oct 28, 2024
6e8ffeb
feat: added tests for myplayer
aarijimam Oct 28, 2024
c774bc2
Merge pull request #1 from aarijimam/refactor/kit-functions
aarijimam Oct 28, 2024
ca63d67
chore: moved mm options to new file
momintlh Oct 29, 2024
d6ffc1c
refactor: added PlayerBase to Player class and updated GetProfile
aarijimam Oct 29, 2024
f842658
feat: added get profile with service
aarijimam Oct 29, 2024
495a530
refactor: wrapper for player internal functions and test for get profile
aarijimam Oct 29, 2024
9a996b5
feat: added set state and test for set state
aarijimam Oct 29, 2024
a646679
feat: updated on quit
aarijimam Oct 29, 2024
699d73e
feat: updated player kick
aarijimam Oct 29, 2024
b4575a6
feat: updated wait for state
aarijimam Oct 29, 2024
e3dcad6
refactor: added id to service
aarijimam Oct 29, 2024
db484c9
feat: tests for kick, wait for state, on quit player
aarijimam Oct 29, 2024
7c655b1
feat: import package test scene
momintlh Oct 30, 2024
dba5ea8
fix: using with architecture
momintlh Oct 30, 2024
60a8a77
fix: new class useage
momintlh Oct 30, 2024
83f5402
fix: ANOTHER FIX
momintlh Oct 30, 2024
b049a91
feat: WaitForState local mode
aarijimam Oct 30, 2024
30db603
feat: wait for player state local and test
aarijimam Oct 30, 2024
1c47813
fix: removed browser mode toggle
momintlh Nov 4, 2024
666f5df
chore: removed unused variables in tests
momintlh Nov 4, 2024
d619ffa
chore: removed option from custom editor
momintlh Nov 4, 2024
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
18 changes: 18 additions & 0 deletions Assets/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources />
<packageSourceCredentials />
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<config>
<add key="packageInstallLocation" value="CustomWithinAssets" />
<add key="repositoryPath" value="PlayroomKit/dependencies" />
<add key="PackagesConfigDirectoryPath" value="." />
<add key="slimRestore" value="true" />
<add key="PreferNetStandardOverNetFramework" value="true" />
</config>
</configuration>
23 changes: 23 additions & 0 deletions Assets/NuGet.config.meta

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

8 changes: 8 additions & 0 deletions Assets/NuGet.meta

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

9 changes: 9 additions & 0 deletions Assets/NuGet/Editor.meta

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

Binary file not shown.
33 changes: 33 additions & 0 deletions Assets/NuGet/Editor/NuGetForUnity.PluginAPI.dll.meta

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

342 changes: 342 additions & 0 deletions Assets/NuGet/Editor/NuGetForUnity.PluginAPI.xml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Assets/NuGet/Editor/NuGetForUnity.PluginAPI.xml.meta

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

Binary file added Assets/NuGet/Editor/NugetForUnity.dll
Binary file not shown.
33 changes: 33 additions & 0 deletions Assets/NuGet/Editor/NugetForUnity.dll.meta

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

21 changes: 21 additions & 0 deletions Assets/NuGet/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Patrick McCarthy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions Assets/NuGet/LICENSE.meta

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

Binary file added Assets/NuGet/README.pdf
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/NuGet/README.pdf.meta

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

9 changes: 9 additions & 0 deletions Assets/NuGet/Resources.meta

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

Binary file added Assets/NuGet/Resources/defaultIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions Assets/NuGet/Resources/defaultIcon.png.meta

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

8 changes: 8 additions & 0 deletions Assets/Packages.meta

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

9 changes: 6 additions & 3 deletions Assets/PlayroomKit/Editor/PlayroomDevEditor.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#if UNITY_EDITOR


using UnityEngine;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
using System.Collections.Generic;
using ParrelSync;
using UnityEngine.Networking;
using UnityEditor.Search;

namespace Playroom
{
Expand Down Expand Up @@ -158,4 +160,5 @@ private static VisualElement DocumentationLinkCreator()
return docLink;
}
}
}
}
#endif
18 changes: 11 additions & 7 deletions Assets/PlayroomKit/Examples/2d-platformer/scripts/GameManager2d.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class GameManager2d : MonoBehaviour
private static readonly List<GameObject> playerGameObjects = new();
private static Dictionary<string, GameObject> PlayerDict = new();

private PlayroomKit _playroomKit = new();


void Awake()
{
Expand All @@ -44,7 +46,7 @@ void Awake()
/// </summary>
private void Initialize()
{
PlayroomKit.InsertCoin(new InitOptions()
_playroomKit.InsertCoin(new InitOptions()
{
maxPlayersPerRoom = 2,
defaultPlayerStates = new() {
Expand All @@ -53,8 +55,8 @@ private void Initialize()

}, () =>
{
PlayroomKit.OnPlayerJoin(AddPlayer);
print($"[Unity Log] isHost: {PlayroomKit.IsHost()}");
_playroomKit.OnPlayerJoin(AddPlayer);
print($"[Unity Log] isHost: {_playroomKit.IsHost()}");
});
}

Expand All @@ -63,8 +65,7 @@ private void Initialize()
/// </summary>
void Start()
{
PlayroomKit.RpcRegister("ShootBullet", HandleScoreUpdate, "You shot a bullet!");

_playroomKit.RpcRegister("ShootBullet", HandleScoreUpdate, "You shot a bullet!");
}

/// <summary>
Expand Down Expand Up @@ -101,7 +102,7 @@ private void Update()
{
if (playerJoined)
{
var myPlayer = PlayroomKit.MyPlayer();
var myPlayer = _playroomKit.MyPlayer();
var index = players.IndexOf(myPlayer);

playerGameObjects[index].GetComponent<PlayerController2d>().Move();
Expand All @@ -116,6 +117,9 @@ private void Update()
if (players[i] != null)
{
var pos = players[i].GetState<Vector3>("pos");

Debug.Log(pos);

var color = players[i].GetState<Color>("color");
if (playerGameObjects != null)
{
Expand All @@ -141,7 +145,7 @@ private void ShootBullet(int playerIndex)

score = playerGameObjects[playerIndex].GetComponent<PlayerController2d>().ShootBullet(playerPosition, 50f, score);

PlayroomKit.RpcCall("ShootBullet", score, PlayroomKit.RpcMode.OTHERS, () =>
_playroomKit.RpcCall("ShootBullet", score, PlayroomKit.RpcMode.ALL, () =>
{
Debug.Log("Shooting bullet");
});
Expand Down
Loading
Loading