Skip to content

Commit 40638ff

Browse files
committed
jslib
1 parent b1729ae commit 40638ff

File tree

218 files changed

+1468
-39346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+1468
-39346
lines changed

UnityWebSocket/Assembly-CSharp-Editor.csproj

Lines changed: 238 additions & 271 deletions
Large diffs are not rendered by default.

UnityWebSocket/Assembly-CSharp.csproj

Lines changed: 236 additions & 342 deletions
Large diffs are not rendered by default.

UnityWebSocket/Assets/Plugins/WebSocketJS/WebSocketJS.jslib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@
9797
{
9898
var address = Pointer_stringify(addressPtr);
9999
if(!(webSocketMap instanceof Map))
100-
return 0;
100+
return 3; // Closed
101101
if(webSocketMap.has(address))
102102
return webSocketMap.get(address).readyState;
103-
return 0;
103+
return 3; // Closed
104104
},
105105

106106
$OnMessage: function(address, opcode, data)

UnityWebSocket/Assets/Plugins/WebSocketJS/WebSocketJS.jslib.meta

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

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/CloseEventArgs.cs.meta

Lines changed: 0 additions & 13 deletions
This file was deleted.

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/CloseStatusCode.cs.meta

Lines changed: 0 additions & 13 deletions
This file was deleted.

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/New.meta renamed to UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/Core.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/CloseEventArgs.cs renamed to UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/Core/CloseEventArgs.cs

Lines changed: 9 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,3 @@
1-
#region License
2-
/*
3-
* CloseEventArgs.cs
4-
*
5-
* The MIT License
6-
*
7-
* Copyright (c) 2012-2016 sta.blockhead
8-
*
9-
* Permission is hereby granted, free of charge, to any person obtaining a copy
10-
* of this software and associated documentation files (the "Software"), to deal
11-
* in the Software without restriction, including without limitation the rights
12-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13-
* copies of the Software, and to permit persons to whom the Software is
14-
* furnished to do so, subject to the following conditions:
15-
*
16-
* The above copyright notice and this permission notice shall be included in
17-
* all copies or substantial portions of the Software.
18-
*
19-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25-
* THE SOFTWARE.
26-
*/
27-
#endregion
28-
291
using System;
302

313
namespace UnityWebSocket
@@ -44,14 +16,6 @@ namespace UnityWebSocket
4416
/// </remarks>
4517
public class CloseEventArgs : EventArgs
4618
{
47-
#region Private Fields
48-
49-
private bool _clean;
50-
private ushort _code;
51-
private string _reason;
52-
53-
#endregion
54-
5519
#region Internal Constructors
5620

5721
internal CloseEventArgs()
@@ -75,9 +39,9 @@ internal CloseEventArgs(CloseStatusCode code, string reason, bool wasClean)
7539

7640
internal CloseEventArgs(ushort code, string reason, bool wasClean)
7741
{
78-
_code = code;
79-
_reason = reason;
80-
_clean = wasClean;
42+
Code = code;
43+
Reason = reason;
44+
WasClean = wasClean;
8145
}
8246

8347
#endregion
@@ -90,56 +54,33 @@ internal CloseEventArgs(ushort code, string reason, bool wasClean)
9054
/// <value>
9155
/// A <see cref="ushort"/> that represents the status code for the close if any.
9256
/// </value>
93-
public ushort Code
94-
{
95-
get
96-
{
97-
return _code;
98-
}
99-
}
57+
public ushort Code { get; private set; }
10058

10159
/// <summary>
10260
/// Gets the reason for the close.
10361
/// </summary>
10462
/// <value>
10563
/// A <see cref="string"/> that represents the reason for the close if any.
10664
/// </value>
107-
public string Reason
108-
{
109-
get
110-
{
111-
return _reason;
112-
}
113-
}
65+
public string Reason { get; private set; }
11466

11567
/// <summary>
11668
/// Gets a value indicating whether the connection has been closed cleanly.
11769
/// </summary>
11870
/// <value>
11971
/// <c>true</c> if the connection has been closed cleanly; otherwise, <c>false</c>.
12072
/// </value>
121-
public bool WasClean
122-
{
123-
get
124-
{
125-
return _clean;
126-
}
127-
128-
internal set
129-
{
130-
_clean = value;
131-
}
132-
}
73+
public bool WasClean { get; internal set; }
13374

13475
/// <summary>
13576
/// Enum value same as Code
13677
/// </summary>
137-
public CloseStatusCode statusCode
78+
public CloseStatusCode StatusCode
13879
{
13980
get
14081
{
141-
if (Enum.IsDefined(typeof(CloseStatusCode), _code))
142-
return (CloseStatusCode)_code;
82+
if (Enum.IsDefined(typeof(CloseStatusCode), Code))
83+
return (CloseStatusCode)Code;
14384
return CloseStatusCode.Unknown;
14485
}
14586
}

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/websocket-sharp/CloseEventArgs.cs.meta renamed to UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/Core/CloseEventArgs.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/CloseStatusCode.cs renamed to UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/Core/CloseStatusCode.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,3 @@
1-
#region License
2-
/*
3-
* CloseStatusCode.cs
4-
*
5-
* The MIT License
6-
*
7-
* Copyright (c) 2012-2016 sta.blockhead
8-
*
9-
* Permission is hereby granted, free of charge, to any person obtaining a copy
10-
* of this software and associated documentation files (the "Software"), to deal
11-
* in the Software without restriction, including without limitation the rights
12-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13-
* copies of the Software, and to permit persons to whom the Software is
14-
* furnished to do so, subject to the following conditions:
15-
*
16-
* The above copyright notice and this permission notice shall be included in
17-
* all copies or substantial portions of the Software.
18-
*
19-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25-
* THE SOFTWARE.
26-
*/
27-
#endregion
28-
29-
using System;
30-
311
namespace UnityWebSocket
322
{
333
/// <summary>

0 commit comments

Comments
 (0)