Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit eaf4ad8

Browse files
committed
Upgrade bindings to 1.0.0 and make helper code check versions
1 parent e35d921 commit eaf4ad8

File tree

7 files changed

+21
-15
lines changed

7 files changed

+21
-15
lines changed

browser/chrome/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "netcode.io support",
4-
"version": "0.1.2",
4+
"version": "0.1.3",
55
"description": "Provides netcode.io APIs to websites in Chrome",
66
"content_scripts": [
77
{

browser/chrome/netcode.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,13 @@ window.netcode = {
124124
var messageId = _createMessage(function(type, args) {
125125
window.clearTimeout(handle);
126126
if (type == _resultSuccess) {
127-
callback(null, true);
127+
if (args.length >= 1 && args[0] == '0.1.0') {
128+
callback(null, true);
129+
} else {
130+
// Mismatched version, treat as missing so users are
131+
// prompted to install it again.
132+
callback(null, false);
133+
}
128134
} else {
129135
callback(new Error(args[0]), null);
130136
}

netcode.io.demoserver/netcode.io.demoserver.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
</PropertyGroup>
3636
<ItemGroup>
3737
<Reference Include="netcode.io-csharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\netcode.io.0.1.5\lib\net45\netcode.io-csharp.dll</HintPath>
38+
<HintPath>..\packages\netcode.io.1.0.0\lib\net45\netcode.io-csharp.dll</HintPath>
3939
</Reference>
4040
<Reference Include="netcodeBinding, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41-
<HintPath>..\packages\netcode.io.0.1.5\lib\net45\netcodeBinding.dll</HintPath>
41+
<HintPath>..\packages\netcode.io.1.0.0\lib\net45\netcodeBinding.dll</HintPath>
4242
</Reference>
4343
<Reference Include="System" />
4444
<Reference Include="System.Core" />
@@ -64,11 +64,11 @@
6464
</Content>
6565
</ItemGroup>
6666
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
67-
<Import Project="..\packages\netcode.io.0.1.5\build\netcode.io.targets" Condition="Exists('..\packages\netcode.io.0.1.5\build\netcode.io.targets')" />
67+
<Import Project="..\packages\netcode.io.1.0.0\build\netcode.io.targets" Condition="Exists('..\packages\netcode.io.1.0.0\build\netcode.io.targets')" />
6868
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
6969
<PropertyGroup>
7070
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
7171
</PropertyGroup>
72-
<Error Condition="!Exists('..\packages\netcode.io.0.1.5\build\netcode.io.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\netcode.io.0.1.5\build\netcode.io.targets'))" />
72+
<Error Condition="!Exists('..\packages\netcode.io.1.0.0\build\netcode.io.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\netcode.io.1.0.0\build\netcode.io.targets'))" />
7373
</Target>
7474
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="netcode.io" version="0.1.5" targetFramework="net452" />
3+
<package id="netcode.io" version="1.0.0" targetFramework="net452" />
44
</packages>

netcode.io.host/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
using System;
44
using System.Collections.Concurrent;
55
using System.Collections.Generic;
6-
using System.Diagnostics;
76
using System.IO;
8-
using System.Linq;
97
using System.Text;
108
using System.Threading;
11-
using System.Threading.Tasks;
129

1310
namespace netcode.io.host
1411
{
@@ -19,6 +16,8 @@ class Program
1916
static BinaryWriter _outWriter;
2017
static object _writerLock;
2118

19+
const string HelperVersion = "0.1.0";
20+
2221
class ManagedClient
2322
{
2423
public Client client;
@@ -103,6 +102,7 @@ static void Main(string[] args)
103102
{
104103
JValue.FromObject(ResultSuccess),
105104
JValue.FromObject(messageId),
105+
JValue.FromObject(HelperVersion),
106106
});
107107
break;
108108
}

netcode.io.host/netcode.io.host.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
</PropertyGroup>
3636
<ItemGroup>
3737
<Reference Include="netcode.io-csharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\netcode.io.0.1.5\lib\net45\netcode.io-csharp.dll</HintPath>
38+
<HintPath>..\packages\netcode.io.1.0.0\lib\net45\netcode.io-csharp.dll</HintPath>
3939
</Reference>
4040
<Reference Include="netcodeBinding, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41-
<HintPath>..\packages\netcode.io.0.1.5\lib\net45\netcodeBinding.dll</HintPath>
41+
<HintPath>..\packages\netcode.io.1.0.0\lib\net45\netcodeBinding.dll</HintPath>
4242
</Reference>
4343
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
4444
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
@@ -61,11 +61,11 @@
6161
<None Include="packages.config" />
6262
</ItemGroup>
6363
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
64-
<Import Project="..\packages\netcode.io.0.1.5\build\netcode.io.targets" Condition="Exists('..\packages\netcode.io.0.1.5\build\netcode.io.targets')" />
64+
<Import Project="..\packages\netcode.io.1.0.0\build\netcode.io.targets" Condition="Exists('..\packages\netcode.io.1.0.0\build\netcode.io.targets')" />
6565
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
6666
<PropertyGroup>
6767
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
6868
</PropertyGroup>
69-
<Error Condition="!Exists('..\packages\netcode.io.0.1.5\build\netcode.io.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\netcode.io.0.1.5\build\netcode.io.targets'))" />
69+
<Error Condition="!Exists('..\packages\netcode.io.1.0.0\build\netcode.io.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\netcode.io.1.0.0\build\netcode.io.targets'))" />
7070
</Target>
7171
</Project>

netcode.io.host/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="netcode.io" version="0.1.5" targetFramework="net452" />
3+
<package id="netcode.io" version="1.0.0" targetFramework="net452" />
44
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
55
</packages>

0 commit comments

Comments
 (0)