Skip to content

Commit 2c7cd1c

Browse files
author
박찬영/게임기술팀/NK
committed
Merge branch 'develop'
2 parents e3d1c64 + 2267b51 commit 2c7cd1c

File tree

14 files changed

+39
-13
lines changed

14 files changed

+39
-13
lines changed

Assets/Plugins/socket.io/Decoder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public static Packet Decode(this string data) {
3030

3131
if (data[readPos] == '/')
3232
pkt.nsp = ReadChunk(ref data, ref readPos);
33+
3334
if (readPos == data.Length)
3435
return pkt;
3536

@@ -38,6 +39,7 @@ public static Packet Decode(this string data) {
3839

3940
if (data[readPos] != '[')
4041
int.TryParse(ReadChunk(ref data, ref readPos), out pkt.id);
42+
4143
if (readPos == data.Length)
4244
return pkt;
4345

Assets/Plugins/socket.io/Socket.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace socket.io {
88
public class Socket : MonoBehaviour {
99

1010
/// <summary>
11-
/// 네임스페이스 ("/"은 기본값으로 글로벌 네임스페이스임)
11+
/// Namespace ("/" is the default namespace which means global namespace.)
1212
/// </summary>
1313
public string nsp = "/";
1414

@@ -89,7 +89,7 @@ void DispatchPacket(Packet pkt) {
8989
readonly Dictionary<int, Action<string>> _acks = new Dictionary<int, Action<string>>();
9090

9191
/// <summary>
92-
/// Acks를 받기 위한 패킷 아이디 할당용 카운팅 필드
92+
/// The unique value generator for acks message id.
9393
/// </summary>
9494
int _idGenerator = -1;
9595

@@ -123,7 +123,7 @@ public void Emit(string evtName) {
123123
Emit(evtName, string.Empty, null);
124124
}
125125

126-
#region 시스템 이벤트 핸들러
126+
#region System-Event handlers
127127
public Action onConnect;
128128
public Action onConnectTimeOut;
129129
public Action onReconnectAttempt;

Assets/Plugins/socket.io/SocketManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace socket.io {
1010

11+
/// <summary>
12+
/// SocketManager manages Socket and WebSocketTrigger instances
13+
/// </summary>
1114
public class SocketManager : MonoSingleton<SocketManager> {
1215

1316
public Socket Connect(string url) {

Assets/__Sample/Src.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/__Sample/Acks.cs renamed to Assets/__Sample/Src/Acks.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
using socket.io;
33

44
namespace Sample {
5-
5+
66
/// <summary>
7-
/// http://socket.io/docs/#sending-and-getting-data-(acknowledgements) 샘플
7+
/// The sample show how to acks the message you sent.
88
/// </summary>
99
public class Acks : MonoBehaviour {
1010

1111
void Start() {
12+
Config.serverUrl = "http://localhost:80";
13+
1214
var socket = Socket.Connect(Config.serverUrl);
1315
socket.On("connect", () => {
1416
socket.Emit("ferret", "\"toby\"", (string r) => {
File renamed without changes.

Assets/__Sample/Chat.cs renamed to Assets/__Sample/Src/Chat.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
namespace Sample {
1313

1414
/// <summary>
15-
/// https://github.com/socketio/socket.io/tree/master/examples/chat - Unity3D client code
15+
/// The deco code which implements the client-side of Chat service.
16+
/// You can download Chat service server-side code from URL below
17+
/// (https://github.com/socketio/socket.io/tree/master/examples/chat)
1618
/// </summary>
1719
public class Chat : MonoBehaviour {
1820

@@ -27,9 +29,6 @@ public class Chat : MonoBehaviour {
2729
GameObject _chat;
2830

2931
void Awake() {
30-
// Set the server address here~
31-
Config.serverUrl = "http://10.77.38.110:3000";
32-
3332
_login = gameObject.Descendants().First(d => d.name == "Login Panel");
3433
_login.SetActive(false);
3534

@@ -46,7 +45,7 @@ struct Message {
4645
public string username;
4746
public string message;
4847

49-
#region 컬러 테이블
48+
#region User name color table
5049
/// <summary>
5150
/// User's name color table
5251
/// </summary>
@@ -116,7 +115,7 @@ struct Login {
116115
string _userName;
117116

118117
IEnumerator Start() {
119-
yield return null;
118+
Config.serverUrl = "http://localhost:3000";
120119

121120
var socket = Socket.Connect(Config.serverUrl);
122121
yield return new WaitUntil(() => socket.IsConnected);
File renamed without changes.

Assets/__Sample/Config.cs renamed to Assets/__Sample/Src/Config.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
namespace Sample {
22

33
public static class Config {
4+
5+
/// <summary>
6+
/// Change this value to connect a HTTP server you want.
7+
/// </summary>
48
public static string serverUrl = "http://localhost:80";
59
}
610

File renamed without changes.

0 commit comments

Comments
 (0)