├── Assets ├── .gitkeep ├── Mirror │ └── Transports │ │ ├── Ignorance │ │ ├── version.txt │ │ ├── Plugins │ │ │ ├── Linux │ │ │ │ ├── libenet.so │ │ │ │ ├── libenet_debug.zip │ │ │ │ ├── README.txt.meta │ │ │ │ ├── libenet_debug.zip.meta │ │ │ │ ├── README.txt │ │ │ │ └── libenet.so.meta │ │ │ ├── Windows │ │ │ │ ├── enet.dll │ │ │ │ ├── README.txt.meta │ │ │ │ ├── README.txt │ │ │ │ └── enet.dll.meta │ │ │ ├── macOS │ │ │ │ ├── libenet.dylib │ │ │ │ └── libenet.dylib.meta │ │ │ ├── Android │ │ │ │ ├── x86 │ │ │ │ │ ├── libenet.so │ │ │ │ │ └── libenet.so.meta │ │ │ │ ├── arm64-v8a │ │ │ │ │ ├── libenet.so │ │ │ │ │ └── libenet.so.meta │ │ │ │ ├── armeabi-v7a │ │ │ │ │ ├── libenet.so │ │ │ │ │ └── libenet.so.meta │ │ │ │ ├── x86.meta │ │ │ │ ├── arm64-v8a.meta │ │ │ │ └── armeabi-v7a.meta │ │ │ ├── iOS │ │ │ │ ├── libenet-release-arm64.a │ │ │ │ ├── libenet-release-armv7.a │ │ │ │ ├── libenet-release-simulator64.a │ │ │ │ ├── libenet-release-arm64.a.meta │ │ │ │ ├── libenet-release-armv7.a.meta │ │ │ │ └── libenet-release-simulator64.a.meta │ │ │ ├── readme.txt.meta │ │ │ ├── Linux.meta │ │ │ ├── iOS.meta │ │ │ ├── macOS.meta │ │ │ ├── Android.meta │ │ │ ├── Windows.meta │ │ │ └── readme.txt │ │ ├── LICENSE.txt.meta │ │ ├── version.txt.meta │ │ ├── Core.meta │ │ ├── Editor.meta │ │ ├── Plugins.meta │ │ ├── Dependencies.meta │ │ ├── Editor │ │ │ ├── Toolbox.cs.meta │ │ │ ├── AddScriptingDefine.cs.meta │ │ │ ├── Toolbox.cs │ │ │ └── AddScriptingDefine.cs │ │ ├── Ignorance.cs.meta │ │ ├── Core │ │ │ ├── IgnoranceClient.cs.meta │ │ │ ├── IgnoranceServer.cs.meta │ │ │ ├── IgnoranceClient.cs │ │ │ └── IgnoranceServer.cs │ │ ├── Dependencies │ │ │ ├── ENet.cs.meta │ │ │ ├── RingBuffer.cs.meta │ │ │ └── RingBuffer.cs │ │ ├── IgnoranceDefinitions.cs.meta │ │ ├── LICENSE.txt │ │ └── IgnoranceDefinitions.cs │ │ └── Ignorance.meta └── Ignorance │ ├── Demo │ ├── PongChamp │ │ ├── Textures │ │ │ ├── PoutRyuu.png │ │ │ ├── pogchamp.png │ │ │ ├── Sprites │ │ │ │ ├── Ball.png │ │ │ │ ├── Racket.png │ │ │ │ ├── DottedLine.png │ │ │ │ ├── WallVertical.png │ │ │ │ ├── WallHorizontal.png │ │ │ │ ├── Ball.png.meta │ │ │ │ ├── Racket.png.meta │ │ │ │ ├── DottedLine.png.meta │ │ │ │ ├── WallVertical.png.meta │ │ │ │ └── WallHorizontal.png.meta │ │ │ ├── Sprites.meta │ │ │ ├── pogchamp.png.meta │ │ │ └── PoutRyuu.png.meta │ │ ├── Demo.unity.meta │ │ ├── TenryuuBall.prefab.meta │ │ ├── Scripts.meta │ │ ├── Textures.meta │ │ ├── AtariBall.prefab.meta │ │ ├── AtariRacket.prefab.meta │ │ ├── BallMaterial 1.physicsMaterial2D.meta │ │ ├── Scripts │ │ │ ├── OnlineTimer.cs.meta │ │ │ ├── AtariPongBall.cs.meta │ │ │ ├── AtariPongRacket.cs.meta │ │ │ ├── AtariPongRacket.cs │ │ │ ├── OnlineTimer.cs │ │ │ └── AtariPongBall.cs │ │ ├── BallMaterial 1.physicsMaterial2D │ │ ├── TenryuuBall.prefab │ │ ├── AtariBall.prefab │ │ └── AtariRacket.prefab │ ├── Basic.meta │ ├── Basic │ │ ├── BasicWithIgnorance.unity.meta │ │ ├── BasicWithIgnoranceSettings.lighting.meta │ │ └── BasicWithIgnoranceSettings.lighting │ └── PongChamp.meta │ └── Demo.meta ├── ProjectSettings ├── .gitkeep ├── boot.config ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── NetworkManager.asset ├── XRSettings.asset ├── VersionControlSettings.asset ├── TimeManager.asset ├── VFXManager.asset ├── AudioManager.asset ├── EditorBuildSettings.asset ├── TagManager.asset ├── EditorSettings.asset ├── PresetManager.asset ├── UnityConnectSettings.asset ├── DynamicsManager.asset ├── PackageManagerSettings.asset ├── MemorySettings.asset ├── Physics2DSettings.asset ├── NavMeshAreas.asset ├── GraphicsSettings.asset ├── SceneTemplateSettings.json ├── QualitySettings.asset └── InputManager.asset ├── .github └── FUNDING.yml ├── .vsconfig ├── Documentation └── ignorance14options.png ├── LICENSE ├── STANDALONE.md ├── FAQ.md ├── .editorconfig ├── DOCUMENTATION.md ├── README.md └── .gitignore /Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ProjectSettings/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ProjectSettings/boot.config: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/version.txt: -------------------------------------------------------------------------------- 1 | 1.4.0r1 LTS -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: coburn 2 | patreon: Oiran_Studio 3 | custom: [ 'https://www.paypal.com/paypalme/coburn64' ] 4 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.21f1 2 | m_EditorVersionWithRevision: 2021.3.21f1 (1b156197d683) 3 | -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Documentation/ignorance14options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Documentation/ignorance14options.png -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/PoutRyuu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Ignorance/Demo/PongChamp/Textures/PoutRyuu.png -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/pogchamp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Ignorance/Demo/PongChamp/Textures/pogchamp.png -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/Ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Ignorance/Demo/PongChamp/Textures/Sprites/Ball.png -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/Racket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Ignorance/Demo/PongChamp/Textures/Sprites/Racket.png -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Linux/libenet.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/Linux/libenet.so -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Windows/enet.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/Windows/enet.dll -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/DottedLine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Ignorance/Demo/PongChamp/Textures/Sprites/DottedLine.png -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/macOS/libenet.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/macOS/libenet.dylib -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/WallVertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Ignorance/Demo/PongChamp/Textures/Sprites/WallVertical.png -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/x86/libenet.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/Android/x86/libenet.so -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/WallHorizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Ignorance/Demo/PongChamp/Textures/Sprites/WallHorizontal.png -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Linux/libenet_debug.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/Linux/libenet_debug.zip -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-arm64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-arm64.a -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-armv7.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-armv7.a -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/arm64-v8a/libenet.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/Android/arm64-v8a/libenet.so -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/armeabi-v7a/libenet.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/Android/armeabi-v7a/libenet.so -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-simulator64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareGuy/Ignorance/HEAD/Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-simulator64.a -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f3dc386b0074be4caf7b858e3189529 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Demo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c63e1eea85874ae43a7fdd723a38741e 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/Basic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd20cf8481e733f42a140665486354bd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/TenryuuBall.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5339554c46006dd4e91cae9ff34c095d 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/LICENSE.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b80d01f91b34154aa5d86ccba78dbad 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/version.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad80075449f17c548877161f32a9841a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/Basic/BasicWithIgnorance.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2db17f37f98c4cf4a88890358a4fa966 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 634f781b33ac69147bff9edd5829cfd6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc98cd95e3fb22b4eb88082706967357 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2898db03f0b9654498df19a98dc9503 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e03829cb9e647274db0f6a7b8b1b757b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a28193472bc84d341ab4aee18c471a93 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23b5913b9b8b2e1419a41acde1b49883 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0995e08af14888348b42ecaa6eb21544 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8bd04b9965420e40ac911fbf4294e1c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Linux/README.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 765c88bc8183ed44cb51a5529d8f743e 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Windows/README.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09ee288deb259474c819a5e3daf54b80 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0dbfc247338e79a4dbe7474f69b46503 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Dependencies.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12f903db684732e45b130ad56f7c86c1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Linux.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e3ca9b41c9f4064581a6b56ae549a9c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Linux/libenet_debug.zip.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7482955b4ae93c4081db9ddd04cae47 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7edc275f3670f4251b90301cbb9f7413 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/macOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 957ba76da095cd64aaa658f034ab78e5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c90c88052305a054d87177362f63dea8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3486c84aaebff4489e2e11f5bd3030f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Windows.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8837cb1a7320b8b4f824a02e23f4a545 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/arm64-v8a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4a42b5855436864693138f74335c094 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/armeabi-v7a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfbaf4fbcf8987e4585ca666e28f4871 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/AtariBall.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da367a4c269be6d4a855ee1a9a68256b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/AtariRacket.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a85b24263182aae4bbc1829bb2b73d7a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/BallMaterial 1.physicsMaterial2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 315510c0721e82f4cad07c2669b863fa 3 | timeCreated: 1426602119 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/Basic/BasicWithIgnoranceSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f34de581ee6ab3743844c33f257a03c2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Scripts/OnlineTimer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0996ec573094c24890a4d4233ee871e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Editor/Toolbox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fdecc996313d614ca16214d4e2b9162 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Ignorance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 872fa23ef6e77334ca452ce16f6cd091 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: -32000 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Core/IgnoranceClient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7b9e2c091c3d42439840a02fe700252 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Core/IgnoranceServer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1069f42b88a4adb4ab1990cec4949343 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Dependencies/ENet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12a7875e95f5ebb4a9b58390441dd933 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/IgnoranceDefinitions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b2d1f7f7d9d3d64297755419f6ab925 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /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_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Dependencies/RingBuffer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f0c413335c890f4a87e1a9dbe32bd68 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Editor/AddScriptingDefine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed8acbde141f2d8469baf2142712de9e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/BallMaterial 1.physicsMaterial2D: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!62 &6200000 4 | PhysicsMaterial2D: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: BallMaterial 1 10 | friction: 0 11 | bounciness: 1 12 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Scripts/AtariPongBall.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a08d5ab1f59230458264367f00c54d8 3 | timeCreated: 1426602353 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Scripts/AtariPongRacket.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b68eb08343b29a54dbd5ed7830fb9211 3 | timeCreated: 1426597826 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Windows/README.txt: -------------------------------------------------------------------------------- 1 | This is a Windows x64 build of ENet-CSharp. 2 | 3 | If you require a version of ENet for 32 Bit computer systems (ie. Windows 7/8/10 32Bit) then please get in touch, or you can install the requirements yourself and compile it using ENet-CSharp's MSBuild-based build system. Get in touch if you want me to compile them for you, but keep in mind that I do not support them when reporting bugs. -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Linux/README.txt: -------------------------------------------------------------------------------- 1 | Rename this debug library without the "_debug" suffix and replace (maybe backup the original first) the library. 2 | For example, to replace the x64 ENet Library with the Debug version, you'd first backup/move "libenet.so", then extract and rename "libenet_debug.so" to "libenet.so". 3 | 4 | If you have trouble, file a GitHub support ticket at https://github.com/SoftwareGuy/Ignorance. 5 | 6 | - Coburn 7 | -------------------------------------------------------------------------------- /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: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /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: 0 9 | path: Assets/Ignorance/Demo/PongChamp/Demo.unity 10 | guid: c63e1eea85874ae43a7fdd723a38741e 11 | - enabled: 1 12 | path: Assets/Ignorance/Demo/Basic/BasicWithIgnorance.unity 13 | guid: 2db17f37f98c4cf4a88890358a4fa966 14 | m_configObjects: {} 15 | -------------------------------------------------------------------------------- /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 | - PostProcessing 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 | -------------------------------------------------------------------------------- /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: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/macOS/libenet.dylib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5317859893ad2cf48a6df1d585ebdd2c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 1 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Standalone: OSXUniversal 27 | second: 28 | enabled: 1 29 | settings: {} 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Scripts/AtariPongRacket.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Mirror; 3 | 4 | namespace Ignorance.Examples.PongChamp 5 | { 6 | public class AtariPongRacket : NetworkBehaviour 7 | { 8 | public float speed = 1500; 9 | private Rigidbody2D rigidbody2d; 10 | 11 | private void Awake() 12 | { 13 | rigidbody2d = GetComponent(); 14 | } 15 | 16 | // need to use FixedUpdate for rigidbody 17 | void FixedUpdate() 18 | { 19 | // only let the local player control the racket. 20 | // don't control other player's rackets 21 | if (isLocalPlayer) 22 | rigidbody2d.velocity = new Vector2(0, Input.GetAxisRaw("Vertical")) * speed * Time.fixedDeltaTime; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /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 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /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: 0 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_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /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: 7 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_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 - 2021 Matt Coburn (Coburn, SoftwareGuy) 4 | This software uses dependencies (Mirror, ENet-C#) that are also licensed under 5 | the MIT License. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Scripts/OnlineTimer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Mirror; 5 | using System.Diagnostics; 6 | using Debug = UnityEngine.Debug; 7 | 8 | public class OnlineTimer : NetworkBehaviour 9 | { 10 | private Stopwatch stopwatch; 11 | 12 | // Start is called before the first frame update 13 | private void Awake() 14 | { 15 | stopwatch = new Stopwatch(); 16 | } 17 | 18 | public override void OnStartClient() 19 | { 20 | stopwatch.Reset(); 21 | stopwatch.Start(); 22 | 23 | Debug.Log("Stopwatch started!"); 24 | 25 | base.OnStartClient(); 26 | } 27 | 28 | public void OnDisable() 29 | { 30 | if(stopwatch.IsRunning) 31 | { 32 | System.TimeSpan ts = stopwatch.Elapsed; 33 | stopwatch.Stop(); 34 | 35 | Debug.Log("Stopwatch stopped: duration " + string.Format("{0:00}:{1:00}:{2:00}.{3:00}", 36 | ts.Hours, ts.Minutes, ts.Seconds, 37 | ts.Milliseconds / 10)); 38 | } 39 | } 40 | 41 | private void OnGUI() 42 | { 43 | if (!stopwatch.IsRunning) return; 44 | 45 | GUI.Box(new Rect(new Vector2(2, Screen.height - 36), new Vector2(320, 32)), "ONLINE TIME: " + string.Format("{0:00}:{1:00}:{2:00}.{3:00}", 46 | stopwatch.Elapsed.Hours, stopwatch.Elapsed.Minutes, stopwatch.Elapsed.Seconds, 47 | stopwatch.Elapsed.Milliseconds / 10)); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/readme.txt: -------------------------------------------------------------------------------- 1 | ENET Pre-compiled Binary Library Blobs 2 | ========================== 3 | This folder contains pre-compiled binaries for a variety of different platforms. 4 | 5 | A brief summary of these folders are as follows: 6 | 7 | - Windows, Mac, Linux 8 | -- 64bit (x64) 9 | 10 | - Android (Kitkat 4.4 minimum target OS) 11 | -- ARMv7 (armeabi-v7a), ARMv8/AArch64 (arm64-v8a) 12 | 13 | - iOS 14 | -- FAT Library (armv7 + arm64). Targeted for iOS 8 minimum. Unsigned library. 15 | 16 | DEBUG VERSIONS 17 | =============== 18 | Debug versions of the libraries can be obtained at https://github.com/SoftwareGuy/ENet-CSharp/releases. 19 | Otherwise you can also compile the library yourself with Debug enabled. 20 | 21 | DOT POINTS 22 | =========== 23 | 1. 32bit Support for Ignorance has been removed. Originally, I did not want to support 32bit operating systems, 24 | however due to some countries in the world still stuck in the 32bit era (Brasil, some Russian areas, etc) I added them as a 25 | goodwill gesture. However, since those who needed the libraries have now vanished, I have stopped building 32bit versions of ENet. 26 | 27 | COMPILE THE CODE YOURSELF 28 | ========================= 29 | If you don't trust the above binaries then git clone the ENET-CSharp repository (http://github.com/SoftwareGuy/ENet-CSharp) and read the readme. 30 | 31 | EXCLUSION INSTRUCTIONS 32 | ====================== 33 | No need, the meta data will cover that for you. 34 | 35 | Still don't know what to do with these? Drop by the Mirror discord and post in the Ignorance channel. -------------------------------------------------------------------------------- /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: 3 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_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Editor/Toolbox.cs: -------------------------------------------------------------------------------- 1 | // Ignorance 1.4.x LTS (Long Term Support) 2 | // https://github.com/SoftwareGuy/Ignorance 3 | // ----------------- 4 | // Copyright (c) 2019 - 2023 Matt Coburn (SoftwareGuy/Coburn64) 5 | // Ignorance is licensed under the MIT license. Refer 6 | // to the LICENSE file for more information. 7 | #if UNITY_EDITOR 8 | using UnityEditor; 9 | 10 | namespace IgnoranceTransport 11 | { 12 | public class Toolbox 13 | { 14 | #pragma warning disable IDE0051 15 | /* - 2024-07-04: Commented this out since some C# ENet glue update broke it. 16 | [MenuItem("Ignorance/Debug/Native Library Name")] 17 | public static void RevealEnetLibraryName() 18 | { 19 | EditorUtility.DisplayDialog("ENet Library Name", $"Your platform expects the native library to be called: {ENet.Native.nativeLibraryName}.\n\n" + 20 | $"This info is very useful when trying to diagnose issues with native library loading.", "Got it"); 21 | } 22 | */ 23 | [MenuItem("Ignorance/RTFM/Github Repo")] 24 | private static void LaunchGithubRepo() 25 | { 26 | UnityEngine.Application.OpenURL("https://github.com/SoftwareGuy/Ignorance"); 27 | } 28 | 29 | [MenuItem("Ignorance/RTFM/Issue Tracker")] 30 | private static void LaunchGithubIssueTracker() 31 | { 32 | UnityEngine.Application.OpenURL("https://github.com/SoftwareGuy/Ignorance/issues"); 33 | } 34 | 35 | [MenuItem("Ignorance/RTFM/ENet-C# Repo")] 36 | private static void LaunchENetCSharpForkRepo() 37 | { 38 | UnityEngine.Application.OpenURL("https://github.com/SoftwareGuy/ENet-CSharp"); 39 | } 40 | 41 | #pragma warning restore 42 | } 43 | } 44 | #endif 45 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 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 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/LICENSE.txt: -------------------------------------------------------------------------------- 1 | IF YOU PAID MONEY TO OBTAIN A COPY OF THIS CODE FROM A THIRD PARTY AND 2 | NOT FROM THE OFFICIAL IGNORANCE GITHUB, YOU MAY HAVE BEEN SCAMMED. DEMAND A 3 | REFUND. Ignorance is a free of charge Mirror Networking plugin. 4 | 5 | Ignorance, the ENet-powered reliable UDP transport layer for Mirror Networking 6 | is licensed under the folllowing MIT license. If this license is missing or has 7 | been stripped from your local copy of Ignorance, then you may be in violation 8 | of the MIT license. 9 | 10 | Ignorance Reliable UDP Transport for Mirror Networking 11 | Copyright (c) 2019 - 2023 Matt Coburn (Coburn64/SoftwareGuy) 12 | This software uses dependencies (Mirror, ENet-C#) that are also licensed under 13 | the MIT License. 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/x86/libenet.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba78b07719f786c4cae4c52b9528903f 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | Exclude iOS: 1 26 | - first: 27 | Android: Android 28 | second: 29 | enabled: 1 30 | settings: 31 | CPU: x86 32 | - first: 33 | Any: 34 | second: 35 | enabled: 0 36 | settings: {} 37 | - first: 38 | Editor: Editor 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: AnyCPU 43 | DefaultValueInitialized: true 44 | OS: AnyOS 45 | - first: 46 | Standalone: Linux64 47 | second: 48 | enabled: 0 49 | settings: 50 | CPU: None 51 | - first: 52 | Standalone: OSXUniversal 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: None 57 | - first: 58 | Standalone: Win 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: None 63 | - first: 64 | Standalone: Win64 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: None 69 | - first: 70 | iPhone: iOS 71 | second: 72 | enabled: 0 73 | settings: 74 | AddToEmbeddedBinaries: false 75 | CPU: AnyCPU 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-arm64.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1485de7d76884a64bac00df01454081e 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | Exclude iOS: 0 26 | - first: 27 | Android: Android 28 | second: 29 | enabled: 0 30 | settings: 31 | CPU: ARMv7 32 | - first: 33 | Any: 34 | second: 35 | enabled: 0 36 | settings: {} 37 | - first: 38 | Editor: Editor 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: AnyCPU 43 | DefaultValueInitialized: true 44 | OS: AnyOS 45 | - first: 46 | Standalone: Linux64 47 | second: 48 | enabled: 0 49 | settings: 50 | CPU: None 51 | - first: 52 | Standalone: OSXUniversal 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: None 57 | - first: 58 | Standalone: Win 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: None 63 | - first: 64 | Standalone: Win64 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: None 69 | - first: 70 | iPhone: iOS 71 | second: 72 | enabled: 1 73 | settings: 74 | AddToEmbeddedBinaries: false 75 | CPU: ARM64 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-armv7.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa239cb4c47fc9447816815f80667fea 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | Exclude iOS: 0 26 | - first: 27 | Android: Android 28 | second: 29 | enabled: 0 30 | settings: 31 | CPU: ARMv7 32 | - first: 33 | Any: 34 | second: 35 | enabled: 0 36 | settings: {} 37 | - first: 38 | Editor: Editor 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: AnyCPU 43 | DefaultValueInitialized: true 44 | OS: AnyOS 45 | - first: 46 | Standalone: Linux64 47 | second: 48 | enabled: 0 49 | settings: 50 | CPU: None 51 | - first: 52 | Standalone: OSXUniversal 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: None 57 | - first: 58 | Standalone: Win 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: None 63 | - first: 64 | Standalone: Win64 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: None 69 | - first: 70 | iPhone: iOS 71 | second: 72 | enabled: 1 73 | settings: 74 | AddToEmbeddedBinaries: false 75 | CPU: ARMv7 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/iOS/libenet-release-simulator64.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 385bb48fb124b5f40a79bdecf421671f 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | Exclude iOS: 0 26 | - first: 27 | Android: Android 28 | second: 29 | enabled: 0 30 | settings: 31 | CPU: ARMv7 32 | - first: 33 | Any: 34 | second: 35 | enabled: 0 36 | settings: {} 37 | - first: 38 | Editor: Editor 39 | second: 40 | enabled: 0 41 | settings: 42 | CPU: AnyCPU 43 | DefaultValueInitialized: true 44 | OS: AnyOS 45 | - first: 46 | Standalone: Linux64 47 | second: 48 | enabled: 0 49 | settings: 50 | CPU: None 51 | - first: 52 | Standalone: OSXUniversal 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: None 57 | - first: 58 | Standalone: Win 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: None 63 | - first: 64 | Standalone: Win64 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: None 69 | - first: 70 | iPhone: iOS 71 | second: 72 | enabled: 1 73 | settings: 74 | AddToEmbeddedBinaries: false 75 | CPU: X64 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/Basic/BasicWithIgnoranceSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: BasicWithIgnoranceSettings 10 | serializedVersion: 3 11 | m_GIWorkflowMode: 0 12 | m_EnableBakedLightmaps: 0 13 | m_EnableRealtimeLightmaps: 0 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 1 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 500 45 | m_PVREnvironmentSampleCount: 500 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentMIS: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Linux/libenet.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2bd341c8082ddd47b4b5cc9bfdf2332 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 1 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 1 25 | Exclude WebGL: 1 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 1 43 | settings: 44 | CPU: x86_64 45 | DefaultValueInitialized: true 46 | OS: Linux 47 | - first: 48 | Facebook: Win 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: AnyCPU 53 | - first: 54 | Facebook: Win64 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: AnyCPU 59 | - first: 60 | Standalone: Linux 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: None 65 | - first: 66 | Standalone: Linux64 67 | second: 68 | enabled: 1 69 | settings: 70 | CPU: x86_64 71 | - first: 72 | Standalone: LinuxUniversal 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: x86_64 77 | - first: 78 | Standalone: OSXUniversal 79 | second: 80 | enabled: 0 81 | settings: 82 | CPU: None 83 | - first: 84 | Standalone: Win 85 | second: 86 | enabled: 1 87 | settings: 88 | CPU: AnyCPU 89 | - first: 90 | Standalone: Win64 91 | second: 92 | enabled: 1 93 | settings: 94 | CPU: AnyCPU 95 | userData: 96 | assetBundleName: 97 | assetBundleVariant: 98 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/Ball.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03167da12fa50334e8c8641a23df41b0 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -3 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 0 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 1 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: c5a291323e0d5f34883a55625f66ca70 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/Racket.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e11aad367beb44f4b8a3def9b8fc57ec 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -3 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 0 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 1 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 09819c66a21defd49b2cfc87fea685d2 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/DottedLine.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75254f20e37ff3640beccde38f796fed 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -3 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 0 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 1 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 98b4e2aa86aa3d843821adfe71dbbac0 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/WallVertical.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b41679787bea72d419d10a6df7dc137f 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -3 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 0 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 1 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 3a92f998f14389948aa928ac64e8e426 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/Sprites/WallHorizontal.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51f6a08479c829a49b6a15df6849e727 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -3 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 0 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 1 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 0 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 74c5541eed52f67428025c83260d8bec 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /STANDALONE.md: -------------------------------------------------------------------------------- 1 | # Ignorance Standalone 2 | 3 | Starting with Ignorance 1.4 Beta, the Ignorance *Core* is now a seperate class arrangement (see the files inside `Core`) while the *Transport* (`Ignorance.cs`) is the glue that sticks Ignorance to Mirror so Mirror knows how to talk to ENet Native. In short, the best analogy is if you put both Mirror and ENet together in a room out of the box, they'll just look at each other strangely. Ignorance and the Transport (using ENet-CSharp which are bindings for native ENet) has to sit between Mirror and ENet. It acts as the translator. 4 | 5 | For example's sake, lets say Mirror and ENet are both different languages, similar to English and Spanish. When Mirror says Hello to ENet in English, Ignorance will on-the-fly translate into a language the native ENet library can understand in Spanish. ENet will then reply with it's greetings in Spanish. Ignorance translates this back into English for Mirror to understand. The key point is Mirror runs in Managed world, while ENet is Native world. We can't directly talk to Native from Managed, so we need to have a layer in between that does the translations for us. Ignorance is the layer that does this. 6 | 7 | Due to this new design arrangement, this makes it possible to use Ignorance Core as a standalone system, however you will need to chop off or refactor the Core classes a little to remove dependencies on `UnityEngine`. Also ensure that you have placed a native library blob (`enet.dll`, `libenet.so`, etc) with your application. Without it, Ignorance will throw an error saying a thread failed to initialize. **Also check the "What devices are supported?" section in the `README.md` file. 32Bit desktop platforms are not supported out of the box, you will need to re-compile ENet yourself in 32Bit mode.** 8 | 9 | The Ignorance Core is high performance and uses numerous ConcurrentQueues to help seperate events. Incoming events are placed in `Incoming`, things to be sent out are processed from `Outgoing`, Connection Events (Server got a new connection, client disconnected, etc) are also in their own queue. You can use the *Transport* implementation as hints as to how to implement very fast networking using queuing/de-queuing strategies in your non-Unity/non-Mirror projects. 10 | 11 | If you have issues with the Ignorance Core then please by all means investigate, open a issue ticket and if you can resolve it, open a PR and get your fix in. 😃 12 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Scripts/AtariPongBall.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Mirror; 3 | 4 | namespace Ignorance.Examples.PongChamp 5 | { 6 | public class AtariPongBall : NetworkBehaviour 7 | { 8 | public float speed = 100; 9 | private Rigidbody2D rigidbody2d; 10 | 11 | private void Awake() 12 | { 13 | rigidbody2d = GetComponent(); 14 | } 15 | 16 | public override void OnStartServer() 17 | { 18 | base.OnStartServer(); 19 | 20 | // only simulate ball physics on server 21 | rigidbody2d.simulated = true; 22 | 23 | // Serve the ball from left player 24 | rigidbody2d.velocity = Vector2.right * speed; 25 | } 26 | 27 | float HitFactor(Vector2 ballPos, Vector2 racketPos, float racketHeight) 28 | { 29 | // ascii art: 30 | // || 1 <- at the top of the racket 31 | // || 32 | // || 0 <- at the middle of the racket 33 | // || 34 | // || -1 <- at the bottom of the racket 35 | return (ballPos.y - racketPos.y) / racketHeight; 36 | } 37 | 38 | // only call this on server 39 | [ServerCallback] 40 | void OnCollisionEnter2D(Collision2D col) 41 | { 42 | // Note: 'col' holds the collision information. If the 43 | // Ball collided with a racket, then: 44 | // col.gameObject is the racket 45 | // col.transform.position is the racket's position 46 | // col.collider is the racket's collider 47 | 48 | // did we hit a racket? then we need to calculate the hit factor 49 | if (col.transform.GetComponent()) 50 | { 51 | // Calculate y direction via hit Factor 52 | float y = HitFactor(transform.position, 53 | col.transform.position, 54 | col.collider.bounds.size.y); 55 | 56 | // Calculate x direction via opposite collision 57 | float x = col.relativeVelocity.x > 0 ? 1 : -1; 58 | 59 | // Calculate direction, make length=1 via .normalized 60 | Vector2 dir = new Vector2(x, y).normalized; 61 | 62 | // Set Velocity with dir * speed 63 | rigidbody2d.velocity = dir * speed; 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/armeabi-v7a/libenet.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3ce4b8600e09d74ead46137ba184d01 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude OSXUniversal: 1 25 | Exclude WebGL: 1 26 | Exclude Win: 1 27 | Exclude Win64: 1 28 | Exclude iOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 1 33 | settings: 34 | CPU: ARMv7 35 | - first: 36 | Any: 37 | second: 38 | enabled: 0 39 | settings: {} 40 | - first: 41 | Editor: Editor 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: AnyCPU 46 | DefaultValueInitialized: true 47 | OS: AnyOS 48 | - first: 49 | Facebook: Win 50 | second: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | - first: 55 | Facebook: Win64 56 | second: 57 | enabled: 0 58 | settings: 59 | CPU: AnyCPU 60 | - first: 61 | Standalone: Linux 62 | second: 63 | enabled: 0 64 | settings: 65 | CPU: x86 66 | - first: 67 | Standalone: Linux64 68 | second: 69 | enabled: 0 70 | settings: 71 | CPU: AnyCPU 72 | - first: 73 | Standalone: LinuxUniversal 74 | second: 75 | enabled: 0 76 | settings: 77 | CPU: None 78 | - first: 79 | Standalone: OSXUniversal 80 | second: 81 | enabled: 0 82 | settings: 83 | CPU: AnyCPU 84 | - first: 85 | Standalone: Win 86 | second: 87 | enabled: 0 88 | settings: 89 | CPU: AnyCPU 90 | - first: 91 | Standalone: Win64 92 | second: 93 | enabled: 0 94 | settings: 95 | CPU: AnyCPU 96 | - first: 97 | iPhone: iOS 98 | second: 99 | enabled: 0 100 | settings: 101 | AddToEmbeddedBinaries: false 102 | CompileFlags: 103 | FrameworkDependencies: 104 | userData: 105 | assetBundleName: 106 | assetBundleVariant: 107 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Windows/enet.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc98033c6bc234a419ccd053e7173781 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 1 26 | Exclude Win: 1 27 | Exclude Win64: 0 28 | Exclude iOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 0 33 | settings: 34 | CPU: ARMv7 35 | - first: 36 | Any: 37 | second: 38 | enabled: 0 39 | settings: {} 40 | - first: 41 | Editor: Editor 42 | second: 43 | enabled: 1 44 | settings: 45 | CPU: AnyCPU 46 | DefaultValueInitialized: true 47 | OS: AnyOS 48 | - first: 49 | Facebook: Win 50 | second: 51 | enabled: 0 52 | settings: 53 | CPU: None 54 | - first: 55 | Facebook: Win64 56 | second: 57 | enabled: 0 58 | settings: 59 | CPU: AnyCPU 60 | - first: 61 | Standalone: Linux 62 | second: 63 | enabled: 1 64 | settings: 65 | CPU: x86 66 | - first: 67 | Standalone: Linux64 68 | second: 69 | enabled: 1 70 | settings: 71 | CPU: x86_64 72 | - first: 73 | Standalone: LinuxUniversal 74 | second: 75 | enabled: 1 76 | settings: 77 | CPU: AnyCPU 78 | - first: 79 | Standalone: OSXUniversal 80 | second: 81 | enabled: 1 82 | settings: 83 | CPU: AnyCPU 84 | - first: 85 | Standalone: Win 86 | second: 87 | enabled: 0 88 | settings: 89 | CPU: None 90 | - first: 91 | Standalone: Win64 92 | second: 93 | enabled: 1 94 | settings: 95 | CPU: AnyCPU 96 | - first: 97 | WebGL: WebGL 98 | second: 99 | enabled: 0 100 | settings: {} 101 | - first: 102 | iPhone: iOS 103 | second: 104 | enabled: 0 105 | settings: 106 | AddToEmbeddedBinaries: false 107 | CompileFlags: 108 | FrameworkDependencies: 109 | userData: 110 | assetBundleName: 111 | assetBundleVariant: 112 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Plugins/Android/arm64-v8a/libenet.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b3abd2268dea254da11190b00d16051 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude OSXUniversal: 1 25 | Exclude WebGL: 1 26 | Exclude Win: 1 27 | Exclude Win64: 1 28 | Exclude iOS: 1 29 | - first: 30 | Android: Android 31 | second: 32 | enabled: 1 33 | settings: 34 | CPU: ARM64 35 | - first: 36 | Any: 37 | second: 38 | enabled: 0 39 | settings: {} 40 | - first: 41 | Editor: Editor 42 | second: 43 | enabled: 0 44 | settings: 45 | CPU: AnyCPU 46 | DefaultValueInitialized: true 47 | OS: AnyOS 48 | - first: 49 | Facebook: Win 50 | second: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | - first: 55 | Facebook: Win64 56 | second: 57 | enabled: 0 58 | settings: 59 | CPU: AnyCPU 60 | - first: 61 | Standalone: Linux 62 | second: 63 | enabled: 0 64 | settings: 65 | CPU: None 66 | - first: 67 | Standalone: Linux64 68 | second: 69 | enabled: 0 70 | settings: 71 | CPU: None 72 | - first: 73 | Standalone: LinuxUniversal 74 | second: 75 | enabled: 0 76 | settings: 77 | CPU: None 78 | - first: 79 | Standalone: OSXUniversal 80 | second: 81 | enabled: 0 82 | settings: 83 | CPU: None 84 | - first: 85 | Standalone: Win 86 | second: 87 | enabled: 0 88 | settings: 89 | CPU: AnyCPU 90 | - first: 91 | Standalone: Win64 92 | second: 93 | enabled: 0 94 | settings: 95 | CPU: AnyCPU 96 | - first: 97 | WebGL: WebGL 98 | second: 99 | enabled: 0 100 | settings: {} 101 | - first: 102 | iPhone: iOS 103 | second: 104 | enabled: 0 105 | settings: 106 | AddToEmbeddedBinaries: false 107 | CompileFlags: 108 | FrameworkDependencies: 109 | userData: 110 | assetBundleName: 111 | assetBundleVariant: 112 | -------------------------------------------------------------------------------- /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: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 41 | - {fileID: 16001, 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: 1 52 | m_FogStripping: 1 53 | m_InstancingStripping: 1 54 | m_LightmapKeepPlain: 0 55 | m_LightmapKeepDirCombined: 0 56 | m_LightmapKeepDynamicPlain: 0 57 | m_LightmapKeepDynamicDirCombined: 0 58 | m_LightmapKeepShadowMask: 0 59 | m_LightmapKeepSubtractive: 0 60 | m_FogKeepLinear: 0 61 | m_FogKeepExp: 0 62 | m_FogKeepExp2: 0 63 | m_AlbedoSwatchInfos: [] 64 | m_LightsUseLinearIntensity: 0 65 | m_LightsUseColorTemperature: 0 66 | m_LogWhenShaderIsCompiled: 0 67 | m_AllowEnlightenSupportForUpgradedProject: 1 68 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/pogchamp.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 160d53f9f2b149c418d6d07e95438e53 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: -1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 2048 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: Android 85 | maxTextureSize: 2048 86 | resizeAlgorithm: 0 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | - serializedVersion: 2 95 | buildTarget: WebGL 96 | maxTextureSize: 2048 97 | resizeAlgorithm: 0 98 | textureFormat: -1 99 | textureCompression: 1 100 | compressionQuality: 50 101 | crunchedCompression: 0 102 | allowsAlphaSplitting: 0 103 | overridden: 0 104 | androidETC2FallbackOverride: 0 105 | spriteSheet: 106 | serializedVersion: 2 107 | sprites: [] 108 | outline: [] 109 | physicsShape: [] 110 | bones: [] 111 | spriteID: 1a75587224e4a5f468c03dbd1af78d0b 112 | vertices: [] 113 | indices: 114 | edges: [] 115 | weights: [] 116 | spritePackingTag: 117 | pSDRemoveMatte: 0 118 | pSDShowRemoveMatteOption: 0 119 | userData: 120 | assetBundleName: 121 | assetBundleVariant: 122 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/IgnoranceDefinitions.cs: -------------------------------------------------------------------------------- 1 | // Ignorance 1.4.x LTS (Long Term Support) 2 | // https://github.com/SoftwareGuy/Ignorance 3 | // ----------------- 4 | // Copyright (c) 2019 - 2023 Matt Coburn (SoftwareGuy/Coburn64) 5 | // Ignorance is licensed under the MIT license. Refer 6 | // to the LICENSE file for more information. 7 | using System; 8 | using System.Collections.Generic; 9 | using ENet; 10 | 11 | namespace IgnoranceCore 12 | { 13 | // Snipped from the transport files, as this will help 14 | // me keep things up to date. 15 | [Serializable] 16 | public enum IgnoranceChannelTypes 17 | { 18 | Reliable = PacketFlags.Reliable, // Reliable UDP (TCP-like emulation) 19 | ReliableUnsequenced = PacketFlags.Reliable | PacketFlags.Unsequenced, // Reliable UDP (TCP-like emulation w/o sequencing) 20 | Unreliable = PacketFlags.Unsequenced, // Pure UDP, high velocity packet action. 21 | UnreliableFragmented = PacketFlags.UnreliableFragmented, // Pure UDP, but fragmented. 22 | UnreliableSequenced = PacketFlags.None, // Pure UDP, but sequenced. 23 | Unthrottled = PacketFlags.Unthrottled, // Pure UDP. Literally turbo mode. 24 | } 25 | 26 | public class IgnoranceInternals 27 | { 28 | public const string Version = "1.4.1r0 (LTS)"; 29 | public const string Scheme = "enet"; 30 | public const string BindAnyAddress = "::0"; 31 | } 32 | 33 | public enum IgnoranceLogType 34 | { 35 | Quiet, 36 | Standard, 37 | Verbose 38 | } 39 | 40 | public struct IgnoranceIncomingPacket 41 | { 42 | public byte Channel; 43 | public uint NativePeerId; 44 | public Packet Payload; 45 | } 46 | 47 | public struct IgnoranceOutgoingPacket 48 | { 49 | public byte Channel; 50 | public uint NativePeerId; 51 | public Packet Payload; 52 | } 53 | 54 | public struct IgnoranceConnectionEvent 55 | { 56 | public byte EventType; 57 | public ushort Port; 58 | public uint NativePeerId; 59 | public string IP; 60 | } 61 | 62 | public struct IgnoranceCommandPacket 63 | { 64 | public IgnoranceCommandType Type; 65 | public uint PeerId; 66 | } 67 | 68 | // Stats only - may not always be used! 69 | public struct IgnoranceClientStats 70 | { 71 | 72 | public uint RTT; 73 | public ulong BytesReceived; 74 | public ulong BytesSent; 75 | public ulong PacketsReceived; 76 | public ulong PacketsSent; 77 | public ulong PacketsLost; 78 | } 79 | 80 | public enum IgnoranceCommandType 81 | { 82 | // Client 83 | ClientWantsToStop, 84 | ClientStatusRequest, 85 | // Server 86 | ServerKickPeer, 87 | ServerStatusRequest 88 | } 89 | 90 | // Stats only - may not always be used! 91 | public struct IgnoranceServerStats 92 | { 93 | 94 | public ulong BytesReceived; 95 | public ulong BytesSent; 96 | public ulong PacketsReceived; 97 | public ulong PacketsSent; 98 | public ulong PeersCount; 99 | 100 | public Dictionary PeerStats; 101 | } 102 | 103 | public struct PeerConnectionData 104 | { 105 | public ushort Port; 106 | public uint NativePeerId; 107 | public string IP; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/Textures/PoutRyuu.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 824ee62c0fc357b4081855e43253a948 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 0 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: -1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 0 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | - serializedVersion: 3 75 | buildTarget: Standalone 76 | maxTextureSize: 2048 77 | resizeAlgorithm: 0 78 | textureFormat: -1 79 | textureCompression: 0 80 | compressionQuality: 50 81 | crunchedCompression: 0 82 | allowsAlphaSplitting: 0 83 | overridden: 0 84 | androidETC2FallbackOverride: 0 85 | forceMaximumCompressionQuality_BC6H_BC7: 0 86 | - serializedVersion: 3 87 | buildTarget: iPhone 88 | maxTextureSize: 2048 89 | resizeAlgorithm: 0 90 | textureFormat: -1 91 | textureCompression: 0 92 | compressionQuality: 50 93 | crunchedCompression: 0 94 | allowsAlphaSplitting: 0 95 | overridden: 0 96 | androidETC2FallbackOverride: 0 97 | forceMaximumCompressionQuality_BC6H_BC7: 0 98 | - serializedVersion: 3 99 | buildTarget: Android 100 | maxTextureSize: 2048 101 | resizeAlgorithm: 0 102 | textureFormat: -1 103 | textureCompression: 0 104 | compressionQuality: 50 105 | crunchedCompression: 0 106 | allowsAlphaSplitting: 0 107 | overridden: 0 108 | androidETC2FallbackOverride: 0 109 | forceMaximumCompressionQuality_BC6H_BC7: 0 110 | spriteSheet: 111 | serializedVersion: 2 112 | sprites: [] 113 | outline: [] 114 | physicsShape: [] 115 | bones: [] 116 | spriteID: 5e97eb03825dee720800000000000000 117 | internalID: 0 118 | vertices: [] 119 | indices: 120 | edges: [] 121 | weights: [] 122 | secondaryTextures: [] 123 | spritePackingTag: 124 | pSDRemoveMatte: 0 125 | pSDShowRemoveMatteOption: 0 126 | userData: 127 | assetBundleName: 128 | assetBundleVariant: 129 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Editor/AddScriptingDefine.cs: -------------------------------------------------------------------------------- 1 | // Ignorance 1.4.x LTS (Long Term Support) 2 | // https://github.com/SoftwareGuy/Ignorance 3 | // ----------------- 4 | // Copyright (c) 2019 - 2023 Matt Coburn (SoftwareGuy/Coburn64) 5 | // Ignorance is licensed under the MIT license. Refer 6 | // to the LICENSE file for more information. 7 | #if UNITY_EDITOR 8 | using System.Collections.Generic; 9 | using System.Linq; 10 | using UnityEditor; 11 | 12 | namespace IgnoranceTransport 13 | { 14 | /// 15 | /// Adds the given define symbols to PlayerSettings define symbols. 16 | /// Just add your own define symbols to the Symbols property at the below. 17 | /// 18 | [InitializeOnLoad] 19 | public class AddIgnoranceDefine : Editor 20 | { 21 | private static bool debugMode = false; 22 | private static string existingDefines = string.Empty; 23 | 24 | /// 25 | /// Symbols that will be added to the editor 26 | /// 27 | public static readonly string[] Symbols = new string[] { 28 | "IGNORANCE", // Ignorance exists 29 | "IGNORANCE_1", // Major version 30 | "IGNORANCE_1_4" // Major and minor version 31 | }; 32 | 33 | /// 34 | /// Do not remove these symbols 35 | /// 36 | public static readonly string[] DoNotRemoveTheseSymbols = new string[] 37 | { 38 | "IGNORANCE", 39 | "IGNORANCE_1", 40 | "IGNORANCE_1_4", 41 | "IGNORANCE_MIRROR_POLLING" 42 | }; 43 | 44 | /// 45 | /// Add define symbols as soon as Unity gets done compiling. 46 | /// 47 | static AddIgnoranceDefine() 48 | { 49 | // Get the current scripting defines 50 | string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); 51 | if (existingDefines == definesString) 52 | { 53 | // 1.2.6: There is no need to apply the changes, return. 54 | return; 55 | } 56 | 57 | // Convert the string to a list 58 | List allDefines = definesString.Split(';').ToList(); 59 | // Remove any old version defines from previous installs 60 | allDefines.RemoveAll(IsSafeToRemove); 61 | // x => x.StartsWith("IGNORANCE") && !DoesSymbolExistInBlacklist(x)); 62 | // Add any symbols that weren't already in the list 63 | allDefines.AddRange(Symbols.Except(allDefines)); 64 | 65 | string newDefines = string.Join(";", allDefines.ToArray()); 66 | PlayerSettings.SetScriptingDefineSymbolsForGroup( 67 | EditorUserBuildSettings.selectedBuildTargetGroup, 68 | newDefines 69 | ); 70 | 71 | existingDefines = newDefines; 72 | } 73 | 74 | // 1.2.4: Workaround to stop things from eating custom IGNORANCE_ symbols 75 | static bool DoesSymbolExistInBlacklist(string symbol) 76 | { 77 | foreach(string s in DoNotRemoveTheseSymbols) 78 | { 79 | if(debugMode) 80 | UnityEngine.Debug.Log($"{s.Trim()} matches blacklist"); 81 | 82 | if (s == symbol.Trim()) return true; 83 | } 84 | 85 | return false; 86 | } 87 | 88 | static bool IsSafeToRemove (string input) 89 | { 90 | if (input.StartsWith("IGNORANCE") && !DoesSymbolExistInBlacklist(input)) 91 | { 92 | if (debugMode) 93 | UnityEngine.Debug.Log($"{input.Trim()} is safe to remove"); 94 | 95 | return true; 96 | } 97 | 98 | return false; 99 | } 100 | } 101 | } 102 | #endif 103 | -------------------------------------------------------------------------------- /FAQ.md: -------------------------------------------------------------------------------- 1 |

