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

Feature/sdkcpp/remove rxcpp #4

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 43 additions & 4 deletions setup.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
rmdir output\cpp\Party
rmdir /s /q output\cpp\Analytics
mklink /J output\cpp\Analytics src\Stormancer.Plugins\Analytics\cpp

rmdir /s /q output\cpp\Epic
mklink /J output\cpp\Epic src\Stormancer.Plugins\Epic\cpp

rmdir /s /q output\cpp\Friends
mklink /J output\cpp\Friends src\Stormancer.Plugins\Friends\cpp

rmdir /s /q output\cpp\Galaxy
mklink /J output\cpp\Galaxy src\Stormancer.Plugins\Galaxy\cpp

rmdir /s /q output\cpp\GameFinder
mklink /J output\cpp\GameFinder src\Stormancer.Plugins\GameFinder\cpp

rmdir /s /q output\cpp\GameSession
mklink /J output\cpp\GameSession src\Stormancer.Plugins\GameSession\cpp

rmdir /s /q output\cpp\GameVersion
mklink /J output\cpp\GameVersion src\Stormancer.Plugins\GameVersion\cpp

rmdir /s /q output\cpp\Leaderboards
mklink /J output\cpp\Leaderboards src\Stormancer.Plugins\Leaderboards\cpp

rmdir /s /q output\cpp\Notification
mklink /J output\cpp\Notification src\Stormancer.Plugins\Notification\cpp

rmdir /s /q output\cpp\Party
mklink /J output\cpp\Party src\Stormancer.Plugins\Party\cpp

rmdir output\cpp\Steam
rmdir /s /q output\cpp\Profile
mklink /J output\cpp\Profile src\Stormancer.Plugins\Profile\cpp

rmdir /s /q output\cpp\Replication
mklink /J output\cpp\Replication src\Stormancer.Plugins\Replication\cpp

rmdir /s /q output\cpp\SocketApi
mklink /J output\cpp\SocketApi src\Stormancer.Plugins\SocketApi\cpp

rmdir /s /q output\cpp\Spectate
mklink /J output\cpp\Spectate src\Stormancer.Plugins\Spectate\cpp

rmdir /s /q output\cpp\Steam
mklink /J output\cpp\Steam src\Stormancer.Plugins\Steam\cpp

rmdir output\cpp\gamesession
mklink /J output\cpp\gamesession src\Stormancer.Plugins\GameSession\cpp
rmdir /s /q output\cpp\Users
mklink /J output\cpp\Users src\Stormancer.Plugins\Users\cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@
</ItemGroup>
<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Analytics" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(Pdbs)" DestinationFolder="$(ProjectDir)../../../../output/symbols" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Epic" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
</ItemGroup>
<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Friends" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,5 @@
<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(Pdbs)" DestinationFolder="$(ProjectDir)../../../../output/symbols/$(ConfigurationName)" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Galaxy" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/GameFinder" />
</Target>

</Project>
12 changes: 2 additions & 10 deletions src/Stormancer.Plugins/GameFinder/cpp/GameFinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,6 @@ namespace Stormancer

struct GameFinderContainer
{
~GameFinderContainer()
{
if (connectionStateChangedSubscription.is_subscribed())
{
connectionStateChangedSubscription.unsubscribe();
}
}

//Keep game finder scene alive
std::shared_ptr<Scene> scene;
std::shared_ptr<GameFinderService> service()
Expand All @@ -458,7 +450,7 @@ namespace Stormancer
Subscription gameFoundSubscription;
Subscription gameFinderStateUpdatedSubscription;
Subscription findGamefailedSubscription;
rxcpp::subscription connectionStateChangedSubscription;
Subscription connectionStateChangedSubscription;
};

