├── README.md ├── nodeGameServer ├── .gitignore └── package.json ├── Simple Multiplayer NodeJS ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── NetworkManager.asset │ ├── TimeManager.asset │ ├── XRSettings.asset │ ├── EditorBuildSettings.asset │ ├── VFXManager.asset │ ├── AudioManager.asset │ ├── TagManager.asset │ ├── DynamicsManager.asset │ ├── UnityConnectSettings.asset │ ├── NavMeshAreas.asset │ ├── EditorSettings.asset │ ├── Physics2DSettings.asset │ └── GraphicsSettings.asset ├── Assets │ ├── SocketIO │ │ ├── Server │ │ │ ├── beep.js.zip │ │ │ └── beep.js.zip.meta │ │ ├── Readme.txt.meta │ │ ├── JSONObject │ │ │ ├── readme.txt.meta │ │ │ ├── Editor.meta │ │ │ ├── JSONObject.cs.meta │ │ │ ├── JSONTemplates.cs.meta │ │ │ ├── VectorTemplates.cs.meta │ │ │ ├── Editor │ │ │ │ ├── JSONChecker.cs.meta │ │ │ │ └── JSONChecker.cs │ │ │ └── JSONTemplates.cs │ │ ├── Prefabs │ │ │ ├── SocketIO.prefab.meta │ │ │ └── SocketIO.prefab │ │ ├── Scenes │ │ │ └── SocketIOTest.unity.meta │ │ ├── WebsocketSharp │ │ │ ├── websocket-sharp.snk │ │ │ ├── websocket-sharp.snk.meta │ │ │ ├── Net.meta │ │ │ ├── Net │ │ │ │ ├── Security.meta │ │ │ │ ├── WebSockets.meta │ │ │ │ ├── Chunk.cs.meta │ │ │ │ ├── Cookie.cs.meta │ │ │ │ ├── ChunkStream.cs.meta │ │ │ │ ├── HttpListener.cs.meta │ │ │ │ ├── HttpUtility.cs.meta │ │ │ │ ├── HttpVersion.cs.meta │ │ │ │ ├── InputState.cs.meta │ │ │ │ ├── LineState.cs.meta │ │ │ │ ├── CookieCollection.cs.meta │ │ │ │ ├── CookieException.cs.meta │ │ │ │ ├── EndPointListener.cs.meta │ │ │ │ ├── EndPointManager.cs.meta │ │ │ │ ├── HttpBasicIdentity.cs.meta │ │ │ │ ├── HttpConnection.cs.meta │ │ │ │ ├── HttpHeaderInfo.cs.meta │ │ │ │ ├── HttpHeaderType.cs.meta │ │ │ │ ├── HttpStatusCode.cs.meta │ │ │ │ ├── InputChunkState.cs.meta │ │ │ │ ├── ListenerPrefix.cs.meta │ │ │ │ ├── NetworkCredential.cs.meta │ │ │ │ ├── ReadBufferState.cs.meta │ │ │ │ ├── RequestStream.cs.meta │ │ │ │ ├── ResponseStream.cs.meta │ │ │ │ ├── AuthenticationBase.cs.meta │ │ │ │ ├── AuthenticationResponse.cs.meta │ │ │ │ ├── AuthenticationSchemes.cs.meta │ │ │ │ ├── ChunkedRequestStream.cs.meta │ │ │ │ ├── HttpDigestIdentity.cs.meta │ │ │ │ ├── HttpListenerContext.cs.meta │ │ │ │ ├── HttpListenerException.cs.meta │ │ │ │ ├── HttpListenerRequest.cs.meta │ │ │ │ ├── HttpListenerResponse.cs.meta │ │ │ │ ├── HttpStreamAsyncResult.cs.meta │ │ │ │ ├── ListenerAsyncResult.cs.meta │ │ │ │ ├── QueryStringCollection.cs.meta │ │ │ │ ├── Security │ │ │ │ │ ├── SslStream.cs.meta │ │ │ │ │ └── SslStream.cs │ │ │ │ ├── WebHeaderCollection.cs.meta │ │ │ │ ├── AuthenticationChallenge.cs.meta │ │ │ │ ├── WebSockets │ │ │ │ │ ├── WebSocketContext.cs.meta │ │ │ │ │ ├── HttpListenerWebSocketContext.cs.meta │ │ │ │ │ └── TcpListenerWebSocketContext.cs.meta │ │ │ │ ├── HttpListenerPrefixCollection.cs.meta │ │ │ │ ├── HttpHeaderType.cs │ │ │ │ ├── LineState.cs │ │ │ │ ├── InputState.cs │ │ │ │ ├── InputChunkState.cs │ │ │ │ ├── AuthenticationSchemes.cs │ │ │ │ ├── HttpVersion.cs │ │ │ │ ├── QueryStringCollection.cs │ │ │ │ ├── ReadBufferState.cs │ │ │ │ ├── Chunk.cs │ │ │ │ ├── HttpBasicIdentity.cs │ │ │ │ ├── HttpHeaderInfo.cs │ │ │ │ ├── HttpStreamAsyncResult.cs │ │ │ │ ├── AuthenticationBase.cs │ │ │ │ ├── HttpListenerException.cs │ │ │ │ └── AuthenticationChallenge.cs │ │ │ ├── Ext.cs.meta │ │ │ ├── Fin.cs.meta │ │ │ ├── Logger.cs.meta │ │ │ ├── Mask.cs.meta │ │ │ ├── Opcode.cs.meta │ │ │ ├── Rsv.cs.meta │ │ │ ├── ByteOrder.cs.meta │ │ │ ├── LogData.cs.meta │ │ │ ├── LogLevel.cs.meta │ │ │ ├── PayloadData.cs.meta │ │ │ ├── WebSocket.cs.meta │ │ │ ├── AssemblyInfo.cs.meta │ │ │ ├── CloseEventArgs.cs.meta │ │ │ ├── CloseStatusCode.cs.meta │ │ │ ├── ErrorEventArgs.cs.meta │ │ │ ├── HandshakeBase.cs.meta │ │ │ ├── HandshakeRequest.cs.meta │ │ │ ├── MessageEventArgs.cs.meta │ │ │ ├── WebSocketFrame.cs.meta │ │ │ ├── WebSocketState.cs.meta │ │ │ ├── WebSocketStream.cs.meta │ │ │ ├── CompressionMethod.cs.meta │ │ │ ├── HandshakeResponse.cs.meta │ │ │ ├── WebSocketException.cs.meta │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Rsv.cs │ │ │ ├── Fin.cs │ │ │ ├── Mask.cs │ │ │ ├── ByteOrder.cs │ │ │ ├── CompressionMethod.cs │ │ │ ├── LogLevel.cs │ │ │ ├── ErrorEventArgs.cs │ │ │ ├── WebSocketState.cs │ │ │ ├── Opcode.cs │ │ │ ├── WebSocketException.cs │ │ │ ├── HandshakeBase.cs │ │ │ ├── CloseEventArgs.cs │ │ │ ├── MessageEventArgs.cs │ │ │ └── LogData.cs │ │ ├── Prefabs.meta │ │ ├── Scenes.meta │ │ ├── Scripts.meta │ │ ├── Server.meta │ │ ├── JSONObject.meta │ │ ├── Scripts │ │ │ ├── Test.meta │ │ │ ├── SocketIO.meta │ │ │ ├── SocketIO │ │ │ │ ├── Ack.cs.meta │ │ │ │ ├── Decoder.cs.meta │ │ │ │ ├── Encoder.cs.meta │ │ │ │ ├── Packet.cs.meta │ │ │ │ ├── Parser.cs.meta │ │ │ │ ├── SocketIOEvent.cs.meta │ │ │ │ ├── EnginePacketType.cs.meta │ │ │ │ ├── SocketIOComponent.cs.meta │ │ │ │ ├── SocketIOException.cs.meta │ │ │ │ ├── SocketPacketType.cs.meta │ │ │ │ ├── EnginePacketType.cs │ │ │ │ ├── SocketIOException.cs │ │ │ │ ├── SocketPacketType.cs │ │ │ │ ├── SocketIOEvent.cs │ │ │ │ ├── Ack.cs │ │ │ │ ├── Parser.cs │ │ │ │ ├── Packet.cs │ │ │ │ ├── Encoder.cs │ │ │ │ └── Decoder.cs │ │ │ └── Test │ │ │ │ ├── TestSocketIO.cs.meta │ │ │ │ └── TestSocketIO.cs │ │ └── WebsocketSharp.meta │ ├── Scripts │ │ ├── Billboard.cs │ │ ├── PlayerSpawner.cs │ │ ├── SpawnPoint.cs │ │ ├── Billboard.cs.meta │ │ ├── Bullet.cs.meta │ │ ├── Health.cs.meta │ │ ├── SpawnPoint.cs.meta │ │ ├── EnemySpawner.cs.meta │ │ ├── NetworkManager.cs.meta │ │ ├── PlayerSpawner.cs.meta │ │ ├── PlayerController.cs.meta │ │ ├── Bullet.cs │ │ ├── Health.cs │ │ ├── EnemySpawner.cs │ │ └── PlayerController.cs │ ├── Scenes │ │ └── Main.unity.meta │ ├── Materials │ │ ├── Black.mat.meta │ │ ├── Brown.mat.meta │ │ ├── White.mat.meta │ │ ├── Black.mat │ │ ├── White.mat │ │ └── Brown.mat │ ├── Prefabs │ │ ├── Bullet.prefab.meta │ │ ├── Enemy.prefab.meta │ │ ├── Ground.prefab.meta │ │ ├── Player.prefab.meta │ │ ├── Spawn Point.prefab.meta │ │ ├── Join Game Canvas.prefab.meta │ │ ├── Network Manager.prefab.meta │ │ ├── Spawn Point.prefab │ │ ├── Network Manager.prefab │ │ ├── Ground.prefab │ │ └── Bullet.prefab │ ├── Prefabs.meta │ ├── Scenes.meta │ ├── Scripts.meta │ ├── Materials.meta │ └── SocketIO.meta ├── .gitignore ├── Logs │ └── Packages-Update.log └── Packages │ └── manifest.json └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # Unity-Multiplayer-Networking-NodeJS -------------------------------------------------------------------------------- /nodeGameServer/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.3.7f1 2 | m_EditorVersionWithRevision: 2019.3.7f1 (6437fd74d35d) 3 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Server/beep.js.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acarnagey/Unity-Multiplayer-Networking-NodeJS/HEAD/Simple Multiplayer NodeJS/Assets/SocketIO/Server/beep.js.zip -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b52026292ddad4d6fad7f461936e38c0 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Server/beep.js.zip.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 523a07c14fb3743f49dd078940c7cf3a 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject/readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 938920005d68243aa96976ec0c1b66ac 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Prefabs/SocketIO.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 010d39cbd03ee4c99a746c1f8ecdc0d8 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scenes/SocketIOTest.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0610c6cbb3e14cb6961f361c3ba23fe 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/websocket-sharp.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/acarnagey/Unity-Multiplayer-Networking-NodeJS/HEAD/Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/websocket-sharp.snk -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/websocket-sharp.snk.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf290fc04cfd7bc4ea70598dec911109 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/Billboard.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Billboard : MonoBehaviour { 5 | 6 | void Update () { 7 | transform.LookAt (Camera.main.transform); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scenes/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7a345bff75cf42a9a164f58b857c401 3 | timeCreated: 1479404916 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/PlayerSpawner.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | public class PlayerSpawner : MonoBehaviour { 6 | 7 | public List playerSpawnPoints; 8 | } 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Materials/Black.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbd22bf33e5864734b4ac033b53615c3 3 | timeCreated: 1479404962 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Materials/Brown.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7920bb0bab6f44adcb550153c5c51074 3 | timeCreated: 1479404970 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Materials/White.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa6c37f7939b74a1daa87a286e0afd89 3 | timeCreated: 1479404979 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Bullet.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8ea4b5977dd748f29ed462b059007f5 3 | timeCreated: 1479494202 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Enemy.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2208e186b3894f39b2d5efeb20d6f4d 3 | timeCreated: 1479493893 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Ground.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83d6b418961954b48ba2fc8ccad0fbb1 3 | timeCreated: 1479405116 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Player.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 776432fb90f0a4769915d763937254b6 3 | timeCreated: 1479493769 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Spawn Point.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1286f7f5e90364316a73873a8d40c30f 3 | timeCreated: 1479494250 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2b65ee68f99046e9bf19e7320df67bb 3 | folderAsset: yes 4 | timeCreated: 1479404942 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Join Game Canvas.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93694ac6ca9734650903aba0798ef214 3 | timeCreated: 1479501608 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Network Manager.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e5da52bb30574f4484f2fb6b3978ed8 3 | timeCreated: 1479501638 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a873c9aae8e5a4160b29b15934af80bf 3 | folderAsset: yes 4 | timeCreated: 1479404932 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f72534ada2744cb8a3759a8cb300a92 3 | folderAsset: yes 4 | timeCreated: 1479404949 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcf3ac58da6f2417198fe25c269ac870 3 | folderAsset: yes 4 | timeCreated: 1479404927 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92af5ba8b3b14429d96580c8ef77f942 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 321de1b0ff01641e997cdc4d622a7fee 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95346ccf2c8294555b916ad7687111dd 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31a461f5810794291929d1c9ccd71434 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Server.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35eb8211951aa4500944688c9b0b263e 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c0979b1448324bec948fd2ac092eeff 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ad16bc505ae6485e8ba70af1ecb5698 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/Main.unity 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 900de9d9d2c7f435a84e07d203295f49 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c054ec3816f0e45389180c9a7c4e2ca7 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 914c3f52322f945249dffa3ee1913222 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd914ab83a6d34d979af121a15789c4a 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/Security.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1b7a76e8f54e43a194302f2684b5edf 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/WebSockets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0267d94b067094564b273a0f116713a4 3 | folderAsset: yes 4 | timeCreated: 1479589197 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/SpawnPoint.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpawnPoint : MonoBehaviour { 5 | 6 | // Use this for initialization 7 | void Start () { 8 | 9 | } 10 | 11 | // Update is called once per frame 12 | void Update () { 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject/JSONObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eeba495d221e843f3838f785f3e1e419 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Ack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fa9179af012046faad73ac18c415335 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Ext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 144897afaafa3cc4a98db7590f012339 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Fin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5116139d728d9da4587f86e48e0bcf53 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Logger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b9b20c2797001e4896a1d5b84dcafd3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Mask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9b4485e7626b594bafabc101905288a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Opcode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08116a1f4132d8d4e828f5348e931f30 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Rsv.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c96f786bb0a34043b18bb4f8110cff9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject/JSONTemplates.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58ef13267807449f085b6f8ac66f3b30 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject/VectorTemplates.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82f5403151f5a4135b184d1fdf8e2d7e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Decoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c866e085c81854a12be82a44dc4166ad 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Encoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7740b68868194e789ed20c53019c622 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Packet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b6adf79681b140779f21a7ebecde17f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Parser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af6cc409b9f7f42198b3270ffcaeed13 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/Test/TestSocketIO.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9484cf1f87e894773ab4d8564652833d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/ByteOrder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fcb2fa3f551e6a4ba6dd3f7f3d319a4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/LogData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8635c86a5edac7e4aa95d5d71571206c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/LogLevel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27c64de5c5518d44c8769f8cc754fc94 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/Chunk.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 024d2731b29683144af3be58152d7e95 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/Cookie.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: daebe88ca64ea0146890c1cb8eb8e27f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/PayloadData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba1c73f5c54ab534e94cb406f218be74 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/WebSocket.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f809565376eb364d95c7dac01f25a12 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject/Editor/JSONChecker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9eed650df23fe4f118b3ce9004111650 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/SocketIOEvent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0478da7272a8446dabf31efa772affad 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1521934461328a04e98f127fd326e0be 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/CloseEventArgs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a84cd752ba6c7414babf89c045c59704 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/CloseStatusCode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22af06d118f46d441bca7d17c4fdbc41 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/ErrorEventArgs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3215f6caf074b5c4595d5ac0d352391f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/HandshakeBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe5b43f99c9141d4e99bfad6c0359e7a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/HandshakeRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2bf9efaee14d414eb4c6a81cbdb1b2a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/MessageEventArgs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7206e89bff762404ea8667aa83a42f52 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/ChunkStream.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3258eeefc74d97b4d91d81fa3c883e7c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpListener.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a424a80e4de6074290037399bfb50ef 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57be9c00db84b3e46b7aef54ab3d8ea9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpVersion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d85bfed4e6c625e4897ed6d6c948a5e0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/InputState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fc14597a95d5d3489fc8652e6aa12cc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/LineState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f26b5cafcf922bf409ec8509a68895a4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/WebSocketFrame.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0508f37c785f68b4ebd94c3469b06ff3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/WebSocketState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 223ae24f299634d45af9039f24d5b03c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/WebSocketStream.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67d631278ca52114f86d5b8b9930a34e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/EnginePacketType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4188e69e5ebff473a882031651f196d0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/SocketIOComponent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 961346d7e16a445ff93777573e78efd6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/SocketIOException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a922e9bb9b544eb7b91b92fde935827 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/SocketPacketType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d386b9308e01f43a4a95dad054eee941 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/CompressionMethod.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 990ecb6d612370f408def5e017442d1f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/HandshakeResponse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6cb91ebc2d29fa4fae26c77b016a491 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/CookieCollection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1de67737c8552804583f8eafee33c4e0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/CookieException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d31f64ba18153d640928c6efbe14570b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/EndPointListener.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a97d8730eff548644883a34cc4eac68d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/EndPointManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a7c160bcf87fca48a3f481f4615ea53 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpBasicIdentity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c26c419a36603d438160d63c60759ad 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpConnection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b74ef60f30bf36d4f9f65782d8334903 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpHeaderInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6357da8a4644b7240b5af4214a8ae2d4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpHeaderType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b01082e447b0084cbdad3796343c597 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpStatusCode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2cf2595f60c2b248a31746b13f52815 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/InputChunkState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73a65f8c9aeba4d48b323c877677c0dd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/ListenerPrefix.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7ba3d09617a06746ae4f00db5cc7e95 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/NetworkCredential.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d072ecd203a1aef479aea006752b87ca 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/ReadBufferState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0305b53a1181299409eba30b39680acd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/RequestStream.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dc6edc6aff89984592d3bb9f6d3a77f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/ResponseStream.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 255a052cd2e786d46af71dc6682ee21f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/WebSocketException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 144bc914c9257e54b99ea77e6f1714c8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/AuthenticationBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 910cdcca401a9924697b5a4caa654421 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/AuthenticationResponse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 156616d94d5d5ee4bb1788faf05804ef 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/AuthenticationSchemes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 176175dab868d194291cd7370a980e76 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/ChunkedRequestStream.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc6a5a78a833514469846f16f1e26749 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpDigestIdentity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f8937a933f76e347ae4a12fc1bbd307 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpListenerContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6590397730b7c564a91f42ff33fc9ea6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpListenerException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac801e71f1eef1149b88beeb1941495f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpListenerRequest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0558474268fcfc1468cd06f7474139e2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpListenerResponse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f651119f4eb5c5409133c5af2f88ee9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpStreamAsyncResult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b58ef061e9d1d524c855bcbe20e4e2cd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/ListenerAsyncResult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e774199d106829e4882dd9cd4606900f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/QueryStringCollection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f869b9a24c9507449fd4c9212e6fbe3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/Security/SslStream.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a77656427ba58c34baaabdfe963157e8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/WebHeaderCollection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 853e55b214b4f6f4fae0cc6424ec0251 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/AuthenticationChallenge.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02402f9bf7e946a4fa6749872bdd33d0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/WebSockets/WebSocketContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d709cd1c9245ca34991b0ae08d86c115 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpListenerPrefixCollection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f7886e9bea6f624889aafd692f585a5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/Billboard.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a07fb1985d0134b55a83e5d8b1683abd 3 | timeCreated: 1479493737 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/Bullet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da11515a9d033427fa6815c138b1b855 3 | timeCreated: 1479494188 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/Health.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cdd451bf98b9b4bba8d24c840094eded 3 | timeCreated: 1479405284 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/SpawnPoint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92e4704f04f63432d8ad52f9b60aada5 3 | timeCreated: 1479494236 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/WebSockets/HttpListenerWebSocketContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6d636d72962f5d44aef6cebbf7e0e7b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/WebSockets/TcpListenerWebSocketContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddb47cc1d0a35ee4494d873de965236e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/EnemySpawner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 479b63cee56c64b8899ac04c2ac1ef28 3 | timeCreated: 1479501301 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/NetworkManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95260bb3afc2e466f8dfd98733a41c84 3 | timeCreated: 1479501289 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/PlayerSpawner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 799ae02b3116c4430b978f47aacd1d68 3 | timeCreated: 1479501312 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/PlayerController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 274cae0defa0949e883de62d5a6f4400 3 | timeCreated: 1479405248 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /nodeGameServer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodegameserver", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.14.0", 13 | "socket.io": "^1.5.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | m_VirtualizeEffects: 1 17 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/Bullet.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Bullet : MonoBehaviour { 5 | 6 | [HideInInspector] 7 | public GameObject playerFrom; 8 | 9 | void OnCollisionEnter(Collision collision) 10 | { 11 | var hit = collision.gameObject; 12 | var health = hit.GetComponent(); 13 | if (health != null) 14 | { 15 | health.TakeDamage(playerFrom, 10); 16 | } 17 | 18 | Destroy(gameObject); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Autogenerated VS/MD solution and project files 9 | ExportedObj/ 10 | *.csproj 11 | *.unityproj 12 | *.sln 13 | *.suo 14 | *.tmp 15 | *.user 16 | *.userprefs 17 | *.pidb 18 | *.booproj 19 | *.svd 20 | 21 | 22 | # Unity3D generated meta files 23 | *.pidb.meta 24 | 25 | # Unity3D Generated File On Crash Reports 26 | sysinfo.txt 27 | 28 | # Builds 29 | *.apk 30 | *.unitypackage 31 | 32 | .vs 33 | .vscode 34 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_SolverIterationCount: 6 13 | m_SolverVelocityIterations: 1 14 | m_QueriesHitTriggers: 1 15 | m_EnableAdaptiveForce: 0 16 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2020, Adam Carnagey 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 1 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("websocket-sharp")] 8 | [assembly: AssemblyDescription("A C# implementation of the WebSocket protocol client and server")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("websocket-sharp.dll")] 12 | [assembly: AssemblyCopyright("sta.blockhead")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.2.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshAreas: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 1 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 2 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 0 16 | m_EtcTextureFastCompressor: 2 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 5 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_MinPenetrationForPenalty: 0.01 17 | m_BaumgarteScale: 0.2 18 | m_BaumgarteTimeOfImpactScale: 0.75 19 | m_TimeToSleep: 0.5 20 | m_LinearSleepTolerance: 0.01 21 | m_AngularSleepTolerance: 2 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_AlwaysShowColliders: 0 26 | m_ShowColliderSleep: 1 27 | m_ShowColliderContacts: 0 28 | m_ContactArrowScale: 0.2 29 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 30 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 31 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 32 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 33 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Rsv.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Rsv.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | internal enum Rsv : byte 34 | { 35 | Off = 0x0, 36 | On = 0x1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/Health.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Health : MonoBehaviour { 5 | 6 | public const int maxHealth = 100; 7 | public bool destroyOnDeath; 8 | 9 | public int currentHealth = maxHealth; 10 | public bool isEnemy = false; 11 | 12 | public RectTransform healthBar; 13 | 14 | private bool isLocalPlayer; 15 | 16 | // Use this for initialization 17 | void Start () { 18 | PlayerController pc = GetComponent(); 19 | isLocalPlayer = pc.isLocalPlayer; 20 | } 21 | 22 | public void TakeDamage(GameObject playerFrom, int amount) { 23 | currentHealth -= amount; 24 | //OnChangeHealth(); 25 | NetworkManager n = NetworkManager.instance.GetComponent(); 26 | n.CommandHealthChange(playerFrom, this.gameObject, amount, isEnemy); 27 | } 28 | 29 | public void OnChangeHealth() { 30 | healthBar.sizeDelta = new Vector2(currentHealth, healthBar.sizeDelta.y); 31 | if(currentHealth <= 0) { 32 | if(destroyOnDeath) { 33 | Destroy(gameObject); 34 | } 35 | else { 36 | currentHealth = maxHealth; 37 | healthBar.sizeDelta = new Vector2(currentHealth, healthBar.sizeDelta.y); 38 | Respawn(); 39 | } 40 | } 41 | } 42 | 43 | void Respawn() { 44 | if(isLocalPlayer) { 45 | Vector3 spawnPoint = Vector3.zero; 46 | Quaternion spawnRotation = Quaternion.Euler(0,180,0); 47 | transform.position = spawnPoint; 48 | transform.rotation = spawnRotation; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Fin.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Fin.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | internal enum Fin : byte 34 | { 35 | More = 0x0, 36 | Final = 0x1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Mask.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Mask.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | internal enum Mask : byte 34 | { 35 | Unmask = 0x0, 36 | Mask = 0x1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject/Editor/JSONChecker.cs: -------------------------------------------------------------------------------- 1 | //#define PERFTEST //For testing performance of parse/stringify. Turn on editor profiling to see how we're doing 2 | 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | public class JSONChecker : EditorWindow { 7 | string JSON = @"{ 8 | ""TestObject"": { 9 | ""SomeText"": ""Blah"", 10 | ""SomeObject"": { 11 | ""SomeNumber"": 42, 12 | ""SomeBool"": true, 13 | ""SomeNull"": null 14 | }, 15 | 16 | ""SomeEmptyObject"": { }, 17 | ""SomeEmptyArray"": [ ], 18 | ""EmbeddedObject"": ""{\""field\"":\""Value with \\\""escaped quotes\\\""\""}"" 19 | } 20 | }"; //dat string literal... 21 | JSONObject j; 22 | [MenuItem("Window/JSONChecker")] 23 | static void Init() { 24 | GetWindow(typeof(JSONChecker)); 25 | } 26 | void OnGUI() { 27 | JSON = EditorGUILayout.TextArea(JSON); 28 | GUI.enabled = !string.IsNullOrEmpty(JSON); 29 | if(GUILayout.Button("Check JSON")) { 30 | #if PERFTEST 31 | Profiler.BeginSample("JSONParse"); 32 | j = JSONObject.Create(JSON); 33 | Profiler.EndSample(); 34 | Profiler.BeginSample("JSONStringify"); 35 | j.ToString(true); 36 | Profiler.EndSample(); 37 | #else 38 | j = JSONObject.Create(JSON); 39 | #endif 40 | Debug.Log(j.ToString(true)); 41 | } 42 | if(j) { 43 | //Debug.Log(System.GC.GetTotalMemory(false) + ""); 44 | if(j.type == JSONObject.Type.NULL) 45 | GUILayout.Label("JSON fail:\n" + j.ToString(true)); 46 | else 47 | GUILayout.Label("JSON success:\n" + j.ToString(true)); 48 | 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/EnginePacketType.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * EnginePacketType.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | using System; 29 | 30 | /** 31 | * Message types 32 | */ 33 | namespace SocketIO 34 | { 35 | public enum EnginePacketType 36 | { 37 | UNKNOWN = -1, 38 | OPEN = 0, 39 | CLOSE = 1, 40 | PING = 2, 41 | PONG = 3, 42 | MESSAGE = 4, 43 | UPGRADE = 5, 44 | NOOP = 6 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/SocketIOException.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * SocketIOException.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | using System; 29 | 30 | namespace SocketIO 31 | { 32 | public class SocketIOException : Exception 33 | { 34 | public SocketIOException(){} 35 | public SocketIOException(string message): base(message){} 36 | public SocketIOException(string message, Exception innerException): base(message, innerException){} 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/SocketPacketType.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * SocketPacketType.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | namespace SocketIO 30 | { 31 | public enum SocketPacketType 32 | { 33 | UNKNOWN = -1, 34 | CONNECT = 0, 35 | DISCONNECT = 1, 36 | EVENT = 2, 37 | ACK = 3, 38 | ERROR = 4, 39 | BINARY_EVENT = 5, 40 | BINARY_ACK = 6, 41 | CONTROL = 7 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Logs/Packages-Update.log: -------------------------------------------------------------------------------- 1 | 2 | === Wed Aug 5 17:25:31 2020 3 | 4 | Packages were changed. 5 | Update Mode: resetToDefaultDependencies 6 | 7 | The following packages were added: 8 | com.unity.collab-proxy@1.2.16 9 | com.unity.ide.rider@1.1.4 10 | com.unity.ide.vscode@1.1.4 11 | com.unity.modules.ai@1.0.0 12 | com.unity.modules.androidjni@1.0.0 13 | com.unity.modules.animation@1.0.0 14 | com.unity.modules.assetbundle@1.0.0 15 | com.unity.modules.audio@1.0.0 16 | com.unity.modules.cloth@1.0.0 17 | com.unity.modules.director@1.0.0 18 | com.unity.modules.imageconversion@1.0.0 19 | com.unity.modules.imgui@1.0.0 20 | com.unity.modules.jsonserialize@1.0.0 21 | com.unity.modules.particlesystem@1.0.0 22 | com.unity.modules.physics@1.0.0 23 | com.unity.modules.physics2d@1.0.0 24 | com.unity.modules.screencapture@1.0.0 25 | com.unity.modules.terrain@1.0.0 26 | com.unity.modules.terrainphysics@1.0.0 27 | com.unity.modules.tilemap@1.0.0 28 | com.unity.modules.ui@1.0.0 29 | com.unity.modules.uielements@1.0.0 30 | com.unity.modules.umbra@1.0.0 31 | com.unity.modules.unityanalytics@1.0.0 32 | com.unity.modules.unitywebrequest@1.0.0 33 | com.unity.modules.unitywebrequestassetbundle@1.0.0 34 | com.unity.modules.unitywebrequestaudio@1.0.0 35 | com.unity.modules.unitywebrequesttexture@1.0.0 36 | com.unity.modules.unitywebrequestwww@1.0.0 37 | com.unity.modules.vehicles@1.0.0 38 | com.unity.modules.video@1.0.0 39 | com.unity.modules.vr@1.0.0 40 | com.unity.modules.wind@1.0.0 41 | com.unity.modules.xr@1.0.0 42 | com.unity.test-framework@1.1.11 43 | com.unity.textmeshpro@2.0.1 44 | com.unity.timeline@1.2.13 45 | com.unity.ugui@1.0.0 46 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpHeaderType.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * HttpHeaderType.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2013-2014 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 | 31 | namespace WebSocketSharp.Net 32 | { 33 | [Flags] 34 | internal enum HttpHeaderType 35 | { 36 | Unspecified = 0, 37 | Request = 1, 38 | Response = 1 << 1, 39 | Restricted = 1 << 2, 40 | MultiValue = 1 << 3, 41 | MultiValueInRequest = 1 << 4, 42 | MultiValueInResponse = 1 << 5 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Spawn Point.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000013066951950} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000013066951950 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000011228822264} 22 | - 114: {fileID: 114000013077605552} 23 | m_Layer: 0 24 | m_Name: Spawn Point 25 | m_TagString: Untagged 26 | m_Icon: {fileID: 0} 27 | m_NavMeshLayer: 0 28 | m_StaticEditorFlags: 0 29 | m_IsActive: 1 30 | --- !u!4 &4000011228822264 31 | Transform: 32 | m_ObjectHideFlags: 1 33 | m_PrefabParentObject: {fileID: 0} 34 | m_PrefabInternal: {fileID: 100100000} 35 | m_GameObject: {fileID: 1000013066951950} 36 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 37 | m_LocalPosition: {x: 0, y: 0, z: 0} 38 | m_LocalScale: {x: 1, y: 1, z: 1} 39 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 40 | m_Children: [] 41 | m_Father: {fileID: 0} 42 | m_RootOrder: 0 43 | --- !u!114 &114000013077605552 44 | MonoBehaviour: 45 | m_ObjectHideFlags: 1 46 | m_PrefabParentObject: {fileID: 0} 47 | m_PrefabInternal: {fileID: 100100000} 48 | m_GameObject: {fileID: 1000013066951950} 49 | m_Enabled: 1 50 | m_EditorHideFlags: 0 51 | m_Script: {fileID: 11500000, guid: 92e4704f04f63432d8ad52f9b60aada5, type: 3} 52 | m_Name: 53 | m_EditorClassIdentifier: 54 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/ByteOrder.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * ByteOrder.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | /// 34 | /// Contains the values that indicate whether the byte order is a Little-endian or Big-endian. 35 | /// 36 | public enum ByteOrder : byte 37 | { 38 | /// 39 | /// Indicates a Little-endian. 40 | /// 41 | Little, 42 | /// 43 | /// Indicates a Big-endian. 44 | /// 45 | Big 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/LineState.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * LineState.cs 4 | * 5 | * This code is derived from System.Net.HttpConnection.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2005 Novell, Inc. (http://www.novell.com) 11 | * Copyright (c) 2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Gonzalo Paniagua Javier 37 | */ 38 | #endregion 39 | 40 | using System; 41 | 42 | namespace WebSocketSharp.Net 43 | { 44 | internal enum LineState 45 | { 46 | None, 47 | CR, 48 | LF 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/InputState.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * InputState.cs 4 | * 5 | * This code is derived from System.Net.HttpConnection.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2005 Novell, Inc. (http://www.novell.com) 11 | * Copyright (c) 2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Gonzalo Paniagua Javier 37 | */ 38 | #endregion 39 | 40 | using System; 41 | 42 | namespace WebSocketSharp.Net 43 | { 44 | internal enum InputState 45 | { 46 | RequestLine, 47 | Headers 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Prefabs/SocketIO.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 114: {fileID: 11400000} 12 | m_Layer: 0 13 | m_Name: SocketIO 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &400000 20 | Transform: 21 | m_ObjectHideFlags: 1 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | m_GameObject: {fileID: 100000} 25 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 26 | m_LocalPosition: {x: 0, y: 0, z: 0} 27 | m_LocalScale: {x: 1, y: 1, z: 1} 28 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 29 | m_Children: [] 30 | m_Father: {fileID: 0} 31 | m_RootOrder: 0 32 | --- !u!114 &11400000 33 | MonoBehaviour: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 100000} 38 | m_Enabled: 1 39 | m_EditorHideFlags: 0 40 | m_Script: {fileID: 11500000, guid: 961346d7e16a445ff93777573e78efd6, type: 3} 41 | m_Name: 42 | m_EditorClassIdentifier: 43 | url: ws://127.0.0.1:4567/socket.io/?EIO=4&transport=websocket 44 | autoConnect: 1 45 | reconnectDelay: 5 46 | ackExpirationTime: 1800 47 | pingInterval: 25 48 | pingTimeout: 60 49 | --- !u!1001 &100100000 50 | Prefab: 51 | m_ObjectHideFlags: 1 52 | serializedVersion: 2 53 | m_Modification: 54 | m_TransformParent: {fileID: 0} 55 | m_Modifications: [] 56 | m_RemovedComponents: [] 57 | m_ParentPrefab: {fileID: 0} 58 | m_RootGameObject: {fileID: 100000} 59 | m_IsPrefabParent: 1 60 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/InputChunkState.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * InputChunkState.cs 4 | * 5 | * This code is derived from System.Net.ChunkStream.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2003 Ximian, Inc (http://www.ximian.com) 11 | * Copyright (c) 2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Gonzalo Paniagua Javier 37 | */ 38 | #endregion 39 | 40 | using System; 41 | 42 | namespace WebSocketSharp.Net 43 | { 44 | internal enum InputChunkState 45 | { 46 | None, 47 | Body, 48 | BodyFinished, 49 | Trailer 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.2.16", 4 | "com.unity.ide.rider": "1.1.4", 5 | "com.unity.ide.vscode": "1.1.4", 6 | "com.unity.test-framework": "1.1.11", 7 | "com.unity.textmeshpro": "2.0.1", 8 | "com.unity.timeline": "1.2.13", 9 | "com.unity.ugui": "1.0.0", 10 | "com.unity.modules.ai": "1.0.0", 11 | "com.unity.modules.androidjni": "1.0.0", 12 | "com.unity.modules.animation": "1.0.0", 13 | "com.unity.modules.assetbundle": "1.0.0", 14 | "com.unity.modules.audio": "1.0.0", 15 | "com.unity.modules.cloth": "1.0.0", 16 | "com.unity.modules.director": "1.0.0", 17 | "com.unity.modules.imageconversion": "1.0.0", 18 | "com.unity.modules.imgui": "1.0.0", 19 | "com.unity.modules.jsonserialize": "1.0.0", 20 | "com.unity.modules.particlesystem": "1.0.0", 21 | "com.unity.modules.physics": "1.0.0", 22 | "com.unity.modules.physics2d": "1.0.0", 23 | "com.unity.modules.screencapture": "1.0.0", 24 | "com.unity.modules.terrain": "1.0.0", 25 | "com.unity.modules.terrainphysics": "1.0.0", 26 | "com.unity.modules.tilemap": "1.0.0", 27 | "com.unity.modules.ui": "1.0.0", 28 | "com.unity.modules.uielements": "1.0.0", 29 | "com.unity.modules.umbra": "1.0.0", 30 | "com.unity.modules.unityanalytics": "1.0.0", 31 | "com.unity.modules.unitywebrequest": "1.0.0", 32 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 33 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 34 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 35 | "com.unity.modules.unitywebrequestwww": "1.0.0", 36 | "com.unity.modules.vehicles": "1.0.0", 37 | "com.unity.modules.video": "1.0.0", 38 | "com.unity.modules.vr": "1.0.0", 39 | "com.unity.modules.wind": "1.0.0", 40 | "com.unity.modules.xr": "1.0.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/SocketIOEvent.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * SocketIOEvent.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | namespace SocketIO 30 | { 31 | public class SocketIOEvent 32 | { 33 | public string name { get; set; } 34 | 35 | public JSONObject data { get; set; } 36 | 37 | public SocketIOEvent(string name) : this(name, null) { } 38 | 39 | public SocketIOEvent(string name, JSONObject data) 40 | { 41 | this.name = name; 42 | this.data = data; 43 | } 44 | 45 | public override string ToString() 46 | { 47 | return string.Format("[SocketIOEvent: name={0}, data={1}]", name, data); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/EnemySpawner.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | public class EnemySpawner : MonoBehaviour { 6 | 7 | public GameObject enemy; 8 | public GameObject spawnPoint; 9 | public int numberOfEnemies; 10 | [HideInInspector] 11 | public List enemySpawnPoints; 12 | 13 | // Use this for initialization 14 | void Start () { 15 | // set the random spawn points over here 16 | for (int i = 0; i < numberOfEnemies; i++) 17 | { 18 | var spawnPosition = new Vector3(Random.Range(-8f, 8f), 0f, Random.Range(-8f, 8f)); 19 | var spawnRotation = Quaternion.Euler(0f, Random.Range(0, 180), 0f); 20 | SpawnPoint enemySpawnPoint = (Instantiate(spawnPoint, 21 | spawnPosition, 22 | spawnRotation) 23 | as GameObject).GetComponent(); 24 | enemySpawnPoints.Add(enemySpawnPoint); 25 | } 26 | //SpawnEnemies(); 27 | } 28 | 29 | public void SpawnEnemies(NetworkManager.EnemiesJSON enemiesJSON) 30 | { 31 | foreach (NetworkManager.UserJSON enemyJSON in enemiesJSON.enemies) 32 | { 33 | if (enemyJSON.health <= 0) 34 | { 35 | continue; 36 | } 37 | Vector3 position = new Vector3(enemyJSON.position[0], enemyJSON.position[1], enemyJSON.position[2]); 38 | Quaternion rotation = Quaternion.Euler(enemyJSON.rotation[0], enemyJSON.rotation[1], enemyJSON.rotation[2]); 39 | GameObject newEnemy = Instantiate(enemy, position, rotation) as GameObject; 40 | newEnemy.name = enemyJSON.name; 41 | PlayerController pc = newEnemy.GetComponent(); 42 | pc.isLocalPlayer = false; 43 | Health h = newEnemy.GetComponent(); 44 | h.currentHealth = enemyJSON.health; 45 | h.OnChangeHealth(); 46 | h.destroyOnDeath = true; 47 | h.isEnemy = true; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Ack.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Ack.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | 31 | namespace SocketIO 32 | { 33 | public class Ack 34 | { 35 | public int packetId; 36 | public DateTime time; 37 | 38 | private System.Action action; 39 | 40 | public Ack(int packetId, System.Action action) 41 | { 42 | this.packetId = packetId; 43 | this.time = DateTime.Now; 44 | this.action = action; 45 | } 46 | 47 | public void Invoke(JSONObject ev) 48 | { 49 | action.Invoke(ev); 50 | } 51 | 52 | public override string ToString() 53 | { 54 | return string.Format("[Ack: packetId={0}, time={1}, action={2}]", packetId, time, action); 55 | } 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/CompressionMethod.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * CompressionMethod.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2013-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | /// 34 | /// Contains the values of the compression method used to compress the message on the WebSocket 35 | /// connection. 36 | /// 37 | /// 38 | /// The values of the compression method are defined in 39 | /// Compression 40 | /// Extensions for WebSocket. 41 | /// 42 | public enum CompressionMethod : byte 43 | { 44 | /// 45 | /// Indicates non compression. 46 | /// 47 | None, 48 | /// 49 | /// Indicates using DEFLATE. 50 | /// 51 | Deflate 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Scripts/PlayerController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class PlayerController : MonoBehaviour { 5 | 6 | public GameObject bulletPrefab; 7 | public Transform bulletSpawn; 8 | public bool isLocalPlayer = false; 9 | 10 | Vector3 oldPosition; 11 | Vector3 currentPosition; 12 | Quaternion oldRotation; 13 | Quaternion currentRotation; 14 | 15 | // Use this for initialization 16 | void Start () { 17 | oldPosition = transform.position; 18 | currentPosition = oldPosition; 19 | oldRotation = transform.rotation; 20 | currentRotation = oldRotation; 21 | } 22 | 23 | // Update is called once per frame 24 | void Update () { 25 | if (!isLocalPlayer) { 26 | return; 27 | } 28 | 29 | var x = Input.GetAxis ("Horizontal") * Time.deltaTime * 150.0f; 30 | var z = Input.GetAxis ("Vertical") * Time.deltaTime * 3.0f; 31 | 32 | transform.Rotate (0, x, 0); 33 | transform.Translate (0, 0, z); 34 | 35 | currentPosition = transform.position; 36 | currentRotation = transform.rotation; 37 | 38 | if (currentPosition != oldPosition) { 39 | NetworkManager.instance.GetComponent().CommandMove(transform.position); 40 | oldPosition = currentPosition; 41 | } 42 | 43 | if (currentRotation != oldRotation) { 44 | NetworkManager.instance.GetComponent().CommandTurn(transform.rotation); 45 | oldRotation = currentRotation; 46 | } 47 | 48 | if (Input.GetKeyDown (KeyCode.Space)) { 49 | NetworkManager n = NetworkManager.instance.GetComponent(); 50 | n.CommandShoot(); 51 | } 52 | } 53 | 54 | public void CmdFire() { 55 | var bullet = Instantiate(bulletPrefab, 56 | bulletSpawn.position, 57 | bulletSpawn.rotation) as GameObject; 58 | Bullet b = bullet.GetComponent(); 59 | b.playerFrom = this.gameObject; 60 | print("setting the velocity"); 61 | print(bullet.transform.up); 62 | bullet.GetComponent().isKinematic = false; 63 | bullet.GetComponent().AddForce(bullet.transform.up * 6, ForceMode.VelocityChange); 64 | Destroy(bullet, 2.0f); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Parser.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Parser.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | using UnityEngine; 29 | 30 | namespace SocketIO 31 | { 32 | public class Parser 33 | { 34 | public SocketIOEvent Parse(JSONObject json) 35 | { 36 | if (json.Count < 1 || json.Count > 2) { 37 | throw new SocketIOException("Invalid number of parameters received: " + json.Count); 38 | } 39 | 40 | if (json[0].type != JSONObject.Type.STRING) { 41 | throw new SocketIOException("Invalid parameter type. " + json[0].type + " received while expecting " + JSONObject.Type.STRING); 42 | } 43 | 44 | if (json.Count == 1) { 45 | return new SocketIOEvent(json[0].str); 46 | } 47 | 48 | if (json[1].type != JSONObject.Type.OBJECT) { 49 | throw new SocketIOException("Invalid argument type. " + json[1].type + " received while expecting " + JSONObject.Type.OBJECT); 50 | } 51 | 52 | return new SocketIOEvent(json[0].str, json[1]); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/LogLevel.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * LogLevel.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2013-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | /// 34 | /// Contains the values of the logging level. 35 | /// 36 | public enum LogLevel 37 | { 38 | /// 39 | /// Indicates the bottom logging level. 40 | /// 41 | Trace, 42 | /// 43 | /// Indicates the 2nd logging level from the bottom. 44 | /// 45 | Debug, 46 | /// 47 | /// Indicates the 3rd logging level from the bottom. 48 | /// 49 | Info, 50 | /// 51 | /// Indicates the 3rd logging level from the top. 52 | /// 53 | Warn, 54 | /// 55 | /// Indicates the 2nd logging level from the top. 56 | /// 57 | Error, 58 | /// 59 | /// Indicates the top logging level. 60 | /// 61 | Fatal 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/AuthenticationSchemes.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * AuthenticationSchemes.cs 4 | * 5 | * This code is derived from System.Net.AuthenticationSchemes.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2005 Novell, Inc. (http://www.novell.com) 11 | * Copyright (c) 2012-2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Atsushi Enomoto 37 | */ 38 | #endregion 39 | 40 | using System; 41 | 42 | namespace WebSocketSharp.Net 43 | { 44 | /// 45 | /// Contains the values of the schemes for authentication. 46 | /// 47 | [Flags] 48 | public enum AuthenticationSchemes 49 | { 50 | /// 51 | /// Indicates that no authentication is allowed. 52 | /// 53 | None, 54 | /// 55 | /// Indicates digest authentication. 56 | /// 57 | Digest = 1, 58 | /// 59 | /// Indicates basic authentication. 60 | /// 61 | Basic = 8, 62 | /// 63 | /// Indicates anonymous authentication. 64 | /// 65 | Anonymous = 0x8000 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpVersion.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * HttpVersion.cs 4 | * 5 | * This code is derived from System.Net.HttpVersion.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2012-2014 sta.blockhead 11 | * 12 | * Permission is hereby granted, free of charge, to any person obtaining a copy 13 | * of this software and associated documentation files (the "Software"), to deal 14 | * in the Software without restriction, including without limitation the rights 15 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | * copies of the Software, and to permit persons to whom the Software is 17 | * furnished to do so, subject to the following conditions: 18 | * 19 | * The above copyright notice and this permission notice shall be included in 20 | * all copies or substantial portions of the Software. 21 | * 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28 | * THE SOFTWARE. 29 | */ 30 | #endregion 31 | 32 | #region Authors 33 | /* 34 | * Authors: 35 | * - Lawrence Pit 36 | */ 37 | #endregion 38 | 39 | using System; 40 | 41 | namespace WebSocketSharp.Net 42 | { 43 | /// 44 | /// Provides the HTTP version numbers. 45 | /// 46 | public class HttpVersion 47 | { 48 | #region Public Static Fields 49 | 50 | /// 51 | /// Provides a instance for HTTP 1.0. 52 | /// 53 | public static readonly Version Version10 = new Version (1, 0); 54 | 55 | /// 56 | /// Provides a instance for HTTP 1.1. 57 | /// 58 | public static readonly Version Version11 = new Version (1, 1); 59 | 60 | #endregion 61 | 62 | #region Public Constructors 63 | 64 | /// 65 | /// Initializes a new instance of the class. 66 | /// 67 | public HttpVersion () 68 | { 69 | } 70 | 71 | #endregion 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Packet.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Packet.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | namespace SocketIO 30 | { 31 | public class Packet 32 | { 33 | public EnginePacketType enginePacketType; 34 | public SocketPacketType socketPacketType; 35 | 36 | public int attachments; 37 | public string nsp; 38 | public int id; 39 | public JSONObject json; 40 | 41 | public Packet() : this(EnginePacketType.UNKNOWN, SocketPacketType.UNKNOWN, -1, "/", -1, null) { } 42 | public Packet(EnginePacketType enginePacketType) : this(enginePacketType, SocketPacketType.UNKNOWN, -1, "/", -1, null) { } 43 | 44 | public Packet(EnginePacketType enginePacketType, SocketPacketType socketPacketType, int attachments, string nsp, int id, JSONObject json) 45 | { 46 | this.enginePacketType = enginePacketType; 47 | this.socketPacketType = socketPacketType; 48 | this.attachments = attachments; 49 | this.nsp = nsp; 50 | this.id = id; 51 | this.json = json; 52 | } 53 | 54 | public override string ToString() 55 | { 56 | return string.Format("[Packet: enginePacketType={0}, socketPacketType={1}, attachments={2}, nsp={3}, id={4}, json={5}]", enginePacketType, socketPacketType, attachments, nsp, id, json); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/QueryStringCollection.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * QueryStringCollection.cs 4 | * 5 | * This code is derived from System.Net.HttpUtility.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2005-2009 Novell, Inc. (http://www.novell.com) 11 | * Copyright (c) 2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Patrik Torstensson 37 | * - Wictor Wilén (decode/encode functions) 38 | * - Tim Coleman 39 | * - Gonzalo Paniagua Javier 40 | */ 41 | #endregion 42 | 43 | using System; 44 | using System.Collections.Specialized; 45 | using System.Text; 46 | 47 | namespace WebSocketSharp.Net 48 | { 49 | internal sealed class QueryStringCollection : NameValueCollection 50 | { 51 | public override string ToString () 52 | { 53 | var cnt = Count; 54 | if (cnt == 0) 55 | return String.Empty; 56 | 57 | var output = new StringBuilder (); 58 | var keys = AllKeys; 59 | foreach (var key in keys) 60 | output.AppendFormat ("{0}={1}&", key, this [key]); 61 | 62 | if (output.Length > 0) 63 | output.Length--; 64 | 65 | return output.ToString (); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/ErrorEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * ErrorEventArgs.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | /// 34 | /// Contains the event data associated with a event. 35 | /// 36 | /// 37 | /// A event occurs when the gets an error. 38 | /// If you would like to get the error message, you should access the 39 | /// property. 40 | /// 41 | public class ErrorEventArgs : EventArgs 42 | { 43 | #region Private Fields 44 | 45 | private string _message; 46 | 47 | #endregion 48 | 49 | #region Internal Constructors 50 | 51 | internal ErrorEventArgs (string message) 52 | { 53 | _message = message; 54 | } 55 | 56 | #endregion 57 | 58 | #region Public Properties 59 | 60 | /// 61 | /// Gets the error message. 62 | /// 63 | /// 64 | /// A that represents the error message. 65 | /// 66 | public string Message { 67 | get { 68 | return _message; 69 | } 70 | } 71 | 72 | #endregion 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/ReadBufferState.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * ReadBufferState.cs 4 | * 5 | * This code is derived from System.Net.ChunkedInputStream.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2005 Novell, Inc. (http://www.novell.com) 11 | * Copyright (c) 2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Gonzalo Paniagua Javier 37 | */ 38 | #endregion 39 | 40 | using System; 41 | 42 | namespace WebSocketSharp.Net 43 | { 44 | internal class ReadBufferState 45 | { 46 | #region Public Constructors 47 | 48 | public ReadBufferState ( 49 | byte [] buffer, int offset, int count, HttpStreamAsyncResult asyncResult) 50 | { 51 | Buffer = buffer; 52 | Offset = offset; 53 | Count = count; 54 | InitialCount = count; 55 | AsyncResult = asyncResult; 56 | } 57 | 58 | #endregion 59 | 60 | #region Public Properties 61 | 62 | public HttpStreamAsyncResult AsyncResult { 63 | get; set; 64 | } 65 | 66 | public byte [] Buffer { 67 | get; set; 68 | } 69 | 70 | public int Count { 71 | get; set; 72 | } 73 | 74 | public int InitialCount { 75 | get; set; 76 | } 77 | 78 | public int Offset { 79 | get; set; 80 | } 81 | 82 | #endregion 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/WebSocketState.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * WebSocketState.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2010-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | /// 34 | /// Contains the values of the state of the WebSocket connection. 35 | /// 36 | /// 37 | /// The values of the state are defined in 38 | /// The WebSocket 39 | /// API. 40 | /// 41 | public enum WebSocketState : ushort 42 | { 43 | /// 44 | /// Equivalent to numeric value 0. 45 | /// Indicates that the connection has not yet been established. 46 | /// 47 | Connecting = 0, 48 | /// 49 | /// Equivalent to numeric value 1. 50 | /// Indicates that the connection is established and the communication is possible. 51 | /// 52 | Open = 1, 53 | /// 54 | /// Equivalent to numeric value 2. 55 | /// Indicates that the connection is going through the closing handshake or 56 | /// the WebSocket.Close method has been invoked. 57 | /// 58 | Closing = 2, 59 | /// 60 | /// Equivalent to numeric value 3. 61 | /// Indicates that the connection has been closed or couldn't be opened. 62 | /// 63 | Closed = 3 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/Chunk.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Chunk.cs 4 | * 5 | * This code is derived from System.Net.ChunkStream.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2003 Ximian, Inc (http://www.ximian.com) 11 | * Copyright (c) 2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Gonzalo Paniagua Javier 37 | */ 38 | #endregion 39 | 40 | using System; 41 | 42 | namespace WebSocketSharp.Net 43 | { 44 | internal class Chunk 45 | { 46 | #region Private Fields 47 | 48 | private byte [] _data; 49 | private int _offset; 50 | 51 | #endregion 52 | 53 | #region Public Constructors 54 | 55 | public Chunk (byte [] data) 56 | { 57 | _data = data; 58 | } 59 | 60 | #endregion 61 | 62 | #region Public Properties 63 | 64 | public int ReadLeft { 65 | get { 66 | return _data.Length - _offset; 67 | } 68 | } 69 | 70 | #endregion 71 | 72 | #region Public Methods 73 | 74 | public int Read (byte [] buffer, int offset, int size) 75 | { 76 | var left = _data.Length - _offset; 77 | if (left == 0) 78 | return left; 79 | 80 | if (size > left) 81 | size = left; 82 | 83 | Buffer.BlockCopy (_data, _offset, buffer, offset, size); 84 | _offset += size; 85 | 86 | return size; 87 | } 88 | 89 | #endregion 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Opcode.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Opcode.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | /// 34 | /// Contains the values of the opcode that indicates the type of a WebSocket frame. 35 | /// 36 | /// 37 | /// The values of the opcode are defined in 38 | /// Section 5.2 of RFC 6455. 39 | /// 40 | public enum Opcode : byte 41 | { 42 | /// 43 | /// Equivalent to numeric value 0. 44 | /// Indicates a continuation frame. 45 | /// 46 | Cont = 0x0, 47 | /// 48 | /// Equivalent to numeric value 1. 49 | /// Indicates a text frame. 50 | /// 51 | Text = 0x1, 52 | /// 53 | /// Equivalent to numeric value 2. 54 | /// Indicates a binary frame. 55 | /// 56 | Binary = 0x2, 57 | /// 58 | /// Equivalent to numeric value 8. 59 | /// Indicates a connection close frame. 60 | /// 61 | Close = 0x8, 62 | /// 63 | /// Equivalent to numeric value 9. 64 | /// Indicates a ping frame. 65 | /// 66 | Ping = 0x9, 67 | /// 68 | /// Equivalent to numeric value 10. 69 | /// Indicates a pong frame. 70 | /// 71 | Pong = 0xa 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpBasicIdentity.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * HttpBasicIdentity.cs 4 | * 5 | * This code is derived from System.Net.HttpListenerBasicIdentity.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2005 Novell, Inc. (http://www.novell.com) 11 | * Copyright (c) 2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Gonzalo Paniagua Javier 37 | */ 38 | #endregion 39 | 40 | using System; 41 | using System.Security.Principal; 42 | 43 | namespace WebSocketSharp.Net 44 | { 45 | /// 46 | /// Holds the user name and password from the HTTP Basic authentication credentials. 47 | /// 48 | public class HttpBasicIdentity : GenericIdentity 49 | { 50 | #region Private Fields 51 | 52 | private string _password; 53 | 54 | #endregion 55 | 56 | #region internal Constructors 57 | 58 | internal HttpBasicIdentity (string username, string password) 59 | : base (username, "Basic") 60 | { 61 | _password = password; 62 | } 63 | 64 | #endregion 65 | 66 | #region Public Properties 67 | 68 | /// 69 | /// Gets the password from the HTTP Basic authentication credentials. 70 | /// 71 | /// 72 | /// A that represents the password. 73 | /// 74 | public virtual string Password { 75 | get { 76 | return _password; 77 | } 78 | } 79 | 80 | #endregion 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 41 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 42 | m_PreloadedShaders: [] 43 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 44 | type: 0} 45 | m_CustomRenderPipeline: {fileID: 0} 46 | m_TransparencySortMode: 0 47 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 48 | m_DefaultRenderingPath: 1 49 | m_DefaultMobileRenderingPath: 1 50 | m_TierSettings: [] 51 | m_LightmapStripping: 0 52 | m_FogStripping: 0 53 | m_InstancingStripping: 0 54 | m_LightmapKeepPlain: 1 55 | m_LightmapKeepDirCombined: 1 56 | m_LightmapKeepDynamicPlain: 1 57 | m_LightmapKeepDynamicDirCombined: 1 58 | m_LightmapKeepShadowMask: 1 59 | m_LightmapKeepSubtractive: 1 60 | m_FogKeepLinear: 1 61 | m_FogKeepExp: 1 62 | m_FogKeepExp2: 1 63 | m_AlbedoSwatchInfos: [] 64 | m_LightsUseLinearIntensity: 0 65 | m_LightsUseColorTemperature: 0 66 | m_LogWhenShaderIsCompiled: 0 67 | m_AllowEnlightenSupportForUpgradedProject: 1 68 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Network Manager.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000010322164812} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000010322164812 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000010103306070} 22 | - 114: {fileID: 114000014098334418} 23 | - 114: {fileID: 114000011500049566} 24 | - 114: {fileID: 114000010400414242} 25 | m_Layer: 0 26 | m_Name: Network Manager 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000010103306070 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000010322164812} 38 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 39 | m_LocalPosition: {x: 0, y: 0, z: 0} 40 | m_LocalScale: {x: 1, y: 1, z: 1} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!114 &114000010400414242 46 | MonoBehaviour: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000010322164812} 51 | m_Enabled: 1 52 | m_EditorHideFlags: 0 53 | m_Script: {fileID: 11500000, guid: 799ae02b3116c4430b978f47aacd1d68, type: 3} 54 | m_Name: 55 | m_EditorClassIdentifier: 56 | playerSpawnPoints: [] 57 | --- !u!114 &114000011500049566 58 | MonoBehaviour: 59 | m_ObjectHideFlags: 1 60 | m_PrefabParentObject: {fileID: 0} 61 | m_PrefabInternal: {fileID: 100100000} 62 | m_GameObject: {fileID: 1000010322164812} 63 | m_Enabled: 1 64 | m_EditorHideFlags: 0 65 | m_Script: {fileID: 11500000, guid: 479b63cee56c64b8899ac04c2ac1ef28, type: 3} 66 | m_Name: 67 | m_EditorClassIdentifier: 68 | enemy: {fileID: 0} 69 | spawnPoint: {fileID: 0} 70 | numberOfEnemies: 0 71 | enemySpawnPoints: [] 72 | --- !u!114 &114000014098334418 73 | MonoBehaviour: 74 | m_ObjectHideFlags: 1 75 | m_PrefabParentObject: {fileID: 0} 76 | m_PrefabInternal: {fileID: 100100000} 77 | m_GameObject: {fileID: 1000010322164812} 78 | m_Enabled: 1 79 | m_EditorHideFlags: 0 80 | m_Script: {fileID: 11500000, guid: 95260bb3afc2e466f8dfd98733a41c84, type: 3} 81 | m_Name: 82 | m_EditorClassIdentifier: 83 | canvas: {fileID: 0} 84 | socket: {fileID: 0} 85 | playerNameInput: {fileID: 0} 86 | player: {fileID: 0} 87 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/Security/SslStream.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * SslStream.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | using System.Net.Security; 31 | using System.Net.Sockets; 32 | 33 | namespace WebSocketSharp.Net.Security 34 | { 35 | internal class SslStream : System.Net.Security.SslStream 36 | { 37 | #region Public Constructors 38 | 39 | public SslStream (NetworkStream innerStream) 40 | : base (innerStream) 41 | { 42 | } 43 | 44 | public SslStream (NetworkStream innerStream, bool leaveInnerStreamOpen) 45 | : base (innerStream, leaveInnerStreamOpen) 46 | { 47 | } 48 | 49 | public SslStream ( 50 | NetworkStream innerStream, 51 | bool leaveInnerStreamOpen, 52 | RemoteCertificateValidationCallback userCertificateValidationCallback) 53 | : base (innerStream, leaveInnerStreamOpen, userCertificateValidationCallback) 54 | { 55 | } 56 | 57 | public SslStream ( 58 | NetworkStream innerStream, 59 | bool leaveInnerStreamOpen, 60 | RemoteCertificateValidationCallback userCertificateValidationCallback, 61 | LocalCertificateSelectionCallback userCertificateSelectionCallback) 62 | : base ( 63 | innerStream, 64 | leaveInnerStreamOpen, 65 | userCertificateValidationCallback, 66 | userCertificateSelectionCallback) 67 | { 68 | } 69 | 70 | #endregion 71 | 72 | #region Public Properties 73 | 74 | public bool DataAvailable { 75 | get { 76 | return ((NetworkStream) InnerStream).DataAvailable; 77 | } 78 | } 79 | 80 | #endregion 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Ground.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000013447312472} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000013447312472 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000012553059580} 22 | - 33: {fileID: 33000012190468054} 23 | - 64: {fileID: 64000012665721052} 24 | - 23: {fileID: 23000012679231664} 25 | m_Layer: 0 26 | m_Name: Ground 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!4 &4000012553059580 33 | Transform: 34 | m_ObjectHideFlags: 1 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | m_GameObject: {fileID: 1000013447312472} 38 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 39 | m_LocalPosition: {x: 0, y: -1, z: 0} 40 | m_LocalScale: {x: 20, y: 1, z: 20} 41 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | --- !u!23 &23000012679231664 46 | MeshRenderer: 47 | m_ObjectHideFlags: 1 48 | m_PrefabParentObject: {fileID: 0} 49 | m_PrefabInternal: {fileID: 100100000} 50 | m_GameObject: {fileID: 1000013447312472} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 1 54 | m_MotionVectors: 1 55 | m_LightProbeUsage: 1 56 | m_ReflectionProbeUsage: 1 57 | m_Materials: 58 | - {fileID: 2100000, guid: 7920bb0bab6f44adcb550153c5c51074, type: 2} 59 | m_SubsetIndices: 60 | m_StaticBatchRoot: {fileID: 0} 61 | m_ProbeAnchor: {fileID: 0} 62 | m_LightProbeVolumeOverride: {fileID: 0} 63 | m_ScaleInLightmap: 1 64 | m_PreserveUVs: 1 65 | m_IgnoreNormalsForChartDetection: 0 66 | m_ImportantGI: 0 67 | m_SelectedWireframeHidden: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingOrder: 0 74 | --- !u!33 &33000012190468054 75 | MeshFilter: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1000013447312472} 80 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 81 | --- !u!64 &64000012665721052 82 | MeshCollider: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1000013447312472} 87 | m_Material: {fileID: 0} 88 | m_IsTrigger: 0 89 | m_Enabled: 1 90 | serializedVersion: 2 91 | m_Convex: 0 92 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 93 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/WebSocketException.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * WebSocketException.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | 31 | namespace WebSocketSharp 32 | { 33 | /// 34 | /// The exception that is thrown when a gets a fatal error. 35 | /// 36 | public class WebSocketException : Exception 37 | { 38 | #region Internal Constructors 39 | 40 | internal WebSocketException () 41 | : this (CloseStatusCode.Abnormal, null, null) 42 | { 43 | } 44 | 45 | internal WebSocketException (string message) 46 | : this (CloseStatusCode.Abnormal, message, null) 47 | { 48 | } 49 | 50 | internal WebSocketException (CloseStatusCode code) 51 | : this (code, null, null) 52 | { 53 | } 54 | 55 | internal WebSocketException (string message, Exception innerException) 56 | : this (CloseStatusCode.Abnormal, message, innerException) 57 | { 58 | } 59 | 60 | internal WebSocketException (CloseStatusCode code, string message) 61 | : this (code, message, null) 62 | { 63 | } 64 | 65 | internal WebSocketException (CloseStatusCode code, string message, Exception innerException) 66 | : base (message ?? code.GetMessage (), innerException) 67 | { 68 | Code = code; 69 | } 70 | 71 | #endregion 72 | 73 | #region Public Properties 74 | 75 | /// 76 | /// Gets the status code indicating the cause for the exception. 77 | /// 78 | /// 79 | /// One of the enum values, represents the status code indicating 80 | /// the cause for the exception. 81 | /// 82 | public CloseStatusCode Code { 83 | get; private set; 84 | } 85 | 86 | #endregion 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Encoder.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Encoder.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | //#define SOCKET_IO_DEBUG // Uncomment this for debug 30 | using System; 31 | using System.Collections; 32 | using System.Text; 33 | using UnityEngine; 34 | 35 | namespace SocketIO 36 | { 37 | public class Encoder 38 | { 39 | public string Encode(Packet packet) 40 | { 41 | try 42 | { 43 | #if SOCKET_IO_DEBUG 44 | Debug.Log("[SocketIO] Encoding: " + packet.json); 45 | #endif 46 | 47 | StringBuilder builder = new StringBuilder(); 48 | 49 | // first is type 50 | builder.Append((int)packet.enginePacketType); 51 | if(!packet.enginePacketType.Equals(EnginePacketType.MESSAGE)){ 52 | return builder.ToString(); 53 | } 54 | 55 | builder.Append((int)packet.socketPacketType); 56 | 57 | // attachments if we have them 58 | if (packet.socketPacketType == SocketPacketType.BINARY_EVENT || packet.socketPacketType == SocketPacketType.BINARY_ACK) { 59 | builder.Append(packet.attachments); 60 | builder.Append('-'); 61 | } 62 | 63 | // if we have a namespace other than '/' 64 | // we append it followed by a comma ',' 65 | if (!string.IsNullOrEmpty(packet.nsp) && !packet.nsp.Equals("/")) { 66 | builder.Append(packet.nsp); 67 | builder.Append(','); 68 | } 69 | 70 | // immediately followed by the id 71 | if (packet.id > -1) { 72 | builder.Append(packet.id); 73 | } 74 | 75 | if (packet.json != null && !packet.json.ToString().Equals("null")) { 76 | builder.Append(packet.json.ToString()); 77 | } 78 | 79 | #if SOCKET_IO_DEBUG 80 | Debug.Log("[SocketIO] Encoded: " + builder); 81 | #endif 82 | 83 | return builder.ToString(); 84 | 85 | } catch(Exception ex) { 86 | throw new SocketIOException("Packet encoding failed: " + packet ,ex); 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/JSONObject/JSONTemplates.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | 5 | /* 6 | * http://www.opensource.org/licenses/lgpl-2.1.php 7 | * JSONTemplates class 8 | * for use with Unity 9 | * Copyright Matt Schoen 2010 10 | */ 11 | 12 | public static partial class JSONTemplates { 13 | static readonly HashSet touched = new HashSet(); 14 | 15 | public static JSONObject TOJSON(object obj) { //For a generic guess 16 | if(touched.Add(obj)) { 17 | JSONObject result = JSONObject.obj; 18 | //Fields 19 | FieldInfo[] fieldinfo = obj.GetType().GetFields(); 20 | foreach(FieldInfo fi in fieldinfo) { 21 | JSONObject val = JSONObject.nullJO; 22 | if(!fi.GetValue(obj).Equals(null)) { 23 | MethodInfo info = typeof(JSONTemplates).GetMethod("From" + fi.FieldType.Name); 24 | if(info != null) { 25 | object[] parms = new object[1]; 26 | parms[0] = fi.GetValue(obj); 27 | val = (JSONObject)info.Invoke(null, parms); 28 | } else if(fi.FieldType == typeof(string)) 29 | val = JSONObject.CreateStringObject(fi.GetValue(obj).ToString()); 30 | else 31 | val = JSONObject.Create(fi.GetValue(obj).ToString()); 32 | } 33 | if(val) { 34 | if(val.type != JSONObject.Type.NULL) 35 | result.AddField(fi.Name, val); 36 | else Debug.LogWarning("Null for this non-null object, property " + fi.Name + " of class " + obj.GetType().Name + ". Object type is " + fi.FieldType.Name); 37 | } 38 | } 39 | //Properties 40 | PropertyInfo[] propertyInfo = obj.GetType().GetProperties(); 41 | foreach(PropertyInfo pi in propertyInfo) { 42 | //This section should mirror part of AssetFactory.AddScripts() 43 | JSONObject val = JSONObject.nullJO; 44 | if(!pi.GetValue(obj, null).Equals(null)) { 45 | MethodInfo info = typeof(JSONTemplates).GetMethod("From" + pi.PropertyType.Name); 46 | if(info != null) { 47 | object[] parms = new object[1]; 48 | parms[0] = pi.GetValue(obj, null); 49 | val = (JSONObject)info.Invoke(null, parms); 50 | } else if(pi.PropertyType == typeof(string)) 51 | val = JSONObject.CreateStringObject(pi.GetValue(obj, null).ToString()); 52 | else 53 | val = JSONObject.Create(pi.GetValue(obj, null).ToString()); 54 | } 55 | if(val) { 56 | if(val.type != JSONObject.Type.NULL) 57 | result.AddField(pi.Name, val); 58 | else Debug.LogWarning("Null for this non-null object, property " + pi.Name + " of class " + obj.GetType().Name + ". Object type is " + pi.PropertyType.Name); 59 | } 60 | } 61 | return result; 62 | } 63 | Debug.LogWarning("trying to save the same data twice"); 64 | return JSONObject.nullJO; 65 | } 66 | } 67 | 68 | /* 69 | * Some helpful code templates for the JSON class 70 | * 71 | * LOOP THROUGH OBJECT 72 | for(int i = 0; i < obj.Count; i++){ 73 | if(obj.keys[i] != null){ 74 | switch((string)obj.keys[i]){ 75 | case "key1": 76 | do stuff with (JSONObject)obj.list[i]; 77 | break; 78 | case "key2": 79 | do stuff with (JSONObject)obj.list[i]; 80 | break; 81 | } 82 | } 83 | } 84 | * 85 | * LOOP THROUGH ARRAY 86 | foreach(JSONObject ob in obj.list) 87 | do stuff with ob; 88 | */ 89 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/Test/TestSocketIO.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * TestSocketIO.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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.Collections; 30 | using UnityEngine; 31 | using SocketIO; 32 | 33 | public class TestSocketIO : MonoBehaviour 34 | { 35 | private SocketIOComponent socket; 36 | 37 | public void Start() 38 | { 39 | GameObject go = GameObject.Find("SocketIO"); 40 | socket = go.GetComponent(); 41 | 42 | socket.On("open", TestOpen); 43 | socket.On("boop", TestBoop); 44 | socket.On("error", TestError); 45 | socket.On("close", TestClose); 46 | 47 | StartCoroutine("BeepBoop"); 48 | } 49 | 50 | private IEnumerator BeepBoop() 51 | { 52 | // wait 1 seconds and continue 53 | yield return new WaitForSeconds(1); 54 | 55 | socket.Emit("beep"); 56 | 57 | // wait 3 seconds and continue 58 | yield return new WaitForSeconds(3); 59 | 60 | socket.Emit("beep"); 61 | 62 | // wait 2 seconds and continue 63 | yield return new WaitForSeconds(2); 64 | 65 | socket.Emit("beep"); 66 | 67 | // wait ONE FRAME and continue 68 | yield return null; 69 | 70 | socket.Emit("beep"); 71 | socket.Emit("beep"); 72 | } 73 | 74 | public void TestOpen(SocketIOEvent e) 75 | { 76 | Debug.Log("[SocketIO] Open received: " + e.name + " " + e.data); 77 | } 78 | 79 | public void TestBoop(SocketIOEvent e) 80 | { 81 | Debug.Log("[SocketIO] Boop received: " + e.name + " " + e.data); 82 | 83 | if (e.data == null) { return; } 84 | 85 | Debug.Log( 86 | "#####################################################" + 87 | "THIS: " + e.data.GetField("this").str + 88 | "#####################################################" 89 | ); 90 | } 91 | 92 | public void TestError(SocketIOEvent e) 93 | { 94 | Debug.Log("[SocketIO] Error received: " + e.name + " " + e.data); 95 | } 96 | 97 | public void TestClose(SocketIOEvent e) 98 | { 99 | Debug.Log("[SocketIO] Close received: " + e.name + " " + e.data); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Materials/Black.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Black 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 0, g: 0, b: 0, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Materials/White.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: White 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 1, g: 1, b: 1, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Materials/Brown.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Brown 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 0.6, g: 0.4, b: 0.2, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpHeaderInfo.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * HttpHeaderInfo.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2013-2014 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 | 31 | namespace WebSocketSharp.Net 32 | { 33 | internal class HttpHeaderInfo 34 | { 35 | #region Private Fields 36 | 37 | private HttpHeaderType _type; 38 | 39 | #endregion 40 | 41 | #region Public Constructors 42 | 43 | public HttpHeaderInfo () 44 | { 45 | } 46 | 47 | #endregion 48 | 49 | #region Internal Properties 50 | 51 | internal bool IsMultiValueInRequest { 52 | get { 53 | return (_type & HttpHeaderType.MultiValueInRequest) == HttpHeaderType.MultiValueInRequest; 54 | } 55 | } 56 | 57 | internal bool IsMultiValueInResponse { 58 | get { 59 | return (_type & HttpHeaderType.MultiValueInResponse) == HttpHeaderType.MultiValueInResponse; 60 | } 61 | } 62 | 63 | #endregion 64 | 65 | #region Public Properties 66 | 67 | public bool IsRequest { 68 | get { 69 | return (_type & HttpHeaderType.Request) == HttpHeaderType.Request; 70 | } 71 | } 72 | 73 | public bool IsResponse { 74 | get { 75 | return (_type & HttpHeaderType.Response) == HttpHeaderType.Response; 76 | } 77 | } 78 | 79 | public string Name { 80 | get; set; 81 | } 82 | 83 | public HttpHeaderType Type { 84 | get { 85 | return _type; 86 | } 87 | 88 | set { 89 | _type = value; 90 | } 91 | } 92 | 93 | #endregion 94 | 95 | #region Public Methods 96 | 97 | public bool IsMultiValue (bool response) 98 | { 99 | return (_type & HttpHeaderType.MultiValue) != HttpHeaderType.MultiValue 100 | ? response 101 | ? IsMultiValueInResponse 102 | : IsMultiValueInRequest 103 | : response 104 | ? IsResponse 105 | : IsRequest; 106 | } 107 | 108 | public bool IsRestricted (bool response) 109 | { 110 | return (_type & HttpHeaderType.Restricted) != HttpHeaderType.Restricted 111 | ? false 112 | : response 113 | ? IsResponse 114 | : IsRequest; 115 | } 116 | 117 | #endregion 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/HandshakeBase.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * HandshakeBase.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | using System.Collections.Specialized; 31 | using System.Text; 32 | using WebSocketSharp.Net; 33 | 34 | namespace WebSocketSharp 35 | { 36 | internal abstract class HandshakeBase 37 | { 38 | #region Private Fields 39 | 40 | private NameValueCollection _headers; 41 | private Version _version; 42 | 43 | #endregion 44 | 45 | #region Internal Fields 46 | 47 | internal byte[] EntityBodyData; 48 | 49 | #endregion 50 | 51 | #region Protected Const Fields 52 | 53 | protected const string CrLf = "\r\n"; 54 | 55 | #endregion 56 | 57 | #region Protected Constructors 58 | 59 | protected HandshakeBase (Version version, NameValueCollection headers) 60 | { 61 | _version = version; 62 | _headers = headers; 63 | } 64 | 65 | #endregion 66 | 67 | #region Public Properties 68 | 69 | public string EntityBody { 70 | get { 71 | return EntityBodyData != null && EntityBodyData.LongLength > 0 72 | ? getEncoding (_headers["Content-Type"]).GetString (EntityBodyData) 73 | : String.Empty; 74 | } 75 | } 76 | 77 | public NameValueCollection Headers { 78 | get { 79 | return _headers; 80 | } 81 | } 82 | 83 | public Version ProtocolVersion { 84 | get { 85 | return _version; 86 | } 87 | } 88 | 89 | #endregion 90 | 91 | #region Private Methods 92 | 93 | private static Encoding getEncoding (string contentType) 94 | { 95 | if (contentType == null || contentType.Length == 0) 96 | return Encoding.UTF8; 97 | 98 | var i = contentType.IndexOf ("charset=", StringComparison.Ordinal); 99 | if (i == -1) 100 | return Encoding.UTF8; 101 | 102 | var charset = contentType.Substring (i + 8); 103 | i = charset.IndexOf (';'); 104 | if (i != -1) 105 | charset = charset.Substring (0, i); 106 | 107 | return Encoding.GetEncoding (charset); 108 | } 109 | 110 | #endregion 111 | 112 | #region Public Methods 113 | 114 | public byte[] ToByteArray () 115 | { 116 | return Encoding.UTF8.GetBytes (ToString ()); 117 | } 118 | 119 | #endregion 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/CloseEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * CloseEventArgs.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2014 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 | using System.Text; 31 | 32 | namespace WebSocketSharp 33 | { 34 | /// 35 | /// Contains the event data associated with a event. 36 | /// 37 | /// 38 | /// A event occurs when the WebSocket connection has been closed. 39 | /// If you would like to get the reason for the close, you should access the or 40 | /// property. 41 | /// 42 | public class CloseEventArgs : EventArgs 43 | { 44 | #region Private Fields 45 | 46 | private bool _clean; 47 | private ushort _code; 48 | private string _reason; 49 | 50 | #endregion 51 | 52 | #region Internal Constructors 53 | 54 | internal CloseEventArgs (PayloadData payload) 55 | { 56 | var data = payload.ApplicationData; 57 | var len = data.Length; 58 | _code = len > 1 59 | ? data.SubArray (0, 2).ToUInt16 (ByteOrder.Big) 60 | : (ushort) CloseStatusCode.NoStatusCode; 61 | 62 | _reason = len > 2 63 | ? Encoding.UTF8.GetString (data.SubArray (2, len - 2)) 64 | : String.Empty; 65 | } 66 | 67 | #endregion 68 | 69 | #region Public Properties 70 | 71 | /// 72 | /// Gets the status code for the close. 73 | /// 74 | /// 75 | /// A that represents the status code for the close if any. 76 | /// 77 | public ushort Code { 78 | get { 79 | return _code; 80 | } 81 | } 82 | 83 | /// 84 | /// Gets the reason for the close. 85 | /// 86 | /// 87 | /// A that represents the reason for the close if any. 88 | /// 89 | public string Reason { 90 | get { 91 | return _reason; 92 | } 93 | } 94 | 95 | /// 96 | /// Gets a value indicating whether the WebSocket connection has been closed cleanly. 97 | /// 98 | /// 99 | /// true if the WebSocket connection has been closed cleanly; otherwise, false. 100 | /// 101 | public bool WasClean { 102 | get { 103 | return _clean; 104 | } 105 | 106 | internal set { 107 | _clean = value; 108 | } 109 | } 110 | 111 | #endregion 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpStreamAsyncResult.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * HttpStreamAsyncResult.cs 4 | * 5 | * This code is derived from System.Net.HttpStreamAsyncResult.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2005 Novell, Inc. (http://www.novell.com) 11 | * Copyright (c) 2012-2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Gonzalo Paniagua Javier 37 | */ 38 | #endregion 39 | 40 | using System; 41 | using System.Threading; 42 | 43 | namespace WebSocketSharp.Net 44 | { 45 | internal class HttpStreamAsyncResult : IAsyncResult 46 | { 47 | #region Private Fields 48 | 49 | private AsyncCallback _callback; 50 | private bool _completed; 51 | private object _state; 52 | private object _sync; 53 | private ManualResetEvent _waitHandle; 54 | 55 | #endregion 56 | 57 | #region Internal Fields 58 | 59 | internal byte [] Buffer; 60 | internal int Count; 61 | internal Exception Error; 62 | internal int Offset; 63 | internal int SyncRead; 64 | 65 | #endregion 66 | 67 | #region Public Constructors 68 | 69 | public HttpStreamAsyncResult (AsyncCallback callback, object state) 70 | { 71 | _callback = callback; 72 | _state = state; 73 | _sync = new object (); 74 | } 75 | 76 | #endregion 77 | 78 | #region Public Properties 79 | 80 | public object AsyncState { 81 | get { 82 | return _state; 83 | } 84 | } 85 | 86 | public WaitHandle AsyncWaitHandle { 87 | get { 88 | lock (_sync) 89 | return _waitHandle ?? (_waitHandle = new ManualResetEvent (_completed)); 90 | } 91 | } 92 | 93 | public bool CompletedSynchronously { 94 | get { 95 | return SyncRead == Count; 96 | } 97 | } 98 | 99 | public bool IsCompleted { 100 | get { 101 | lock (_sync) 102 | return _completed; 103 | } 104 | } 105 | 106 | #endregion 107 | 108 | #region Public Methods 109 | 110 | public void Complete () 111 | { 112 | lock (_sync) { 113 | if (_completed) 114 | return; 115 | 116 | _completed = true; 117 | if (_waitHandle != null) 118 | _waitHandle.Set (); 119 | 120 | if (_callback != null) 121 | _callback.BeginInvoke (this, ar => _callback.EndInvoke (ar), null); 122 | } 123 | } 124 | 125 | public void Complete (Exception exception) 126 | { 127 | Error = exception; 128 | Complete (); 129 | } 130 | 131 | #endregion 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/Prefabs/Bullet.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1000011697043442} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1000011697043442 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 4 20 | m_Component: 21 | - 4: {fileID: 4000010888113016} 22 | - 33: {fileID: 33000012410929180} 23 | - 135: {fileID: 135000013152506418} 24 | - 23: {fileID: 23000011944293110} 25 | - 54: {fileID: 54000011619221594} 26 | - 114: {fileID: 114000012251277886} 27 | m_Layer: 0 28 | m_Name: Bullet 29 | m_TagString: Untagged 30 | m_Icon: {fileID: 0} 31 | m_NavMeshLayer: 0 32 | m_StaticEditorFlags: 0 33 | m_IsActive: 1 34 | --- !u!4 &4000010888113016 35 | Transform: 36 | m_ObjectHideFlags: 1 37 | m_PrefabParentObject: {fileID: 0} 38 | m_PrefabInternal: {fileID: 100100000} 39 | m_GameObject: {fileID: 1000011697043442} 40 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 41 | m_LocalPosition: {x: 0, y: 0, z: 0} 42 | m_LocalScale: {x: 0.2, y: 0.2, z: 0.2} 43 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 44 | m_Children: [] 45 | m_Father: {fileID: 0} 46 | m_RootOrder: 0 47 | --- !u!23 &23000011944293110 48 | MeshRenderer: 49 | m_ObjectHideFlags: 1 50 | m_PrefabParentObject: {fileID: 0} 51 | m_PrefabInternal: {fileID: 100100000} 52 | m_GameObject: {fileID: 1000011697043442} 53 | m_Enabled: 1 54 | m_CastShadows: 1 55 | m_ReceiveShadows: 1 56 | m_MotionVectors: 0 57 | m_LightProbeUsage: 1 58 | m_ReflectionProbeUsage: 1 59 | m_Materials: 60 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 61 | m_SubsetIndices: 62 | m_StaticBatchRoot: {fileID: 0} 63 | m_ProbeAnchor: {fileID: 0} 64 | m_LightProbeVolumeOverride: {fileID: 0} 65 | m_ScaleInLightmap: 1 66 | m_PreserveUVs: 1 67 | m_IgnoreNormalsForChartDetection: 0 68 | m_ImportantGI: 0 69 | m_SelectedWireframeHidden: 0 70 | m_MinimumChartSize: 4 71 | m_AutoUVMaxDistance: 0.5 72 | m_AutoUVMaxAngle: 89 73 | m_LightmapParameters: {fileID: 0} 74 | m_SortingLayerID: 0 75 | m_SortingOrder: 0 76 | --- !u!33 &33000012410929180 77 | MeshFilter: 78 | m_ObjectHideFlags: 1 79 | m_PrefabParentObject: {fileID: 0} 80 | m_PrefabInternal: {fileID: 100100000} 81 | m_GameObject: {fileID: 1000011697043442} 82 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 83 | --- !u!54 &54000011619221594 84 | Rigidbody: 85 | m_ObjectHideFlags: 1 86 | m_PrefabParentObject: {fileID: 0} 87 | m_PrefabInternal: {fileID: 100100000} 88 | m_GameObject: {fileID: 1000011697043442} 89 | serializedVersion: 2 90 | m_Mass: 1 91 | m_Drag: 0 92 | m_AngularDrag: 0.05 93 | m_UseGravity: 0 94 | m_IsKinematic: 1 95 | m_Interpolate: 0 96 | m_Constraints: 0 97 | m_CollisionDetection: 0 98 | --- !u!114 &114000012251277886 99 | MonoBehaviour: 100 | m_ObjectHideFlags: 1 101 | m_PrefabParentObject: {fileID: 0} 102 | m_PrefabInternal: {fileID: 100100000} 103 | m_GameObject: {fileID: 1000011697043442} 104 | m_Enabled: 1 105 | m_EditorHideFlags: 0 106 | m_Script: {fileID: 11500000, guid: da11515a9d033427fa6815c138b1b855, type: 3} 107 | m_Name: 108 | m_EditorClassIdentifier: 109 | playerFrom: {fileID: 0} 110 | --- !u!135 &135000013152506418 111 | SphereCollider: 112 | m_ObjectHideFlags: 1 113 | m_PrefabParentObject: {fileID: 0} 114 | m_PrefabInternal: {fileID: 100100000} 115 | m_GameObject: {fileID: 1000011697043442} 116 | m_Material: {fileID: 0} 117 | m_IsTrigger: 0 118 | m_Enabled: 1 119 | serializedVersion: 2 120 | m_Radius: 0.5 121 | m_Center: {x: 0, y: 0, z: 0} 122 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/Scripts/SocketIO/Decoder.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * Decoder.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 Fabio Panettieri 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 | //#define SOCKET_IO_DEBUG // Uncomment this for debug 30 | using System; 31 | using System.Collections; 32 | using System.Text; 33 | using UnityEngine; 34 | using WebSocketSharp; 35 | 36 | namespace SocketIO 37 | { 38 | public class Decoder 39 | { 40 | public Packet Decode(MessageEventArgs e) 41 | { 42 | try 43 | { 44 | #if SOCKET_IO_DEBUG 45 | Debug.Log("[SocketIO] Decoding: " + e.Data); 46 | #endif 47 | 48 | string data = e.Data; 49 | Packet packet = new Packet(); 50 | int offset = 0; 51 | 52 | // look up packet type 53 | int enginePacketType = int.Parse(data.Substring(offset, 1)); 54 | packet.enginePacketType = (EnginePacketType)enginePacketType; 55 | 56 | if (enginePacketType == (int)EnginePacketType.MESSAGE) { 57 | int socketPacketType = int.Parse(data.Substring(++offset, 1)); 58 | packet.socketPacketType = (SocketPacketType)socketPacketType; 59 | } 60 | 61 | // connect message properly parsed 62 | if (data.Length <= 2) { 63 | #if SOCKET_IO_DEBUG 64 | Debug.Log("[SocketIO] Decoded: " + packet); 65 | #endif 66 | return packet; 67 | } 68 | 69 | // look up namespace (if any) 70 | if ('/' == data [offset + 1]) { 71 | StringBuilder builder = new StringBuilder(); 72 | while (offset < data.Length - 1 && data[++offset] != ',') { 73 | builder.Append(data [offset]); 74 | } 75 | packet.nsp = builder.ToString(); 76 | } else { 77 | packet.nsp = "/"; 78 | } 79 | 80 | // look up id 81 | char next = data [offset + 1]; 82 | if (next != ' ' && char.IsNumber(next)) { 83 | StringBuilder builder = new StringBuilder(); 84 | while (offset < data.Length - 1) { 85 | char c = data [++offset]; 86 | if (char.IsNumber(c)) { 87 | builder.Append(c); 88 | } else { 89 | --offset; 90 | break; 91 | } 92 | } 93 | packet.id = int.Parse(builder.ToString()); 94 | } 95 | 96 | // look up json data 97 | if (++offset < data.Length - 1) { 98 | try { 99 | #if SOCKET_IO_DEBUG 100 | Debug.Log("[SocketIO] Parsing JSON: " + data.Substring(offset)); 101 | #endif 102 | packet.json = new JSONObject(data.Substring(offset)); 103 | } catch (Exception ex) { 104 | Debug.LogException(ex); 105 | } 106 | } 107 | 108 | #if SOCKET_IO_DEBUG 109 | Debug.Log("[SocketIO] Decoded: " + packet); 110 | #endif 111 | 112 | return packet; 113 | 114 | } catch(Exception ex) { 115 | throw new SocketIOException("Packet decoding failed: " + e.Data ,ex); 116 | } 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/MessageEventArgs.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * MessageEventArgs.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2012-2013 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 | using System.Text; 31 | 32 | namespace WebSocketSharp 33 | { 34 | /// 35 | /// Contains the event data associated with a event. 36 | /// 37 | /// 38 | /// A event occurs when the receives 39 | /// a text or binary data frame. 40 | /// If you want to get the received data, you access the or 41 | /// property. 42 | /// 43 | public class MessageEventArgs : EventArgs 44 | { 45 | #region Private Fields 46 | 47 | private string _data; 48 | private Opcode _opcode; 49 | private byte[] _rawData; 50 | 51 | #endregion 52 | 53 | #region Internal Constructors 54 | 55 | internal MessageEventArgs (Opcode opcode, byte[] data) 56 | { 57 | if ((ulong) data.LongLength > PayloadData.MaxLength) 58 | throw new WebSocketException (CloseStatusCode.TooBig); 59 | 60 | _opcode = opcode; 61 | _rawData = data; 62 | _data = convertToString (opcode, data); 63 | } 64 | 65 | internal MessageEventArgs (Opcode opcode, PayloadData payload) 66 | { 67 | _opcode = opcode; 68 | _rawData = payload.ApplicationData; 69 | _data = convertToString (opcode, _rawData); 70 | } 71 | 72 | #endregion 73 | 74 | #region Public Properties 75 | 76 | /// 77 | /// Gets the received data as a . 78 | /// 79 | /// 80 | /// A that contains the received data. 81 | /// 82 | public string Data { 83 | get { 84 | return _data; 85 | } 86 | } 87 | 88 | /// 89 | /// Gets the received data as an array of . 90 | /// 91 | /// 92 | /// An array of that contains the received data. 93 | /// 94 | public byte [] RawData { 95 | get { 96 | return _rawData; 97 | } 98 | } 99 | 100 | /// 101 | /// Gets the type of the received data. 102 | /// 103 | /// 104 | /// One of the values, indicates the type of the received data. 105 | /// 106 | public Opcode Type { 107 | get { 108 | return _opcode; 109 | } 110 | } 111 | 112 | #endregion 113 | 114 | #region Private Methods 115 | 116 | private static string convertToString (Opcode opcode, byte [] data) 117 | { 118 | return data.LongLength == 0 119 | ? String.Empty 120 | : opcode == Opcode.Text 121 | ? Encoding.UTF8.GetString (data) 122 | : opcode.ToString (); 123 | } 124 | 125 | #endregion 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/AuthenticationBase.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * AuthenticationBase.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2014 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 | using System.Collections.Specialized; 31 | using System.Text; 32 | 33 | namespace WebSocketSharp.Net 34 | { 35 | internal abstract class AuthenticationBase 36 | { 37 | #region Private Fields 38 | 39 | private AuthenticationSchemes _scheme; 40 | 41 | #endregion 42 | 43 | #region Internal Fields 44 | 45 | internal NameValueCollection Parameters; 46 | 47 | #endregion 48 | 49 | #region Protected Constructors 50 | 51 | protected AuthenticationBase (AuthenticationSchemes scheme, NameValueCollection parameters) 52 | { 53 | _scheme = scheme; 54 | Parameters = parameters; 55 | } 56 | 57 | #endregion 58 | 59 | #region Public Properties 60 | 61 | public string Algorithm { 62 | get { 63 | return Parameters["algorithm"]; 64 | } 65 | } 66 | 67 | public string Nonce { 68 | get { 69 | return Parameters["nonce"]; 70 | } 71 | } 72 | 73 | public string Opaque { 74 | get { 75 | return Parameters["opaque"]; 76 | } 77 | } 78 | 79 | public string Qop { 80 | get { 81 | return Parameters["qop"]; 82 | } 83 | } 84 | 85 | public string Realm { 86 | get { 87 | return Parameters["realm"]; 88 | } 89 | } 90 | 91 | public AuthenticationSchemes Scheme { 92 | get { 93 | return _scheme; 94 | } 95 | } 96 | 97 | #endregion 98 | 99 | #region Internal Methods 100 | 101 | internal static string CreateNonceValue () 102 | { 103 | var src = new byte[16]; 104 | var rand = new Random (); 105 | rand.NextBytes (src); 106 | 107 | var res = new StringBuilder (32); 108 | foreach (var b in src) 109 | res.Append (b.ToString ("x2")); 110 | 111 | return res.ToString (); 112 | } 113 | 114 | internal static NameValueCollection ParseParameters (string value) 115 | { 116 | var res = new NameValueCollection (); 117 | foreach (var param in value.SplitHeaderValue (',')) { 118 | var i = param.IndexOf ('='); 119 | var name = i > 0 ? param.Substring (0, i).Trim () : null; 120 | var val = i < 0 121 | ? param.Trim ().Trim ('"') 122 | : i < param.Length - 1 123 | ? param.Substring (i + 1).Trim ().Trim ('"') 124 | : String.Empty; 125 | 126 | res.Add (name, val); 127 | } 128 | 129 | return res; 130 | } 131 | 132 | internal abstract string ToBasicString (); 133 | 134 | internal abstract string ToDigestString (); 135 | 136 | #endregion 137 | 138 | #region Public Methods 139 | 140 | public override string ToString () 141 | { 142 | return _scheme == AuthenticationSchemes.Basic 143 | ? ToBasicString () 144 | : _scheme == AuthenticationSchemes.Digest 145 | ? ToDigestString () 146 | : String.Empty; 147 | } 148 | 149 | #endregion 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/HttpListenerException.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * HttpListenerException.cs 4 | * 5 | * This code is derived from System.Net.HttpListenerException.cs of Mono 6 | * (http://www.mono-project.com). 7 | * 8 | * The MIT License 9 | * 10 | * Copyright (c) 2005 Novell, Inc. (http://www.novell.com) 11 | * Copyright (c) 2012-2014 sta.blockhead 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in 21 | * all copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | * THE SOFTWARE. 30 | */ 31 | #endregion 32 | 33 | #region Authors 34 | /* 35 | * Authors: 36 | * - Gonzalo Paniagua Javier 37 | */ 38 | #endregion 39 | 40 | using System; 41 | using System.ComponentModel; 42 | using System.Runtime.Serialization; 43 | 44 | namespace WebSocketSharp.Net 45 | { 46 | /// 47 | /// The exception that is thrown when a gets an error 48 | /// processing an HTTP request. 49 | /// 50 | [Serializable] 51 | public class HttpListenerException : Win32Exception 52 | { 53 | #region Protected Constructors 54 | 55 | /// 56 | /// Initializes a new instance of the class from 57 | /// the specified and . 58 | /// 59 | /// 60 | /// A that contains the serialized object data. 61 | /// 62 | /// 63 | /// A that specifies the source for the deserialization. 64 | /// 65 | protected HttpListenerException ( 66 | SerializationInfo serializationInfo, StreamingContext streamingContext) 67 | : base (serializationInfo, streamingContext) 68 | { 69 | } 70 | 71 | #endregion 72 | 73 | #region Public Constructors 74 | 75 | /// 76 | /// Initializes a new instance of the class. 77 | /// 78 | public HttpListenerException () 79 | { 80 | } 81 | 82 | /// 83 | /// Initializes a new instance of the class 84 | /// with the specified . 85 | /// 86 | /// 87 | /// An that identifies the error. 88 | /// 89 | public HttpListenerException (int errorCode) 90 | : base (errorCode) 91 | { 92 | } 93 | 94 | /// 95 | /// Initializes a new instance of the class 96 | /// with the specified and . 97 | /// 98 | /// 99 | /// An that identifies the error. 100 | /// 101 | /// 102 | /// A that describes the error. 103 | /// 104 | public HttpListenerException (int errorCode, string message) 105 | : base (errorCode, message) 106 | { 107 | } 108 | 109 | #endregion 110 | 111 | #region Public Properties 112 | 113 | /// 114 | /// Gets the error code that identifies the error that occurred. 115 | /// 116 | /// 117 | /// An that identifies the error. 118 | /// 119 | public override int ErrorCode { 120 | get { 121 | return NativeErrorCode; 122 | } 123 | } 124 | 125 | #endregion 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/Net/AuthenticationChallenge.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * AuthenticationChallenge.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2013-2014 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 | using System.Collections.Specialized; 31 | using System.Text; 32 | 33 | namespace WebSocketSharp.Net 34 | { 35 | internal class AuthenticationChallenge : AuthenticationBase 36 | { 37 | #region Private Constructors 38 | 39 | private AuthenticationChallenge (AuthenticationSchemes scheme, NameValueCollection parameters) 40 | : base (scheme, parameters) 41 | { 42 | } 43 | 44 | #endregion 45 | 46 | #region Internal Constructors 47 | 48 | internal AuthenticationChallenge (AuthenticationSchemes scheme, string realm) 49 | : base (scheme, new NameValueCollection ()) 50 | { 51 | Parameters["realm"] = realm; 52 | if (scheme == AuthenticationSchemes.Digest) { 53 | Parameters["nonce"] = CreateNonceValue (); 54 | Parameters["algorithm"] = "MD5"; 55 | Parameters["qop"] = "auth"; 56 | } 57 | } 58 | 59 | #endregion 60 | 61 | #region Public Properties 62 | 63 | public string Domain { 64 | get { 65 | return Parameters["domain"]; 66 | } 67 | } 68 | 69 | public string Stale { 70 | get { 71 | return Parameters["stale"]; 72 | } 73 | } 74 | 75 | #endregion 76 | 77 | #region Internal Methods 78 | 79 | internal static AuthenticationChallenge CreateBasicChallenge (string realm) 80 | { 81 | return new AuthenticationChallenge (AuthenticationSchemes.Basic, realm); 82 | } 83 | 84 | internal static AuthenticationChallenge CreateDigestChallenge (string realm) 85 | { 86 | return new AuthenticationChallenge (AuthenticationSchemes.Digest, realm); 87 | } 88 | 89 | internal static AuthenticationChallenge Parse (string value) 90 | { 91 | var chal = value.Split (new[] { ' ' }, 2); 92 | if (chal.Length != 2) 93 | return null; 94 | 95 | var schm = chal[0].ToLower (); 96 | return schm == "basic" 97 | ? new AuthenticationChallenge ( 98 | AuthenticationSchemes.Basic, ParseParameters (chal[1])) 99 | : schm == "digest" 100 | ? new AuthenticationChallenge ( 101 | AuthenticationSchemes.Digest, ParseParameters (chal[1])) 102 | : null; 103 | } 104 | 105 | internal override string ToBasicString () 106 | { 107 | return String.Format ("Basic realm=\"{0}\"", Parameters["realm"]); 108 | } 109 | 110 | internal override string ToDigestString () 111 | { 112 | var output = new StringBuilder (128); 113 | 114 | var domain = Parameters["domain"]; 115 | if (domain != null) 116 | output.AppendFormat ( 117 | "Digest realm=\"{0}\", domain=\"{1}\", nonce=\"{2}\"", 118 | Parameters["realm"], 119 | domain, 120 | Parameters["nonce"]); 121 | else 122 | output.AppendFormat ( 123 | "Digest realm=\"{0}\", nonce=\"{1}\"", Parameters["realm"], Parameters["nonce"]); 124 | 125 | var opaque = Parameters["opaque"]; 126 | if (opaque != null) 127 | output.AppendFormat (", opaque=\"{0}\"", opaque); 128 | 129 | var stale = Parameters["stale"]; 130 | if (stale != null) 131 | output.AppendFormat (", stale={0}", stale); 132 | 133 | var algo = Parameters["algorithm"]; 134 | if (algo != null) 135 | output.AppendFormat (", algorithm={0}", algo); 136 | 137 | var qop = Parameters["qop"]; 138 | if (qop != null) 139 | output.AppendFormat (", qop=\"{0}\"", qop); 140 | 141 | return output.ToString (); 142 | } 143 | 144 | #endregion 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Simple Multiplayer NodeJS/Assets/SocketIO/WebsocketSharp/LogData.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | /* 3 | * LogData.cs 4 | * 5 | * The MIT License 6 | * 7 | * Copyright (c) 2013-2014 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 | using System.Diagnostics; 31 | using System.Text; 32 | 33 | namespace WebSocketSharp 34 | { 35 | /// 36 | /// Represents a log data used by the class. 37 | /// 38 | public class LogData 39 | { 40 | #region Private Fields 41 | 42 | private StackFrame _caller; 43 | private DateTime _date; 44 | private LogLevel _level; 45 | private string _message; 46 | 47 | #endregion 48 | 49 | #region Internal Constructors 50 | 51 | internal LogData (LogLevel level, StackFrame caller, string message) 52 | { 53 | _level = level; 54 | _caller = caller; 55 | _message = message ?? String.Empty; 56 | _date = DateTime.Now; 57 | } 58 | 59 | #endregion 60 | 61 | #region Public Properties 62 | 63 | /// 64 | /// Gets the information of the logging method caller. 65 | /// 66 | /// 67 | /// A that provides the information of the logging method caller. 68 | /// 69 | public StackFrame Caller { 70 | get { 71 | return _caller; 72 | } 73 | } 74 | 75 | /// 76 | /// Gets the date and time when the log data was created. 77 | /// 78 | /// 79 | /// A that represents the date and time when the log data was created. 80 | /// 81 | public DateTime Date { 82 | get { 83 | return _date; 84 | } 85 | } 86 | 87 | /// 88 | /// Gets the logging level of the log data. 89 | /// 90 | /// 91 | /// One of the enum values, indicates the logging level of the log data. 92 | /// 93 | public LogLevel Level { 94 | get { 95 | return _level; 96 | } 97 | } 98 | 99 | /// 100 | /// Gets the message of the log data. 101 | /// 102 | /// 103 | /// A that represents the message of the log data. 104 | /// 105 | public string Message { 106 | get { 107 | return _message; 108 | } 109 | } 110 | 111 | #endregion 112 | 113 | #region Public Methods 114 | 115 | /// 116 | /// Returns a that represents the current . 117 | /// 118 | /// 119 | /// A that represents the current . 120 | /// 121 | public override string ToString () 122 | { 123 | var header = String.Format ("{0}|{1,-5}|", _date, _level); 124 | var method = _caller.GetMethod (); 125 | var type = method.DeclaringType; 126 | #if DEBUG 127 | var lineNum = _caller.GetFileLineNumber (); 128 | var headerAndCaller = String.Format ( 129 | "{0}{1}.{2}:{3}|", header, type.Name, method.Name, lineNum); 130 | #else 131 | var headerAndCaller = String.Format ("{0}{1}.{2}|", header, type.Name, method.Name); 132 | #endif 133 | 134 | var messages = _message.Replace ("\r\n", "\n").TrimEnd ('\n').Split ('\n'); 135 | if (messages.Length <= 1) 136 | return String.Format ("{0}{1}", headerAndCaller, _message); 137 | 138 | var log = new StringBuilder ( 139 | String.Format ("{0}{1}\n", headerAndCaller, messages [0]), 64); 140 | 141 | var space = header.Length; 142 | var format = String.Format ("{{0,{0}}}{{1}}\n", space); 143 | for (var i = 1; i < messages.Length; i++) 144 | log.AppendFormat (format, "", messages [i]); 145 | 146 | log.Length--; 147 | return log.ToString (); 148 | } 149 | 150 | #endregion 151 | } 152 | } 153 | --------------------------------------------------------------------------------