This repository has been archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
3,731 additions
and
786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Download [Photon Server SDK] https://www.photonengine.com/en-US/OnPremise/Download | ||
Add and reference following dlls. | ||
|
||
lib/ExitGamesLibs.dll | ||
lib/Photon3DotNet.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<solution> | ||
<add key="disableSourceControlIntegration" value="true" /> | ||
</solution> | ||
</configuration> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir> | ||
|
||
<!-- Enable the restore command to run before builds --> | ||
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages> | ||
|
||
<!-- Property that enables building a package from a project --> | ||
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage> | ||
|
||
<!-- Determines if package restore consent is required to restore packages --> | ||
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent> | ||
|
||
<!-- Download NuGet.exe if it does not already exist --> | ||
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition=" '$(PackageSources)' == '' "> | ||
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used --> | ||
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list --> | ||
<!-- | ||
<PackageSource Include="https://www.nuget.org/api/v2/" /> | ||
<PackageSource Include="https://my-nuget-source/nuget/" /> | ||
--> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'"> | ||
<!-- Windows specific commands --> | ||
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'"> | ||
<!-- We need to launch nuget.exe with the mono command if we're not on windows --> | ||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig> | ||
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig> | ||
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<!-- NuGet command --> | ||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath> | ||
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources> | ||
|
||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand> | ||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand> | ||
|
||
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir> | ||
|
||
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch> | ||
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch> | ||
|
||
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir> | ||
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir> | ||
|
||
<!-- Commands --> | ||
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand> | ||
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand> | ||
|
||
<!-- We need to ensure packages are restored prior to assembly resolve --> | ||
<BuildDependsOn Condition="$(RestorePackages) == 'true'"> | ||
RestorePackages; | ||
$(BuildDependsOn); | ||
</BuildDependsOn> | ||
|
||
<!-- Make the build depend on restore packages --> | ||
<BuildDependsOn Condition="$(BuildPackage) == 'true'"> | ||
$(BuildDependsOn); | ||
BuildPackage; | ||
</BuildDependsOn> | ||
</PropertyGroup> | ||
|
||
<Target Name="CheckPrerequisites"> | ||
<!-- Raise an error if we're unable to locate nuget.exe --> | ||
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" /> | ||
<!-- | ||
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once. | ||
This effectively acts as a lock that makes sure that the download operation will only happen once and all | ||
parallel builds will have to wait for it to complete. | ||
--> | ||
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" /> | ||
</Target> | ||
|
||
<Target Name="_DownloadNuGet"> | ||
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" /> | ||
</Target> | ||
|
||
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites"> | ||
<Exec Command="$(RestoreCommand)" | ||
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" /> | ||
|
||
<Exec Command="$(RestoreCommand)" | ||
LogStandardErrorAsError="true" | ||
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" /> | ||
</Target> | ||
|
||
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites"> | ||
<Exec Command="$(BuildCommand)" | ||
Condition=" '$(OS)' != 'Windows_NT' " /> | ||
|
||
<Exec Command="$(BuildCommand)" | ||
LogStandardErrorAsError="true" | ||
Condition=" '$(OS)' == 'Windows_NT' " /> | ||
</Target> | ||
|
||
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> | ||
<ParameterGroup> | ||
<OutputFilename ParameterType="System.String" Required="true" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Reference Include="System.Core" /> | ||
<Using Namespace="System" /> | ||
<Using Namespace="System.IO" /> | ||
<Using Namespace="System.Net" /> | ||
<Using Namespace="Microsoft.Build.Framework" /> | ||
<Using Namespace="Microsoft.Build.Utilities" /> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
try { | ||
OutputFilename = Path.GetFullPath(OutputFilename); | ||
Log.LogMessage("Downloading latest version of NuGet.exe..."); | ||
WebClient webClient = new WebClient(); | ||
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename); | ||
return true; | ||
} | ||
catch (Exception ex) { | ||
Log.LogErrorFromException(ex); | ||
return false; | ||
} | ||
]]> | ||
</Code> | ||
</Task> | ||
</UsingTask> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<metadata> | ||
<id>PhotonWire.Client</id> | ||
<version>1.0.2</version> | ||
<title>PhotonWire.Client</title> | ||
<authors>neuecc</authors> | ||
<owners>neuecc</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>Typed Asynchronous RPC Layer for Photon Server. This package is for .NET client implementation.</description> | ||
<releaseNotes> | ||
<![CDATA[ | ||
Initial Release. | ||
]]> | ||
</releaseNotes> | ||
<language>en-US</language> | ||
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl> | ||
<projectUrl>https://github.com/neuecc/PhotonWire</projectUrl> | ||
<tags>Photon MultiPlayer Distributed websockets streaming realtime unity</tags> | ||
<dependencies> | ||
<dependency id="MsgPack.Cli" version="0.6.5" /> | ||
<dependency id="Newtonsoft.Json" version="7.0.1" /> | ||
<dependency id="Rx-Main" version="2.2.5" /> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="..\Source\PhotonWire.Client\bin\Release\PhotonWire.Client.dll" target="lib" /> | ||
<file src="..\Source\PhotonWire.Client\bin\Release\PhotonWire.Client.xml" target="lib" /> | ||
<file src="Client_ReadMe.txt" target="readme.txt" /> | ||
<file src="..\Source\PhotonWire.UnityClient\Assets\Plugins\PhotonWire\PhotonWireProxy.tt" target="Content" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<metadata> | ||
<id>PhotonWire.Server</id> | ||
<version>1.0.2</version> | ||
<title>PhotonWire.Server</title> | ||
<authors>neuecc</authors> | ||
<owners>neuecc</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>Typed Asynchronous RPC Layer for Photon Server. This package is for realtime server implementation.</description> | ||
<releaseNotes> | ||
<![CDATA[ | ||
Initial Release. | ||
]]> | ||
</releaseNotes> | ||
<language>en-US</language> | ||
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl> | ||
<projectUrl>https://github.com/neuecc/PhotonWire</projectUrl> | ||
<tags>Photon MultiPlayer Distributed websockets streaming realtime unity</tags> | ||
<dependencies> | ||
<dependency id="MsgPack.Cli" version="0.6.5" /> | ||
<dependency id="Newtonsoft.Json" version="7.0.1" /> | ||
<dependency id="System.Collections.Immutable" version="1.1.37" /> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="..\Source\PhotonWire.Server\bin\Release\PhotonWire.Server.dll" target="lib" /> | ||
<file src="..\Source\PhotonWire.Server\bin\Release\PhotonWire.Server.xml" target="lib" /> | ||
<file src="Server_ReadMe.txt" target="readme.txt" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<metadata> | ||
<id>PhotonWire</id> | ||
<version>1.0.2</version> | ||
<title>PhotonWire</title> | ||
<authors>neuecc</authors> | ||
<owners>neuecc</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>Typed Asynchronous RPC Layer for Photon Server. This package includes Server libs + Analyzer + HubInvoker</description> | ||
<releaseNotes> | ||
<![CDATA[ | ||
Initial Release. | ||
]]> | ||
</releaseNotes> | ||
<language>en-US</language> | ||
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl> | ||
<projectUrl>https://github.com/neuecc/PhotonWire</projectUrl> | ||
<tags>Photon MultiPlayer Distributed websockets streaming realtime unity</tags> | ||
<dependencies> | ||
<dependency id="PhotonWire.Server" version="1.0.2" /> | ||
<dependency id="PhotonWire.Analyzer" version="1.0.2" /> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="..\Source\PhotonWire.HubInvoker\bin\Release\" target="tools\PhotonWire.HubInvoker" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
Package does not includes Photon SDK, | ||
please download from [Photon Server SDK] | ||
https://www.photonengine.com/en-US/OnPremise/Download | ||
Add and reference following dlls. | ||
|
||
lib/ExitGamesLibs.dll | ||
lib/Photon.SocketServer.dll | ||
lib/PhotonHostRuntimeInterfaces.dll | ||
|
||
And PhotonSocketServer.exe binary copy to $(SolutionDir)\PhotonLibs\bin_Win64 | ||
|
||
PhotonWire.HubInvoker is in packages\PhotonWire\tools\ | ||
|
||
--- | ||
|
||
1. Create Startup.cs | ||
|
||
``` | ||
using PhotonWire.Server; | ||
|
||
public class Startup : PhotonWireApplicationBase | ||
{ | ||
|
||
} | ||
``` | ||
|
||
2. Create Hub | ||
|
||
```csharp | ||
using PhotonWire.Server; | ||
|
||
[Hub(0)] | ||
public class MyFirstHub : Hub | ||
{ | ||
[Operation(0)] | ||
public int Sum(int x, int y) | ||
{ | ||
return x + y; | ||
} | ||
} | ||
``` | ||
|
||
3. Create PhotonServer.config (must be UTF-8 without BOM) | ||
|
||
```xml | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Configuration> | ||
<!-- Manual --> | ||
<!-- http://doc.photonengine.com/en/onpremise/current/reference/server-config-settings --> | ||
|
||
<!-- Instances --> | ||
<GettingStarted> | ||
<IOPool> | ||
<NumThreads>8</NumThreads> | ||
</IOPool> | ||
|
||
<!-- .NET 4.5~6's CLRVersion is v4.0 --> | ||
<Runtime | ||
Assembly="PhotonHostRuntime, Culture=neutral" | ||
Type="PhotonHostRuntime.PhotonDomainManager" | ||
CLRVersion="v4.0" | ||
UnhandledExceptionPolicy="Ignore"> | ||
</Runtime> | ||
|
||
<!-- Configuration of listeners --> | ||
<TCPListeners> | ||
<TCPListener | ||
IPAddress="127.0.0.1" | ||
Port="4530" | ||
ListenBacklog="1000" | ||
InactivityTimeout="60000"> | ||
</TCPListener> | ||
</TCPListeners> | ||
|
||
<!-- Applications --> | ||
<Applications Default="GettingStarted.Server" PassUnknownAppsToDefaultApp="true"> | ||
<Application | ||
Name="GettingStarted.Server" | ||
BaseDirectory="GettingStarted.Server" | ||
Assembly="GettingStarted.Server" | ||
Type="GettingStarted.Server.Startup" | ||
EnableShadowCopy="true" | ||
EnableAutoRestart="true" | ||
ForceAutoRestart="true" | ||
ApplicationRootDirectory="PhotonLibs"> | ||
</Application> | ||
</Applications> | ||
|
||
</GettingStarted> | ||
</Configuration> | ||
``` | ||
|
||
4. Setup VisualStudio debugging option | ||
|
||
// Start external program: | ||
/* Absolute Dir Paths */\PhotonLibs\bin_Win64\PhotonSocketServer.exe | ||
|
||
// Star Options, Command line arguments: | ||
/debug GettingStarted /config GettingStarted.Server\bin\PhotonServer.config | ||
|
||
// Star Options, Working directory: | ||
/* Absolute Path */\PhotonLibs\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
nuget pack PhotonWire.nuspec | ||
nuget pack PhotonWire.Server.nuspec | ||
nuget pack PhotonWire.Client.nuspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
nuget push PhotonWire.1.0.2.nupkg | ||
nuget push PhotonWire.Server.1.0.2.nupkg | ||
nuget push PhotonWire.Client.1.0.2.nupkg | ||
nuget push ..\Source\PhotonWire.Analyzer\bin\Release\PhotonWire.Analyzer.1.0.2.0.nupkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.