2 | Ignorance 1.4 Logo 3 |

4 | 5 | Ignorance FAQ 6 | ============= 7 | 8 | You're reading the FAQ. [Click here](https://github.com/SoftwareGuy/Ignorance) to go back to the repository. 9 | 10 | # Runtime-related 11 | 12 | ## What operating systems are supported? 13 | 14 | Right now, Ignorance supports all major platforms on desktop, such as: 15 | 16 | - Microsoft Windows 17 | - Apple MacOS 18 | - Linux (Ubuntu, Debian, CentOS, Arch, etc) (as long as they support GNU libc, if they use non-GNU libc then the included ENet blobs may fail) 19 | 20 | For desktop only 64 Bit operating systems are supported at this moment in time. When 1.4.0 is fully released, 32 Bit operating systems will be supported, as well as ARM64. 21 | 22 | For mobile devices, the following are supported: 23 | 24 | - Android (ARMv7 Mono-only, ARMv7 and ARM64 supported for IL2CPP) 25 | - iOS (ARMv7, ARM64) 26 | 27 | Note that any devices such as VR/AR/XR headsets that run on Android or iOS will work fine, unless plugins need to be specifically adapted to the platform. 28 | 29 | ## Why doesn't Ignorance like a 32Bit Windows/Linux OS instance? 30 | 31 | - Make sure you're building for **x86_64** build target. 32 | - I don't feel like compiling ENet for 32Bit. If you want to do that yourself, feel free to do so. Instructions are in the [ENet-CSharp](https://github.com/SoftwareGuy/ENet-CSharp) repository. 33 | 34 | # Connection-related 35 | 36 | ## Does Ignorance do NAT-PMP, UPnP or NAT Punching? 37 | 38 | No. In this day and age of the internet, relying on NAT Punching is russian roulette. Many routers ship with UPnP/NAT-PMP disabled due to security concerns. That said, your ISP 39 | (read: the entity that provides you internet access) may have their own firewall that blocks incoming connections. **Punch through will fail on mobile networks, such as 3G/4G/5G**. 40 | 41 | If you really need to break through restrictive firewalls, your best bet is to use some sort of Relay mechanism. As far as the firewall is concerned, it just sees it as a single connection. 42 | Mirror supports some relays that work well with Ignorance. For more information, check out the Mirror Discord. 43 | 44 | ## Ignorance doesn't connect to the server that's hosting the game. 45 | 46 | - Check your firewall. Sometimes Windows Server instances will not report the firewall blocking the UDP connections, so you'll need to manually go through and open the UDP port in Windows Firewall. 47 | 48 | - If you're using Google, Amazon or Azure, make sure their external firewall (not the servers' firewall) is not blocking the port. 49 | 50 | - Linux users might have some trouble if they are using `iptables` or `ufw`. A simple search for `iptables open udp port` or `ufw allow udp port` should suffice. 51 | 52 | - Mobile users can experience problems depending on their devices. Samsung Knox can be a bitch and refuse incoming connections for stupid reasons. iOS seems to be fine, as long as you allow it to connect to devices on your local network via the iOS 14 prompt. 53 | 54 | - If this doesn't help, please open a ticket and I'll try to help you out. 55 | 56 | # Mirror-related 57 | 58 | ## What is the minimum version of Mirror that Ignorance supports? 59 | 60 | Mirror 35 is the minimum version that Ignorance 1.4.x uses, while it also supports newer Mirror versions. 61 | 62 | ## I heard Mirror supports batching, does Ignorance take advantage of this? 63 | 64 | Yes, Ignorance supports batching and works quite well. Make sure it's enabled on the Network Manager GameObject, and a version of Mirror that supports batching. 65 | 66 | ## Are you still using LateUpdate for network polling? 67 | 68 | No. Ignorance uses it's own network polling method and an awesome little trick to make it literally the fastest reliable UDP transport for Mirror. 69 | 70 | ## I heard Mirror got a better network polling method. How do I use that over the trick you use? 71 | 72 | Take a look at `Ignorance.cs` and you'll see a define that you need to enable in order to use the new Mirror update mechanism. 73 | 74 | # Other 75 | 76 | ## Why should I use Ignorance over Unity LLAPI? 77 | 78 | Unity LLAPI is obsolete and dead. Depending on what you threw over the network, you'd get random latency spikes and packets would go missing even in reliable delivery mode. Yes, it was **that bad**. 79 | 80 | That alone says something, no? 81 | 82 | ## What happened to Ignorance Classic? 83 | 84 | It died back in the 1.3.x days. The classic version was becoming obsolete and not worth the time keeping it up to date. 85 | 86 | 87 | *To be continued...* -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/TenryuuBall.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &542835289192032773 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 548291784780898253} 12 | - component: {fileID: 394858453892616325} 13 | - component: {fileID: 520653813702449573} 14 | - component: {fileID: 440601958556739609} 15 | - component: {fileID: 440842259441939327} 16 | - component: {fileID: 8881572407762724401} 17 | - component: {fileID: 5995301680282788937} 18 | m_Layer: 0 19 | m_Name: TenryuuBall 20 | m_TagString: Untagged 21 | m_Icon: {fileID: 0} 22 | m_NavMeshLayer: 0 23 | m_StaticEditorFlags: 0 24 | m_IsActive: 1 25 | --- !u!4 &548291784780898253 26 | Transform: 27 | m_ObjectHideFlags: 0 28 | m_CorrespondingSourceObject: {fileID: 0} 29 | m_PrefabInstance: {fileID: 0} 30 | m_PrefabAsset: {fileID: 0} 31 | m_GameObject: {fileID: 542835289192032773} 32 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 33 | m_LocalPosition: {x: -3, y: 0, z: 0} 34 | m_LocalScale: {x: 1, y: 1, z: 1} 35 | m_Children: [] 36 | m_Father: {fileID: 0} 37 | m_RootOrder: 0 38 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 39 | --- !u!212 &394858453892616325 40 | SpriteRenderer: 41 | m_ObjectHideFlags: 0 42 | m_CorrespondingSourceObject: {fileID: 0} 43 | m_PrefabInstance: {fileID: 0} 44 | m_PrefabAsset: {fileID: 0} 45 | m_GameObject: {fileID: 542835289192032773} 46 | m_Enabled: 1 47 | m_CastShadows: 0 48 | m_ReceiveShadows: 0 49 | m_DynamicOccludee: 1 50 | m_MotionVectors: 1 51 | m_LightProbeUsage: 1 52 | m_ReflectionProbeUsage: 1 53 | m_RayTracingMode: 0 54 | m_RenderingLayerMask: 1 55 | m_RendererPriority: 0 56 | m_Materials: 57 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 58 | m_StaticBatchInfo: 59 | firstSubMesh: 0 60 | subMeshCount: 0 61 | m_StaticBatchRoot: {fileID: 0} 62 | m_ProbeAnchor: {fileID: 0} 63 | m_LightProbeVolumeOverride: {fileID: 0} 64 | m_ScaleInLightmap: 1 65 | m_ReceiveGI: 1 66 | m_PreserveUVs: 0 67 | m_IgnoreNormalsForChartDetection: 0 68 | m_ImportantGI: 0 69 | m_StitchLightmapSeams: 0 70 | m_SelectedEditorRenderState: 0 71 | m_MinimumChartSize: 4 72 | m_AutoUVMaxDistance: 0.5 73 | m_AutoUVMaxAngle: 89 74 | m_LightmapParameters: {fileID: 0} 75 | m_SortingLayerID: 0 76 | m_SortingLayer: 0 77 | m_SortingOrder: 0 78 | m_Sprite: {fileID: 21300000, guid: 824ee62c0fc357b4081855e43253a948, type: 3} 79 | m_Color: {r: 1, g: 1, b: 1, a: 1} 80 | m_FlipX: 0 81 | m_FlipY: 0 82 | m_DrawMode: 0 83 | m_Size: {x: 1, y: 1} 84 | m_AdaptiveModeThreshold: 0.5 85 | m_SpriteTileMode: 0 86 | m_WasSpriteAssigned: 1 87 | m_MaskInteraction: 0 88 | m_SpriteSortPoint: 0 89 | --- !u!50 &520653813702449573 90 | Rigidbody2D: 91 | serializedVersion: 4 92 | m_ObjectHideFlags: 0 93 | m_CorrespondingSourceObject: {fileID: 0} 94 | m_PrefabInstance: {fileID: 0} 95 | m_PrefabAsset: {fileID: 0} 96 | m_GameObject: {fileID: 542835289192032773} 97 | m_BodyType: 0 98 | m_Simulated: 1 99 | m_UseFullKinematicContacts: 0 100 | m_UseAutoMass: 0 101 | m_Mass: 0.0001 102 | m_LinearDrag: 0 103 | m_AngularDrag: 0 104 | m_GravityScale: 0 105 | m_Material: {fileID: 6200000, guid: 315510c0721e82f4cad07c2669b863fa, type: 2} 106 | m_Interpolate: 2 107 | m_SleepingMode: 1 108 | m_CollisionDetection: 1 109 | m_Constraints: 4 110 | --- !u!114 &440601958556739609 111 | MonoBehaviour: 112 | m_ObjectHideFlags: 0 113 | m_CorrespondingSourceObject: {fileID: 0} 114 | m_PrefabInstance: {fileID: 0} 115 | m_PrefabAsset: {fileID: 0} 116 | m_GameObject: {fileID: 542835289192032773} 117 | m_Enabled: 1 118 | m_EditorHideFlags: 0 119 | m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3} 120 | m_Name: 121 | m_EditorClassIdentifier: 122 | sceneId: 0 123 | serverOnly: 0 124 | visible: 0 125 | m_AssetId: 5339554c46006dd4e91cae9ff34c095d 126 | hasSpawned: 0 127 | --- !u!114 &440842259441939327 128 | MonoBehaviour: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | m_GameObject: {fileID: 542835289192032773} 134 | m_Enabled: 1 135 | m_EditorHideFlags: 0 136 | m_Script: {fileID: 11500000, guid: 2f74aedd71d9a4f55b3ce499326d45fb, type: 3} 137 | m_Name: 138 | m_EditorClassIdentifier: 139 | syncMode: 0 140 | syncInterval: 0.1 141 | clientAuthority: 0 142 | localPositionSensitivity: 0.01 143 | localRotationSensitivity: 0.01 144 | localScaleSensitivity: 0.01 145 | compressRotation: 0 146 | interpolatePosition: 1 147 | interpolateRotation: 1 148 | interpolateScale: 1 149 | syncScale: 1 150 | --- !u!58 &8881572407762724401 151 | CircleCollider2D: 152 | m_ObjectHideFlags: 0 153 | m_CorrespondingSourceObject: {fileID: 0} 154 | m_PrefabInstance: {fileID: 0} 155 | m_PrefabAsset: {fileID: 0} 156 | m_GameObject: {fileID: 542835289192032773} 157 | m_Enabled: 1 158 | m_Density: 1 159 | m_Material: {fileID: 0} 160 | m_IsTrigger: 0 161 | m_UsedByEffector: 0 162 | m_UsedByComposite: 0 163 | m_Offset: {x: 0, y: 0} 164 | serializedVersion: 2 165 | m_Radius: 1.28 166 | --- !u!114 &5995301680282788937 167 | MonoBehaviour: 168 | m_ObjectHideFlags: 0 169 | m_CorrespondingSourceObject: {fileID: 0} 170 | m_PrefabInstance: {fileID: 0} 171 | m_PrefabAsset: {fileID: 0} 172 | m_GameObject: {fileID: 542835289192032773} 173 | m_Enabled: 1 174 | m_EditorHideFlags: 0 175 | m_Script: {fileID: 11500000, guid: 2a08d5ab1f59230458264367f00c54d8, type: 3} 176 | m_Name: 177 | m_EditorClassIdentifier: 178 | syncMode: 0 179 | syncInterval: 0.1 180 | speed: 70 181 | -------------------------------------------------------------------------------- /ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 0, 121 | "supportsModification": false 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 4 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/AtariBall.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1080679924113744 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4700925592147096} 12 | - component: {fileID: 212107498293566416} 13 | - component: {fileID: 61279514624852186} 14 | - component: {fileID: 50354248948880112} 15 | - component: {fileID: 114290021321007948} 16 | - component: {fileID: 2590138469697868697} 17 | - component: {fileID: 114121325390084138} 18 | m_Layer: 0 19 | m_Name: AtariBall 20 | m_TagString: Untagged 21 | m_Icon: {fileID: 0} 22 | m_NavMeshLayer: 0 23 | m_StaticEditorFlags: 0 24 | m_IsActive: 1 25 | --- !u!4 &4700925592147096 26 | Transform: 27 | m_ObjectHideFlags: 0 28 | m_CorrespondingSourceObject: {fileID: 0} 29 | m_PrefabInstance: {fileID: 0} 30 | m_PrefabAsset: {fileID: 0} 31 | m_GameObject: {fileID: 1080679924113744} 32 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 33 | m_LocalPosition: {x: -3, y: 0, z: 0} 34 | m_LocalScale: {x: 1, y: 1, z: 1} 35 | m_Children: [] 36 | m_Father: {fileID: 0} 37 | m_RootOrder: 0 38 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 39 | --- !u!212 &212107498293566416 40 | SpriteRenderer: 41 | m_ObjectHideFlags: 0 42 | m_CorrespondingSourceObject: {fileID: 0} 43 | m_PrefabInstance: {fileID: 0} 44 | m_PrefabAsset: {fileID: 0} 45 | m_GameObject: {fileID: 1080679924113744} 46 | m_Enabled: 1 47 | m_CastShadows: 0 48 | m_ReceiveShadows: 0 49 | m_DynamicOccludee: 1 50 | m_MotionVectors: 1 51 | m_LightProbeUsage: 1 52 | m_ReflectionProbeUsage: 1 53 | m_RayTracingMode: 0 54 | m_RenderingLayerMask: 1 55 | m_RendererPriority: 0 56 | m_Materials: 57 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 58 | m_StaticBatchInfo: 59 | firstSubMesh: 0 60 | subMeshCount: 0 61 | m_StaticBatchRoot: {fileID: 0} 62 | m_ProbeAnchor: {fileID: 0} 63 | m_LightProbeVolumeOverride: {fileID: 0} 64 | m_ScaleInLightmap: 1 65 | m_ReceiveGI: 1 66 | m_PreserveUVs: 0 67 | m_IgnoreNormalsForChartDetection: 0 68 | m_ImportantGI: 0 69 | m_StitchLightmapSeams: 0 70 | m_SelectedEditorRenderState: 0 71 | m_MinimumChartSize: 4 72 | m_AutoUVMaxDistance: 0.5 73 | m_AutoUVMaxAngle: 89 74 | m_LightmapParameters: {fileID: 0} 75 | m_SortingLayerID: 0 76 | m_SortingLayer: 0 77 | m_SortingOrder: 0 78 | m_Sprite: {fileID: 21300000, guid: 4b66f21097323d44ab40669b2fb9c53d, type: 3} 79 | m_Color: {r: 1, g: 1, b: 1, a: 1} 80 | m_FlipX: 0 81 | m_FlipY: 0 82 | m_DrawMode: 0 83 | m_Size: {x: 1, y: 1} 84 | m_AdaptiveModeThreshold: 0.5 85 | m_SpriteTileMode: 0 86 | m_WasSpriteAssigned: 1 87 | m_MaskInteraction: 0 88 | m_SpriteSortPoint: 0 89 | --- !u!61 &61279514624852186 90 | BoxCollider2D: 91 | m_ObjectHideFlags: 0 92 | m_CorrespondingSourceObject: {fileID: 0} 93 | m_PrefabInstance: {fileID: 0} 94 | m_PrefabAsset: {fileID: 0} 95 | m_GameObject: {fileID: 1080679924113744} 96 | m_Enabled: 1 97 | m_Density: 1 98 | m_Material: {fileID: 6200000, guid: 97a3e4cddb8635c4eba1265f44d106bf, type: 2} 99 | m_IsTrigger: 0 100 | m_UsedByEffector: 0 101 | m_UsedByComposite: 0 102 | m_Offset: {x: 0, y: 0} 103 | m_SpriteTilingProperty: 104 | border: {x: 0, y: 0, z: 0, w: 0} 105 | pivot: {x: 0.5, y: 0.5} 106 | oldSize: {x: 1, y: 1} 107 | newSize: {x: 1, y: 1} 108 | adaptiveTilingThreshold: 0.5 109 | drawMode: 0 110 | adaptiveTiling: 0 111 | m_AutoTiling: 0 112 | serializedVersion: 2 113 | m_Size: {x: 1, y: 1} 114 | m_EdgeRadius: 0 115 | --- !u!50 &50354248948880112 116 | Rigidbody2D: 117 | serializedVersion: 4 118 | m_ObjectHideFlags: 0 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInstance: {fileID: 0} 121 | m_PrefabAsset: {fileID: 0} 122 | m_GameObject: {fileID: 1080679924113744} 123 | m_BodyType: 0 124 | m_Simulated: 0 125 | m_UseFullKinematicContacts: 0 126 | m_UseAutoMass: 0 127 | m_Mass: 0.0001 128 | m_LinearDrag: 0 129 | m_AngularDrag: 0.05 130 | m_GravityScale: 0 131 | m_Material: {fileID: 0} 132 | m_Interpolate: 0 133 | m_SleepingMode: 1 134 | m_CollisionDetection: 0 135 | m_Constraints: 4 136 | --- !u!114 &114290021321007948 137 | MonoBehaviour: 138 | m_ObjectHideFlags: 0 139 | m_CorrespondingSourceObject: {fileID: 0} 140 | m_PrefabInstance: {fileID: 0} 141 | m_PrefabAsset: {fileID: 0} 142 | m_GameObject: {fileID: 1080679924113744} 143 | m_Enabled: 1 144 | m_EditorHideFlags: 0 145 | m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3} 146 | m_Name: 147 | m_EditorClassIdentifier: 148 | sceneId: 0 149 | serverOnly: 0 150 | visible: 0 151 | m_AssetId: 152 | hasSpawned: 0 153 | --- !u!114 &2590138469697868697 154 | MonoBehaviour: 155 | m_ObjectHideFlags: 0 156 | m_CorrespondingSourceObject: {fileID: 0} 157 | m_PrefabInstance: {fileID: 0} 158 | m_PrefabAsset: {fileID: 0} 159 | m_GameObject: {fileID: 1080679924113744} 160 | m_Enabled: 1 161 | m_EditorHideFlags: 0 162 | m_Script: {fileID: 11500000, guid: 2a08d5ab1f59230458264367f00c54d8, type: 3} 163 | m_Name: 164 | m_EditorClassIdentifier: 165 | syncMode: 0 166 | syncInterval: 0.1 167 | speed: 100 168 | --- !u!114 &114121325390084138 169 | MonoBehaviour: 170 | m_ObjectHideFlags: 0 171 | m_CorrespondingSourceObject: {fileID: 0} 172 | m_PrefabInstance: {fileID: 0} 173 | m_PrefabAsset: {fileID: 0} 174 | m_GameObject: {fileID: 1080679924113744} 175 | m_Enabled: 1 176 | m_EditorHideFlags: 0 177 | m_Script: {fileID: 11500000, guid: 2f74aedd71d9a4f55b3ce499326d45fb, type: 3} 178 | m_Name: 179 | m_EditorClassIdentifier: 180 | syncMode: 0 181 | syncInterval: 0 182 | clientAuthority: 0 183 | localPositionSensitivity: 0.01 184 | localRotationSensitivity: 0.01 185 | localScaleSensitivity: 0.01 186 | compressRotation: 1 187 | interpolateScale: 0 188 | syncScale: 0 189 | -------------------------------------------------------------------------------- /Assets/Ignorance/Demo/PongChamp/AtariRacket.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1240244544407914 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4118252415362944} 12 | - component: {fileID: 212641192162007874} 13 | - component: {fileID: 61279767645666242} 14 | - component: {fileID: 50389918509199184} 15 | - component: {fileID: 114104497298166850} 16 | - component: {fileID: -4874889082967523790} 17 | - component: {fileID: 114398896143473162} 18 | m_Layer: 0 19 | m_Name: AtariRacket 20 | m_TagString: Untagged 21 | m_Icon: {fileID: 0} 22 | m_NavMeshLayer: 0 23 | m_StaticEditorFlags: 0 24 | m_IsActive: 1 25 | --- !u!4 &4118252415362944 26 | Transform: 27 | m_ObjectHideFlags: 0 28 | m_CorrespondingSourceObject: {fileID: 0} 29 | m_PrefabInstance: {fileID: 0} 30 | m_PrefabAsset: {fileID: 0} 31 | m_GameObject: {fileID: 1240244544407914} 32 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 33 | m_LocalPosition: {x: 0, y: 0, z: 0} 34 | m_LocalScale: {x: 1, y: 1, z: 1} 35 | m_Children: [] 36 | m_Father: {fileID: 0} 37 | m_RootOrder: 0 38 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 39 | --- !u!212 &212641192162007874 40 | SpriteRenderer: 41 | m_ObjectHideFlags: 0 42 | m_CorrespondingSourceObject: {fileID: 0} 43 | m_PrefabInstance: {fileID: 0} 44 | m_PrefabAsset: {fileID: 0} 45 | m_GameObject: {fileID: 1240244544407914} 46 | m_Enabled: 1 47 | m_CastShadows: 0 48 | m_ReceiveShadows: 0 49 | m_DynamicOccludee: 1 50 | m_MotionVectors: 1 51 | m_LightProbeUsage: 1 52 | m_ReflectionProbeUsage: 1 53 | m_RayTracingMode: 0 54 | m_RenderingLayerMask: 1 55 | m_RendererPriority: 0 56 | m_Materials: 57 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 58 | m_StaticBatchInfo: 59 | firstSubMesh: 0 60 | subMeshCount: 0 61 | m_StaticBatchRoot: {fileID: 0} 62 | m_ProbeAnchor: {fileID: 0} 63 | m_LightProbeVolumeOverride: {fileID: 0} 64 | m_ScaleInLightmap: 1 65 | m_ReceiveGI: 1 66 | m_PreserveUVs: 0 67 | m_IgnoreNormalsForChartDetection: 0 68 | m_ImportantGI: 0 69 | m_StitchLightmapSeams: 0 70 | m_SelectedEditorRenderState: 0 71 | m_MinimumChartSize: 4 72 | m_AutoUVMaxDistance: 0.5 73 | m_AutoUVMaxAngle: 89 74 | m_LightmapParameters: {fileID: 0} 75 | m_SortingLayerID: 0 76 | m_SortingLayer: 0 77 | m_SortingOrder: 0 78 | m_Sprite: {fileID: 21300000, guid: e11aad367beb44f4b8a3def9b8fc57ec, type: 3} 79 | m_Color: {r: 1, g: 1, b: 1, a: 1} 80 | m_FlipX: 0 81 | m_FlipY: 0 82 | m_DrawMode: 0 83 | m_Size: {x: 2, y: 4} 84 | m_AdaptiveModeThreshold: 0.5 85 | m_SpriteTileMode: 0 86 | m_WasSpriteAssigned: 1 87 | m_MaskInteraction: 0 88 | m_SpriteSortPoint: 0 89 | --- !u!61 &61279767645666242 90 | BoxCollider2D: 91 | m_ObjectHideFlags: 0 92 | m_CorrespondingSourceObject: {fileID: 0} 93 | m_PrefabInstance: {fileID: 0} 94 | m_PrefabAsset: {fileID: 0} 95 | m_GameObject: {fileID: 1240244544407914} 96 | m_Enabled: 1 97 | m_Density: 1 98 | m_Material: {fileID: 0} 99 | m_IsTrigger: 0 100 | m_UsedByEffector: 0 101 | m_UsedByComposite: 0 102 | m_Offset: {x: 0, y: 0} 103 | m_SpriteTilingProperty: 104 | border: {x: 0, y: 0, z: 0, w: 0} 105 | pivot: {x: 0.5, y: 0.5} 106 | oldSize: {x: 2, y: 4} 107 | newSize: {x: 2, y: 4} 108 | adaptiveTilingThreshold: 0.5 109 | drawMode: 0 110 | adaptiveTiling: 0 111 | m_AutoTiling: 0 112 | serializedVersion: 2 113 | m_Size: {x: 2, y: 4} 114 | m_EdgeRadius: 0 115 | --- !u!50 &50389918509199184 116 | Rigidbody2D: 117 | serializedVersion: 4 118 | m_ObjectHideFlags: 0 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInstance: {fileID: 0} 121 | m_PrefabAsset: {fileID: 0} 122 | m_GameObject: {fileID: 1240244544407914} 123 | m_BodyType: 0 124 | m_Simulated: 1 125 | m_UseFullKinematicContacts: 0 126 | m_UseAutoMass: 0 127 | m_Mass: 1 128 | m_LinearDrag: 0 129 | m_AngularDrag: 0.05 130 | m_GravityScale: 0 131 | m_Material: {fileID: 0} 132 | m_Interpolate: 1 133 | m_SleepingMode: 1 134 | m_CollisionDetection: 1 135 | m_Constraints: 4 136 | --- !u!114 &114104497298166850 137 | MonoBehaviour: 138 | m_ObjectHideFlags: 0 139 | m_CorrespondingSourceObject: {fileID: 0} 140 | m_PrefabInstance: {fileID: 0} 141 | m_PrefabAsset: {fileID: 0} 142 | m_GameObject: {fileID: 1240244544407914} 143 | m_Enabled: 1 144 | m_EditorHideFlags: 0 145 | m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3} 146 | m_Name: 147 | m_EditorClassIdentifier: 148 | sceneId: 0 149 | serverOnly: 0 150 | visible: 0 151 | m_AssetId: a85b24263182aae4bbc1829bb2b73d7a 152 | hasSpawned: 0 153 | --- !u!114 &-4874889082967523790 154 | MonoBehaviour: 155 | m_ObjectHideFlags: 0 156 | m_CorrespondingSourceObject: {fileID: 0} 157 | m_PrefabInstance: {fileID: 0} 158 | m_PrefabAsset: {fileID: 0} 159 | m_GameObject: {fileID: 1240244544407914} 160 | m_Enabled: 1 161 | m_EditorHideFlags: 0 162 | m_Script: {fileID: 11500000, guid: b68eb08343b29a54dbd5ed7830fb9211, type: 3} 163 | m_Name: 164 | m_EditorClassIdentifier: 165 | syncMode: 0 166 | syncInterval: 0.1 167 | speed: 1500 168 | --- !u!114 &114398896143473162 169 | MonoBehaviour: 170 | m_ObjectHideFlags: 0 171 | m_CorrespondingSourceObject: {fileID: 0} 172 | m_PrefabInstance: {fileID: 0} 173 | m_PrefabAsset: {fileID: 0} 174 | m_GameObject: {fileID: 1240244544407914} 175 | m_Enabled: 1 176 | m_EditorHideFlags: 0 177 | m_Script: {fileID: 11500000, guid: 2f74aedd71d9a4f55b3ce499326d45fb, type: 3} 178 | m_Name: 179 | m_EditorClassIdentifier: 180 | syncMode: 0 181 | syncInterval: 0 182 | clientAuthority: 1 183 | localPositionSensitivity: 0.01 184 | localRotationSensitivity: 0.01 185 | localScaleSensitivity: 0.01 186 | compressRotation: 1 187 | interpolatePosition: 1 188 | interpolateRotation: 1 189 | interpolateScale: 0 190 | syncScale: 0 191 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | ############################### 2 | # Core EditorConfig Options # 3 | ############################### 4 | root = true 5 | [*.{cs,csx,vb,vbx,md}] 6 | indent_style = space 7 | indent_size = 4 8 | insert_final_newline = true 9 | charset = utf-8 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | # Code files 14 | [*.{cs,csx,vb,vbx}] 15 | trim_trailing_whitespace = true 16 | ############################### 17 | # .NET Coding Conventions # 18 | ############################### 19 | [*.{cs,vb}] 20 | # Organize usings 21 | dotnet_sort_system_directives_first = true 22 | # this. preferences 23 | dotnet_style_qualification_for_field = false:silent 24 | dotnet_style_qualification_for_property = false:silent 25 | dotnet_style_qualification_for_method = false:silent 26 | dotnet_style_qualification_for_event = false:silent 27 | # Language keywords vs BCL types preferences 28 | dotnet_style_predefined_type_for_locals_parameters_members = true:silent 29 | dotnet_style_predefined_type_for_member_access = true:silent 30 | # Parentheses preferences 31 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent 32 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent 33 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent 34 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent 35 | # Modifier preferences 36 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent 37 | dotnet_style_readonly_field = true:suggestion 38 | # Expression-level preferences 39 | dotnet_style_object_initializer = true:suggestion 40 | dotnet_style_collection_initializer = true:suggestion 41 | dotnet_style_explicit_tuple_names = true:suggestion 42 | dotnet_style_null_propagation = true:suggestion 43 | dotnet_style_coalesce_expression = true:suggestion 44 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent 45 | dotnet_prefer_inferred_tuple_names = true:suggestion 46 | dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion 47 | dotnet_style_prefer_auto_properties = true:silent 48 | dotnet_style_prefer_conditional_expression_over_assignment = true:silent 49 | dotnet_style_prefer_conditional_expression_over_return = true:silent 50 | ############################### 51 | # Naming Conventions # 52 | ############################### 53 | # Style Definitions 54 | dotnet_naming_style.pascal_case_style.capitalization = pascal_case 55 | # Use PascalCase for constant fields 56 | dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion 57 | dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields 58 | dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style 59 | dotnet_naming_symbols.constant_fields.applicable_kinds = field 60 | dotnet_naming_symbols.constant_fields.applicable_accessibilities = * 61 | dotnet_naming_symbols.constant_fields.required_modifiers = const 62 | ############################### 63 | # C# Coding Conventions # 64 | ############################### 65 | [*.cs] 66 | # var preferences 67 | csharp_style_var_for_built_in_types = false:suggestion 68 | csharp_style_var_when_type_is_apparent = false:suggestion 69 | csharp_style_var_elsewhere = false:suggestion 70 | # Expression-bodied members 71 | csharp_style_expression_bodied_methods = false:silent 72 | csharp_style_expression_bodied_constructors = false:silent 73 | csharp_style_expression_bodied_operators = false:silent 74 | csharp_style_expression_bodied_properties = true:silent 75 | csharp_style_expression_bodied_indexers = true:silent 76 | csharp_style_expression_bodied_accessors = true:silent 77 | # Pattern matching preferences 78 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion 79 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion 80 | # Null-checking preferences 81 | csharp_style_throw_expression = true:suggestion 82 | csharp_style_conditional_delegate_call = true:suggestion 83 | # Modifier preferences 84 | csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion 85 | # Expression-level preferences 86 | csharp_prefer_braces = true:silent 87 | csharp_style_deconstructed_variable_declaration = true:suggestion 88 | csharp_prefer_simple_default_expression = true:suggestion 89 | csharp_style_pattern_local_over_anonymous_function = true:suggestion 90 | csharp_style_inlined_variable_declaration = true:suggestion 91 | ############################### 92 | # C# Formatting Rules # 93 | ############################### 94 | # New line preferences 95 | csharp_new_line_before_open_brace = all 96 | csharp_new_line_before_else = true 97 | csharp_new_line_before_catch = true 98 | csharp_new_line_before_finally = true 99 | csharp_new_line_before_members_in_object_initializers = true 100 | csharp_new_line_before_members_in_anonymous_types = true 101 | csharp_new_line_between_query_expression_clauses = true 102 | # Indentation preferences 103 | csharp_indent_case_contents = true 104 | csharp_indent_switch_labels = true 105 | csharp_indent_labels = flush_left 106 | # Space preferences 107 | csharp_space_after_cast = false 108 | csharp_space_after_keywords_in_control_flow_statements = true 109 | csharp_space_between_method_call_parameter_list_parentheses = false 110 | csharp_space_between_method_declaration_parameter_list_parentheses = false 111 | csharp_space_between_parentheses = false 112 | csharp_space_before_colon_in_inheritance_clause = true 113 | csharp_space_after_colon_in_inheritance_clause = true 114 | csharp_space_around_binary_operators = before_and_after 115 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false 116 | csharp_space_between_method_call_name_and_opening_parenthesis = false 117 | csharp_space_between_method_call_empty_parameter_list_parentheses = false 118 | # Wrapping preferences 119 | csharp_preserve_single_line_statements = true 120 | csharp_preserve_single_line_blocks = true 121 | ############################### 122 | # VB Coding Conventions # 123 | ############################### 124 | [*.vb] 125 | # Modifier preferences 126 | visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion 127 | -------------------------------------------------------------------------------- /DOCUMENTATION.md: -------------------------------------------------------------------------------- 1 |

2 | Ignorance 1.4 Logo 3 |

4 | 5 | Ignorance Documentation 6 | ============= 7 | 8 | Here's the current documentation presented in good 'ol markdown for easy viewing on GitHub. I ain't gonna use GitBook for a simple documentation, sorry to disappoint! 9 | 10 | Unless noted, all configuration options presented here are based from Ignorance version 1.4. 11 | 12 | Ignorance Transport 13 | ------------ 14 | 15 | The *Ignorance Transport* is a component that attaches to your Mirror NetworkManager. It then bridges code-wise between Mirror itself, Ignorance Core and finally ENet. 16 | For those who are technically inclined, the whole chain is as follows: 17 | 18 | ``` 19 | Mirror Networking (High Level) <-> Ignorance Transport + Core (High to Low Level) <-> ENet-CSharp Managed-To-Native Wrapper <-> ENet (Native, x64/ARM Win/Mac/Linux/Android/iOS/etc) 20 | ``` 21 | 22 | Ignorance Transport Configuration 23 | ------------ 24 | 25 | From top to bottom... 26 | 27 | ![Image](../master/Documentation/ignorance14options.png?raw=true) 28 | 29 | ### Essentials 30 | 31 | This option... | ...does this. 32 | -------------- | ------------- 33 | Port | Specifies the listening port that Ignorance will use when Mirror starts Host or Server Only mode. 34 | 35 | ### Debugging & Logging 36 | 37 | This option... | ...does this. 38 | -------------- | ------------- 39 | Log Type | Specifies how verbose Ignorance will be when it's running. Default is **Standard**, which is balanced between being *almost* mute to super verbose. 40 | Debug Display | If you would like a OnGUI debug display that shows some information about the low-level world, enable this. You'll see a debug window in the bottom left of your game window. 41 | 42 | 43 | ### Server Configuration 44 | 45 | This option... | ...does this. 46 | -------------- | ------------- 47 | Server Binds All | If enabled, ENet will ignore the *Server Bind Address* and bind to all IP addresses. If disabled, it will only bind to the specified bind address. This is useful for multiple instances on the same server. Default is enabled. 48 | Server Bind Address | If *Server Binds All* is disabled, this is the IP address that ENet will attempt to bind to. IPv4 and IPv6 is both supported. If this is invalid, then ENet will likely catch fire. 49 | Server Peer Max Capacity | Also known as maximum CCU. This is best kept to the same number as your Mirror maximum players count. 50 | Server Max Native Time | This is how long the servers' native ENet thread will wait for network events. Higher numbers (3 or 5, for example) can save CPU power, while lower numbers keep ENet running as fast as possible. Default is **1** which is a sane default. 51 | 52 | ### Client Configuration 53 | 54 | This option... | ...does this. 55 | -------------- | ------------- 56 | Client Max Native Time | This is how long the client' native ENet thread will wait for network events. Higher numbers (3 or 5, for example) can save CPU power, while lower numbers keep ENet running as fast as possible. Default is **1** which is a sane default. 57 | Client Status Update Interval | If set above 0, this interval will trigger Ignorance to request client information. Since this technically can be expensive if done aggressively as it asks native ENet for the stats, every 3 or 5 seconds is recommended minimum values. 58 | 59 | ### Channel Configuration 60 | 61 | This option... | ...does this. 62 | -------------- | ------------- 63 | Channels | Defines the channel array. This allows you to divide up your packets into channels with different packet delivery methods. 64 | 65 | 66 | ### Ring Buffer Tweaking 67 | 68 | This option... | ...does this. 69 | -------------- | ------------- 70 | Client Data Buffer Size | Defines how many slots in the ring buffer for data packets coming from the server. This may require tweaking if the server is sending a lot of packet data to your client or you have a very fast paced game. 71 | Client Conn Event Buffer Size | Defines how many slots in the ring buffer for connection events. The default is sane enough. Probably overkill for a client, now that I think about it... 72 | Server Data Buffer Size | Defines how many slots in the ring buffer for data packets coming from clients. This will require tweaking depending on how chatty your client network code is. The default should be enough for a majority of projects, but a value like 10000 might be required for others while a turn-based game might be fine with the default or even less. Your mileage may vary. 73 | Server Conn Event Buffer Size | Defines how many slots in the ring buffer for connection events. The default should be sane enough. This is only useful if you have lots of clients connecting/disconnecting at once. 74 | 75 | NOTE: A connection event is either a ENet Connect or Disconnect. In other words, when a ENet client connects to the server or disconnects, a event is raised and placed into the queue for processing by Mirror. 76 | 77 | ### Danger Zone 78 | 79 | This option... | ...does this. 80 | -------------- | ------------- 81 | Packet Buffer Capacity | Value in bytes. This is used as a temporary scratch pad for incoming packet data. The default is 4 Kilobytes (4096 bytes). If you get errors about packets being too big, it may pay to increase this, or try optimizing your netcode data. 82 | Max Allowed Packet Size | Value in bytes. ENet supports sending a UDP Packet up to 32 Megabytes, but this comes at a cost including reduced performance and stressing out ENet. The default is set to the maximum ENet packet size value. Setting this over 33554432 bytes **will not** have any positive effect, and may even cause ENet to complain. 83 | 84 | It is advised to keep your data packets as small as possible. I do not recommend using Ignorance or ENet for real-time video streaming if it's some insane resolution. 85 | 86 | *End of configuration options.* 87 | 88 | Ignorance Core 89 | ------------ 90 | 91 | Ignorance Core was designed to be able to be used outside of a Unity environment, allowing you to harness the power of Ignorance in your own non-Mirror or non-Unity project. If you remove the Ignorance Transport components, you get Ignorance Standalone. 92 | 93 | You'll need to patch the Core to remove `Debug.Log` calls, but with a little work you'll be able to do your own IO through Ignorance Core. Use the Ignorance Transport component as a coding reference, how to enqueue packets and dequeue them. 94 | 95 | 96 | Help improve the documentation! 97 | ------------ 98 | 99 | Confused? Think something can be explained better? Send a issue ticket and tell me what I can elaborate or improve here. 100 | 101 | Other than that, thanks again for using Ignorance! -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Ignorance 1.4 Logo 3 |

4 | 5 | Ignorance 1.4 Long Term Support (LTS) 6 | ============= 7 | [![Ko-Fi](https://img.shields.io/badge/Donate-Ko--Fi-red)](https://ko-fi.com/coburn) 8 | [![PayPal](https://img.shields.io/badge/Donate-PayPal-blue)](https://paypal.me/coburn64) 9 | [![GitHub issues](https://img.shields.io/github/issues/SoftwareGuy/Ignorance.svg)](https://github.com/SoftwareGuy/Ignorance/issues) 10 | ![GitHub last commit](https://img.shields.io/github/last-commit/SoftwareGuy/Ignorance.svg) ![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg) 11 | 12 | _I'd appreciate [a coffee](https://ko-fi.com/coburn) if you use this transport in your project and you want to help keep my bills paid and lights on._ 13 | 14 | _"Probably the fastest transport out there for Mirror..." - FSE_Vincenzo, 2021 (Mirror Discord)_ 15 | 16 | Ignorance is a high-performance UDP based transport that plugs into [Mirror Networking](https://github.com/vis2k/Mirror). By harnessing the power of the tried and true ENet native library, it provides reliable and unreliable UDP communications with up to 4096 connected peers (clients) and 255 channels. Reliable UDP has a lot of benefits over TCP which was the default in Mirror until KCP was implemented. 17 | 18 | The benefit of Ignorance is that you can utilize channels which allow you to split up network communications. This allows you to have channels for data that are mission critical and must be sent out the door as quickly as possible as well as channels that can send slower non-essential data. 19 | 20 | Long Term Support 21 | ------------ 22 | Ignorance 1.4 is currently in Long Term Support, meaning that no new features are planned. Bug fixes are prioritized and will be addressed when I have free time. 23 | 24 | If you have an urgent bug report, then you are encouraged to consider a sponsorship. This will allow me to take time away from my business activities and prioritize the bug report. 25 | 26 | Licensing 27 | ------------ 28 | Ignorance is licensed under MIT license. However, there has been recent cases where other developers have been using the full Ignorance source or parts thereof, stripping the MIT licensing and slapping their own license on it instead. 29 | 30 | This falls in violation of the MIT license as it clearly states that copyright notices must remain intact. In short, don't be a code thief and respect the MIT license. 31 | 32 | Requirements 33 | ----------- 34 | - Mirror, version 66 upwards 35 | - The minimum version of Unity required is what Mirror requires. I recommend Unity 2020 LTS. 36 | - Basic knowledge of Unity Engine and Mirror Networking 37 | 38 | **Ignorance 1.4 LTS will not work with older Mirror versions.** You can backport 1.4 LTS to your older Mirror project, but that support is on you. 39 | 40 | Installation 41 | ------------ 42 | Download the Unity Package from Releases that is the latest one. Simply import the Unity Package and Unity will do the rest. 43 | Follow the instructions below. 44 | 45 | Alternatively you can use the code from the master branch, which is often up to date compared to the releases. 46 | 47 | How to use 48 | ---------- 49 | I have included two pre-configured sample scenes so you can get started easily. One is Pong, one is a copy paste with some modifications 50 | of Mirror's Basic scene. Otherwise add the script called **Ignorance** to your NetworkManager object, removing any TCP-based or other 51 | UDP-based transport (ie. kcp2k). Then set the script to be used in NetworkManagers' "Transport" field. 52 | 53 | Documentation 54 | ------------ 55 | See [DOCUMENTATION.md](https://github.com/SoftwareGuy/Ignorance/blob/master/DOCUMENTATION.md). 56 | 57 | For *Ignorance Standalone*, see [STANDALONE.md](https://github.com/SoftwareGuy/Ignorance/blob/master/STANDALONE.md). 58 | 59 | For the FAQ (aka Please Read This First), see [FAQ.md](https://github.com/SoftwareGuy/Ignorance/blob/master/FAQ.md). 60 | 61 | Ignorance with Mirage/et al. 62 | ------------ 63 | - Mirage users: Please use the built-in UDP transport that ships with it. 64 | - FishNet users: Fludity was a hacked up version of Ignorance with its license stripped. It's been replaced with Tugboat. 65 | - Other network stacks: Ignorance was **not** designed to be used outside of Mirror. 66 | 67 | If you are using your own network stack or you are trying to plumb Ignorance to another networking solution that already exists, you are **much** better off using the [ENet-CSharp wrapper](https://github.com/SoftwareGuy/ENet-CSharp) to talk to ENet directly. You could also try Ignorance Standalone which is mentioned above. 68 | 69 | Ignorance in Action 70 | ------------ 71 | - **If you own a copy of Population One, congrats.** That game uses Ignorance as its primary network transport layer. It also earns its spot into the first major game that is using Ignorance. 72 | 73 | - Ignorance was used in a "Vinesauce is Hope" walking simulation demo which had multiple server instances running with over 300 CCU each. [Video clips available here](https://clips.twitch.tv/UglyColdbloodedAlfalfaAllenHuhu). 74 | 75 | What devices are supported? 76 | ------------ 77 | **IMPORTANT: 32bit Desktop targets are NOT supported. Macintoshes with the M1 (ARM64/AArch64) chip are also not supported. Rosetta *may* work though.** 78 | 79 | **Supported platforms, out of the box:** 80 | 81 | - 64Bit Desktop Platforms (Windows/Mac/Linux), Android (ARMv7/ARM64) including VR devices and iOS (ARMv7/ARM64). 82 | 83 | - If ENet native can run on it and it's supported by Unity, you're good to go with Ignorance. 84 | 85 | - **Apple M1 Device Users** must recompile ENet Native for their M1 processors. Using Ignorance straight out of the box will result not be able to load the x86_64 library on Apple Silicon. Rosetta may work, but no promises. 86 | 87 | **Other platforms that require some extra work:** 88 | 89 | - Consoles like the Nintendo Switch, PlayStation 4 and PlayStation 5. I do not have development clearance to build the native library for these platforms, so they require additional work to get functioning. 90 | 91 | For more info, see the FAQ. 92 | 93 | I found a bug, where do I report it? 94 | -------------------------------- 95 | [Check the current open bug reports and/or report a new one here](https://github.com/SoftwareGuy/Ignorance/issues). 96 | 97 | Failing that you can always catch me on the Oiran Studio discord or Mirror discord. 98 | 99 | Bugs that do not have enough details will be either closed or put as low priority. Details like your OS, Unity Editor version, any Ignorance errors, etc is essential for a good bug report. 100 | 101 | ### I have other questions, I want answers. 102 | 103 | [Here's a quick primer.](https://vis2k.github.io/Mirror/Transports/Ignorance). It might be slightly out of date, but it covers the basics of Ignorance. 104 | 105 | 106 | Credits 107 | ------- 108 | 109 | - **Donators**: Thanks for helping keep the lights on. 110 | 111 | - [FSE_Vincenzo](https://github.com/Vincenz099): Resident master of the ENet way. They are part of Flying Squirrel Entertainment - go check their games out. 112 | 113 | - [JesusLuvsYooh](https://github.com/JesusLuvsYooh) : CCU endurance testing project, ideas, fixes and other awesome stuff 114 | 115 | - [Katori](https://github.com/katori): Helped kickstart the threaded version that evolved into short-lived Ignorance 2.x version, which later became 116 | Ignorance Threaded. 117 | 118 | - [PhantomGamers](https://github.com/PhantomGamers): Got Mirror + Ignorance working as a BepInEx client-side side-load modification for a game. Holy shit, that's cool. 119 | 120 | - [BigBoxVR](https://github.com/GabeBigBoxVR): Pull requests and found a race condition that threatened stability. Also uses Ignorance in Population One, a VR title. 121 | 122 | - [Martin](https://github.com/martindevans): Pull requests, testing with Dissonance. Great VoIP asset for Unity. 123 | 124 | - [c6burns](https://github.com/c6burns), [Petris](https://github.com/MichalPetryka), [shiena](https://github.com/shiena), [Draknith](https://github.com/FizzCube), [nxrighthere](https://github.com/nxrighthere), [vis2k](https://github.com/vis2k), [Paul](https://github.com/paulpach) 125 | 126 | - The Mirror Discord and the others who I have missed. Thanks a lot, you know who you are. 127 | 128 | - You too can have your name here if you send in a PR. Don't delay, get your PR in today! 129 | 130 | **To be continued...?** 131 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | ReleaseStaging/ 21 | #/x64/ 22 | #/x86/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | [Ll]og/ 27 | 28 | # Visual Studio 2015/2017 cache/options directory 29 | .vs/ 30 | # Uncomment if you have tasks that create the project's static files in wwwroot 31 | #wwwroot/ 32 | 33 | # Visual Studio 2017 auto generated files 34 | Generated\ Files/ 35 | 36 | # MSTest test Results 37 | [Tt]est[Rr]esult*/ 38 | [Bb]uild[Ll]og.* 39 | 40 | # NUNIT 41 | *.VisualState.xml 42 | TestResult.xml 43 | 44 | # Build Results of an ATL Project 45 | [Dd]ebugPS/ 46 | [Rr]eleasePS/ 47 | dlldata.c 48 | 49 | # Benchmark Results 50 | BenchmarkDotNet.Artifacts/ 51 | 52 | # .NET Core 53 | project.lock.json 54 | project.fragment.lock.json 55 | artifacts/ 56 | **/Properties/launchSettings.json 57 | 58 | # StyleCop 59 | StyleCopReport.xml 60 | 61 | # Files built by Visual Studio 62 | *_i.c 63 | *_p.c 64 | *_i.h 65 | *.ilk 66 | # *.meta 67 | *.obj 68 | *.iobj 69 | *.pch 70 | *.pdb 71 | *.ipdb 72 | *.pgc 73 | *.pgd 74 | *.rsp 75 | *.sbr 76 | *.tlb 77 | *.tli 78 | *.tlh 79 | *.tmp 80 | *.tmp_proj 81 | *.log 82 | *.vspscc 83 | *.vssscc 84 | .builds 85 | *.pidb 86 | *.svclog 87 | *.scc 88 | 89 | # Chutzpah Test files 90 | _Chutzpah* 91 | 92 | # Visual C++ cache files 93 | ipch/ 94 | *.aps 95 | *.ncb 96 | *.opendb 97 | *.opensdf 98 | *.sdf 99 | *.cachefile 100 | *.VC.db 101 | *.VC.VC.opendb 102 | 103 | # Visual Studio profiler 104 | *.psess 105 | *.vsp 106 | *.vspx 107 | *.sap 108 | 109 | # Visual Studio Trace Files 110 | *.e2e 111 | 112 | # TFS 2012 Local Workspace 113 | $tf/ 114 | 115 | # Guidance Automation Toolkit 116 | *.gpState 117 | 118 | # ReSharper is a .NET coding add-in 119 | _ReSharper*/ 120 | *.[Rr]e[Ss]harper 121 | *.DotSettings.user 122 | 123 | # JustCode is a .NET coding add-in 124 | .JustCode 125 | 126 | # TeamCity is a build add-in 127 | _TeamCity* 128 | 129 | # DotCover is a Code Coverage Tool 130 | *.dotCover 131 | 132 | # AxoCover is a Code Coverage Tool 133 | .axoCover/* 134 | !.axoCover/settings.json 135 | 136 | # Visual Studio code coverage results 137 | *.coverage 138 | *.coveragexml 139 | 140 | # NCrunch 141 | _NCrunch_* 142 | .*crunch*.local.xml 143 | nCrunchTemp_* 144 | 145 | # MightyMoose 146 | *.mm.* 147 | AutoTest.Net/ 148 | 149 | # Web workbench (sass) 150 | .sass-cache/ 151 | 152 | # Installshield output folder 153 | [Ee]xpress/ 154 | 155 | # DocProject is a documentation generator add-in 156 | DocProject/buildhelp/ 157 | DocProject/Help/*.HxT 158 | DocProject/Help/*.HxC 159 | DocProject/Help/*.hhc 160 | DocProject/Help/*.hhk 161 | DocProject/Help/*.hhp 162 | DocProject/Help/Html2 163 | DocProject/Help/html 164 | 165 | # Click-Once directory 166 | publish/ 167 | 168 | # Publish Web Output 169 | *.[Pp]ublish.xml 170 | *.azurePubxml 171 | # Note: Comment the next line if you want to checkin your web deploy settings, 172 | # but database connection strings (with potential passwords) will be unencrypted 173 | *.pubxml 174 | *.publishproj 175 | 176 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 177 | # checkin your Azure Web App publish settings, but sensitive information contained 178 | # in these scripts will be unencrypted 179 | PublishScripts/ 180 | 181 | # NuGet Packages 182 | *.nupkg 183 | # The packages folder can be ignored because of Package Restore 184 | **/[Pp]ackages/* 185 | # except build/, which is used as an MSBuild target. 186 | !**/[Pp]ackages/build/ 187 | # Uncomment if necessary however generally it will be regenerated when needed 188 | #!**/[Pp]ackages/repositories.config 189 | # NuGet v3's project.json files produces more ignorable files 190 | *.nuget.props 191 | *.nuget.targets 192 | 193 | # Microsoft Azure Build Output 194 | csx/ 195 | *.build.csdef 196 | 197 | # Microsoft Azure Emulator 198 | ecf/ 199 | rcf/ 200 | 201 | # Windows Store app package directories and files 202 | AppPackages/ 203 | BundleArtifacts/ 204 | Package.StoreAssociation.xml 205 | _pkginfo.txt 206 | *.appx 207 | 208 | # Visual Studio cache files 209 | # files ending in .cache can be ignored 210 | *.[Cc]ache 211 | # but keep track of directories ending in .cache 212 | !*.[Cc]ache/ 213 | 214 | # Others 215 | ClientBin/ 216 | ~$* 217 | *~ 218 | *.dbmdl 219 | *.dbproj.schemaview 220 | *.jfm 221 | *.pfx 222 | *.publishsettings 223 | orleans.codegen.cs 224 | 225 | # Including strong name files can present a security risk 226 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 227 | #*.snk 228 | 229 | # Since there are multiple workflows, uncomment next line to ignore bower_components 230 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 231 | #bower_components/ 232 | 233 | # RIA/Silverlight projects 234 | Generated_Code/ 235 | 236 | # Backup & report files from converting an old project file 237 | # to a newer Visual Studio version. Backup files are not needed, 238 | # because we have git ;-) 239 | _UpgradeReport_Files/ 240 | Backup*/ 241 | UpgradeLog*.XML 242 | UpgradeLog*.htm 243 | ServiceFabricBackup/ 244 | *.rptproj.bak 245 | 246 | # SQL Server files 247 | *.mdf 248 | *.ldf 249 | *.ndf 250 | 251 | # Business Intelligence projects 252 | *.rdl.data 253 | *.bim.layout 254 | *.bim_*.settings 255 | *.rptproj.rsuser 256 | 257 | # Microsoft Fakes 258 | FakesAssemblies/ 259 | 260 | # GhostDoc plugin setting file 261 | *.GhostDoc.xml 262 | 263 | # Node.js Tools for Visual Studio 264 | .ntvs_analysis.dat 265 | node_modules/ 266 | 267 | # Visual Studio 6 build log 268 | *.plg 269 | 270 | # Visual Studio 6 workspace options file 271 | *.opt 272 | 273 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 274 | *.vbw 275 | 276 | # Visual Studio LightSwitch build output 277 | **/*.HTMLClient/GeneratedArtifacts 278 | **/*.DesktopClient/GeneratedArtifacts 279 | **/*.DesktopClient/ModelManifest.xml 280 | **/*.Server/GeneratedArtifacts 281 | **/*.Server/ModelManifest.xml 282 | _Pvt_Extensions 283 | 284 | # Paket dependency manager 285 | .paket/paket.exe 286 | paket-files/ 287 | 288 | # FAKE - F# Make 289 | .fake/ 290 | 291 | # JetBrains Rider 292 | .idea/ 293 | *.sln.iml 294 | 295 | # CodeRush 296 | .cr/ 297 | 298 | # Python Tools for Visual Studio (PTVS) 299 | __pycache__/ 300 | *.pyc 301 | 302 | # Cake - Uncomment if you are using it 303 | # tools/** 304 | # !tools/packages.config 305 | 306 | # Tabs Studio 307 | *.tss 308 | 309 | # Telerik's JustMock configuration file 310 | *.jmconfig 311 | 312 | # BizTalk build output 313 | *.btp.cs 314 | *.btm.cs 315 | *.odx.cs 316 | *.xsd.cs 317 | 318 | # OpenCover UI analysis results 319 | OpenCover/ 320 | 321 | # Azure Stream Analytics local run output 322 | ASALocalRun/ 323 | 324 | # MSBuild Binary and Structured Log 325 | *.binlog 326 | 327 | # NVidia Nsight GPU debugger configuration file 328 | *.nvuser 329 | 330 | # MFractors (Xamarin productivity tool) working folder 331 | .mfractor/ 332 | 333 | # Dependencies so that people don't get import issues. 334 | [Ll]ibrary/* 335 | ![Ll]ibrary/.gitkeep 336 | 337 | *.csproj 338 | *.sln 339 | Temp/* 340 | 341 | # ENet Logs 342 | enet_log.txt 343 | 344 | # Private shit 345 | Build 346 | Assets/_DoNotShip/ 347 | Assets/_DoNotShip.meta 348 | LinuxBuild/ 349 | Assets/NotFucked 350 | Assets/Plugins 351 | Assets/Plugins.meta 352 | Assets/NotFucked.meta 353 | Assets/StreamingAssets.meta 354 | *.shadervariants 355 | *.shadervariants.meta 356 | Builds 357 | Logs 358 | *.bak 359 | *.bak.meta 360 | 361 | # Mirror 362 | Assets/*.meta 363 | Assets/ScriptTemplates/ 364 | Assets/ScriptTemplates.meta 365 | Assets/Mirror/Authenticators* 366 | Assets/Mirror/CompilerSymbols* 367 | Assets/Mirror/Components* 368 | Assets/Mirror/Core* 369 | Assets/Mirror/Editor* 370 | Assets/Mirror/Examples* 371 | Assets/Mirror/Icon* 372 | Assets/Mirror/Plugins* 373 | Assets/Mirror/*.meta 374 | Assets/Mirror/LICENSE 375 | Assets/Mirror/*.txt 376 | Assets/Mirror/Runtime/*.asmdef 377 | Assets/Mirror/Runtime/*.cs 378 | Assets/Mirror/Runtime/*.meta 379 | Assets/Mirror/Runtime/Empty/* 380 | Assets/Mirror/Runtime/Logging* 381 | Assets/Mirror/Transports/* 382 | # Do not exclude Ignorance folders. 383 | !Assets/Mirror/Transports/Ignorance 384 | !Assets/Mirror/Transports/Ignorance.* 385 | # Exclude other transports. 386 | 387 | Assets/Mirror/Runtime/Batching 388 | Assets/Mirror/Runtime/SnapshotInterpolation 389 | Assets/Mirror/Test 390 | UserSettings 391 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Dependencies/RingBuffer.cs: -------------------------------------------------------------------------------- 1 | // The following dependency was taken from https://github.com/dave-hillier/disruptor-unity3d 2 | // The Apache License 2.0 this dependency follows is located at https://github.com/dave-hillier/disruptor-unity3d/blob/master/LICENSE. 3 | // Modifications were made by SoftwareGuy (Coburn). 4 | 5 | using System.Runtime.CompilerServices; 6 | using System.Runtime.InteropServices; 7 | using System.Threading; 8 | 9 | namespace IgnoranceThirdparty 10 | { 11 | /// 12 | /// Implementation of the Disruptor pattern 13 | /// 14 | /// the type of item to be stored 15 | public class RingBuffer 16 | { 17 | private readonly T[] _entries; 18 | private readonly int _modMask; 19 | private Volatile.PaddedLong _consumerCursor = new Volatile.PaddedLong(); 20 | private Volatile.PaddedLong _producerCursor = new Volatile.PaddedLong(); 21 | 22 | /// 23 | /// Creates a new RingBuffer with the given capacity 24 | /// 25 | /// The capacity of the buffer 26 | /// Only a single thread may attempt to consume at any one time 27 | public RingBuffer(int capacity) 28 | { 29 | capacity = NextPowerOfTwo(capacity); 30 | _modMask = capacity - 1; 31 | _entries = new T[capacity]; 32 | } 33 | 34 | /// 35 | /// The maximum number of items that can be stored 36 | /// 37 | public int Capacity 38 | { 39 | get { return _entries.Length; } 40 | } 41 | 42 | public T this[long index] 43 | { 44 | get { unchecked { return _entries[index & _modMask]; } } 45 | set { unchecked { _entries[index & _modMask] = value; } } 46 | } 47 | 48 | /// 49 | /// Removes an item from the buffer. 50 | /// 51 | /// The next available item 52 | public T Dequeue() 53 | { 54 | var next = _consumerCursor.ReadAcquireFence() + 1; 55 | while (_producerCursor.ReadAcquireFence() < next) // makes sure we read the data from _entries after we have read the producer cursor 56 | { 57 | Thread.SpinWait(1); 58 | } 59 | var result = this[next]; 60 | _consumerCursor.WriteReleaseFence(next); // makes sure we read the data from _entries before we update the consumer cursor 61 | return result; 62 | } 63 | 64 | /// 65 | /// Attempts to remove an items from the queue 66 | /// 67 | /// the items 68 | /// True if successful 69 | public bool TryDequeue(out T obj) 70 | { 71 | var next = _consumerCursor.ReadAcquireFence() + 1; 72 | 73 | if (_producerCursor.ReadAcquireFence() < next) 74 | { 75 | obj = default(T); 76 | return false; 77 | } 78 | obj = Dequeue(); 79 | return true; 80 | } 81 | 82 | /// 83 | /// Add an item to the buffer 84 | /// 85 | /// 86 | public void Enqueue(T item) 87 | { 88 | var next = _producerCursor.ReadAcquireFence() + 1; 89 | 90 | long wrapPoint = next - _entries.Length; 91 | long min = _consumerCursor.ReadAcquireFence(); 92 | 93 | while (wrapPoint > min) 94 | { 95 | min = _consumerCursor.ReadAcquireFence(); 96 | Thread.SpinWait(1); 97 | } 98 | 99 | this[next] = item; 100 | _producerCursor.WriteReleaseFence(next); // makes sure we write the data in _entries before we update the producer cursor 101 | } 102 | 103 | /// 104 | /// The number of items in the buffer 105 | /// 106 | /// for indicative purposes only, may contain stale data 107 | public int Count { get { return (int)(_producerCursor.ReadFullFence() - _consumerCursor.ReadFullFence()); } } 108 | 109 | private static int NextPowerOfTwo(int x) 110 | { 111 | var result = 2; 112 | while (result < x) 113 | { 114 | result <<= 1; 115 | } 116 | return result; 117 | } 118 | 119 | 120 | } 121 | public static class Volatile 122 | { 123 | private const int CacheLineSize = 64; 124 | 125 | [StructLayout(LayoutKind.Explicit, Size = CacheLineSize * 2)] 126 | public struct PaddedLong 127 | { 128 | [FieldOffset(CacheLineSize)] 129 | private long _value; 130 | 131 | /// 132 | /// Create a new with the given initial value. 133 | /// 134 | /// Initial value 135 | public PaddedLong(long value) 136 | { 137 | _value = value; 138 | } 139 | 140 | /// 141 | /// Read the value without applying any fence 142 | /// 143 | /// The current value 144 | public long ReadUnfenced() 145 | { 146 | return _value; 147 | } 148 | 149 | /// 150 | /// Read the value applying acquire fence semantic 151 | /// 152 | /// The current value 153 | public long ReadAcquireFence() 154 | { 155 | var value = _value; 156 | Thread.MemoryBarrier(); 157 | return value; 158 | } 159 | 160 | /// 161 | /// Read the value applying full fence semantic 162 | /// 163 | /// The current value 164 | public long ReadFullFence() 165 | { 166 | Thread.MemoryBarrier(); 167 | return _value; 168 | } 169 | 170 | /// 171 | /// Read the value applying a compiler only fence, no CPU fence is applied 172 | /// 173 | /// The current value 174 | [MethodImpl(MethodImplOptions.NoOptimization)] 175 | public long ReadCompilerOnlyFence() 176 | { 177 | return _value; 178 | } 179 | 180 | /// 181 | /// Write the value applying release fence semantic 182 | /// 183 | /// The new value 184 | public void WriteReleaseFence(long newValue) 185 | { 186 | Thread.MemoryBarrier(); 187 | _value = newValue; 188 | } 189 | 190 | /// 191 | /// Write the value applying full fence semantic 192 | /// 193 | /// The new value 194 | public void WriteFullFence(long newValue) 195 | { 196 | Thread.MemoryBarrier(); 197 | _value = newValue; 198 | } 199 | 200 | /// 201 | /// Write the value applying a compiler fence only, no CPU fence is applied 202 | /// 203 | /// The new value 204 | [MethodImpl(MethodImplOptions.NoOptimization)] 205 | public void WriteCompilerOnlyFence(long newValue) 206 | { 207 | _value = newValue; 208 | } 209 | 210 | /// 211 | /// Write without applying any fence 212 | /// 213 | /// The new value 214 | public void WriteUnfenced(long newValue) 215 | { 216 | _value = newValue; 217 | } 218 | 219 | /// 220 | /// Atomically set the value to the given updated value if the current value equals the comparand 221 | /// 222 | /// The new value 223 | /// The comparand (expected value) 224 | /// 225 | public bool AtomicCompareExchange(long newValue, long comparand) 226 | { 227 | return Interlocked.CompareExchange(ref _value, newValue, comparand) == comparand; 228 | } 229 | 230 | /// 231 | /// Atomically set the value to the given updated value 232 | /// 233 | /// The new value 234 | /// The original value 235 | public long AtomicExchange(long newValue) 236 | { 237 | return Interlocked.Exchange(ref _value, newValue); 238 | } 239 | 240 | /// 241 | /// Atomically add the given value to the current value and return the sum 242 | /// 243 | /// The value to be added 244 | /// The sum of the current value and the given value 245 | public long AtomicAddAndGet(long delta) 246 | { 247 | return Interlocked.Add(ref _value, delta); 248 | } 249 | 250 | /// 251 | /// Atomically increment the current value and return the new value 252 | /// 253 | /// The incremented value. 254 | public long AtomicIncrementAndGet() 255 | { 256 | return Interlocked.Increment(ref _value); 257 | } 258 | 259 | /// 260 | /// Atomically increment the current value and return the new value 261 | /// 262 | /// The decremented value. 263 | public long AtomicDecrementAndGet() 264 | { 265 | return Interlocked.Decrement(ref _value); 266 | } 267 | 268 | /// 269 | /// Returns the string representation of the current value. 270 | /// 271 | /// the string representation of the current value. 272 | public override string ToString() 273 | { 274 | var value = ReadFullFence(); 275 | return value.ToString(); 276 | } 277 | } 278 | } 279 | } 280 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Core/IgnoranceClient.cs: -------------------------------------------------------------------------------- 1 | // Ignorance 1.4.x LTS (Long Term Support) 2 | // https://github.com/SoftwareGuy/Ignorance 3 | // ----------------- 4 | // Copyright (c) 2019 - 2023 Matt Coburn (SoftwareGuy/Coburn64) 5 | // Ignorance is licensed under the MIT license. Refer 6 | // to the LICENSE file for more information. 7 | 8 | using System; 9 | using System.Collections.Concurrent; 10 | using System.Threading; 11 | using ENet; 12 | using IgnoranceThirdparty; 13 | using UnityEngine; 14 | using Event = ENet.Event; // fixes CS0104 ambigous reference between the same thing in UnityEngine 15 | using EventType = ENet.EventType; // fixes CS0104 ambigous reference between the same thing in UnityEngine 16 | using Object = System.Object; // fixes CS0104 ambigous reference between the same thing in UnityEngine 17 | 18 | namespace IgnoranceCore 19 | { 20 | public class IgnoranceClient 21 | { 22 | // Connection port 23 | public int ConnectPort = 7777; 24 | // How many channels are expected 25 | public int ExpectedChannels = 2; 26 | // Native Maximum Timeout (> 0 changes it) 27 | public int MaxClientNativeTimeout = -1; 28 | // Maximum Packet Size 29 | public int MaximumPacketSize = 33554432; 30 | // Native poll waiting time 31 | public int PollTime = 1; 32 | // General Verbosity by default. 33 | public int Verbosity = 1; 34 | // Maximum ring buffer capacity. 35 | public int IncomingOutgoingBufferSize = 5000; 36 | public int ConnectionEventBufferSize = 100; 37 | // Client connection address 38 | public string ConnectAddress = "127.0.0.1"; 39 | 40 | // Queues 41 | public RingBuffer Incoming; 42 | public RingBuffer Outgoing; 43 | public RingBuffer Commands; 44 | public RingBuffer ConnectionEvents; 45 | public RingBuffer StatusUpdates; 46 | 47 | public bool IsAlive => WorkerThread != null && WorkerThread.IsAlive; 48 | 49 | private volatile bool CeaseOperation = false; 50 | private Thread WorkerThread; 51 | 52 | public void Start() 53 | { 54 | if (WorkerThread != null && WorkerThread.IsAlive) 55 | { 56 | // Cannot do that. 57 | Debug.LogError("Ignorance: A client worker thread is already running. Cannot start another."); 58 | return; 59 | } 60 | 61 | // Setup the ring buffers. 62 | SetupRingBuffersIfNull(); 63 | 64 | CeaseOperation = false; 65 | ThreadParamInfo threadParams = new ThreadParamInfo() 66 | { 67 | Address = ConnectAddress, 68 | Port = ConnectPort, 69 | Channels = ExpectedChannels, 70 | MaxNativeTimeout = MaxClientNativeTimeout > 0 ? MaxClientNativeTimeout : 0, 71 | PollTime = PollTime, 72 | PacketSizeLimit = MaximumPacketSize, 73 | Verbosity = Verbosity 74 | }; 75 | 76 | // Drain queues. 77 | if (Incoming != null) while (Incoming.TryDequeue(out _)) ; 78 | if (Outgoing != null) while (Outgoing.TryDequeue(out _)) ; 79 | if (Commands != null) while (Commands.TryDequeue(out _)) ; 80 | if (ConnectionEvents != null) while (ConnectionEvents.TryDequeue(out _)) ; 81 | if (StatusUpdates != null) while (StatusUpdates.TryDequeue(out _)) ; 82 | 83 | WorkerThread = new Thread(ThreadWorker); 84 | WorkerThread.Start(threadParams); 85 | 86 | if(Verbosity > 0) 87 | Debug.Log("Ignorance: Client instance has dispatched worker thread."); 88 | } 89 | 90 | public void Stop() 91 | { 92 | if (WorkerThread != null && !CeaseOperation) 93 | { 94 | Debug.Log("Ignorance: Client stop request acknowledged. This may take a while depending on network load..."); 95 | 96 | CeaseOperation = true; 97 | } 98 | } 99 | 100 | #region The meat and potatoes. 101 | // This runs in a seperate thread, be careful accessing anything outside of it's thread 102 | // or you may get an AccessViolation/crash. 103 | private void ThreadWorker(Object parameters) 104 | { 105 | if (Verbosity > 0) 106 | Debug.Log("Ignorance: Client instance worker thread initializing. Please stand by..."); 107 | 108 | ThreadParamInfo setupInfo; 109 | Address clientAddress = new Address(); 110 | Peer clientPeer; // The peer object that represents the client's connection. 111 | Host clientHost; // NOT related to Mirror "Client Host". This is the client's ENet Host Object. 112 | Event clientEvent; // Used when clients get events on the network. 113 | IgnoranceClientStats icsu = default; 114 | bool alreadyNotifiedAboutDisconnect = false; 115 | 116 | // Grab the setup information. 117 | if (parameters.GetType() == typeof(ThreadParamInfo)) 118 | setupInfo = (ThreadParamInfo)parameters; 119 | else 120 | { 121 | Debug.LogError("Ignorance: Client instance worker thread startup failure; Invalid thread parameters. Aborting."); 122 | return; 123 | } 124 | 125 | // Attempt to initialize ENet inside the thread. 126 | if (Library.Initialize()) 127 | Debug.Log("Ignorance: Client instance worker thread successfully initialized ENet."); 128 | else 129 | { 130 | Debug.LogError("Ignorance: Client instance worker thread failed to initialize ENet. Aborting."); 131 | return; 132 | } 133 | 134 | // Attempt to connect to our target. 135 | clientAddress.SetHost(setupInfo.Address); 136 | clientAddress.Port = (ushort)setupInfo.Port; 137 | 138 | using (clientHost = new Host()) 139 | { 140 | try 141 | { 142 | clientHost.Create(); 143 | 144 | Debug.Log($"Ignorance: Client worker thread attempting connection to '{setupInfo.Address}:{setupInfo.Port}'."); 145 | clientPeer = clientHost.Connect(clientAddress, setupInfo.Channels); 146 | 147 | // Apply the custom native timeout if needed. 148 | if(setupInfo.MaxNativeTimeout > 0) 149 | { 150 | clientPeer.Timeout(Library.timeoutLimit, Library.timeoutMinimum, (uint)MaxClientNativeTimeout * 1000); 151 | } 152 | 153 | } 154 | catch (Exception ex) 155 | { 156 | // Oops, something failed. 157 | Debug.LogError($"Ignorance: Client instance worker thread reports that something went wrong. While attempting to create client object, we caught an exception:\n{ex.Message}\n"); 158 | Debug.LogError($"You could try the debug-enabled version of the native ENet library which creates a logfile, or alternatively you could try restart " + 159 | $"your device to ensure jank is cleared out of memory. If problems persist, please file a support ticket explaining what happened."); 160 | 161 | Library.Deinitialize(); 162 | return; 163 | } 164 | 165 | // Process network events as long as we're not ceasing operation. 166 | while (!CeaseOperation) 167 | { 168 | bool pollComplete = false; 169 | 170 | while (Commands.TryDequeue(out IgnoranceCommandPacket ignoranceCommandPacket)) 171 | { 172 | switch (ignoranceCommandPacket.Type) 173 | { 174 | case IgnoranceCommandType.ClientStatusRequest: 175 | // Respond with statistics so far. 176 | if (!clientPeer.IsSet) 177 | break; 178 | 179 | icsu.RTT = clientPeer.RoundTripTime; 180 | 181 | icsu.BytesReceived = clientPeer.BytesReceived; 182 | icsu.BytesSent = clientPeer.BytesSent; 183 | 184 | icsu.PacketsReceived = clientHost.PacketsReceived; 185 | icsu.PacketsSent = clientPeer.PacketsSent; 186 | icsu.PacketsLost = clientPeer.PacketsLost; 187 | 188 | StatusUpdates.Enqueue(icsu); 189 | break; 190 | 191 | case IgnoranceCommandType.ClientWantsToStop: 192 | CeaseOperation = true; 193 | break; 194 | } 195 | } 196 | 197 | // If something outside the thread has told us to stop execution, then we need to break out of this while loop. 198 | if (CeaseOperation) 199 | break; 200 | 201 | // Step 1: Sending to Server 202 | while (Outgoing.TryDequeue(out IgnoranceOutgoingPacket outgoingPacket)) 203 | { 204 | // TODO: Revise this, could we tell the Peer to disconnect right here? 205 | // Stop early if we get a client stop packet. 206 | // if (outgoingPacket.Type == IgnorancePacketType.ClientWantsToStop) break; 207 | 208 | int ret = clientPeer.Send(outgoingPacket.Channel, ref outgoingPacket.Payload); 209 | 210 | if (ret < 0 && setupInfo.Verbosity > 0) 211 | Debug.LogWarning($"Ignorance: ENet error {ret} while sending packet to Server via Peer {outgoingPacket.NativePeerId}."); 212 | } 213 | 214 | // If something outside the thread has told us to stop execution, then we need to break out of this while loop. 215 | // while loop to break out of is while(!CeaseOperation). 216 | if (CeaseOperation) 217 | break; 218 | 219 | // Step 2: Receive Data packets 220 | // This loops until polling is completed. It may take a while, if it's 221 | // a slow networking day. 222 | while (!pollComplete) 223 | { 224 | Packet incomingPacket; 225 | Peer incomingPeer; 226 | int incomingPacketLength; 227 | 228 | // Any events worth checking out? 229 | if (clientHost.CheckEvents(out clientEvent) <= 0) 230 | { 231 | // If service time is met, break out of it. 232 | if (clientHost.Service(setupInfo.PollTime, out clientEvent) <= 0) break; 233 | 234 | // Poll is done. 235 | pollComplete = true; 236 | } 237 | 238 | // Setup the packet references. 239 | incomingPeer = clientEvent.Peer; 240 | 241 | // Now, let's handle those events. 242 | switch (clientEvent.Type) 243 | { 244 | case EventType.None: 245 | default: 246 | break; 247 | 248 | case EventType.Connect: 249 | if (setupInfo.Verbosity > 0) 250 | Debug.Log($"Ignorance: Client worker thread has connected to '{incomingPeer.IP}:{incomingPeer.Port}'."); 251 | 252 | ConnectionEvents.Enqueue(new IgnoranceConnectionEvent 253 | { 254 | EventType = 0x00, 255 | NativePeerId = incomingPeer.ID, 256 | IP = incomingPeer.IP, 257 | Port = incomingPeer.Port 258 | }); 259 | break; 260 | 261 | case EventType.Disconnect: 262 | case EventType.Timeout: 263 | if (setupInfo.Verbosity > 0) 264 | Debug.Log($"Ignorance: Client worker thread has disconnected from '{incomingPeer.IP}:{incomingPeer.Port}'."); 265 | 266 | ConnectionEvents.Enqueue(new IgnoranceConnectionEvent { EventType = 0x01 }); 267 | CeaseOperation = true; 268 | alreadyNotifiedAboutDisconnect = true; 269 | break; 270 | 271 | case EventType.Receive: 272 | // Receive event type usually includes a packet; so cache its reference. 273 | incomingPacket = clientEvent.Packet; 274 | 275 | if (!incomingPacket.IsSet) 276 | { 277 | if (setupInfo.Verbosity > 0) 278 | Debug.LogWarning($"Ignorance: Client receive event did not supply us with a packet to work with. This should never happen."); 279 | break; 280 | } 281 | 282 | incomingPacketLength = incomingPacket.Length; 283 | 284 | // Never consume more than we can have capacity for. 285 | if (incomingPacketLength > setupInfo.PacketSizeLimit) 286 | { 287 | if (setupInfo.Verbosity > 0) 288 | Debug.LogWarning($"Ignorance: Client incoming packet is too big. My limit is {setupInfo.PacketSizeLimit} byte(s) whilest this packet is {incomingPacketLength} bytes."); 289 | 290 | incomingPacket.Dispose(); 291 | break; 292 | } 293 | 294 | IgnoranceIncomingPacket incomingQueuePacket = new IgnoranceIncomingPacket 295 | { 296 | Channel = clientEvent.ChannelID, 297 | NativePeerId = incomingPeer.ID, 298 | Payload = incomingPacket 299 | }; 300 | 301 | Incoming.Enqueue(incomingQueuePacket); 302 | break; 303 | } 304 | } 305 | 306 | // If something outside the thread has told us to stop execution, then we need to break out of this while loop. 307 | // while loop to break out of is while(!CeaseOperation). 308 | if (CeaseOperation) 309 | break; 310 | } 311 | 312 | if (Verbosity > 0) 313 | Debug.Log("Ignorance: Client worker thread shutdown commencing. Disconnecting and flushing connection."); 314 | 315 | // Flush the client and disconnect. 316 | clientPeer.Disconnect(0); 317 | clientHost.Flush(); 318 | 319 | // Fix for client stuck in limbo, since the disconnection event may not be fired until next loop. 320 | if (!alreadyNotifiedAboutDisconnect) 321 | { 322 | ConnectionEvents.Enqueue(new IgnoranceConnectionEvent { EventType = 0x01 }); 323 | alreadyNotifiedAboutDisconnect = true; 324 | } 325 | 326 | } 327 | 328 | // Fix for client stuck in limbo, since the disconnection event may not be fired until next loop, again. 329 | if (!alreadyNotifiedAboutDisconnect) 330 | ConnectionEvents.Enqueue(new IgnoranceConnectionEvent { EventType = 0x01 }); 331 | 332 | // Deinitialize 333 | Library.Deinitialize(); 334 | 335 | if (setupInfo.Verbosity > 0) 336 | Debug.Log("Ignorance: Client worker thread shutdown complete."); 337 | } 338 | #endregion 339 | 340 | private void SetupRingBuffersIfNull() 341 | { 342 | Debug.Log($"Ignorance: Setting up the ring buffers if they're not already created. " + 343 | $"If they are already, this step will be skipped."); 344 | 345 | if (Incoming == null) 346 | Incoming = new RingBuffer(IncomingOutgoingBufferSize); 347 | if (Outgoing == null) 348 | Outgoing = new RingBuffer(IncomingOutgoingBufferSize); 349 | if (Commands == null) 350 | Commands = new RingBuffer(100); 351 | if (ConnectionEvents == null) 352 | ConnectionEvents = new RingBuffer(ConnectionEventBufferSize); 353 | if (StatusUpdates == null) 354 | StatusUpdates = new RingBuffer(10); 355 | } 356 | 357 | private struct ThreadParamInfo 358 | { 359 | public int Channels; 360 | public int PollTime; 361 | public int MaxNativeTimeout; 362 | public int Port; 363 | public int PacketSizeLimit; 364 | public int Verbosity; 365 | public string Address; 366 | } 367 | } 368 | } 369 | -------------------------------------------------------------------------------- /Assets/Mirror/Transports/Ignorance/Core/IgnoranceServer.cs: -------------------------------------------------------------------------------- 1 | // Ignorance 1.4.x LTS (Long Term Support) 2 | // https://github.com/SoftwareGuy/Ignorance 3 | // ----------------- 4 | // Copyright (c) 2019 - 2023 Matt Coburn (SoftwareGuy/Coburn64) 5 | // Ignorance is licensed under the MIT license. Refer 6 | // to the LICENSE file for more information. 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Threading; 10 | using ENet; 11 | using IgnoranceThirdparty; 12 | using UnityEngine; 13 | using Event = ENet.Event; // fixes CS0104 ambigous reference between the same thing in UnityEngine 14 | using EventType = ENet.EventType; // fixes CS0104 ambigous reference between the same thing in UnityEngine 15 | using Object = System.Object; // fixes CS0104 ambigous reference between the same thing in UnityEngine 16 | 17 | namespace IgnoranceCore 18 | { 19 | public class IgnoranceServer 20 | { 21 | // Server Properties 22 | // - Bind Settings 23 | public string BindAddress = "127.0.0.1"; 24 | public int BindPort = 7777; 25 | // - Maximum allowed channels, peers, etc. 26 | public int MaximumChannels = 2; 27 | public int MaximumPeers = 100; 28 | public int MaximumPacketSize = 33554432; // ENet.cs: uint maxPacketSize = 32 * 1024 * 1024 = 33554432 29 | // - Native poll waiting time 30 | public int PollTime = 1; 31 | // - Verbosity. 32 | public int Verbosity = 1; 33 | // - Queue Sizing 34 | public int IncomingOutgoingBufferSize = 5000; 35 | public int ConnectionEventBufferSize = 100; 36 | // - Fruity devices 37 | public bool IsFruityDevice; 38 | public bool BindAllInterfaces; 39 | 40 | public bool IsAlive => WorkerThread != null && WorkerThread.IsAlive; 41 | 42 | private volatile bool CeaseOperation = false; 43 | 44 | // Queues 45 | // v1.4.0b9: Replace the queues with RingBuffers. 46 | public RingBuffer Incoming; 47 | public RingBuffer Outgoing; 48 | public RingBuffer Commands; 49 | public RingBuffer ConnectionEvents; 50 | public RingBuffer DisconnectionEvents; 51 | public RingBuffer StatusUpdates; 52 | 53 | public RingBuffer RecycledServerStatBlocks = new RingBuffer(100); 54 | 55 | // Thread 56 | private Thread WorkerThread; 57 | 58 | public void Start() 59 | { 60 | if (WorkerThread != null && WorkerThread.IsAlive) 61 | { 62 | // Cannot do that. 63 | Debug.LogError("Ignorance Server: A worker thread is already running. Cannot start another."); 64 | return; 65 | } 66 | 67 | // Setup the ring buffers. 68 | SetupRingBuffersIfNull(); 69 | 70 | CeaseOperation = false; 71 | ThreadParamInfo threadParams = new ThreadParamInfo() 72 | { 73 | IsFruityDevice = IsFruityDevice, 74 | BindAllInterfaces = BindAllInterfaces, 75 | Address = BindAddress, 76 | Port = BindPort, 77 | Peers = MaximumPeers, 78 | Channels = MaximumChannels, 79 | PollTime = PollTime, 80 | PacketSizeLimit = MaximumPacketSize, 81 | Verbosity = Verbosity 82 | }; 83 | 84 | // Drain queues. 85 | if (Incoming != null) while (Incoming.TryDequeue(out _)) ; 86 | if (Outgoing != null) while (Outgoing.TryDequeue(out _)) ; 87 | if (Commands != null) while (Commands.TryDequeue(out _)) ; 88 | if (ConnectionEvents != null) while (ConnectionEvents.TryDequeue(out _)) ; 89 | if (DisconnectionEvents != null) while (DisconnectionEvents.TryDequeue(out _)) ; 90 | if (StatusUpdates != null) while (StatusUpdates.TryDequeue(out _)) ; 91 | 92 | WorkerThread = new Thread(ThreadWorker); 93 | WorkerThread.Start(threadParams); 94 | 95 | // Announce 96 | if (Verbosity > 0) 97 | Debug.Log("Ignorance Server: Dispatched worker thread."); 98 | } 99 | 100 | public void Stop() 101 | { 102 | // v1.4.0b7: Mirror may call this; if the worker thread isn't alive then don't announce it. 103 | if (WorkerThread != null && WorkerThread.IsAlive) 104 | { 105 | if (Verbosity > 0) 106 | Debug.Log("Ignorance Server: Server stop acknowledged. Depending on network load, this may take a moment or two..."); 107 | 108 | CeaseOperation = true; 109 | } 110 | } 111 | 112 | #region The meat and potatoes. 113 | private void ThreadWorker(Object parameters) 114 | { 115 | if (Verbosity > 0) 116 | Debug.Log("Ignorance: Server instance worker thread is initializing. Please stand by..."); 117 | 118 | // Thread cache items 119 | ThreadParamInfo setupInfo; 120 | Address serverAddress = new Address(); 121 | Host serverENetHost; 122 | Event serverENetEvent; 123 | 124 | Peer[] serverPeerArray; 125 | IgnoranceClientStats peerStats = default; 126 | 127 | // Grab the setup information. 128 | if (parameters.GetType() == typeof(ThreadParamInfo)) 129 | { 130 | setupInfo = (ThreadParamInfo)parameters; 131 | } 132 | else 133 | { 134 | Debug.LogError("Ignorance: Server instance worker thread reports startup failure; Invalid thread parameters. Aborting."); 135 | return; 136 | } 137 | 138 | // Attempt to initialize ENet inside the thread. 139 | if (Library.Initialize()) 140 | { 141 | Debug.Log("Ignorance: Server instance worker thread successfully initialized ENet."); 142 | } 143 | else 144 | { 145 | Debug.LogError("Ignorance Server: Failed to initialize ENet Native. Aborting."); 146 | return; 147 | } 148 | 149 | // Configure the server address. 150 | // So... if we're running on a Mac, we have an issue where if we attempt to bind to all devices which usually is either 151 | // 0.0.0.0 or ::0. In older versions of Mac OS, this worked since those addresses are "broadcast" or "listen all"... 152 | // but on newer versions this broke the server functionality. So the fix was rather easy but the debugging was not. 153 | // The fix was to NOT set any IP/Host if we're binding to all addresses on MacOS. Apparently that works. Go figure. 154 | // Afterthought: Maybe it's something funky in ENet...? 155 | 156 | if (setupInfo.IsFruityDevice) 157 | { 158 | if (!setupInfo.BindAllInterfaces) 159 | serverAddress.SetHost(setupInfo.Address); 160 | } 161 | else 162 | { 163 | if (setupInfo.BindAllInterfaces) 164 | serverAddress.SetIP(IgnoranceInternals.BindAnyAddress); 165 | else 166 | serverAddress.SetHost(setupInfo.Address); 167 | } 168 | 169 | // Set the port too. 170 | serverAddress.Port = (ushort)setupInfo.Port; 171 | serverPeerArray = new Peer[setupInfo.Peers]; 172 | 173 | using (serverENetHost = new Host()) 174 | { 175 | // Create the server object. 176 | try 177 | { 178 | serverENetHost.Create(serverAddress, setupInfo.Peers, setupInfo.Channels); 179 | } 180 | catch (Exception ex) 181 | { 182 | Debug.LogError($"Ignorance: Server instance worker thread reports that something went wrong. While attempting to create server host object, we caught an exception:\n{ex.Message}"); 183 | Debug.LogError($"If you are getting a \"Host creation call failed\" exception, please ensure you don't have a server already running on the same IP and Port.\n" + 184 | $"Multiple server instances running on the same port are not supported. Also check to see if ports are not in-use by another application. In the worse case scenario, " + 185 | $"restart your device to ensure no random background ENet threads are active that haven't been cleaned up correctly. If problems persist, please file a support ticket."); 186 | 187 | Library.Deinitialize(); 188 | return; 189 | } 190 | 191 | // Loop until we're told to cease operations. 192 | while (!CeaseOperation) 193 | { 194 | // Intermission: Command Handling 195 | while (Commands.TryDequeue(out IgnoranceCommandPacket commandPacket)) 196 | { 197 | switch (commandPacket.Type) 198 | { 199 | default: 200 | break; 201 | 202 | // Boot a Peer off the Server. 203 | case IgnoranceCommandType.ServerKickPeer: 204 | uint targetPeer = commandPacket.PeerId; 205 | 206 | if (!serverPeerArray[targetPeer].IsSet) continue; 207 | 208 | if (setupInfo.Verbosity > 0) 209 | Debug.Log($"Ignorance: Server instance is disconnecting peer {targetPeer}."); 210 | 211 | IgnoranceConnectionEvent iced = new IgnoranceConnectionEvent 212 | { 213 | EventType = 0x01, 214 | NativePeerId = targetPeer 215 | }; 216 | 217 | DisconnectionEvents.Enqueue(iced); 218 | 219 | // Disconnect and reset the peer array's entry for that peer. 220 | serverPeerArray[targetPeer].DisconnectNow(0); 221 | serverPeerArray[targetPeer] = default; 222 | break; 223 | 224 | case IgnoranceCommandType.ServerStatusRequest: 225 | IgnoranceServerStats serverStats; 226 | if (!RecycledServerStatBlocks.TryDequeue(out serverStats)) 227 | serverStats.PeerStats = new Dictionary(setupInfo.Peers); 228 | 229 | serverStats.PeerStats.Clear(); 230 | 231 | serverStats.BytesReceived = serverENetHost.BytesReceived; 232 | serverStats.BytesSent = serverENetHost.BytesSent; 233 | 234 | serverStats.PacketsReceived = serverENetHost.PacketsReceived; 235 | serverStats.PacketsSent = serverENetHost.PacketsSent; 236 | 237 | serverStats.PeersCount = serverENetHost.PeersCount; 238 | 239 | for (int i = 0; i < serverPeerArray.Length; i++) 240 | { 241 | if (!serverPeerArray[i].IsSet) continue; 242 | 243 | peerStats.RTT = serverPeerArray[i].RoundTripTime; 244 | 245 | peerStats.BytesReceived = serverPeerArray[i].BytesReceived; 246 | peerStats.BytesSent = serverPeerArray[i].BytesSent; 247 | 248 | peerStats.PacketsSent = serverPeerArray[i].PacketsSent; 249 | peerStats.PacketsLost = serverPeerArray[i].PacketsLost; 250 | 251 | serverStats.PeerStats.Add(i, peerStats); 252 | } 253 | 254 | StatusUpdates.Enqueue(serverStats); 255 | break; 256 | } 257 | } 258 | 259 | // Step One: 260 | // ---> Sending to peers 261 | while (Outgoing.TryDequeue(out IgnoranceOutgoingPacket outgoingPacket)) 262 | { 263 | // Only create a packet if the server knows the peer. 264 | if (serverPeerArray[outgoingPacket.NativePeerId].IsSet) 265 | { 266 | int ret = serverPeerArray[outgoingPacket.NativePeerId].Send(outgoingPacket.Channel, ref outgoingPacket.Payload); 267 | 268 | if (ret < 0 && setupInfo.Verbosity > 0) 269 | Debug.LogWarning($"Ignorance: Server instance ENet error {ret} while sending packet to Peer {outgoingPacket.NativePeerId}."); 270 | } 271 | else 272 | { 273 | // A peer might have disconnected, this is OK - just log the packet if set to paranoid. 274 | if (setupInfo.Verbosity > 1) 275 | Debug.LogWarning("Ignorance: Server instance can't send packet, a native peer object is not set. This may be normal if the Peer has disconnected before this send cycle."); 276 | } 277 | 278 | } 279 | 280 | // Step 2 281 | // <--- Receiving from peers 282 | bool pollComplete = false; 283 | 284 | while (!pollComplete) 285 | { 286 | Packet incomingPacket; 287 | Peer incomingPeer; 288 | int incomingPacketLength; 289 | 290 | // Any events happening? 291 | if (serverENetHost.CheckEvents(out serverENetEvent) <= 0) 292 | { 293 | // If service time is met, break out of it. 294 | if (serverENetHost.Service(setupInfo.PollTime, out serverENetEvent) <= 0) break; 295 | 296 | pollComplete = true; 297 | } 298 | 299 | // Setup the packet references. 300 | incomingPeer = serverENetEvent.Peer; 301 | 302 | // What type are you? 303 | switch (serverENetEvent.Type) 304 | { 305 | // Idle. 306 | case EventType.None: 307 | default: 308 | break; 309 | 310 | // Connection Event. 311 | case EventType.Connect: 312 | if (setupInfo.Verbosity > 1) 313 | Debug.Log($"Ignorance: Server instance says that Peer {incomingPeer.ID} says Hi."); 314 | 315 | IgnoranceConnectionEvent ice = new IgnoranceConnectionEvent() 316 | { 317 | NativePeerId = incomingPeer.ID, 318 | IP = incomingPeer.IP, 319 | Port = incomingPeer.Port 320 | }; 321 | 322 | ConnectionEvents.Enqueue(ice); 323 | 324 | // Assign a reference to the Peer. 325 | serverPeerArray[incomingPeer.ID] = incomingPeer; 326 | break; 327 | 328 | // Disconnect/Timeout. Mirror doesn't care if it's either, so we lump them together. 329 | case EventType.Disconnect: 330 | case EventType.Timeout: 331 | if (!serverPeerArray[incomingPeer.ID].IsSet) break; 332 | 333 | if (setupInfo.Verbosity > 1) 334 | Debug.Log($"Ignorance: Server instance says that Peer {incomingPeer.ID} has disconnected."); 335 | 336 | IgnoranceConnectionEvent iced = new IgnoranceConnectionEvent 337 | { 338 | EventType = 0x01, 339 | NativePeerId = incomingPeer.ID 340 | }; 341 | 342 | DisconnectionEvents.Enqueue(iced); 343 | 344 | // Reset the peer array's entry for that peer. 345 | serverPeerArray[incomingPeer.ID] = default; 346 | break; 347 | 348 | case EventType.Receive: 349 | // Receive event type usually includes a packet; so cache its reference. 350 | incomingPacket = serverENetEvent.Packet; 351 | if (!incomingPacket.IsSet) 352 | { 353 | if (setupInfo.Verbosity > 0) 354 | Debug.LogWarning($"Ignorance: Server instance receive event did not supply us with a packet to work with. This should never happen."); 355 | break; 356 | } 357 | 358 | incomingPacketLength = incomingPacket.Length; 359 | 360 | // Firstly check if the packet is too big. If it is, do not process it - drop it. 361 | if (incomingPacketLength > setupInfo.PacketSizeLimit) 362 | { 363 | if (setupInfo.Verbosity > 0) 364 | Debug.LogWarning($"Ignorance: Server incoming packet is too big. My limit is {setupInfo.PacketSizeLimit} byte(s) whilest this packet is {incomingPacketLength} bytes."); 365 | 366 | incomingPacket.Dispose(); 367 | break; 368 | } 369 | 370 | IgnoranceIncomingPacket incomingQueuePacket = new IgnoranceIncomingPacket 371 | { 372 | Channel = serverENetEvent.ChannelID, 373 | NativePeerId = incomingPeer.ID, 374 | Payload = incomingPacket, 375 | }; 376 | 377 | // Enqueue. 378 | Incoming.Enqueue(incomingQueuePacket); 379 | break; 380 | } 381 | } 382 | } 383 | 384 | if (Verbosity > 0) 385 | Debug.Log("Ignorance: Server instance thread shutdown commencing. Flushing connections."); 386 | 387 | // Cleanup and flush everything. 388 | serverENetHost.Flush(); 389 | 390 | // Kick everyone. 391 | for (int i = 0; i < serverPeerArray.Length; i++) 392 | { 393 | if (!serverPeerArray[i].IsSet) continue; 394 | serverPeerArray[i].DisconnectNow(0); 395 | } 396 | } 397 | 398 | if (setupInfo.Verbosity > 0) 399 | Debug.Log("Ignorance: Server instance thread shutdown complete."); 400 | 401 | Library.Deinitialize(); 402 | } 403 | #endregion 404 | 405 | private void SetupRingBuffersIfNull() 406 | { 407 | Debug.Log($"Ignorance: Setting up ring buffers if they're not already created. " + 408 | $"If they are already, this step will be skipped."); 409 | 410 | if (Incoming == null) 411 | Incoming = new RingBuffer(IncomingOutgoingBufferSize); 412 | if (Outgoing == null) 413 | Outgoing = new RingBuffer(IncomingOutgoingBufferSize); 414 | if (Commands == null) 415 | Commands = new RingBuffer(100); 416 | if (ConnectionEvents == null) 417 | ConnectionEvents = new RingBuffer(ConnectionEventBufferSize); 418 | if (DisconnectionEvents == null) 419 | DisconnectionEvents = new RingBuffer(ConnectionEventBufferSize); 420 | if (StatusUpdates == null) 421 | StatusUpdates = new RingBuffer(10); 422 | } 423 | 424 | private struct ThreadParamInfo 425 | { 426 | public bool IsFruityDevice; 427 | public bool BindAllInterfaces; 428 | public int Channels; 429 | public int Peers; 430 | public int PollTime; 431 | public int Port; 432 | public int PacketSizeLimit; 433 | public int Verbosity; 434 | public string Address; 435 | } 436 | } 437 | } 438 | --------------------------------------------------------------------------------