Skip to content

Commit

Permalink
Minor fix - changing json formatting to snake_case for the server_inf…
Browse files Browse the repository at this point in the history
…o object
  • Loading branch information
leonidumanskiy committed Jan 9, 2024
1 parent 7056ce7 commit 94d5c2c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/Fenrir.Multiplayer/Fenrir.Multiplayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Fenrir Multiplayer Library</Description>
<Version>1.0.17</Version>
<Version>1.0.18</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Fenrir.Multiplayer.LiteNet
using Newtonsoft.Json;

namespace Fenrir.Multiplayer.LiteNet
{
/// <summary>
/// Identifies data require to connect
Expand All @@ -9,11 +11,13 @@ class LiteNetProtocolConnectionData : IProtocolConnectionData
/// <summary>
/// Public port that client is supposed to use
/// </summary>
[JsonProperty("port")]
public ushort Port { get; set; }

/// <summary>
/// IPv6 Mode
/// </summary>
[JsonProperty("ipv6_enabled")]
public bool IPv6Enabled { get; set; }

/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion source/UnityPackage/Assets/Runtime/Network/ProtocolInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json.Converters;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System;

Expand All @@ -13,11 +14,13 @@ public class ProtocolInfo
/// <summary>
/// Type of the supported protocol
/// </summary>
[JsonProperty("protocol_type")]
public ProtocolType ProtocolType { get; set; }

/// <summary>
/// Protocol-specific connection data
/// </summary>
[JsonProperty("connection_data")]
public JObject ConnectionData { get; set; }

/// <summary>
Expand Down
7 changes: 6 additions & 1 deletion source/UnityPackage/Assets/Runtime/Network/ServerInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Fenrir.Multiplayer
using Newtonsoft.Json;

namespace Fenrir.Multiplayer
{
/// <summary>
/// Payload object that is being delivered via server info endpoint,
Expand All @@ -9,16 +11,19 @@ public class ServerInfo
/// <summary>
/// Public hostname of the server
/// </summary>
[JsonProperty("hostname")]
public string Hostname { get; set; }

/// <summary>
/// Unique ID of the server
/// </summary>
[JsonProperty("server_id")]
public string ServerId { get; set; }

/// <summary>
/// List of protocols supported by this server
/// </summary>
[JsonProperty("protocols")]
public ProtocolInfo[] Protocols { get; set; }
}
}
2 changes: 1 addition & 1 deletion source/UnityPackage/Assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Fenrir Multiplayer",
"description": "Library for building multiplayer games with using Fenrir Multiplayer Platform",
"license": "MIT",
"version": "1.0.17",
"version": "1.0.18",
"author": {
"name": "Fenrir",
"email": "[email protected]",
Expand Down

0 comments on commit 94d5c2c

Please sign in to comment.