Skip to content

Commit

Permalink
Updated to v0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-weiland committed Nov 26, 2021
1 parent f9a0b33 commit c6cee4b
Show file tree
Hide file tree
Showing 26 changed files with 1,242 additions and 817 deletions.
Binary file modified Demos/Unity/Client/Assets/Scripts/Multiplayer/RiptideNetworking.dll
Binary file not shown.
345 changes: 209 additions & 136 deletions Demos/Unity/Client/Assets/Scripts/Multiplayer/RiptideNetworking.xml

Large diffs are not rendered by default.

Binary file modified Demos/Unity/Server/Assets/Scripts/Multiplayer/RiptideNetworking.dll
Binary file not shown.
345 changes: 209 additions & 136 deletions Demos/Unity/Server/Assets/Scripts/Multiplayer/RiptideNetworking.xml

Large diffs are not rendered by default.

94 changes: 54 additions & 40 deletions Demos/Unity/Server/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 20
serializedVersion: 22
productGUID: d0227a9962d1a524fb6ebd95aee32f5e
AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0
Expand Down Expand Up @@ -49,6 +49,8 @@ PlayerSettings:
m_StereoRenderingPath: 0
m_ActiveColorSpace: 1
m_MTRendering: 1
mipStripping: 0
numberOfMipsStripped: 0
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1
Expand Down Expand Up @@ -117,6 +119,7 @@ PlayerSettings:
stadiaTargetFramerate: 0
vulkanNumSwapchainBuffers: 3
vulkanEnableSetSRGBWrite: 0
vulkanEnablePreTransform: 0
vulkanEnableLateAcquireNextImage: 0
m_SupportedAspectRatios:
4:3: 1
Expand All @@ -132,31 +135,6 @@ PlayerSettings:
xboxOneDisableKinectGpuReservation: 1
xboxOneEnable7thCore: 1
vrSettings:
cardboard:
depthFormat: 0
enableTransitionView: 0
daydream:
depthFormat: 0
useSustainedPerformanceMode: 0
enableVideoLayer: 0
useProtectedVideoMemory: 0
minimumSupportedHeadTracking: 0
maximumSupportedHeadTracking: 1
hololens:
depthFormat: 1
depthBufferSharingEnabled: 1
lumin:
depthFormat: 0
frameTiming: 2
enableGLCache: 0
glCacheMaxBlobSize: 524288
glCacheMaxFileSize: 8388608
oculus:
sharedDepthBuffer: 1
dashSupport: 1
lowOverheadMode: 0
protectedContext: 0
v2Signing: 1
enable360StereoCapture: 0
isWsaHolographicRemotingEnabled: 0
enableFrameTimingStats: 0
Expand All @@ -167,8 +145,13 @@ PlayerSettings:
resolutionScalingMode: 0
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier: {}
buildNumber: {}
applicationIdentifier:
Standalone: com.DefaultCompany.Server
buildNumber:
Standalone: 0
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 0
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 19
AndroidTargetSdkVersion: 0
Expand All @@ -185,10 +168,10 @@ PlayerSettings:
StripUnusedMeshComponents: 0
VertexChannelCompressionMask: 4054
iPhoneSdkVersion: 988
iOSTargetOSVersionString: 10.0
iOSTargetOSVersionString: 11.0
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 10.0
tvOSTargetOSVersionString: 11.0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
Expand Down Expand Up @@ -222,15 +205,16 @@ PlayerSettings:
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSUseLaunchScreenStoryboard: 0
iOSLaunchScreenCustomStoryboardPath:
iOSLaunchScreeniPadCustomStoryboardPath:
iOSDeviceRequirements: []
iOSURLSchemes: []
iOSBackgroundModes: 0
iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID:
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
Expand All @@ -240,9 +224,17 @@ PlayerSettings:
iOSRequireARKit: 0
iOSAutomaticallyDetectAndAddCapabilities: 1
appleEnableProMotion: 0
shaderPrecisionModel: 0
clonedFromGUID: 9870af204204ab84596f8a656f2f2ce6
templatePackageId: com.unity.template.universal@7.3.1
templateDefaultScene: Assets/Scenes/SampleScene.unity
useCustomMainManifest: 0
useCustomLauncherManifest: 0
useCustomMainGradleTemplate: 0
useCustomLauncherGradleManifest: 0
useCustomBaseGradleTemplate: 0
useCustomGradlePropertiesTemplate: 0
useCustomProguardFile: 0
AndroidTargetArchitectures: 1
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
Expand All @@ -260,6 +252,9 @@ PlayerSettings:
height: 180
banner: {fileID: 0}
androidGamepadSupportLevel: 0
AndroidMinifyWithR8: 0
AndroidMinifyRelease: 0
AndroidMinifyDebug: 0
AndroidValidateAppBundleSize: 1
AndroidAppBundleSizeToValidate: 100
m_BuildTargetIcons: []
Expand Down Expand Up @@ -315,10 +310,10 @@ PlayerSettings:
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: iOSSupport
m_APIs: 10000000
m_Automatic: 0
m_Automatic: 1
- m_BuildTarget: AppleTVSupport
m_APIs: 10000000
m_Automatic: 0
m_Automatic: 1
- m_BuildTarget: AndroidPlayer
m_APIs: 150000000b000000
m_Automatic: 0
Expand All @@ -338,6 +333,7 @@ PlayerSettings:
- m_BuildTarget: Standalone
m_EncodingQuality: 1
m_BuildTargetGroupLightmapSettings: []
m_BuildTargetNormalMapEncoding: []
playModeTestRunnerEnabled: 0
runPlayModeTestAsEditModeTest: 0
actionOnDotNetUnhandledException: 1
Expand All @@ -347,12 +343,14 @@ PlayerSettings:
cameraUsageDescription:
locationUsageDescription:
microphoneUsageDescription:
switchNMETAOverride:
switchNetLibKey:
switchSocketMemoryPoolSize: 6144
switchSocketAllocatorPoolSize: 128
switchSocketConcurrencyLimit: 14
switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0
switchUseGOLDLinker: 0
switchApplicationID: 0x01004b9000490000
switchNSODependencies:
switchTitleNames_0:
Expand All @@ -370,6 +368,7 @@ PlayerSettings:
switchTitleNames_12:
switchTitleNames_13:
switchTitleNames_14:
switchTitleNames_15:
switchPublisherNames_0:
switchPublisherNames_1:
switchPublisherNames_2:
Expand All @@ -385,6 +384,7 @@ PlayerSettings:
switchPublisherNames_12:
switchPublisherNames_13:
switchPublisherNames_14:
switchPublisherNames_15:
switchIcons_0: {fileID: 0}
switchIcons_1: {fileID: 0}
switchIcons_2: {fileID: 0}
Expand All @@ -400,6 +400,7 @@ PlayerSettings:
switchIcons_12: {fileID: 0}
switchIcons_13: {fileID: 0}
switchIcons_14: {fileID: 0}
switchIcons_15: {fileID: 0}
switchSmallIcons_0: {fileID: 0}
switchSmallIcons_1: {fileID: 0}
switchSmallIcons_2: {fileID: 0}
Expand All @@ -415,6 +416,7 @@ PlayerSettings:
switchSmallIcons_12: {fileID: 0}
switchSmallIcons_13: {fileID: 0}
switchSmallIcons_14: {fileID: 0}
switchSmallIcons_15: {fileID: 0}
switchManualHTML:
switchAccessibleURLs:
switchLegalInformation:
Expand Down Expand Up @@ -477,6 +479,9 @@ PlayerSettings:
switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1
switchPlayerConnectionEnabled: 1
switchUseNewStyleFilepaths: 0
switchUseMicroSleepForYield: 1
switchMicroSleepForYieldTime: 25
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:
Expand All @@ -503,6 +508,7 @@ PlayerSettings:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4ExtraSceSysFile:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
Expand Down Expand Up @@ -545,6 +551,8 @@ PlayerSettings:
ps4disableAutoHideSplash: 0
ps4videoRecordingFeaturesUsed: 0
ps4contentSearchFeaturesUsed: 0
ps4CompatibilityPS5: 0
ps4GPU800MHz: 1
ps4attribEyeToEyeDistanceSettingVR: 0
ps4IncludedModules:
- libc.prx
Expand Down Expand Up @@ -575,20 +583,27 @@ PlayerSettings:
webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0
webGLCompressionFormat: 1
webGLWasmArithmeticExceptions: 0
webGLLinkerTarget: 1
webGLThreadsSupport: 0
webGLWasmStreaming: 0
webGLDecompressionFallback: 0
scriptingDefineSymbols: {}
additionalCompilerArguments: {}
platformArchitecture: {}
scriptingBackend:
Standalone: 0
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}
suppressCommonWarnings: 1
allowUnsafeCode: 0
useDeterministicCompilation: 1
useReferenceAssemblies: 1
enableRoslynAnalyzers: 1
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
gcIncremental: 0
assemblyVersionValidation: 1
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform:
Standalone: 3
Expand Down Expand Up @@ -640,6 +655,7 @@ PlayerSettings:
XboxOneCapability: []
XboxOneGameRating: {}
XboxOneIsContentPackage: 0
XboxOneEnhancedXboxCompatibilityMode: 0
XboxOneEnableGPUVariability: 1
XboxOneSockets: {}
XboxOneSplashScreen: {fileID: 0}
Expand All @@ -648,10 +664,7 @@ PlayerSettings:
XboxOneXTitleMemory: 8
XboxOneOverrideIdentityName:
XboxOneOverrideIdentityPublisher:
vrEditorSettings:
daydream:
daydreamIconForeground: {fileID: 0}
daydreamIconBackground: {fileID: 0}
vrEditorSettings: {}
cloudServicesEnabled:
UNet: 1
luminIcon:
Expand All @@ -666,11 +679,12 @@ PlayerSettings:
m_VersionCode: 1
m_VersionName:
apiCompatibilityLevel: 6
activeInputHandler: 0
cloudProjectId:
framebufferDepthMemorylessMode: 0
qualitySettingsNames: []
projectName:
organizationId:
cloudEnabled: 0
enableNativePlatformBackendsForNewInputSystem: 0
disableOldInputManagerSupport: 0
legacyClampBlendShapeWeights: 0
virtualTexturingSupportEnabled: 0
26 changes: 22 additions & 4 deletions UnityPackage/Runtime/Client.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using RiptideNetworking.Transports;