class GameFinder_Impl : public std::enable_shared_from_this<GameFinder_Impl>, public GameFinderApi
Expand Down Expand Up @@ -615,7 +607,7 @@ namespace Stormancer
{
auto container = std::make_shared<GameFinderContainer>();
container->scene = task.get();
container->connectionStateChangedSubscription = container->scene->getConnectionStateChangedObservable().subscribe([wThat, gameFinderName](ConnectionState s)
container->connectionStateChangedSubscription = container->scene->subscribeConnectionStateChanged([wThat, gameFinderName](ConnectionState s)
{
if (auto that = wThat.lock())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@

<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />

</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
</ItemGroup>
<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />

<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/GameVersion" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@

<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Leaderboards" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@
</ItemGroup>
<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Notifications" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<Deterministic>true</Deterministic>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<Version>$(Version)-pre</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -39,8 +41,6 @@
<cpp Include="$(ProjectDir)../cpp/*" />
</ItemGroup>



<ItemGroup>
<None Include="docs\Readme.md" Pack="true" PackagePath="\" />
</ItemGroup>
Expand All @@ -57,7 +57,6 @@
</ItemGroup>
<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<!--<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Party" />-->

</Target>

</Project>
11 changes: 7 additions & 4 deletions src/Stormancer.Plugins/Party/cpp/Party.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,7 @@ namespace Stormancer
Event<PartySettings> UpdatedPartySettings;
Event<std::vector<std::string>> UpdatedInviteList;
Event<PartyGameFinderFailure> OnGameFinderFailed;
Subscription connectionStateChangedSubscription;

std::vector<PartyUserDto> members() const
{
Expand Down Expand Up @@ -2042,7 +2043,7 @@ namespace Stormancer
}
});

scene->getConnectionStateChangedObservable().subscribe([wThat](ConnectionState state) {
connectionStateChangedSubscription = scene->subscribeConnectionStateChanged([wThat](ConnectionState state) {
if (auto that = wThat.lock())
{
try
Expand All @@ -2054,6 +2055,8 @@ namespace Stormancer
else if (state == ConnectionState::Disconnected)
{
that->failInit(state.reason);
//Unsubscribe
that->connectionStateChangedSubscription = nullptr;
that->_gameFinder->disconnectFromGameFinder(that->_state.settings.gameFinderName)
.then([](pplx::task<void> t)
{
Expand Down Expand Up @@ -3279,7 +3282,7 @@ namespace Stormancer
else
{
return false;
}
}

}

Expand Down Expand Up @@ -4446,8 +4449,8 @@ namespace Stormancer
});
if (it != _invitationsNew.end())
{
_invitationsNew.erase(it);
}
_invitationsNew.erase(it);
}
}

pplx::task<void> joinPartyBySceneId(const std::string& sceneId, const std::vector<byte>& userData, const std::unordered_map<std::string, std::string>& userMetadata = {}, pplx::cancellation_token ct = pplx::cancellation_token::none()) override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@
<ProjectReference Include="..\..\Api\Stormancer.Server.Plugins.Api.S2SProxyGenerator\Stormancer.Server.Plugins.Api.S2SProxyGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\..\Users\Stormancer.Server.Plugins.Users\Stormancer.Server.Plugins.Users.csproj" />
</ItemGroup>

<ItemGroup>
<NugetPackages Include="$(TargetDir)../$(ProjectName).$(Version).nupkg; $(TargetDir)../$(ProjectName).$(Version).snupkg" />
<cpp Include="$(ProjectDir)../cpp/*" />
</ItemGroup>

<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />

<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Profile" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<Description>Provides server services required for object replication.</Description>
<Deterministic>true</Deterministic>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<Version>$(Version)-pre</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -28,6 +30,7 @@
<PropertyGroup>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
<None Include="../../../../res/stormancer_128x128.png" Pack="true" PackagePath="\icon.png" />
</ItemGroup>
Expand All @@ -41,9 +44,8 @@
<ProjectReference Include="..\..\Api\Stormancer.Server.Plugins.Api\Stormancer.Server.Plugins.Api.csproj" />
</ItemGroup>


<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Replication" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Description>Provides a API similar to sockets for P2P communication in a scene.</Description>
<Deterministic>true</Deterministic>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<Version>$(Version)-pre</Version>
</PropertyGroup>
Expand All @@ -21,7 +22,6 @@
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>


<ItemGroup>
<None Include="../../../../res/stormancer_128x128.png" Pack="true" PackagePath="\icon.png" />
</ItemGroup>
Expand All @@ -44,11 +44,8 @@
<ProjectReference Include="..\..\Api\Stormancer.Server.Plugins.Api\Stormancer.Server.Plugins.Api.csproj" />
</ItemGroup>


<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Socket" />
</Target>


</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<Description>Provides game data streaming APIs for replay or realtime spectate.</Description>
<Deterministic>true</Deterministic>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<Version>$(Version)-pre</Version>
</PropertyGroup>
Expand All @@ -22,7 +23,6 @@
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>


<ItemGroup>
<None Include="../../../../res/stormancer_128x128.png" Pack="true" PackagePath="\icon.png" />
</ItemGroup>
Expand All @@ -47,7 +47,6 @@

<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Spectate" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<Deterministic>true</Deterministic>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<Version>$(Version)-pre</Version>
</PropertyGroup>
Expand Down Expand Up @@ -52,7 +53,6 @@

<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<!--<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Steam" />-->
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
<Pdbs Include="$(TargetDir)*.pdb" />
</ItemGroup>


<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(Pdbs)" DestinationFolder="$(ProjectDir)../../../../output/symbols/$(ConfigurationName)" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
<Target Name="PostPack" AfterTargets="Pack">
<Copy SourceFiles="@(NugetPackages)" DestinationFolder="$(ProjectDir)../../../../output/packages" />
<Copy SourceFiles="@(Pdbs)" DestinationFolder="$(ProjectDir)../../../../output/symbols/$(ConfigurationName)" />
<Copy SourceFiles="@(cpp)" DestinationFolder="$(ProjectDir)../../../../output/cpp/Users" />
</Target>

</Project>
Loading