Skip to content

Commit

Permalink
Merge pull request #19 from nhnent/develop
Browse files Browse the repository at this point in the history
v1.1.2 Release Candidate
  • Loading branch information
smallmiro committed Aug 11, 2017
2 parents b1fe8a1 + 956d368 commit 1be12d3
Show file tree
Hide file tree
Showing 34 changed files with 26 additions and 26 deletions.
Binary file modified Assets/LINQtoGameObject/Examples/SampleScene.unity
Binary file not shown.
8 changes: 4 additions & 4 deletions Assets/Plugins/socket.io/Decoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ public static class Decoder {
if (data[readPos] == ',')
++readPos;

if (data[readPos] != '[')
int.TryParse(ReadChunk(ref data, ref readPos), out pkt.id);

if (readPos == data.Length)
return pkt;

if (data[readPos] != '[')
int.TryParse(ReadChunk(ref data, ref readPos), out pkt.id);

pkt.body = data.Substring(readPos);
return pkt;
}
catch (Exception e) {
throw;
throw e;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Assets/Plugins/socket.io/Encoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static class Encoder {
return builder.ToString();
}
catch (Exception e) {
throw;
throw e;
}
}

Expand Down
16 changes: 8 additions & 8 deletions Assets/Plugins/socket.io/SocketInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Collections.Generic;
using System.Text.RegularExpressions;