// This file is provided under The MIT License as part of RiptideNetworking.
// Copyright (c) 2021 Tom Weiland
// For additional information please see the included LICENSE.md file or view it on GitHub: https://github.com/tom-weiland/RiptideNetworking/blob/main/LICENSE.md

using RiptideNetworking.Transports;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -53,6 +58,13 @@ public override bool ShouldOutputInfoLogs
/// <param name="client">The underlying client that is used for sending and receiving data.</param>
public Client(IClient client) => this.client = client;

/// <summary>Handles initial setup using the built-in RUDP transport.</summary>
/// <param name="timeoutTime">The time (in milliseconds) after which to disconnect if there's no heartbeat from the server.</param>
/// <param name="heartbeatInterval">The interval (in milliseconds) at which heartbeats should be sent to the server.</param>
/// <param name="maxConnectionAttempts">How many connection attempts to make before giving up.</param>
/// <param name="logName">The name to use when logging messages via <see cref="RiptideLogger"/>.</param>
public Client(ushort timeoutTime = 5000, ushort heartbeatInterval = 1000, byte maxConnectionAttempts = 5, string logName = "CLIENT") => client = new Transports.RudpTransport.RudpClient(timeoutTime, heartbeatInterval, maxConnectionAttempts, logName);

/// <summary>Attempts connect to the given host address.</summary>
/// <param name="hostAddress">The host address to connect to.</param>
/// <param name="messageHandlerGroupId">The ID of the group of message handler methods to use when building <see cref="messageHandlers"/>.</param>
Expand All @@ -62,6 +74,9 @@ public override bool ShouldOutputInfoLogs
/// </remarks>
public void Connect(string hostAddress, byte messageHandlerGroupId = 0)
{
if (IsConnecting || IsConnected)
Disconnect();

CreateMessageHandlersDictionary(Assembly.GetCallingAssembly(), messageHandlerGroupId);

client.Connected += Connected;
Expand All @@ -77,7 +92,7 @@ public void Connect(string hostAddress, byte messageHandlerGroupId = 0)
protected override void CreateMessageHandlersDictionary(Assembly assembly, byte messageHandlerGroupId)
{
MethodInfo[] methods = assembly.GetTypes()
.SelectMany(t => t.GetMethods())
.SelectMany(t => t.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static))
.Where(m => m.GetCustomAttributes(typeof(MessageHandlerAttribute), false).Length > 0)
.ToArray();

Expand Down Expand Up @@ -116,12 +131,15 @@ protected override void CreateMessageHandlersDictionary(Assembly assembly, byte
/// <inheritdoc/>
public override void Tick() => client.Tick();

/// <inheritdoc cref="IClient.Send(Message, byte, bool)"/>
public void Send(Message message, byte maxSendAttempts = 15, bool shouldRelease = true) => client.Send(message, maxSendAttempts, shouldRelease);
/// <inheritdoc cref="IClient.Send(Message, bool)"/>
public void Send(Message message, bool shouldRelease = true) => client.Send(message, shouldRelease);

/// <summary>Disconnects from the server.</summary>
public void Disconnect()
{
if (IsNotConnected)
return;

client.Disconnect();
LocalDisconnect();
}
Expand Down
7 changes: 6 additions & 1 deletion UnityPackage/Runtime/Common.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using RiptideNetworking.Transports;

// This file is provided under The MIT License as part of RiptideNetworking.
// Copyright (c) 2021 Tom Weiland
// For additional information please see the included LICENSE.md file or view it on GitHub: https://github.com/tom-weiland/RiptideNetworking/blob/main/LICENSE.md

using RiptideNetworking.Transports;
using System.Reflection;

namespace RiptideNetworking
Expand Down
7 changes: 6 additions & 1 deletion UnityPackage/Runtime/EventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using RiptideNetworking.Transports;

// This file is provided under The MIT License as part of RiptideNetworking.
// Copyright (c) 2021 Tom Weiland
// For additional information please see the included LICENSE.md file or view it on GitHub: https://github.com/tom-weiland/RiptideNetworking/blob/main/LICENSE.md

using RiptideNetworking.Transports;
using System;

namespace RiptideNetworking
Expand Down
Loading

0 comments on commit c6cee4b

Please sign in to comment.