namespace socket.io {

/// <summary>
Expand Down Expand Up @@ -76,7 +75,7 @@ public class SocketInitializer : MonoBehaviour {
/// <param name="url"> WWW URL of a server </param>
/// <param name="socket"> a socket which will be connected </param>
/// <returns></returns>
public IObservable<Socket> InitAsObservable(Socket socket, bool reconnection, int reconnectionAttempts) {
public UniRx.IObservable<Socket> InitAsObservable(Socket socket, bool reconnection, int reconnectionAttempts) {
Socket = socket;
Reconnection = reconnection;
ReconnectionAttempts = reconnectionAttempts;
Expand All @@ -91,15 +90,15 @@ public class SocketInitializer : MonoBehaviour {
if (Reconnection && Socket.OnReconnecting != null)
Socket.OnReconnecting(ReconnectionAttempts);

return Observable.FromCoroutine<Socket>((observer, cancelToken) =>
return UniRx.Observable.FromCoroutine<Socket>((observer, cancelToken) =>
InitCore(observer, cancelToken));
}

/// <summary>
/// The json object to parse the response of PollingURL
/// </summary>
[Serializable]
class PollingUrlAnswer {
struct PollingUrlAnswer {
public string sid;
public int pingInterval;
public int pingTimeout;
Expand All @@ -111,7 +110,7 @@ class PollingUrlAnswer {
/// <param name="observer"> The return value of InitAsObservable() method </param>
/// <param name="cancelToken"> The cancel token object which signals to stop the currnet coroutine </param>
/// <returns></returns>
IEnumerator InitCore(IObserver<Socket> observer, CancellationToken cancelToken) {
IEnumerator InitCore(UniRx.IObserver<Socket> observer, UniRx.CancellationToken cancelToken) {
// Declare to connect in socket.io v1.0
_urlQueries.Add("EIO", "3");
_urlQueries.Add("transport", "polling");
Expand All @@ -121,14 +120,15 @@ class PollingUrlAnswer {
var webSocketTrigger = SocketManager.Instance.GetWebSocketTrigger(BaseUrl);
if (webSocketTrigger == null || !webSocketTrigger.IsConnected) {
var www = new WWW(PollingUrl);
while (!www.isDone && !cancelToken.IsCancellationRequested)

while (!www.isDone && !cancelToken.IsCancellationRequested )
yield return null;

if (cancelToken.IsCancellationRequested)
yield break;

if (www.error != null) {
observer.OnError(new WWWErrorException(www, www.text));
if (!string.IsNullOrEmpty(www.error)) {
observer.OnError(new Exception(www.error));
yield break;
}

Expand Down
6 changes: 3 additions & 3 deletions Assets/Plugins/socket.io/SocketManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class SocketManager : MonoSingleton<SocketManager> {
public int ReconnectionDelay { get; set; }

public void Connect(Socket socket) {
_connectRequests.Add(Tuple.Create(socket, false, 0, DateTime.Now));
_connectRequests.Add(UniRx.Tuple.Create(socket, false, 0, DateTime.Now));
}

/// <summary>
Expand All @@ -48,7 +48,7 @@ public class SocketManager : MonoSingleton<SocketManager> {
if (_connectRequests.Any(r => r.Item1 == socket))
return;

_connectRequests.Add(Tuple.Create(socket, true, reconnectionAttempts, DateTime.Now.AddMilliseconds(ReconnectionDelay)));
_connectRequests.Add(UniRx.Tuple.Create(socket, true, reconnectionAttempts, DateTime.Now.AddMilliseconds(ReconnectionDelay)));

if (socket.OnReconnectAttempt != null)
socket.OnReconnectAttempt();
Expand All @@ -71,7 +71,7 @@ public class SocketManager : MonoSingleton<SocketManager> {
/// The pended requests to connect a server
/// (Item1: Url, Item2: Reconnection, Item3: ReconnectionAttempts, Item4: Socket ref, Item5: TimeStamp)
/// </summary>
readonly List<Tuple<Socket, bool, int, DateTime>> _connectRequests = new List<Tuple<Socket, bool, int, DateTime>>();
readonly List<UniRx.Tuple<Socket, bool, int, DateTime>> _connectRequests = new List<UniRx.Tuple<Socket, bool, int, DateTime>>();

/// <summary>
/// WebSocketTrigger instances (WebSocketTrigger is almost same with a session object)
Expand Down
2 changes: 1 addition & 1 deletion Assets/Plugins/socket.io/WebSocketTrigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class WebSocketTrigger : ObservableTriggerBase {
/// Observes received packets and also starts Ping-Pong routine
/// </summary>
/// <returns></returns>
public IObservable<string> OnRecvAsObservable() {
public UniRx.IObservable<string> OnRecvAsObservable() {
if (_cancelPingPong == null) {
_cancelPingPong = gameObject.UpdateAsObservable()
.Sample(TimeSpan.FromSeconds(10f))
Expand Down
Binary file modified Assets/__Sample/Client/Acks.unity
Binary file not shown.
Binary file modified Assets/__Sample/Client/Connect.unity
Binary file not shown.
Binary file modified Assets/__Sample/Client/Events.unity
Binary file not shown.
Binary file modified Assets/__Sample/Client/Namespace.unity
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/__Sample/Client/Src/Acks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Sample {
public class Acks : MonoBehaviour {

void Start() {
var serverUrl = "http://localhost:4444";
var serverUrl = "http://localhost:7001";
var socket = Socket.Connect(serverUrl);

socket.On(SystemEvents.connect, () => {
Expand Down
2 changes: 1 addition & 1 deletion Assets/__Sample/Client/Src/Connect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Sample {
public class Connect : MonoBehaviour {

void Start() {
var serverUrl = "http://localhost:4444";
var serverUrl = "http://localhost:7001";
var socket = Socket.Connect(serverUrl);

socket.On(SystemEvents.connect, () => {
Expand Down
2 changes: 1 addition & 1 deletion Assets/__Sample/Client/Src/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Sample {
public class Events : MonoBehaviour {

void Start() {
var serverUrl = "http://localhost:4444";
var serverUrl = "http://localhost:7001";
var socket = Socket.Connect(serverUrl);

// receive "news" event
Expand Down
2 changes: 1 addition & 1 deletion Assets/__Sample/Client/Src/Namespace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Sample {
public class Namespace : MonoBehaviour {

void Start() {
var serverUrl = "http://localhost:4444";
var serverUrl = "http://localhost:7001";

// news namespace
var news = Socket.Connect(serverUrl + "/news");
Expand Down
2 changes: 1 addition & 1 deletion Assets/__Sample/Server~/acks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var app = require('http').createServer(handler)
var fs = require('fs');

app.listen(4444);
app.listen(7001);

function handler (req, res) {
fs.readFile(__dirname + '/index.html',
Expand Down
2 changes: 1 addition & 1 deletion Assets/__Sample/Server~/connection.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var app = require('http').createServer(handler)
var fs = require('fs');

app.listen(4444);
app.listen(7001);

function handler (req, res) {
fs.readFile(__dirname + '/index.html',
Expand Down
2 changes: 1 addition & 1 deletion Assets/__Sample/Server~/events.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var app = require('http').createServer(handler)
var fs = require('fs');

app.listen(4444);
app.listen(7001);

function handler (req, res) {
fs.readFile(__dirname + '/index.html',
Expand Down
2 changes: 1 addition & 1 deletion Assets/__Sample/Server~/namespace.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var app = require('http').createServer(handler)
var fs = require('fs');

app.listen(4444);
app.listen(7001);

function handler (req, res) {
fs.readFile(__dirname + '/index.html',
Expand Down
Binary file modified ProjectSettings/AudioManager.asset
Binary file not shown.
Binary file modified ProjectSettings/ClusterInputManager.asset
Binary file not shown.
Binary file modified ProjectSettings/DynamicsManager.asset
Binary file not shown.
Binary file modified ProjectSettings/EditorBuildSettings.asset
Binary file not shown.
Binary file modified ProjectSettings/EditorSettings.asset
Binary file not shown.
Binary file modified ProjectSettings/GraphicsSettings.asset
Binary file not shown.
Binary file modified ProjectSettings/InputManager.asset
Binary file not shown.
Binary file modified ProjectSettings/NavMeshAreas.asset
Binary file not shown.
Binary file modified ProjectSettings/NetworkManager.asset
Binary file not shown.
Binary file modified ProjectSettings/Physics2DSettings.asset
Binary file not shown.
Binary file modified ProjectSettings/ProjectSettings.asset
Binary file not shown.
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
m_EditorVersion: 5.6.1p2
m_EditorVersion: 2017.1.0f3
Binary file modified ProjectSettings/QualitySettings.asset
Binary file not shown.
Binary file modified ProjectSettings/TagManager.asset
Binary file not shown.
Binary file modified ProjectSettings/TimeManager.asset
Binary file not shown.
Binary file modified ProjectSettings/UnityConnectSettings.asset
Binary file not shown.

0 comments on commit 1be12d3

Please sign in to comment.