├── .gitattributes ├── .gitignore ├── Client ├── .gitignore ├── .vscode │ └── settings.json ├── Assets │ ├── ColyseusBackground.png │ ├── ColyseusBackground.png.meta │ ├── Editor.meta │ ├── Editor │ │ ├── ExportNavMeshToObj.cs │ │ └── ExportNavMeshToObj.cs.meta │ ├── Materials.meta │ ├── Materials │ │ ├── Black.mat │ │ ├── Black.mat.meta │ │ ├── Blue.mat │ │ ├── Blue.mat.meta │ │ ├── Green.mat │ │ ├── Green.mat.meta │ │ ├── Wall.mat │ │ └── Wall.mat.meta │ ├── Models.meta │ ├── Models │ │ ├── Player.cs │ │ ├── Player.cs.meta │ │ ├── Position.cs │ │ ├── Position.cs.meta │ │ ├── State.cs │ │ ├── State.cs.meta │ │ ├── StatePlayers.cs │ │ ├── StatePlayers.cs.meta │ │ ├── StateUnits.cs │ │ ├── StateUnits.cs.meta │ │ ├── Unit.cs │ │ └── Unit.cs.meta │ ├── Plugins.meta │ ├── Plugins │ │ ├── Colyseus.meta │ │ ├── Colyseus │ │ │ ├── Auth.cs │ │ │ ├── Auth.cs.meta │ │ │ ├── Client.cs │ │ │ ├── Client.cs.meta │ │ │ ├── ColyseusManager.cs │ │ │ ├── ColyseusManager.cs.meta │ │ │ ├── Connection.cs │ │ │ ├── Connection.cs.meta │ │ │ ├── Properties.meta │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── AssemblyInfo.cs.meta │ │ │ ├── Protocol.cs │ │ │ ├── Protocol.cs.meta │ │ │ ├── Room.cs │ │ │ ├── Room.cs.meta │ │ │ ├── Serializer.meta │ │ │ ├── Serializer │ │ │ │ ├── Conversion.meta │ │ │ │ ├── Conversion │ │ │ │ │ ├── BigEndianBitConverter.cs │ │ │ │ │ ├── BigEndianBitConverter.cs.meta │ │ │ │ │ ├── DoubleConverter.cs │ │ │ │ │ ├── DoubleConverter.cs.meta │ │ │ │ │ ├── EndianBitConverter.cs │ │ │ │ │ ├── EndianBitConverter.cs.meta │ │ │ │ │ ├── Endianness.cs │ │ │ │ │ ├── Endianness.cs.meta │ │ │ │ │ ├── LittleEndianBitConverter.cs │ │ │ │ │ └── LittleEndianBitConverter.cs.meta │ │ │ │ ├── FossilDeltaSerializer.cs │ │ │ │ ├── FossilDeltaSerializer.cs.meta │ │ │ │ ├── Schema.meta │ │ │ │ ├── Schema │ │ │ │ │ ├── Decoder.cs │ │ │ │ │ ├── Decoder.cs.meta │ │ │ │ │ ├── Schema.cs │ │ │ │ │ └── Schema.cs.meta │ │ │ │ ├── SchemaSerializer.cs │ │ │ │ ├── SchemaSerializer.cs.meta │ │ │ │ ├── Serializer.cs │ │ │ │ └── Serializer.cs.meta │ │ │ ├── StateListener.meta │ │ │ ├── StateListener │ │ │ │ ├── Compare.cs │ │ │ │ ├── Compare.cs.meta │ │ │ │ ├── StateContainer.cs │ │ │ │ └── StateContainer.cs.meta │ │ │ ├── Utils.meta │ │ │ └── Utils │ │ │ │ ├── ArrayUtils.cs │ │ │ │ ├── ArrayUtils.cs.meta │ │ │ │ ├── ExtensionMethods.cs │ │ │ │ ├── ExtensionMethods.cs.meta │ │ │ │ ├── HttpUtility.cs │ │ │ │ ├── HttpUtility.cs.meta │ │ │ │ ├── ObjectExtensions.cs │ │ │ │ └── ObjectExtensions.cs.meta │ │ ├── FossilDelta.meta │ │ ├── FossilDelta │ │ │ ├── Delta.cs │ │ │ ├── Delta.cs.meta │ │ │ ├── LICENSE │ │ │ ├── LICENSE.meta │ │ │ ├── README.md │ │ │ ├── README.md.meta │ │ │ ├── Reader.cs │ │ │ ├── Reader.cs.meta │ │ │ ├── RollingHash.cs │ │ │ ├── RollingHash.cs.meta │ │ │ ├── Writer.cs │ │ │ └── Writer.cs.meta │ │ ├── GameDevWare.Serialization.meta │ │ ├── GameDevWare.Serialization │ │ │ ├── GenerateTypeSerializerAttribute.cs │ │ │ ├── GenerateTypeSerializerAttribute.cs.meta │ │ │ ├── IJsonReader.cs │ │ │ ├── IJsonReader.cs.meta │ │ │ ├── IJsonWriter.cs │ │ │ ├── IJsonWriter.cs.meta │ │ │ ├── IValueInfo.cs │ │ │ ├── IValueInfo.cs.meta │ │ │ ├── IndexedDictionary.cs │ │ │ ├── IndexedDictionary.cs.meta │ │ │ ├── Json.cs │ │ │ ├── Json.cs.meta │ │ │ ├── JsonMember.cs │ │ │ ├── JsonMember.cs.meta │ │ │ ├── JsonReader.cs │ │ │ ├── JsonReader.cs.meta │ │ │ ├── JsonReaderExtentions.cs │ │ │ ├── JsonReaderExtentions.cs.meta │ │ │ ├── JsonSerializationException.cs │ │ │ ├── JsonSerializationException.cs.meta │ │ │ ├── JsonStreamReader.cs │ │ │ ├── JsonStreamReader.cs.meta │ │ │ ├── JsonStreamWriter.cs │ │ │ ├── JsonStreamWriter.cs.meta │ │ │ ├── JsonStringBuilderReader.cs │ │ │ ├── JsonStringBuilderReader.cs.meta │ │ │ ├── JsonStringBuilderWriter.cs │ │ │ ├── JsonStringBuilderWriter.cs.meta │ │ │ ├── JsonStringReader.cs │ │ │ ├── JsonStringReader.cs.meta │ │ │ ├── JsonTextReader.cs │ │ │ ├── JsonTextReader.cs.meta │ │ │ ├── JsonTextWriter.cs │ │ │ ├── JsonTextWriter.cs.meta │ │ │ ├── JsonToken.cs │ │ │ ├── JsonToken.cs.meta │ │ │ ├── JsonUtils.cs │ │ │ ├── JsonUtils.cs.meta │ │ │ ├── JsonWriter.cs │ │ │ ├── JsonWriter.cs.meta │ │ │ ├── JsonWriterExtentions.cs │ │ │ ├── JsonWriterExtentions.cs.meta │ │ │ ├── MessagePack.meta │ │ │ ├── MessagePack │ │ │ │ ├── BigEndianBitConverter.cs │ │ │ │ ├── BigEndianBitConverter.cs.meta │ │ │ │ ├── DefaultMsgPackExtensionTypeHandler.cs │ │ │ │ ├── DefaultMsgPackExtensionTypeHandler.cs.meta │ │ │ │ ├── EndianBitConverter.cs │ │ │ │ ├── EndianBitConverter.cs.meta │ │ │ │ ├── Endianness.cs │ │ │ │ ├── Endianness.cs.meta │ │ │ │ ├── LittleEndianBitConverter.cs │ │ │ │ ├── LittleEndianBitConverter.cs.meta │ │ │ │ ├── MsgPackExtensionType.cs │ │ │ │ ├── MsgPackExtensionType.cs.meta │ │ │ │ ├── MsgPackExtensionTypeHandler.cs │ │ │ │ ├── MsgPackExtensionTypeHandler.cs.meta │ │ │ │ ├── MsgPackReader.cs │ │ │ │ ├── MsgPackReader.cs.meta │ │ │ │ ├── MsgPackTimestamp.cs │ │ │ │ ├── MsgPackTimestamp.cs.meta │ │ │ │ ├── MsgPackType.cs │ │ │ │ ├── MsgPackType.cs.meta │ │ │ │ ├── MsgPackWriter.cs │ │ │ │ ├── MsgPackWriter.cs.meta │ │ │ │ ├── UnknownMsgPackExtentionTypeException.cs │ │ │ │ ├── UnknownMsgPackExtentionTypeException.cs.meta │ │ │ │ ├── UnknownMsgPackFormatException.cs │ │ │ │ └── UnknownMsgPackFormatException.cs.meta │ │ │ ├── Metadata.meta │ │ │ ├── Metadata │ │ │ │ ├── DataMemberDescription.cs │ │ │ │ ├── DataMemberDescription.cs.meta │ │ │ │ ├── FieldDescription.cs │ │ │ │ ├── FieldDescription.cs.meta │ │ │ │ ├── MemberDescription.cs │ │ │ │ ├── MemberDescription.cs.meta │ │ │ │ ├── PropertyDescription.cs │ │ │ │ ├── PropertyDescription.cs.meta │ │ │ │ ├── ReflectionUtils.cs │ │ │ │ ├── ReflectionUtils.cs.meta │ │ │ │ ├── TypeDescription.cs │ │ │ │ └── TypeDescription.cs.meta │ │ │ ├── MsgPack.cs │ │ │ ├── MsgPack.cs.meta │ │ │ ├── ReflectionExtentions.cs │ │ │ ├── ReflectionExtentions.cs.meta │ │ │ ├── SerializationContext.cs │ │ │ ├── SerializationContext.cs.meta │ │ │ ├── SerializationOptions.cs │ │ │ ├── SerializationOptions.cs.meta │ │ │ ├── Serializers.meta │ │ │ ├── Serializers │ │ │ │ ├── ArraySerializer.cs │ │ │ │ ├── ArraySerializer.cs.meta │ │ │ │ ├── BinarySerializer.cs │ │ │ │ ├── BinarySerializer.cs.meta │ │ │ │ ├── BoundsSerializer.cs │ │ │ │ ├── BoundsSerializer.cs.meta │ │ │ │ ├── DateTimeOffsetSerializer.cs │ │ │ │ ├── DateTimeOffsetSerializer.cs.meta │ │ │ │ ├── DateTimeSerializer.cs │ │ │ │ ├── DateTimeSerializer.cs.meta │ │ │ │ ├── DictionaryEntrySerializer.cs │ │ │ │ ├── DictionaryEntrySerializer.cs.meta │ │ │ │ ├── DictionarySerializer.cs │ │ │ │ ├── DictionarySerializer.cs.meta │ │ │ │ ├── EnumNumberSerializer.cs │ │ │ │ ├── EnumNumberSerializer.cs.meta │ │ │ │ ├── EnumSerializer.cs │ │ │ │ ├── EnumSerializer.cs.meta │ │ │ │ ├── GuidSerializer.cs │ │ │ │ ├── GuidSerializer.cs.meta │ │ │ │ ├── Matrix4x4Serializer.cs │ │ │ │ ├── Matrix4x4Serializer.cs.meta │ │ │ │ ├── MsgPackExtensionTypeSerializer.cs │ │ │ │ ├── MsgPackExtensionTypeSerializer.cs.meta │ │ │ │ ├── MsgPackTimestampSerializer.cs │ │ │ │ ├── MsgPackTimestampSerializer.cs.meta │ │ │ │ ├── ObjectSerializer.cs │ │ │ │ ├── ObjectSerializer.cs.meta │ │ │ │ ├── PrimitiveTypeSerializer.cs │ │ │ │ ├── PrimitiveTypeSerializer.cs.meta │ │ │ │ ├── QuaternionSerializer.cs │ │ │ │ ├── QuaternionSerializer.cs.meta │ │ │ │ ├── RectSerializer.cs │ │ │ │ ├── RectSerializer.cs.meta │ │ │ │ ├── StreamSerializer.cs │ │ │ │ ├── StreamSerializer.cs.meta │ │ │ │ ├── TimeSpanSerializer.cs │ │ │ │ ├── TimeSpanSerializer.cs.meta │ │ │ │ ├── UriSerializer.cs │ │ │ │ ├── UriSerializer.cs.meta │ │ │ │ ├── Vector2Serializer.cs │ │ │ │ ├── Vector2Serializer.cs.meta │ │ │ │ ├── Vector3Serializer.cs │ │ │ │ ├── Vector3Serializer.cs.meta │ │ │ │ ├── Vector4Serializer.cs │ │ │ │ ├── Vector4Serializer.cs.meta │ │ │ │ ├── VersionSerializer.cs │ │ │ │ └── VersionSerializer.cs.meta │ │ │ ├── TypeSerializer.cs │ │ │ ├── TypeSerializer.cs.meta │ │ │ ├── TypeSerializerAttribute.cs │ │ │ └── TypeSerializerAttribute.cs.meta │ │ ├── WebSocket.meta │ │ └── WebSocket │ │ │ ├── WebSocket.cs │ │ │ ├── WebSocket.cs.meta │ │ │ ├── WebSocket.jslib │ │ │ └── WebSocket.jslib.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── Camera.prefab │ │ ├── Camera.prefab.meta │ │ ├── GameManager.prefab │ │ ├── GameManager.prefab.meta │ │ ├── Unit.prefab │ │ └── Unit.prefab.meta │ ├── SampleSceneNavMesh.obj │ ├── SampleSceneNavMesh.obj.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── SampleScene.meta │ │ ├── SampleScene.unity │ │ ├── SampleScene.unity.meta │ │ └── SampleScene │ │ │ ├── NavMesh.asset │ │ │ ├── NavMesh.asset.meta │ │ │ ├── Terrain.asset │ │ │ └── Terrain.asset.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── Controllers.meta │ │ ├── Controllers │ │ │ ├── ControllerCamera.cs │ │ │ ├── ControllerCamera.cs.meta │ │ │ ├── ControllerUnit.cs │ │ │ └── ControllerUnit.cs.meta │ │ ├── GameManager.cs │ │ ├── GameManager.cs.meta │ │ ├── StateHandlers.meta │ │ └── StateHandlers │ │ │ ├── StateHandlerPlayers.cs │ │ │ ├── StateHandlerPlayers.cs.meta │ │ │ ├── StateHandlerUnits.cs │ │ │ └── StateHandlerUnits.cs.meta │ ├── TextMesh Pro.meta │ └── TextMesh Pro │ │ ├── Documentation.meta │ │ ├── Documentation │ │ ├── TextMesh Pro User Guide 2016.pdf │ │ └── TextMesh Pro User Guide 2016.pdf.meta │ │ ├── Fonts.meta │ │ ├── Fonts │ │ ├── LiberationSans - OFL.txt │ │ ├── LiberationSans - OFL.txt.meta │ │ ├── LiberationSans.ttf │ │ └── LiberationSans.ttf.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ ├── Fonts & Materials.meta │ │ ├── Fonts & Materials │ │ │ ├── LiberationSans SDF - Drop Shadow.mat │ │ │ ├── LiberationSans SDF - Drop Shadow.mat.meta │ │ │ ├── LiberationSans SDF - Fallback.asset │ │ │ ├── LiberationSans SDF - Fallback.asset.meta │ │ │ ├── LiberationSans SDF - Outline.mat │ │ │ ├── LiberationSans SDF - Outline.mat.meta │ │ │ ├── LiberationSans SDF.asset │ │ │ └── LiberationSans SDF.asset.meta │ │ ├── LineBreaking Following Characters.txt │ │ ├── LineBreaking Following Characters.txt.meta │ │ ├── LineBreaking Leading Characters.txt │ │ ├── LineBreaking Leading Characters.txt.meta │ │ ├── Shaders.meta │ │ ├── Shaders │ │ │ ├── TMP_Bitmap-Custom-Atlas.shader │ │ │ ├── TMP_Bitmap-Custom-Atlas.shader.meta │ │ │ ├── TMP_Bitmap-Mobile.shader │ │ │ ├── TMP_Bitmap-Mobile.shader.meta │ │ │ ├── TMP_Bitmap.shader │ │ │ ├── TMP_Bitmap.shader.meta │ │ │ ├── TMP_SDF Overlay.shader │ │ │ ├── TMP_SDF Overlay.shader.meta │ │ │ ├── TMP_SDF-Mobile Masking.shader │ │ │ ├── TMP_SDF-Mobile Masking.shader.meta │ │ │ ├── TMP_SDF-Mobile Overlay.shader │ │ │ ├── TMP_SDF-Mobile Overlay.shader.meta │ │ │ ├── TMP_SDF-Mobile.shader │ │ │ ├── TMP_SDF-Mobile.shader.meta │ │ │ ├── TMP_SDF-Surface-Mobile.shader │ │ │ ├── TMP_SDF-Surface-Mobile.shader.meta │ │ │ ├── TMP_SDF-Surface.shader │ │ │ ├── TMP_SDF-Surface.shader.meta │ │ │ ├── TMP_SDF.shader │ │ │ ├── TMP_SDF.shader.meta │ │ │ ├── TMP_Sprite.shader │ │ │ ├── TMP_Sprite.shader.meta │ │ │ ├── TMPro.cginc │ │ │ ├── TMPro.cginc.meta │ │ │ ├── TMPro_Properties.cginc │ │ │ ├── TMPro_Properties.cginc.meta │ │ │ ├── TMPro_Surface.cginc │ │ │ └── TMPro_Surface.cginc.meta │ │ ├── Sprite Assets.meta │ │ ├── Sprite Assets │ │ │ ├── EmojiOne.asset │ │ │ └── EmojiOne.asset.meta │ │ ├── Style Sheets.meta │ │ ├── Style Sheets │ │ │ ├── Default Style Sheet.asset │ │ │ └── Default Style Sheet.asset.meta │ │ ├── TMP Settings.asset │ │ └── TMP Settings.asset.meta │ │ ├── Sprites.meta │ │ └── Sprites │ │ ├── EmojiOne Attribution.txt │ │ ├── EmojiOne Attribution.txt.meta │ │ ├── EmojiOne.json │ │ ├── EmojiOne.json.meta │ │ ├── EmojiOne.png │ │ └── EmojiOne.png.meta ├── Packages │ └── manifest.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── XRSettings.asset ├── LICENSE ├── README.md └── Server ├── .gitignore ├── build └── modelGenerator.js ├── data └── SampleSceneNavMesh.obj ├── nodemon.json ├── package-lock.json ├── package.json ├── src ├── index.ts ├── rooms │ ├── index.ts │ └── match │ │ ├── actions │ │ ├── actionPlayerAdd.ts │ │ ├── actionPlayerRemove.ts │ │ ├── actionTypes.ts │ │ ├── actionUnitMoveTo.ts │ │ └── index.ts │ │ ├── index.ts │ │ ├── models │ │ ├── player.ts │ │ ├── position.ts │ │ └── unit.ts │ │ └── state │ │ ├── index.ts │ │ ├── statePlayers.ts │ │ └── stateUnits.ts └── utility │ ├── clamp.ts │ ├── index.ts │ ├── lerp.ts │ ├── loadNavMesh.ts │ └── vector2.ts └── tsconfig.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /Client/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /Client/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":false, 38 | "**/*.OBJ":false, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Client/Assets/ColyseusBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wenish/ColyseusNavmeshExample/38737e910e0530b00e5eeea18c591ec99d225dcc/Client/Assets/ColyseusBackground.png -------------------------------------------------------------------------------- /Client/Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f9860d038bcd46bfbda2b36f911de14 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Editor/ExportNavMeshToObj.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c00cc58e8e6540ef8b35eb11c799905 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e079de2a3221084c98d146155649fa8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Materials/Black.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Black 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Client/Assets/Materials/Black.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8c03f77b119e1146a8ebe7e1d80bfcc 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Materials/Blue.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Blue 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0.724617, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Client/Assets/Materials/Blue.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94df6d9e4086586458b3ad7a7c424542 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Materials/Green.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Green 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0.4245283, b: 0.064734355, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Client/Assets/Materials/Green.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a6224eeff55ac44bb5448bcd0381d18 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Materials/Wall.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Wall 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.9333334, g: 1, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Client/Assets/Materials/Wall.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 396881b4ce4379e4f8f8c7b79f3e3d68 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Models.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ea2b72c0fb71784ab18bcaa97800b24 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Models/Player.cs: -------------------------------------------------------------------------------- 1 | // 2 | // THIS FILE HAS BEEN GENERATED AUTOMATICALLY 3 | // DO NOT CHANGE IT MANUALLY UNLESS YOU KNOW WHAT YOU'RE DOING 4 | // 5 | // GENERATED USING @colyseus/schema 0.5.33 6 | // 7 | 8 | using Colyseus.Schema; 9 | 10 | namespace Game.Models { 11 | public class Player : Schema { 12 | [Type(0, "string")] 13 | public string id = ""; 14 | 15 | [Type(1, "string")] 16 | public string idUnit = ""; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Client/Assets/Models/Player.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83ee6f940a2160d4eb0a65356169b849 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Models/Position.cs: -------------------------------------------------------------------------------- 1 | // 2 | // THIS FILE HAS BEEN GENERATED AUTOMATICALLY 3 | // DO NOT CHANGE IT MANUALLY UNLESS YOU KNOW WHAT YOU'RE DOING 4 | // 5 | // GENERATED USING @colyseus/schema 0.5.33 6 | // 7 | 8 | using Colyseus.Schema; 9 | 10 | namespace Game.Models { 11 | public class Position : Schema { 12 | [Type(0, "number")] 13 | public float x = 0; 14 | 15 | [Type(1, "number")] 16 | public float y = 0; 17 | 18 | [Type(2, "number")] 19 | public float z = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Client/Assets/Models/Position.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e18ca029ef8fd4c4da4c226e45c2e3d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Models/State.cs: -------------------------------------------------------------------------------- 1 | // 2 | // THIS FILE HAS BEEN GENERATED AUTOMATICALLY 3 | // DO NOT CHANGE IT MANUALLY UNLESS YOU KNOW WHAT YOU'RE DOING 4 | // 5 | // GENERATED USING @colyseus/schema 0.5.33 6 | // 7 | 8 | using Colyseus.Schema; 9 | 10 | namespace Game.Models { 11 | public class State : Schema { 12 | [Type(0, "ref", typeof(StatePlayers))] 13 | public StatePlayers statePlayers = new StatePlayers(); 14 | 15 | [Type(1, "ref", typeof(StateUnits))] 16 | public StateUnits stateUnits = new StateUnits(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Client/Assets/Models/State.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ceee713ac1c2d8c4baebd73738b49a91 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Models/StatePlayers.cs: -------------------------------------------------------------------------------- 1 | // 2 | // THIS FILE HAS BEEN GENERATED AUTOMATICALLY 3 | // DO NOT CHANGE IT MANUALLY UNLESS YOU KNOW WHAT YOU'RE DOING 4 | // 5 | // GENERATED USING @colyseus/schema 0.5.33 6 | // 7 | 8 | using Colyseus.Schema; 9 | 10 | namespace Game.Models { 11 | public class StatePlayers : Schema { 12 | [Type(0, "map", typeof(MapSchema))] 13 | public MapSchema players = new MapSchema(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Client/Assets/Models/StatePlayers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7d5cd949f3e5b747a449bc9980a3f52 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Models/StateUnits.cs: -------------------------------------------------------------------------------- 1 | // 2 | // THIS FILE HAS BEEN GENERATED AUTOMATICALLY 3 | // DO NOT CHANGE IT MANUALLY UNLESS YOU KNOW WHAT YOU'RE DOING 4 | // 5 | // GENERATED USING @colyseus/schema 0.5.33 6 | // 7 | 8 | using Colyseus.Schema; 9 | 10 | namespace Game.Models { 11 | public class StateUnits : Schema { 12 | [Type(0, "map", typeof(MapSchema))] 13 | public MapSchema units = new MapSchema(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Client/Assets/Models/StateUnits.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87f3fdf734ee2314d91807ba78236274 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Models/Unit.cs: -------------------------------------------------------------------------------- 1 | // 2 | // THIS FILE HAS BEEN GENERATED AUTOMATICALLY 3 | // DO NOT CHANGE IT MANUALLY UNLESS YOU KNOW WHAT YOU'RE DOING 4 | // 5 | // GENERATED USING @colyseus/schema 0.5.33 6 | // 7 | 8 | using Colyseus.Schema; 9 | 10 | namespace Game.Models { 11 | public class Unit : Schema { 12 | [Type(0, "string")] 13 | public string id = ""; 14 | 15 | [Type(1, "ref", typeof(Position))] 16 | public Position position = new Position(); 17 | 18 | [Type(2, "number")] 19 | public float moveSpeed = 0; 20 | 21 | [Type(3, "number")] 22 | public float rotation = 0; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Client/Assets/Models/Unit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d94b1ff66584c794896a93269458459d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6710d189760204248908aff42e098cea 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84581d311bedf6f4cba63424327f246c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Auth.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ee37de26e9f4304e80e13a2bdbf284e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Client.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7982bcaebedabc4fb3ca2b3ecb344d0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/ColyseusManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using UnityEngine; 5 | 6 | namespace Colyseus 7 | { 8 | public class ColyseusManager : MonoBehaviour 9 | { 10 | public Client Client; 11 | public List rooms = new List(); 12 | 13 | private const string SingletonName = "/[Colyseus]"; 14 | private static readonly object Lock = new object(); 15 | private static ColyseusManager _instance; 16 | 17 | /// 18 | /// The singleton instance of the Colyseus Manager. 19 | /// 20 | public static ColyseusManager Instance 21 | { 22 | get 23 | { 24 | lock (Lock) 25 | { 26 | if (_instance != null) return _instance; 27 | var go = GameObject.Find(SingletonName); 28 | if (go == null) 29 | { 30 | go = new GameObject(SingletonName); 31 | } 32 | 33 | if (go.GetComponent() == null) 34 | { 35 | go.AddComponent(); 36 | } 37 | DontDestroyOnLoad(go); 38 | _instance = go.GetComponent(); 39 | return _instance; 40 | } 41 | } 42 | } 43 | 44 | public Client CreateClient(string endpoint) 45 | { 46 | Client = new Client(endpoint); 47 | return Client; 48 | } 49 | 50 | public async Task AddRoom(IRoom room) 51 | { 52 | room.OnLeave += (code) => rooms.Remove(room); 53 | rooms.Add(room); 54 | await room.Connect(); 55 | } 56 | 57 | private void OnApplicationQuit() 58 | { 59 | if (Client != null) 60 | { 61 | foreach (var room in rooms) 62 | { 63 | room.Leave(false); 64 | } 65 | } 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/ColyseusManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5caa4976a3fabd54eaae1ed1dd06f856 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Connection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | 6 | using NativeWebSocket; 7 | using GameDevWare.Serialization; 8 | 9 | namespace Colyseus 10 | { 11 | 12 | public class Connection : WebSocket 13 | { 14 | public bool IsOpen = false; 15 | protected Queue _enqueuedCalls = new Queue(); 16 | 17 | public Connection(string url, Dictionary headers) : base(url, headers) 18 | { 19 | Initialize(); 20 | } 21 | 22 | private void Initialize() 23 | { 24 | OnOpen += _OnOpen; 25 | OnClose += _OnClose; 26 | } 27 | 28 | public async Task Send(object[] data) 29 | { 30 | var serializationOutput = new MemoryStream(); 31 | MsgPack.Serialize(data, serializationOutput, SerializationOptions.SuppressTypeInformation); 32 | 33 | byte[] packedData = serializationOutput.ToArray (); 34 | 35 | if (!this.IsOpen) { 36 | _enqueuedCalls.Enqueue(packedData); 37 | 38 | } else { 39 | 40 | await Send(packedData); 41 | } 42 | } 43 | 44 | protected async void _OnOpen () 45 | { 46 | IsOpen = true; 47 | 48 | // send enqueued commands while connection wasn't open 49 | if (_enqueuedCalls.Count > 0) { 50 | do { 51 | await Send(_enqueuedCalls.Dequeue()); 52 | } while (_enqueuedCalls.Count > 0); 53 | } 54 | } 55 | 56 | protected void _OnClose (WebSocketCloseCode code) 57 | { 58 | IsOpen = false; 59 | } 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Connection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aae5a9dcd35db3545925a85f653615c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Properties.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e8644e180fda51449b8def6626c581f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("Colyseus")] 8 | [assembly: AssemblyDescription("C#/Unity3D client for Colyseus Multiplayer Game Server")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("gamestd.io")] 11 | [assembly: AssemblyProduct("Colyseus")] 12 | [assembly: AssemblyCopyright("Copyright © 2016")] 13 | [assembly: AssemblyTrademark ("")] 14 | [assembly: AssemblyCulture ("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion ("0.1.0.0")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | 28 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Properties/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a23bd0329789a224280baed3217a62ca 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Protocol.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Colyseus 4 | { 5 | /// 6 | /// Colyseus server protocol codes mapping. 7 | /// 8 | public class Protocol 9 | { 10 | /// When client receives its unique id. 11 | public static int USER_ID = 1; 12 | 13 | // 14 | // Room-related (9~19) 15 | // 16 | 17 | /// When JOIN is requested. 18 | public static int JOIN_REQUEST = 9; 19 | 20 | /// When JOIN request is accepted. 21 | public static int JOIN_ROOM = 10; 22 | 23 | /// When JOIN request is not accepted. 24 | public static int JOIN_ERROR = 11; 25 | 26 | /// When server explicitly removes from the 27 | public static int LEAVE_ROOM = 12; 28 | 29 | /// When server sends data to a particular 30 | public static int ROOM_DATA = 13; 31 | 32 | /// When server sends state to its clients. 33 | public static int ROOM_STATE = 14; 34 | 35 | /// When server sends state to its clients. 36 | public static int ROOM_STATE_PATCH = 15; 37 | 38 | /// When server sends a Schema-encoded message. 39 | public static int ROOM_DATA_SCHEMA = 16; 40 | 41 | // 42 | // Matchmaking messages (20~30) 43 | // 44 | public static int ROOM_LIST = 20; 45 | 46 | // 47 | // Generic messages (50~60) 48 | // 49 | 50 | /// When server doesn't understand a request, it returns to the 51 | public static int BAD_REQUEST = 50; 52 | 53 | // public Protocol (){} 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Protocol.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e9b70f63b87a8b4c8f714ce9818ccab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Room.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f728f9809efffab42929d122d942fe55 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6a296c7d1f27e747bd5dc54f2312024 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Conversion.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ea252daa47b4b942b6d157960d8b21c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Conversion/BigEndianBitConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc1da6b9ab498f94f8973bddab87e51a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Conversion/DoubleConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce70b7227e6698446b0adf6194b2dd92 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Conversion/EndianBitConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a334467b260eba4bb6e63b2416d1fd3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Conversion/Endianness.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7df6fb3bd118ef4d94f83e4e195c9e7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Conversion/LittleEndianBitConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 907723e8b94d8b84e9e0e81197c8acae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/FossilDeltaSerializer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.IO; 3 | using System.Text; 4 | using GameDevWare.Serialization; 5 | 6 | namespace Colyseus 7 | { 8 | /* public class FossilDeltaSerializer : Serializer */ 9 | public class FossilDeltaSerializer : ISerializer> 10 | { 11 | public StateContainer State = new StateContainer(new IndexedDictionary()); 12 | protected byte[] previousState = null; 13 | 14 | public void SetState(byte[] rawEncodedState, int offset) 15 | { 16 | //Debug.Log("FULL STATE"); 17 | //PrintByteArray(rawEncodedState); 18 | previousState = ArrayUtils.SubArray(rawEncodedState, offset, rawEncodedState.Length - 1); 19 | State.Set(MsgPack.Deserialize> (new MemoryStream(previousState))); 20 | } 21 | 22 | public IndexedDictionary GetState() 23 | { 24 | return State.state; 25 | } 26 | 27 | public void Patch(byte[] bytes, int offset) 28 | { 29 | //Debug.Log("PATCH STATE"); 30 | //PrintByteArray(bytes); 31 | previousState = Fossil.Delta.Apply (previousState, ArrayUtils.SubArray(bytes, offset, bytes.Length - 1)); 32 | var newState = MsgPack.Deserialize> (new MemoryStream(previousState)); 33 | State.Set(newState); 34 | } 35 | 36 | public void Teardown () 37 | { 38 | State.RemoveAllListeners(); 39 | } 40 | 41 | public void Handshake (byte[] bytes, int offset) 42 | { 43 | Debug.Log("Handshake FossilDeltaSerializer!"); 44 | } 45 | 46 | //public void PrintByteArray(byte[] bytes) 47 | //{ 48 | // var sb = new StringBuilder("["); 49 | // foreach (var b in bytes) 50 | // { 51 | // sb.Append(b + ", "); 52 | // } 53 | // sb.Append("]"); 54 | // Debug.Log(sb.ToString()); 55 | //} 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/FossilDeltaSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66cbc0c948c521a44b2cb73affeeafea 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Schema.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cf74172c45fcd248b260b6c4f6eb312 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Schema/Decoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa9792f3c08020e4d806fad03cfdb1d6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Schema/Schema.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3ad17f9fec901143a8ee1aaf2eba3de 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/SchemaSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d57e00853ad4a6240a145b9b994834df 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Serializer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GameDevWare.Serialization; 3 | 4 | namespace Colyseus 5 | { 6 | public interface ISerializer 7 | { 8 | void SetState(byte[] data, int offset); 9 | T GetState(); 10 | //IndexedDictionary GetState(); 11 | void Patch(byte[] data, int offset); 12 | 13 | void Teardown (); 14 | void Handshake (byte[] bytes, int offset); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Serializer/Serializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 509bee0954af1a146918464f825db91b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/StateListener.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5889d6d15ea42154ea3d252708bc39d6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/StateListener/Compare.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 966f73cb58a69224a99aed89ca33b4b9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/StateListener/StateContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f3b72fd422bd3446a8497ecc6e72192 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc5fc3bb077bc8c4ea72b43906207224 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils/ArrayUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Colyseus 4 | { 5 | public class ArrayUtils 6 | { 7 | public static byte[] SubArray(byte[] bytes, int index, int length) 8 | { 9 | return new List(bytes).GetRange(index, length).ToArray(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils/ArrayUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1b19416133e9164db55646790c205ff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils/ExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | 4 | using UnityEngine; 5 | using UnityEngine.Networking; 6 | 7 | public class UnityWebRequestAwaiter : INotifyCompletion 8 | { 9 | private UnityWebRequestAsyncOperation asyncOp; 10 | private Action continuation; 11 | 12 | public UnityWebRequestAwaiter(UnityWebRequestAsyncOperation asyncOp) 13 | { 14 | this.asyncOp = asyncOp; 15 | asyncOp.completed += OnRequestCompleted; 16 | } 17 | 18 | public bool IsCompleted { get { return asyncOp.isDone; } } 19 | 20 | public void GetResult() { } 21 | 22 | public void OnCompleted(Action continuation) 23 | { 24 | this.continuation = continuation; 25 | } 26 | 27 | private void OnRequestCompleted(AsyncOperation obj) 28 | { 29 | continuation(); 30 | } 31 | } 32 | 33 | public static class ExtensionMethods 34 | { 35 | public static UnityWebRequestAwaiter GetAwaiter(this UnityWebRequestAsyncOperation asyncOp) 36 | { 37 | return new UnityWebRequestAwaiter(asyncOp); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils/ExtensionMethods.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ec812361a020c54f8bff8f4943a555a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils/HttpUtility.cs: -------------------------------------------------------------------------------- 1 | #if !NET_LEGACY 2 | 3 | using System.Text; 4 | using System.Collections.Specialized; 5 | using System.Net; 6 | 7 | namespace Colyseus 8 | { 9 | public class HttpQSCollection : NameValueCollection 10 | { 11 | public override string ToString() 12 | { 13 | int count = Count; 14 | if (count == 0) 15 | return ""; 16 | StringBuilder sb = new StringBuilder(); 17 | string[] keys = AllKeys; 18 | for (int i = 0; i < count; i++) 19 | { 20 | sb.AppendFormat("{0}={1}&", keys[i], WebUtility.UrlEncode(this[keys[i]])); 21 | } 22 | if (sb.Length > 0) 23 | sb.Length--; 24 | return sb.ToString(); 25 | } 26 | } 27 | 28 | public class HttpUtility 29 | { 30 | public static HttpQSCollection ParseQueryString(string str) 31 | { 32 | return new HttpQSCollection(); 33 | } 34 | } 35 | 36 | } 37 | 38 | #endif -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils/HttpUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93c8dbed55e97db44bdad8ac9dd9760a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils/ObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Colyseus 5 | { 6 | public static class ObjectExtensions 7 | { 8 | public static T ToObject(object source) where T : class, new() 9 | { 10 | var someObject = new T(); 11 | var someObjectType = someObject.GetType(); 12 | 13 | foreach (var item in (IDictionary)source) { 14 | var prop = someObjectType.GetProperty(item.Key); 15 | try 16 | { 17 | prop.SetValue(someObject, Convert.ChangeType(item.Value, prop.PropertyType), null); 18 | 19 | } catch (OverflowException) { 20 | // workaround for parsing Infinity on RoomAvailable.maxClients 21 | prop.SetValue(someObject, uint.MaxValue, null); 22 | } 23 | } 24 | 25 | return someObject; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/Colyseus/Utils/ObjectExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b218f3439e259ea4ca00694f6a8062e9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25008dad0e3997745839e8034939b837 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/Delta.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a23e344e291f9c2428431c2485e111ec 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2016 Endel Dreyer (C# port) 2 | Copyright 2014 Dmitry Chestnykh (JavaScript port) 3 | Copyright 2007 D. Richard Hipp (original C version) 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or 7 | without modification, are permitted provided that the 8 | following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above 11 | copyright notice, this list of conditions and the 12 | following disclaimer. 13 | 14 | 2. Redistributions in binary form must reproduce the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer in the documentation and/or other 17 | materials provided with the distribution. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS 20 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 26 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | The views and conclusions contained in the software and documentation 32 | are those of the authors and contributors and should not be interpreted 33 | as representing official policies, either expressed or implied, of anybody 34 | else. 35 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9033544d976a0c4409ee42f72e3501f4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/README.md: -------------------------------------------------------------------------------- 1 | Delta compression algorithm for C# 2 | === 3 | 4 | [![Build Status](https://secure.travis-ci.org/endel/FossilDelta.svg?branch=master)](https://travis-ci.org/endel/FossilDelta) 5 | 6 | > This is a port from the original C implementation. See references below. 7 | 8 | Fossil achieves efficient storage and low-bandwidth synchronization through the 9 | use of delta-compression. Instead of storing or transmitting the complete 10 | content of an artifact, fossil stores or transmits only the changes relative to 11 | a related artifact. 12 | 13 | * [Format](http://www.fossil-scm.org/index.html/doc/tip/www/delta_format.wiki) 14 | * [Algorithm](http://www.fossil-scm.org/index.html/doc/tip/www/delta_encoder_algorithm.wiki) 15 | * [Original implementation](http://www.fossil-scm.org/index.html/artifact/f3002e96cc35f37b) 16 | 17 | Other implementations: 18 | 19 | - [JavaScript](https://github.com/dchest/fossil-delta-js) ([Online demo](https://dchest.github.io/fossil-delta-js/)) 20 | 21 | Installation 22 | --- 23 | 24 | ### NuGet Gallery 25 | 26 | FossilDelta is available on the [NuGet Gallery](https://www.nuget.org/packages). 27 | 28 | - [NuGet Gallery: FossilDelta](https://www.nuget.org/packages/FossilDelta) 29 | 30 | You can add FossilDelta to your project with the **NuGet Package Manager**, by using the following command in the **Package Manager Console**. 31 | 32 | PM> Install-Package FossilDelta 33 | 34 | Usage 35 | --- 36 | 37 | ### Fossil.Delta.Create(byte[] origin, byte[] target) 38 | 39 | Returns the difference between `origin` and `target` as a byte array (`byte[]`) 40 | 41 | ### Fossil.Delta.Apply(byte[] origin, byte[] delta) 42 | 43 | Apply the `delta` patch on `origin`, returning the final value as byte array 44 | (`byte[]`). 45 | 46 | Throws an error if it fails to apply the delta 47 | (e.g. if it was corrupted). 48 | 49 | ### Fossil.Delta.OutputSize(byte[] delta) 50 | 51 | Returns a size of target for this delta. 52 | 53 | Throws an error if it can't read the size from delta. 54 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a69560bdcdf7c3f4380a4ea780d062a7 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/Reader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | 4 | namespace Fossil 5 | { 6 | public class Reader 7 | { 8 | static readonly int[] zValue = { 9 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, 13 | -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 14 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, 36, 15 | -1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 16 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, 63, -1 17 | }; 18 | 19 | public byte[] a; 20 | public uint pos; 21 | 22 | public Reader (byte[] array) 23 | { 24 | this.a = array; 25 | this.pos = 0; 26 | } 27 | 28 | public bool HaveBytes () 29 | { 30 | return this.pos < this.a.Length; 31 | } 32 | 33 | public byte GetByte () 34 | { 35 | byte b = this.a[this.pos]; 36 | this.pos++; 37 | if (this.pos > this.a.Length) 38 | throw new IndexOutOfRangeException("out of bounds"); 39 | return b; 40 | } 41 | 42 | public char GetChar() 43 | { 44 | // return String.fromCharCode(this.getByte()); 45 | return (char) this.GetByte(); 46 | } 47 | 48 | /** 49 | * Read bytes from *pz and convert them into a positive integer. When 50 | * finished, leave *pz pointing to the first character past the end of 51 | * the integer. The *pLen parameter holds the length of the string 52 | * in *pz and is decremented once for each character in the integer. 53 | */ 54 | public uint GetInt () 55 | { 56 | uint v = 0; 57 | int c; 58 | while(this.HaveBytes() && (c = zValue[0x7f & this.GetByte()]) >= 0) { 59 | v = (uint) ((((Int32) v) << 6) + c); 60 | } 61 | this.pos--; 62 | return v; 63 | } 64 | } 65 | } 66 | 67 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/Reader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4aebeff0aae474642b9b318e3ecdba5b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/RollingHash.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Fossil 4 | { 5 | public class RollingHash 6 | { 7 | private UInt16 a; 8 | private UInt16 b; 9 | private UInt16 i; 10 | private byte[] z; 11 | static int ii = 0; 12 | 13 | public RollingHash () 14 | { 15 | this.a = 0; 16 | this.b = 0; 17 | this.i = 0; 18 | this.z = new byte[Delta.NHASH]; 19 | } 20 | 21 | /** 22 | * Initialize the rolling hash using the first NHASH characters of z[] 23 | */ 24 | public void Init (byte[] z, int pos) 25 | { 26 | UInt16 a = 0, b = 0, i, x; 27 | for(i = 0; i < Delta.NHASH; i++){ 28 | x = z[pos+i]; 29 | a = (UInt16) ((a + x) & 0xffff); 30 | b = (UInt16) ((b + (Delta.NHASH-i)*x) & 0xffff); 31 | this.z[i] = (byte) x; 32 | } 33 | this.a = (UInt16) (a & 0xffff); 34 | this.b = (UInt16) (b & 0xffff); 35 | this.i = 0; 36 | } 37 | 38 | /** 39 | * Advance the rolling hash by a single character "c" 40 | */ 41 | public void Next (byte c) { 42 | UInt16 old = this.z[this.i]; 43 | this.z[this.i] = c; 44 | this.i = (UInt16) ((this.i+1)&(Delta.NHASH-1)); 45 | this.a = (UInt16) (this.a - old + c); 46 | this.b = (UInt16) (this.b - Delta.NHASH*old + this.a); 47 | } 48 | 49 | 50 | /** 51 | * Return a 32-bit hash value 52 | */ 53 | public UInt32 Value () { 54 | RollingHash.ii ++; 55 | return (UInt32) (((UInt32)(this.a & 0xffff)) | (((UInt32)(this.b & 0xffff)) << 16)); 56 | } 57 | 58 | /* 59 | * Compute a hash on NHASH bytes. 60 | * 61 | * This routine is intended to be equivalent to: 62 | * hash h; 63 | * hash_init(&h, zInput); 64 | * return hash_32bit(&h); 65 | */ 66 | public static UInt32 Once (byte[] z) { 67 | UInt16 a, b, i; 68 | a = b = z[0]; 69 | for(i=1; i a; 17 | 18 | public Writer () 19 | { 20 | this.a = new List(); 21 | } 22 | 23 | public void PutChar (char c) 24 | { 25 | this.a.Add ((byte) c); 26 | } 27 | 28 | public void PutInt (uint v) 29 | { 30 | int i, j; 31 | uint[] zBuf = new uint[20]; 32 | 33 | if (v == 0) { 34 | this.PutChar ('0'); 35 | return; 36 | } 37 | for (i = 0; v > 0; i++, v>>=6) { 38 | zBuf[i] = zDigits[v&0x3f]; 39 | } 40 | for (j = i - 1; j >= 0; j--) { 41 | this.a.Add ((byte) zBuf [j]); 42 | } 43 | } 44 | 45 | public void PutArray (byte[] a, int start, int end) { 46 | for (var i = start; i < end; i++) this.a.Add(a[i]); 47 | } 48 | 49 | public byte[] ToArray () 50 | { 51 | return this.a.ToArray(); 52 | } 53 | 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/FossilDelta/Writer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60064d5f72da1a64d83d4185068dbdc3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e958bfd96efa345468d23c93f0a3829c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/GenerateTypeSerializerAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization 20 | { 21 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)] 22 | public class GenerateTypeSerializerAttribute : Attribute 23 | { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/GenerateTypeSerializerAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8b1ba116d68ff34e8aec46cccea10b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/IJsonReader.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | 17 | // ReSharper disable once CheckNamespace 18 | namespace GameDevWare.Serialization 19 | { 20 | public interface IJsonReader 21 | { 22 | SerializationContext Context { get; } 23 | 24 | JsonToken Token { get; } 25 | object RawValue { get; } 26 | IValueInfo Value { get; } 27 | 28 | bool NextToken(); 29 | 30 | bool IsEndOfStream(); 31 | 32 | /// 33 | /// Resets Line/Column numbers, CharactersReaded and Token information of reader 34 | /// 35 | void Reset(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/IJsonReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d19280389b33a974cb7133a82435ac6c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/IJsonWriter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization 20 | { 21 | public interface IJsonWriter 22 | { 23 | SerializationContext Context { get; } 24 | 25 | void Flush(); 26 | 27 | void Write(string value); 28 | void Write(JsonMember value); 29 | void Write(int number); 30 | void Write(uint number); 31 | void Write(long number); 32 | void Write(ulong number); 33 | void Write(float number); 34 | void Write(double number); 35 | void Write(decimal number); 36 | void Write(bool value); 37 | void Write(DateTime dateTime); 38 | void Write(DateTimeOffset dateTimeOffset); 39 | void WriteObjectBegin(int numberOfMembers); 40 | void WriteObjectEnd(); 41 | void WriteArrayBegin(int numberOfMembers); 42 | void WriteArrayEnd(); 43 | void WriteNull(); 44 | 45 | void WriteJson(string jsonString); 46 | void WriteJson(char[] jsonString, int index, int charCount); 47 | 48 | void Reset(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/IJsonWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a756aefd62528354485559052639e59f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/IValueInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | // ReSharper disable once CheckNamespace 4 | namespace GameDevWare.Serialization 5 | { 6 | public interface IValueInfo 7 | { 8 | bool HasValue { get; } 9 | object Raw { get; } 10 | Type Type { get; } 11 | bool AsBoolean { get; } 12 | byte AsByte { get; } 13 | short AsInt16 { get; } 14 | int AsInt32 { get; } 15 | long AsInt64 { get; } 16 | sbyte AsSByte { get; } 17 | ushort AsUInt16 { get; } 18 | uint AsUInt32 { get; } 19 | ulong AsUInt64 { get; } 20 | float AsSingle { get; } 21 | double AsDouble { get; } 22 | decimal AsDecimal { get; } 23 | string AsString { get; } 24 | DateTime AsDateTime { get; } 25 | 26 | int LineNumber { get; } 27 | int ColumnNumber { get; } 28 | } 29 | } -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/IValueInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bed869962e6e8454a88dea7b813e5637 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/IndexedDictionary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6aecfaceee67a94aa2565c7c3fdd270 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Json.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2f3ce8808eee26409648b61ec4b40eb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonMember.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44afbad572141e24cbd52a0d68eaef36 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3683685f58ef1394f84c6e575299f6d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonReaderExtentions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc4c52c680798a54d92d8417304932fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonSerializationException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b895d00f038b75142830b756b8143b32 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStreamReader.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.IO; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization 21 | { 22 | public sealed class JsonStreamReader : JsonReader 23 | { 24 | private readonly StreamReader reader; 25 | 26 | public JsonStreamReader(Stream stream, SerializationContext context, int bufferSize = DEFAULT_BUFFER_SIZE) 27 | : base(context, bufferSize) 28 | { 29 | if (stream == null) throw new ArgumentNullException("stream"); 30 | if (!stream.CanRead) throw JsonSerializationException.StreamIsNotReadable(); 31 | 32 | 33 | reader = new StreamReader(stream, context.Encoding); 34 | } 35 | 36 | protected override int FillBuffer(char[] buffer, int index) 37 | { 38 | if (buffer == null) 39 | throw new ArgumentNullException("buffer"); 40 | if (index < 0 || index >= buffer.Length) 41 | throw new ArgumentOutOfRangeException("index"); 42 | 43 | 44 | var count = buffer.Length - index; 45 | if (count <= 0) 46 | return index; 47 | 48 | var readed = reader.Read(buffer, index, count); 49 | return index + readed; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStreamReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a93c8f978101774181607eed01ef02e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStreamWriter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.IO; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization 21 | { 22 | public sealed class JsonStreamWriter : JsonWriter 23 | { 24 | private readonly StreamWriter writer; 25 | 26 | public Stream Stream { get { return writer.BaseStream; } } 27 | 28 | public JsonStreamWriter(Stream stream, SerializationContext context) : base(context) 29 | { 30 | if (stream == null) throw new ArgumentNullException("stream"); 31 | if (!stream.CanWrite) throw JsonSerializationException.StreamIsNotWriteable(); 32 | 33 | 34 | writer = new StreamWriter(stream, context.Encoding); 35 | } 36 | 37 | public override void Flush() 38 | { 39 | writer.Flush(); 40 | } 41 | 42 | public override void WriteJson(string jsonString) 43 | { 44 | if (jsonString == null) 45 | throw new ArgumentNullException("jsonString"); 46 | 47 | 48 | writer.Write(jsonString); 49 | this.CharactersWritten += jsonString.Length; 50 | } 51 | 52 | public override void WriteJson(char[] jsonString, int index, int charactersToWrite) 53 | { 54 | if (jsonString == null) 55 | throw new ArgumentNullException("jsonString"); 56 | if (index < 0 || index >= jsonString.Length) 57 | throw new ArgumentOutOfRangeException("index"); 58 | if (charactersToWrite < 0 || index + charactersToWrite > jsonString.Length) 59 | throw new ArgumentOutOfRangeException("charactersToWrite"); 60 | 61 | 62 | if (charactersToWrite == 0) 63 | return; 64 | 65 | writer.Write(jsonString, index, charactersToWrite); 66 | this.CharactersWritten += charactersToWrite; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStreamWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c797c8f3bfa52d4796a06bca564426f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStringBuilderReader.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.Text; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization 21 | { 22 | public sealed class JsonStringBuilderReader : JsonReader 23 | { 24 | private readonly StringBuilder jsonString; 25 | private int position; 26 | 27 | public JsonStringBuilderReader(StringBuilder stringBuilder, SerializationContext context, 28 | int bufferSize = DEFAULT_BUFFER_SIZE) 29 | : base(context, bufferSize) 30 | { 31 | if (stringBuilder == null) 32 | throw new ArgumentNullException("str"); 33 | 34 | 35 | this.jsonString = stringBuilder; 36 | this.position = 0; 37 | } 38 | 39 | protected override int FillBuffer(char[] buffer, int index) 40 | { 41 | if (buffer == null) 42 | throw new ArgumentNullException("buffer"); 43 | if (index < 0 || index >= buffer.Length) 44 | throw new ArgumentOutOfRangeException("index"); 45 | 46 | 47 | var block = Math.Min(jsonString.Length - position, buffer.Length - index); 48 | if (block <= 0) 49 | return index; 50 | 51 | jsonString.CopyTo(position, buffer, index, block); 52 | 53 | position += block; 54 | 55 | return index + block; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStringBuilderReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bcdd6afd9aaa1f458c5541513096344 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStringBuilderWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3a1bfe58a7227f4ebf6b0755a108760 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStringReader.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization 20 | { 21 | public sealed class JsonStringReader : JsonReader 22 | { 23 | private readonly string jsonString; 24 | private int position; 25 | 26 | public JsonStringReader(string jsonString, SerializationContext context, int bufferSize = DEFAULT_BUFFER_SIZE) 27 | : base(context, bufferSize) 28 | { 29 | if (jsonString == null) 30 | throw new ArgumentNullException("jsonString"); 31 | 32 | 33 | this.jsonString = jsonString; 34 | this.position = 0; 35 | } 36 | 37 | protected override int FillBuffer(char[] buffer, int index) 38 | { 39 | if (buffer == null) 40 | throw new ArgumentNullException("buffer"); 41 | if (index < 0 || index >= buffer.Length) 42 | throw new ArgumentOutOfRangeException("index"); 43 | 44 | 45 | var block = Math.Min(jsonString.Length - position, buffer.Length - index); 46 | if (block <= 0) 47 | return index; 48 | 49 | jsonString.CopyTo(position, buffer, index, block); 50 | 51 | position += block; 52 | 53 | return index + block; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonStringReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2432f031b15b2b64ea97c147ec6f722b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonTextReader.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.IO; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization 21 | { 22 | public sealed class JsonTextReader : JsonReader 23 | { 24 | private readonly TextReader reader; 25 | 26 | public JsonTextReader(TextReader reader, SerializationContext context, int bufferSize = DEFAULT_BUFFER_SIZE) 27 | : base(context, bufferSize) 28 | { 29 | if (reader == null) 30 | throw new ArgumentNullException("reader"); 31 | 32 | 33 | this.reader = reader; 34 | } 35 | 36 | protected override int FillBuffer(char[] buffer, int index) 37 | { 38 | if (buffer == null) 39 | throw new ArgumentNullException("buffer"); 40 | if (index < 0 || index >= buffer.Length) 41 | throw new ArgumentOutOfRangeException("index"); 42 | 43 | 44 | var count = buffer.Length - index; 45 | if (count <= 0) 46 | return index; 47 | 48 | var readed = reader.Read(buffer, index, count); 49 | return index + readed; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonTextReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f80c833d9be2cb4b914f6bc1299bf51 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonTextWriter.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.IO; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization 21 | { 22 | public sealed class JsonTextWriter : JsonWriter 23 | { 24 | private readonly TextWriter writer; 25 | 26 | private TextWriter Writer 27 | { 28 | get { return writer; } 29 | } 30 | 31 | public JsonTextWriter(TextWriter writer, SerializationContext context) 32 | : base(context) 33 | { 34 | if (writer == null) 35 | throw new ArgumentNullException("writer"); 36 | 37 | 38 | this.writer = writer; 39 | } 40 | 41 | public override void Flush() 42 | { 43 | writer.Flush(); 44 | } 45 | 46 | public override void WriteJson(string jsonString) 47 | { 48 | if (jsonString == null) 49 | throw new ArgumentNullException("jsonString"); 50 | 51 | 52 | writer.Write(jsonString); 53 | this.CharactersWritten += jsonString.Length; 54 | } 55 | 56 | public override void WriteJson(char[] jsonString, int offset, int charactersToWrite) 57 | { 58 | if (jsonString == null) 59 | throw new ArgumentNullException("jsonString"); 60 | if (offset < 0 || offset >= jsonString.Length) 61 | throw new ArgumentOutOfRangeException("offset"); 62 | if (charactersToWrite < 0 || offset + charactersToWrite > jsonString.Length) 63 | throw new ArgumentOutOfRangeException("charactersToWrite"); 64 | 65 | 66 | if (charactersToWrite == 0) 67 | return; 68 | 69 | writer.Write(jsonString, offset, charactersToWrite); 70 | this.CharactersWritten += charactersToWrite; 71 | } 72 | 73 | public override string ToString() 74 | { 75 | return writer.ToString(); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonTextWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a97cf432bc8b7114fa6ec491d1a2cc5d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonToken.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | 17 | // ReSharper disable once CheckNamespace 18 | namespace GameDevWare.Serialization 19 | { 20 | public enum JsonToken 21 | { 22 | None = 0, 23 | BeginArray, 24 | EndOfArray, 25 | BeginObject, 26 | EndOfObject, 27 | Member, 28 | Number, 29 | StringLiteral, 30 | DateTime, 31 | Null, 32 | Boolean, 33 | EndOfStream 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonToken.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21baa910cafacc7428de0c6246a77e1f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa09fba8bb8783240b29db9e1691b1f1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be5ae879abe99984a9301ccfd72acc1f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/JsonWriterExtentions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae475399245b3d04d80a1a606844231a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05f8d420d08133a4e933164cd058bc72 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/BigEndianBitConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d60faecfe6bc0cd42ae8185c87eeb039 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/DefaultMsgPackExtensionTypeHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 595f5c26567e8fd4ba1e36705c0b8002 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/EndianBitConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 016922f168650ac42a5cc6de93aedf08 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/Endianness.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53915e4a4e819984bbe8a43853153cb1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/LittleEndianBitConverter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a0791573feee3e4fad3ca8cc603615f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackExtensionType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1ae21d86be51794a9a0393496020b61 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackExtensionTypeHandler.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.Collections.Generic; 18 | using System.Linq; 19 | 20 | // ReSharper disable once CheckNamespace 21 | namespace GameDevWare.Serialization.MessagePack 22 | { 23 | public abstract class MessagePackExtensionTypeHandler 24 | { 25 | public abstract IEnumerable ExtensionTypes { get; } 26 | 27 | public abstract bool TryRead(sbyte type, ArraySegment data, out object value); 28 | public abstract bool TryWrite(object value, out sbyte type, ref ArraySegment data); 29 | 30 | /// 31 | public override string ToString() 32 | { 33 | return string.Format("Extension Types: {0}", string.Join(", ", this.ExtensionTypes.Select(t => t.ToString()).ToArray())); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackExtensionTypeHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96d09bf064bb0984f92fcc1c46591739 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e28eedf19239d94c9734a6f87c9fa14 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackTimestamp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcddd898b473c544e891f843aea73c83 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | 17 | // ReSharper disable once CheckNamespace 18 | namespace GameDevWare.Serialization.MessagePack 19 | { 20 | public enum MsgPackType : byte 21 | { 22 | PositiveFixIntStart = 0x00, 23 | PositiveFixIntEnd = 0x7f, 24 | FixMapStart = 0x80, 25 | FixMapEnd = 0x8f, 26 | FixArrayStart = 0x90, 27 | FixArrayEnd = 0x9f, 28 | FixStrStart = 0xa0, 29 | FixStrEnd = 0xbf, 30 | Nil = 0xc0, 31 | Unused = 0xc1, 32 | False = 0xc2, 33 | True = 0xc3, 34 | Bin8 = 0xc4, 35 | Bin16 = 0xc5, 36 | Bin32 = 0xc6, 37 | Ext8 = 0xc7, 38 | Ext16 = 0xc8, 39 | Ext32 = 0xc9, 40 | Float32 = 0xca, 41 | Float64 = 0xcb, 42 | UInt8 = 0xcc, 43 | UInt16 = 0xcd, 44 | UInt32 = 0xce, 45 | UInt64 = 0xcf, 46 | Int8 = 0xd0, 47 | Int16 = 0xd1, 48 | Int32 = 0xd2, 49 | Int64 = 0xd3, 50 | FixExt1 = 0xd4, 51 | FixExt2 = 0xd5, 52 | FixExt4 = 0xd6, 53 | FixExt8 = 0xd7, 54 | FixExt16 = 0xd8, 55 | Str8 = 0xd9, 56 | Str16 = 0xda, 57 | Str32 = 0xdb, 58 | Array16 = 0xdc, 59 | Array32 = 0xdd, 60 | Map16 = 0xde, 61 | Map32 = 0xdf, 62 | NegativeFixIntStart = 0xe0, 63 | NegativeFixIntEnd = 0xff 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 279673c5ab2af7c42819d50a41a0a912 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/MsgPackWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5630dc5d9908d344a34520aa146e6a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/UnknownMsgPackExtentionTypeException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.Runtime.Serialization; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization.MessagePack 21 | { 22 | [Serializable] 23 | public sealed class UnknownMsgPackExtentionTypeException : SerializationException 24 | { 25 | public UnknownMsgPackExtentionTypeException(string message, Exception innerException) : base(message, innerException) 26 | { 27 | } 28 | 29 | public UnknownMsgPackExtentionTypeException(string message) : base(message) 30 | { 31 | } 32 | 33 | public UnknownMsgPackExtentionTypeException(sbyte invalidExtType) 34 | : base(string.Format("Unknown MessagePack extention type '{0}' was readed from stream.", invalidExtType)) 35 | { 36 | } 37 | 38 | private UnknownMsgPackExtentionTypeException(SerializationInfo info, StreamingContext context) 39 | : base(info, context) 40 | { 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/UnknownMsgPackExtentionTypeException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2eb0ae872bca7fe4ba05559efbc2bf77 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/UnknownMsgPackFormatException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.Runtime.Serialization; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization.MessagePack 21 | { 22 | [Serializable] 23 | public sealed class UnknownMsgPackFormatException : SerializationException 24 | { 25 | public UnknownMsgPackFormatException(string message, Exception innerException) : base(message, innerException) 26 | { 27 | } 28 | 29 | public UnknownMsgPackFormatException(string message) : base(message) 30 | { 31 | } 32 | 33 | public UnknownMsgPackFormatException(byte invalidValue) 34 | : base(string.Format("Unknown MessagePack format '{0}' was readed from stream.", invalidValue)) 35 | { 36 | } 37 | 38 | private UnknownMsgPackFormatException(SerializationInfo info, StreamingContext context) 39 | : base(info, context) 40 | { 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MessagePack/UnknownMsgPackFormatException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd2190a93b1e7344e911a7edc3ab6c7f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b37b2079f01b8134a9214e01e94cc1eb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata/DataMemberDescription.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.ComponentModel; 18 | using System.Linq; 19 | using System.Reflection; 20 | 21 | // ReSharper disable once CheckNamespace 22 | namespace GameDevWare.Serialization.Metadata 23 | { 24 | internal abstract class DataMemberDescription : MemberDescription 25 | { 26 | public abstract bool CanGet { get; } 27 | public abstract bool CanSet { get; } 28 | public object DefaultValue { get; private set; } 29 | public abstract Type ValueType { get; } 30 | 31 | protected DataMemberDescription(TypeDescription typeDescription, MemberInfo member) 32 | : base(typeDescription, member) 33 | { 34 | var defaultValue = 35 | (DefaultValueAttribute) this.GetAttributesOrEmptyList(typeof (DefaultValueAttribute)).FirstOrDefault(); 36 | if (defaultValue != null) 37 | this.DefaultValue = defaultValue.Value; 38 | } 39 | 40 | public abstract object GetValue(object target); 41 | public abstract void SetValue(object target, object value); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata/DataMemberDescription.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3cd57220fa833f4aa51cd1cc561c640 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata/FieldDescription.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.Reflection; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization.Metadata 21 | { 22 | internal sealed class FieldDescription : DataMemberDescription 23 | { 24 | private readonly FieldInfo fieldInfo; 25 | private readonly Func getFn; 26 | private readonly Action setFn; 27 | 28 | public override bool CanGet { get { return true; } } 29 | public override bool CanSet { get { return this.fieldInfo.IsInitOnly == false; } } 30 | public override Type ValueType { get { return this.fieldInfo.FieldType; } } 31 | 32 | public FieldDescription(TypeDescription typeDescription, FieldInfo fieldInfo) 33 | : base(typeDescription, fieldInfo) 34 | { 35 | if (fieldInfo == null) throw new ArgumentNullException("fieldInfo"); 36 | 37 | this.fieldInfo = fieldInfo; 38 | 39 | GettersAndSetters.TryGetAssessors(fieldInfo, out this.getFn, out this.setFn); 40 | 41 | } 42 | 43 | public override object GetValue(object target) 44 | { 45 | if (!this.CanGet) throw new InvalidOperationException("Field is write-only."); 46 | 47 | if (this.getFn != null) 48 | return this.getFn(target); 49 | else 50 | return fieldInfo.GetValue(target); 51 | } 52 | 53 | public override void SetValue(object target, object value) 54 | { 55 | if (!this.CanSet) throw new InvalidOperationException("Field is read-only."); 56 | 57 | if (this.setFn != null) 58 | this.setFn(target, value); 59 | else 60 | this.fieldInfo.SetValue(target, value); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata/FieldDescription.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcff3bb7b012a8a4eac5dded0d65a381 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata/MemberDescription.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c624539e89b3dca43a6cb248c83709c8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata/PropertyDescription.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b2923ff870d8c54e98e157774099fd4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata/ReflectionUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3250c0063dac547448f3b3a9fe33ae3f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Metadata/TypeDescription.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 915e2c2b9d07da14c93ff955b14e3cd0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/MsgPack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d202774d1c9c0d84ba0a25d7c9c8528f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/ReflectionExtentions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b402648bb78f38419d46a173609b6aa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/SerializationContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3097be45f3e82f446a28a3f797bdda2a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/SerializationOptions.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization 20 | { 21 | [Flags] 22 | public enum SerializationOptions 23 | { 24 | None = 0, 25 | SuppressTypeInformation = 0x1 << 1, 26 | PrettyPrint = 0x1 << 2, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/SerializationOptions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aafc425e75824a44ab806b2259f53d7a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 972488f9f9f340641b65d18ede1ffd80 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/ArraySerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1213f286ee976647ad47f0e56a0b8fc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/BinarySerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b754a08ed63cbf4391aaa648237bb5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/BoundsSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb9c2d745bb74f0438e731bf1008ccda 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/DateTimeOffsetSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5909c42a18fb9a4c901fa6419eee488 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/DateTimeSerializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using System.Globalization; 18 | using System.Linq; 19 | using System.Runtime.Serialization; 20 | 21 | // ReSharper disable once CheckNamespace 22 | namespace GameDevWare.Serialization.Serializers 23 | { 24 | public sealed class DateTimeSerializer : TypeSerializer 25 | { 26 | public override Type SerializedType { get { return typeof(DateTime); } } 27 | 28 | public override object Deserialize(IJsonReader reader) 29 | { 30 | if (reader == null) throw new ArgumentNullException("reader"); 31 | 32 | if (reader.Token == JsonToken.DateTime || reader.RawValue is DateTime) 33 | return reader.Value.AsDateTime; 34 | 35 | var dateTimeStr = reader.ReadString(false); 36 | try 37 | { 38 | var value = default(DateTime); 39 | if (!DateTime.TryParse(dateTimeStr, reader.Context.Format, DateTimeStyles.RoundtripKind, out value)) 40 | value = DateTime.ParseExact(dateTimeStr, reader.Context.DateTimeFormats, reader.Context.Format, DateTimeStyles.RoundtripKind); 41 | 42 | return value; 43 | } 44 | catch (FormatException fe) 45 | { 46 | throw new SerializationException(string.Format("Failed to parse date '{0}' in with pattern '{1}'.", dateTimeStr, reader.Context.DateTimeFormats[0]), fe); 47 | } 48 | } 49 | 50 | public override void Serialize(IJsonWriter writer, object value) 51 | { 52 | if (writer == null) throw new ArgumentNullException("writer"); 53 | if (value == null) throw new ArgumentNullException("value"); 54 | 55 | var dataTime = (DateTime)value; 56 | writer.Write(dataTime); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/DateTimeSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5319ed666c8e934ea1c5a9ee6e948d1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/DictionaryEntrySerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f16cdba7d04adf4c86ba825e4cea8bc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/DictionarySerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a921dd58cb88be64ab8f43c9ea735625 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/EnumNumberSerializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization.Serializers 20 | { 21 | public sealed class EnumNumberSerializer : TypeSerializer 22 | { 23 | private readonly Type enumType; 24 | private readonly Type enumBaseType; 25 | 26 | public override Type SerializedType { get { return this.enumType; } } 27 | 28 | public EnumNumberSerializer(Type enumType) 29 | { 30 | if (enumType == null) throw new ArgumentNullException("enumType"); 31 | if (!enumType.IsEnum) throw JsonSerializationException.TypeIsNotValid(this.GetType(), "be a Enum"); 32 | 33 | this.enumType = enumType; 34 | this.enumBaseType = Enum.GetUnderlyingType(enumType); 35 | } 36 | 37 | public override object Deserialize(IJsonReader reader) 38 | { 39 | if (reader == null) throw new ArgumentNullException("reader"); 40 | 41 | if (reader.Token == JsonToken.StringLiteral) 42 | return Enum.Parse(this.enumType, reader.ReadString(false), true); 43 | else if (reader.Token == JsonToken.Number) 44 | return Enum.ToObject(this.enumType, reader.ReadValue(this.enumBaseType, false)); 45 | else 46 | throw JsonSerializationException.UnexpectedToken(reader, JsonToken.Number, JsonToken.StringLiteral); 47 | } 48 | 49 | public override void Serialize(IJsonWriter writer, object value) 50 | { 51 | if (writer == null) throw new ArgumentNullException("writer"); 52 | if (value == null) throw new ArgumentNullException("value"); 53 | 54 | writer.WriteValue(Convert.ChangeType(value, this.enumBaseType), this.enumBaseType); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/EnumNumberSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d5acd8e415fa364c8da8d4d3ed93437 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/EnumSerializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization.Serializers 20 | { 21 | public sealed class EnumSerializer : TypeSerializer 22 | { 23 | private readonly Type enumType; 24 | private readonly Type enumBaseType; 25 | 26 | public override Type SerializedType { get { return this.enumType; } } 27 | 28 | public EnumSerializer(Type enumType) 29 | { 30 | if (enumType == null) throw new ArgumentNullException("enumType"); 31 | if (!enumType.IsEnum) throw JsonSerializationException.TypeIsNotValid(this.GetType(), "be a Enum"); 32 | 33 | this.enumType = enumType; 34 | this.enumBaseType = Enum.GetUnderlyingType(enumType); 35 | } 36 | 37 | public override object Deserialize(IJsonReader reader) 38 | { 39 | if (reader == null) throw new ArgumentNullException("reader"); 40 | 41 | if (reader.Token == JsonToken.StringLiteral) 42 | return Enum.Parse(this.enumType, reader.ReadString(false), true); 43 | else if (reader.Token == JsonToken.Number) 44 | return Enum.ToObject(this.enumType, reader.ReadValue(this.enumBaseType, false)); 45 | else 46 | throw JsonSerializationException.UnexpectedToken(reader, JsonToken.Number, JsonToken.StringLiteral); 47 | } 48 | 49 | public override void Serialize(IJsonWriter writer, object value) 50 | { 51 | if (writer == null) throw new ArgumentNullException("writer"); 52 | if (value == null) throw new ArgumentNullException("value"); 53 | 54 | var valueStr = Convert.ToString(value, writer.Context.Format); 55 | writer.WriteString(valueStr); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/EnumSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 111b503f55fe36d49866248a7179469d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/GuidSerializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | using GameDevWare.Serialization.MessagePack; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization.Serializers 21 | { 22 | public sealed class GuidSerializer : TypeSerializer 23 | { 24 | public override Type SerializedType { get { return typeof(Guid); } } 25 | 26 | public override object Deserialize(IJsonReader reader) 27 | { 28 | if (reader == null) throw new ArgumentNullException("reader"); 29 | 30 | var guidStr = reader.ReadString(false); 31 | var value = new Guid(guidStr); 32 | return value; 33 | } 34 | 35 | public override void Serialize(IJsonWriter writer, object value) 36 | { 37 | if (writer == null) throw new ArgumentNullException("writer"); 38 | if (value == null) throw new ArgumentNullException("value"); 39 | 40 | var messagePackWriter = writer as MsgPackWriter; 41 | if (messagePackWriter != null) 42 | { 43 | // try to write it as Message Pack extension type 44 | var extensionType = default(sbyte); 45 | var buffer = messagePackWriter.GetWriteBuffer(); 46 | if (messagePackWriter.Context.ExtensionTypeHandler.TryWrite(value, out extensionType, ref buffer)) 47 | { 48 | messagePackWriter.Write(extensionType, buffer); 49 | return; 50 | } 51 | // if not, continue default serialization 52 | } 53 | 54 | var guid = (Guid)value; 55 | var guidStr = guid.ToString(); 56 | writer.Write(guidStr); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/GuidSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4214174f4454aca4daee14f3773cd8ce 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/Matrix4x4Serializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 466d8c4538c2cb74e9187c58eeed5c36 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/MsgPackExtensionTypeSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88dd42238aacf9e4486524d127fd2e21 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/MsgPackTimestampSerializer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GameDevWare.Serialization.MessagePack; 3 | 4 | // ReSharper disable once CheckNamespace 5 | namespace GameDevWare.Serialization.Serializers 6 | { 7 | public class MsgPackTimestampSerializer : TypeSerializer 8 | { 9 | private const string SECONDS_MEMBER_NAME = "$seconds"; 10 | private const string NANO_SECONDS_MEMBER_NAME = "$nanoSeconds"; 11 | 12 | /// 13 | public override Type SerializedType { get { return typeof(MessagePackTimestamp); } } 14 | 15 | public override object Deserialize(IJsonReader reader) 16 | { 17 | if (reader.RawValue is MessagePackTimestamp) 18 | { 19 | return (MessagePackTimestamp)reader.Value.Raw; 20 | } 21 | else if (reader.Token == JsonToken.Null) 22 | { 23 | return null; 24 | } 25 | 26 | reader.ReadObjectBegin(); 27 | var seconds = default(long); 28 | var nanoSeconds = default(uint); 29 | while (reader.Token != JsonToken.EndOfObject) 30 | { 31 | var member = reader.ReadMember(); 32 | switch (member) 33 | { 34 | case SECONDS_MEMBER_NAME: 35 | seconds = reader.ReadInt64(); 36 | break; 37 | case NANO_SECONDS_MEMBER_NAME: 38 | seconds = reader.ReadUInt32(); 39 | break; 40 | default: 41 | reader.ReadValue(typeof(object)); // skip value 42 | break; 43 | } 44 | } 45 | reader.ReadObjectEnd(false); 46 | 47 | var value = new MessagePackTimestamp(seconds, nanoSeconds); 48 | return value; 49 | } 50 | public override void Serialize(IJsonWriter writer, object value) 51 | { 52 | if (value == null) 53 | { 54 | writer.WriteNull(); 55 | return; 56 | } 57 | 58 | var messagePackWriter = writer as MsgPackWriter; 59 | if (messagePackWriter != null) 60 | { 61 | var extensionType = default(sbyte); 62 | var buffer = messagePackWriter.GetWriteBuffer(); 63 | if (messagePackWriter.Context.ExtensionTypeHandler.TryWrite(value, out extensionType, ref buffer)) 64 | { 65 | messagePackWriter.Write(extensionType, buffer); 66 | return; 67 | } 68 | } 69 | 70 | var timeStamp = (MessagePackTimestamp)value; 71 | writer.WriteObjectBegin(2); 72 | writer.WriteMember(SECONDS_MEMBER_NAME); 73 | writer.Write(timeStamp.Seconds); 74 | writer.WriteMember(NANO_SECONDS_MEMBER_NAME); 75 | writer.Write(timeStamp.NanoSeconds); 76 | writer.WriteObjectEnd(); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/MsgPackTimestampSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a137e7f61e299c54a80c9ac2d6c8c40e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/ObjectSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3394c65ff27466c4d9a795f8d1237dc5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/PrimitiveTypeSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0662f01d7d8e39246958704399465764 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/QuaternionSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd14b6b83303f61498645b5d2f422d42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/RectSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef94076227ba7b7418f4246ca5a46eab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/StreamSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f55336e9bfc0ada4e81ce4054f51eadf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/TimeSpanSerializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization.Serializers 20 | { 21 | public sealed class TimeSpanSerializer : TypeSerializer 22 | { 23 | public override Type SerializedType { get { return typeof(TimeSpan); } } 24 | 25 | public override object Deserialize(IJsonReader reader) 26 | { 27 | if (reader == null) throw new ArgumentNullException("reader"); 28 | 29 | if (reader.Token == JsonToken.Number) 30 | return new TimeSpan(reader.Value.AsInt64); 31 | 32 | var timeSpanStr = reader.ReadString(false); 33 | var value = TimeSpan.Parse(timeSpanStr); 34 | return value; 35 | } 36 | 37 | public override void Serialize(IJsonWriter writer, object value) 38 | { 39 | if (writer == null) throw new ArgumentNullException("writer"); 40 | if (value == null) throw new ArgumentNullException("value"); 41 | 42 | var timeSpan = (TimeSpan)value; 43 | writer.Write((long)timeSpan.Ticks); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/TimeSpanSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d3f5cb473f8aef47bfd14302662ae46 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/UriSerializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization.Serializers 20 | { 21 | public sealed class UriSerializer : TypeSerializer 22 | { 23 | public override Type SerializedType { get { return typeof(Uri); } } 24 | 25 | public override object Deserialize(IJsonReader reader) 26 | { 27 | if (reader == null) throw new ArgumentNullException("reader"); 28 | 29 | var uriStr = reader.ReadString(false); 30 | var value = new Uri(uriStr); 31 | return value; 32 | } 33 | 34 | public override void Serialize(IJsonWriter writer, object value) 35 | { 36 | if (writer == null) throw new ArgumentNullException("writer"); 37 | if (value == null) throw new ArgumentNullException("value"); 38 | 39 | var uri = (Uri)value; 40 | writer.WriteString(uri.OriginalString); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/UriSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b84afee6d8b3554db7b85f30c83eed2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector2Serializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | #if UNITY_5 || UNITY_4 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 17 | using System; 18 | using UnityEngine; 19 | 20 | // ReSharper disable once CheckNamespace 21 | namespace GameDevWare.Serialization.Serializers 22 | { 23 | public sealed class Vector2Serializer : TypeSerializer 24 | { 25 | public override Type SerializedType { get { return typeof(Vector2); } } 26 | 27 | public override object Deserialize(IJsonReader reader) 28 | { 29 | if (reader == null) throw new ArgumentNullException("reader"); 30 | 31 | if (reader.Token == JsonToken.Null) 32 | return null; 33 | 34 | var value = new Vector2(); 35 | reader.ReadObjectBegin(); 36 | while (reader.Token != JsonToken.EndOfObject) 37 | { 38 | var memberName = reader.ReadMember(); 39 | switch (memberName) 40 | { 41 | case "x": value.x = reader.ReadSingle(); break; 42 | case "y": value.y = reader.ReadSingle(); break; 43 | default: reader.ReadValue(typeof(object)); break; 44 | } 45 | } 46 | reader.ReadObjectEnd(nextToken: false); 47 | return value; 48 | } 49 | public override void Serialize(IJsonWriter writer, object value) 50 | { 51 | if (writer == null) throw new ArgumentNullException("writer"); 52 | if (value == null) throw new ArgumentNullException("value"); 53 | 54 | var vector2 = (Vector2)value; 55 | writer.WriteObjectBegin(2); 56 | writer.WriteMember("x"); 57 | writer.Write(vector2.x); 58 | writer.WriteMember("y"); 59 | writer.Write(vector2.y); 60 | writer.WriteObjectEnd(); 61 | } 62 | } 63 | } 64 | #endif 65 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector2Serializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2ed709ec41a3e64299b9274f2baf1e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector3Serializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56ca3d66ddd569849a4e88d3a8a3e409 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/Vector4Serializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2346a34b209076f41908011e029ec6e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/VersionSerializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | using System; 17 | 18 | // ReSharper disable once CheckNamespace 19 | namespace GameDevWare.Serialization.Serializers 20 | { 21 | public sealed class VersionSerializer : TypeSerializer 22 | { 23 | public override Type SerializedType { get { return typeof(Version); } } 24 | 25 | public override object Deserialize(IJsonReader reader) 26 | { 27 | if (reader == null) throw new ArgumentNullException("reader"); 28 | 29 | var versionStr = reader.ReadString(false); 30 | var value = new Version(versionStr); 31 | return value; 32 | } 33 | 34 | public override void Serialize(IJsonWriter writer, object value) 35 | { 36 | if (writer == null) throw new ArgumentNullException("writer"); 37 | if (value == null) throw new ArgumentNullException("value"); 38 | 39 | var version = (Version)value; 40 | writer.WriteString(version.ToString()); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/Serializers/VersionSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63ccd0d8f5f32d849b555da85a5e0582 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/TypeSerializer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | 17 | using System; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization 21 | { 22 | public abstract class TypeSerializer 23 | { 24 | public abstract Type SerializedType { get; } 25 | 26 | public abstract object Deserialize(IJsonReader reader); 27 | public abstract void Serialize(IJsonWriter writer, object value); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/TypeSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d2554e3a9379c64ab9becdaa9a3d53d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/TypeSerializerAttribute.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Denis Zykov, GameDevWare.com 3 | 4 | This a part of "Json & MessagePack Serialization" Unity Asset - https://www.assetstore.unity3d.com/#!/content/59918 5 | 6 | THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND 7 | REPRESENTATIONS WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE 8 | IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, 9 | FITNESS FOR A PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE 10 | AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE OR COURSE OF DEALING. 11 | 12 | This source code is distributed via Unity Asset Store, 13 | to use it in your project you should accept Terms of Service and EULA 14 | https://unity3d.com/ru/legal/as_terms 15 | */ 16 | 17 | using System; 18 | 19 | // ReSharper disable once CheckNamespace 20 | namespace GameDevWare.Serialization 21 | { 22 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)] 23 | public class TypeSerializerAttribute : Attribute 24 | { 25 | public Type SerializerType { get; private set; } 26 | 27 | public TypeSerializerAttribute(Type type) 28 | { 29 | if (type == null) throw new ArgumentNullException("type"); 30 | if (typeof(TypeSerializer).IsAssignableFrom(type) == false) throw new ArgumentException(string.Format("Type '{0}' should inherit from '{1}'.", type, typeof(TypeSerializer)), "type"); 31 | 32 | this.SerializerType = type; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/GameDevWare.Serialization/TypeSerializerAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae695eaf5f73e6f4d838914b980e99c4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/WebSocket.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f7e78d3ab66d674e9434bda20108160 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/WebSocket/WebSocket.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee7e0021ecaa9d646b771cd901f1580b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Plugins/WebSocket/WebSocket.jslib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80a5354b23c34344c99d44a6f53d9d21 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: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | WebGL: WebGL 27 | second: 28 | enabled: 1 29 | settings: {} 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Client/Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f540e447da09d64caccbdec6506b58c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Prefabs/Camera.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4556b28dc3320444bb74ea514a2c0515 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/Prefabs/GameManager.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &7771954765428378636 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: 6598513022554827285} 12 | - component: {fileID: 358736737074737814} 13 | m_Layer: 0 14 | m_Name: GameManager 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &6598513022554827285 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 7771954765428378636} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 2.6416378, y: -9.30567, z: 7.253193} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 34 | --- !u!114 &358736737074737814 35 | MonoBehaviour: 36 | m_ObjectHideFlags: 0 37 | m_CorrespondingSourceObject: {fileID: 0} 38 | m_PrefabInstance: {fileID: 0} 39 | m_PrefabAsset: {fileID: 0} 40 | m_GameObject: {fileID: 7771954765428378636} 41 | m_Enabled: 1 42 | m_EditorHideFlags: 0 43 | m_Script: {fileID: 11500000, guid: 225260926c1080e438467b74723d9432, type: 3} 44 | m_Name: 45 | m_EditorClassIdentifier: 46 | ServerText: {fileID: 0} 47 | PrefabUnit: {fileID: 8035110164388584723, guid: b3f535edbee2a1940a69e49021e309fb, 48 | type: 3} 49 | -------------------------------------------------------------------------------- /Client/Assets/Prefabs/GameManager.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42cae13272b285e44875976c5b8d4cbf 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/Prefabs/Unit.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3f535edbee2a1940a69e49021e309fb 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2900b67f33cf74edfa6a509f76892327 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Scenes/SampleScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd501ae3f83fe46e196a07ab330723d6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/Scenes/SampleScene/NavMesh.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wenish/ColyseusNavmeshExample/38737e910e0530b00e5eeea18c591ec99d225dcc/Client/Assets/Scenes/SampleScene/NavMesh.asset -------------------------------------------------------------------------------- /Client/Assets/Scenes/SampleScene/NavMesh.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00389343d7b2d42edb22c9906b4a6e3b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Scenes/SampleScene/Terrain.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wenish/ColyseusNavmeshExample/38737e910e0530b00e5eeea18c591ec99d225dcc/Client/Assets/Scenes/SampleScene/Terrain.asset -------------------------------------------------------------------------------- /Client/Assets/Scenes/SampleScene/Terrain.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 707afc962b79f4ca08a773eaec8ac8dc 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3c8fe1245c57d04d931fd21c8980f7a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Scripts/Controllers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e069894defaf584381d358dacb6530d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Scripts/Controllers/ControllerCamera.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Game.Scripts; 3 | using Game.Models; 4 | 5 | namespace Game.Scripts.Controllers 6 | { 7 | public class ControllerCamera : MonoBehaviour 8 | { 9 | public GameManager GameManager; 10 | 11 | public async void Update() 12 | { 13 | // Exit Game 14 | if (Input.GetKey(KeyCode.Escape)) 15 | { 16 | Application.Quit(); 17 | #if UNITY_EDITOR 18 | UnityEditor.EditorApplication.isPlaying = false; 19 | #endif 20 | } 21 | 22 | if(Input.GetMouseButtonDown(1) && GameManager.GameRoom != null) 23 | { 24 | RaycastHit hit; 25 | Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); 26 | if(Physics.Raycast(ray, out hit, Mathf.Infinity)) 27 | { 28 | Debug.Log(hit.point); 29 | Player player = GameManager.Players[GameManager.GameRoom.SessionId]; 30 | await GameManager.GameRoom.Send(new 31 | { 32 | ACTION_TYPE = "UNIT_MOVE_TO", 33 | payload = new 34 | { 35 | hit.point.x, 36 | hit.point.z, 37 | player.idUnit 38 | } 39 | }); 40 | } 41 | } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Client/Assets/Scripts/Controllers/ControllerCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 037bb881fd36bfe4cb8f2a30ba6d2cb7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Scripts/Controllers/ControllerUnit.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Game.Scripts.Controllers 4 | { 5 | public class ControllerUnit : MonoBehaviour 6 | { 7 | public Vector3 DesiredPosition; 8 | public Vector3 DesiredRotation; 9 | public float SpeedLerp = .085f; 10 | public string Id = null; 11 | 12 | public void Start() 13 | { 14 | DesiredPosition = transform.position; 15 | } 16 | public void Update() 17 | { 18 | if (DesiredPosition != null) 19 | { 20 | var t = Time.deltaTime / SpeedLerp; 21 | transform.position = Vector3.Lerp(transform.position, DesiredPosition, t); 22 | } 23 | 24 | if (DesiredRotation != null) 25 | { 26 | var t = Time.deltaTime / SpeedLerp; 27 | 28 | float angle = Mathf.LerpAngle(transform.eulerAngles.y, DesiredRotation.y, t); 29 | transform.eulerAngles = new Vector3(0, angle, 0); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Client/Assets/Scripts/Controllers/ControllerUnit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 582e62b23dca8434ea1a6f377686e653 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Scripts/GameManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 225260926c1080e438467b74723d9432 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Scripts/StateHandlers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80baee61f2b27994b8ea661ffb5d587d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/Scripts/StateHandlers/StateHandlerPlayers.cs: -------------------------------------------------------------------------------- 1 | using Game.Models; 2 | using UnityEngine; 3 | using Game.Scripts.Controllers; 4 | 5 | namespace Game.Scripts.StateHandlers 6 | { 7 | public class StateHandlerPlayers 8 | { 9 | private StatePlayers _statePlayers; 10 | private GameManager _gameManager; 11 | public StateHandlerPlayers(StatePlayers statePlayers, GameManager gameManager) 12 | { 13 | _statePlayers = statePlayers; 14 | _gameManager = gameManager; 15 | _statePlayers.players.OnAdd += OnAdd; 16 | //_statePlayers.players.OnRemove += OnRemove; 17 | //_statePlayers.players.OnChange += OnChange; 18 | } 19 | 20 | private void OnAdd(Player player, string key) 21 | { 22 | _gameManager.Players.Add(key, player); 23 | Debug.Log("Player Add"); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Client/Assets/Scripts/StateHandlers/StateHandlerPlayers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79f2d5061ba5afd46a5e412d10d4c272 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/Scripts/StateHandlers/StateHandlerUnits.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d2c25f88d945974d8545b5f2312c3d0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f54d1bd14bd3ca042bd867b519fee8cc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Documentation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e7e8f5a82a3a134e91c54efd2274ea9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wenish/ColyseusNavmeshExample/38737e910e0530b00e5eeea18c591ec99d225dcc/Client/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b8d251f9af63b746bf2f7ffe00ebb9b 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Fonts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ab70aee4d56447429c680537fbf93ed 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Fonts/LiberationSans - OFL.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e59c59b81ab47f9b6ec5781fa725d2c 3 | timeCreated: 1484171296 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Fonts/LiberationSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wenish/ColyseusNavmeshExample/38737e910e0530b00e5eeea18c591ec99d225dcc/Client/Assets/TextMesh Pro/Fonts/LiberationSans.ttf -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Fonts/LiberationSans.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3265ab4bf004d28a9537516768c1c75 3 | timeCreated: 1484171297 4 | licenseType: Pro 5 | TrueTypeFontImporter: 6 | serializedVersion: 2 7 | fontSize: 16 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | use2xBehaviour: 0 13 | fontNames: [] 14 | fallbackFontReferences: [] 15 | customCharacters: 16 | fontRenderingMode: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 243e06394e614e5d99fab26083b707fa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Fonts & Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 731f1baa9d144a9897cb1d341c2092b8 3 | folderAsset: yes 4 | timeCreated: 1442040525 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Drop Shadow.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e73a58f6e2794ae7b1b7e50b7fb811b0 3 | timeCreated: 1484172806 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e498d1c8094910479dc3e1b768306a4 3 | timeCreated: 1484171803 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79459efec17a4d00a321bdcc27bbc385 3 | timeCreated: 1484172856 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f586378b4e144a9851e7b34d9b748ee 3 | timeCreated: 1484171803 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/LineBreaking Following Characters.txt: -------------------------------------------------------------------------------- 1 | )]}〕〉》」』】〙〗〟’”⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、%,.:;。!?]):;=}¢°"†‡℃〆%,. -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/LineBreaking Following Characters.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fade42e8bc714b018fac513c043d323b 3 | timeCreated: 1425440388 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/LineBreaking Leading Characters.txt: -------------------------------------------------------------------------------- 1 | ([{〔〈《「『【〘〖〝‘“⦅«$—…‥〳〴〵\[({£¥"々〇〉》」$⦆¥₩ # -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/LineBreaking Leading Characters.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d82c1b31c7e74239bff1220585707d2b 3 | timeCreated: 1425440388 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99f836c9cb9345dba2e72c4a1f2d0695 3 | folderAsset: yes 4 | timeCreated: 1436068007 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Custom-Atlas.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48bb5f55d8670e349b6e614913f9d910 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e3b057af24249748ff873be7fafee47 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_Bitmap.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 128e987d567d4e2c824d754223b3f3b0 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd89cf5b9246416f84610a006f916af7 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Masking.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc1ede39bf3643ee8e493720e4259791 3 | timeCreated: 1463704911 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a02a7d8c237544f1962732b55a9aebf1 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe393ace9b354375a9cb14cdbbc28be4 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85187c2149c549c5b33f0cdb02836b17 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF-Surface.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7ada0af4f174f0694ca6a487b8f543d 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_SDF.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68e6db2ebdc24f95958faec2be5558d6 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMP_Sprite.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf81c85f95fe47e1a27f6ae460cf182c 3 | timeCreated: 1450517184 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 407bc68d299748449bbf7f48ee690f8d 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3997e2241185407d80309a82f9148466 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Shaders/TMPro_Surface.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d930090c0cd643c7b55f19a38538c162 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Sprite Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 512a49d95c0c4332bdd98131869c23c9 3 | folderAsset: yes 4 | timeCreated: 1441876896 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Sprite Assets/EmojiOne.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c41005c129ba4d66911b75229fd70b45 3 | timeCreated: 1480316912 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Style Sheets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4aecb92fff08436c8303b10eab8da368 3 | folderAsset: yes 4 | timeCreated: 1441876950 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/Style Sheets/Default Style Sheet.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f952c082cb03451daed3ee968ac6c63e 3 | timeCreated: 1432805430 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/TMP Settings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: 2705215ac5b84b70bacc50632be6e391, type: 3} 13 | m_Name: TMP Settings 14 | m_EditorClassIdentifier: 15 | m_enableWordWrapping: 1 16 | m_enableKerning: 1 17 | m_enableExtraPadding: 0 18 | m_enableTintAllSprites: 0 19 | m_enableParseEscapeCharacters: 1 20 | m_EnableRaycastTarget: 1 21 | m_GetFontFeaturesAtRuntime: 1 22 | m_missingGlyphCharacter: 0 23 | m_warningsDisabled: 1 24 | m_defaultFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 25 | m_defaultFontAssetPath: Fonts & Materials/ 26 | m_defaultFontSize: 36 27 | m_defaultAutoSizeMinRatio: 0.5 28 | m_defaultAutoSizeMaxRatio: 2 29 | m_defaultTextMeshProTextContainerSize: {x: 20, y: 5} 30 | m_defaultTextMeshProUITextContainerSize: {x: 200, y: 50} 31 | m_autoSizeTextContainer: 0 32 | m_fallbackFontAssets: [] 33 | m_matchMaterialPreset: 1 34 | m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45, 35 | type: 2} 36 | m_defaultSpriteAssetPath: Sprite Assets/ 37 | m_defaultColorGradientPresetsPath: Color Gradient Presets/ 38 | m_enableEmojiSupport: 1 39 | m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e, 40 | type: 2} 41 | m_leadingCharacters: {fileID: 4900000, guid: d82c1b31c7e74239bff1220585707d2b, type: 3} 42 | m_followingCharacters: {fileID: 4900000, guid: fade42e8bc714b018fac513c043d323b, 43 | type: 3} 44 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Resources/TMP Settings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f5b5dff67a942289a9defa416b206f3 3 | timeCreated: 1436653997 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0603b6d5186471b96c778c3949c7ce2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Sprites/EmojiOne Attribution.txt: -------------------------------------------------------------------------------- 1 | This sample of beautiful emojis are provided by EmojiOne https://www.emojione.com/ 2 | 3 | Please visit their website to view the complete set of their emojis and review their licensing terms. -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Sprites/EmojiOne Attribution.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 381dcb09d5029d14897e55f98031fca5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Sprites/EmojiOne.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f05276190cf498a8153f6cbe761d4e6 3 | timeCreated: 1480316860 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Client/Assets/TextMesh Pro/Sprites/EmojiOne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wenish/ColyseusNavmeshExample/38737e910e0530b00e5eeea18c591ec99d225dcc/Client/Assets/TextMesh Pro/Sprites/EmojiOne.png -------------------------------------------------------------------------------- /Client/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.2.16", 4 | "com.unity.ide.rider": "1.1.4", 5 | "com.unity.ide.vscode": "1.1.4", 6 | "com.unity.test-framework": "1.1.11", 7 | "com.unity.textmeshpro": "2.0.1", 8 | "com.unity.timeline": "1.2.12", 9 | "com.unity.ugui": "1.0.0", 10 | "com.unity.modules.ai": "1.0.0", 11 | "com.unity.modules.androidjni": "1.0.0", 12 | "com.unity.modules.animation": "1.0.0", 13 | "com.unity.modules.assetbundle": "1.0.0", 14 | "com.unity.modules.audio": "1.0.0", 15 | "com.unity.modules.cloth": "1.0.0", 16 | "com.unity.modules.director": "1.0.0", 17 | "com.unity.modules.imageconversion": "1.0.0", 18 | "com.unity.modules.imgui": "1.0.0", 19 | "com.unity.modules.jsonserialize": "1.0.0", 20 | "com.unity.modules.particlesystem": "1.0.0", 21 | "com.unity.modules.physics": "1.0.0", 22 | "com.unity.modules.physics2d": "1.0.0", 23 | "com.unity.modules.screencapture": "1.0.0", 24 | "com.unity.modules.terrain": "1.0.0", 25 | "com.unity.modules.terrainphysics": "1.0.0", 26 | "com.unity.modules.tilemap": "1.0.0", 27 | "com.unity.modules.ui": "1.0.0", 28 | "com.unity.modules.uielements": "1.0.0", 29 | "com.unity.modules.umbra": "1.0.0", 30 | "com.unity.modules.unityanalytics": "1.0.0", 31 | "com.unity.modules.unitywebrequest": "1.0.0", 32 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 33 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 34 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 35 | "com.unity.modules.unitywebrequestwww": "1.0.0", 36 | "com.unity.modules.vehicles": "1.0.0", 37 | "com.unity.modules.video": "1.0.0", 38 | "com.unity.modules.vr": "1.0.0", 39 | "com.unity.modules.wind": "1.0.0", 40 | "com.unity.modules.xr": "1.0.0" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Client/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 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /Client/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 | -------------------------------------------------------------------------------- /Client/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: 11 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: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /Client/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 9fc0d4010bbf28b4594072e72b8655ab 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /Client/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /Client/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 | -------------------------------------------------------------------------------- /Client/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: 4 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_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /Client/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Client/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.3.3f1 2 | m_EditorVersionWithRevision: 2019.3.3f1 (7ceaae5f7503) 3 | -------------------------------------------------------------------------------- /Client/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Client/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Client/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_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /Client/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Client/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 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jonas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ColyseusNavmeshExample 2 | 3 | ## Server 4 | 5 | Using [Colyseus](https://github.com/colyseus/colyseus) as authorative Game Server. 6 | 7 | Using the npm [navmesh](https://github.com/mikewesthad/navmesh) library for pathfinding. 8 | 9 | The navmesh which is the base for the pathfinding calculation is generated from Unity. 10 | 11 | ## Client 12 | 13 | Using the [Colyseus Unity3d](https://github.com/colyseus/colyseus-unity3d) SDK for connecting to the server. 14 | 15 | Using Unity3d for display the Game World. -------------------------------------------------------------------------------- /Server/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port -------------------------------------------------------------------------------- /Server/build/modelGenerator.js: -------------------------------------------------------------------------------- 1 | const modelNamespace = 'Game.Models' 2 | const outputFolder = '../Client/Assets/Models' 3 | 4 | const exec = require('child_process').exec 5 | 6 | var files = 7 | [ 8 | //models 9 | 'src/rooms/match/models/player.ts', 10 | 'src/rooms/match/models/position.ts', 11 | 'src/rooms/match/models/unit.ts', 12 | //states 13 | 'src/rooms/match/state/index.ts', 14 | 'src/rooms/match/state/statePlayers.ts', 15 | 'src/rooms/match/state/stateUnits.ts' 16 | ] 17 | 18 | var filesString = '' 19 | 20 | files.forEach(filePath => { 21 | filesString = filesString + filePath + ' ' 22 | }) 23 | 24 | var command = `npx schema-codegen ${filesString} --output ${outputFolder} --csharp --namespace ${modelNamespace}` 25 | 26 | exec(command, 27 | function (error, stdout, stderr) { 28 | console.log('stdout: ' + stdout); 29 | console.log('stderr: ' + stderr); 30 | if (error !== null) { 31 | console.log('exec error: ' + error) 32 | } 33 | }) -------------------------------------------------------------------------------- /Server/nodemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "watch": ["src"], 3 | "ext": "ts", 4 | "exec": "ts-node src/index.ts" 5 | } -------------------------------------------------------------------------------- /Server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "start": "tsc && node dist/index.js", 8 | "dev": "nodemon", 9 | "test": "echo \"Error: no test specified\" && exit 1", 10 | "generateClasses": "node build/modelGenerator.js" 11 | }, 12 | "author": "", 13 | "license": "MIT", 14 | "devDependencies": { 15 | "nodemon": "^2.0.2", 16 | "ts-node": "^8.6.2", 17 | "typescript": "^3.8.3" 18 | }, 19 | "dependencies": { 20 | "@colyseus/monitor": "^0.12.1", 21 | "bignumber.js": "^9.0.0", 22 | "colyseus": "^0.12.3", 23 | "express": "^4.17.1", 24 | "fs-extra": "^8.1.0", 25 | "navmesh": "^2.0.3", 26 | "shortid": "^2.2.15", 27 | "wavefront-obj-parser": "^2.0.1" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Server/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Server } from "colyseus" 2 | import { monitor } from '@colyseus/monitor'; 3 | import { createServer } from "http" 4 | import express from "express" 5 | 6 | import rooms from './rooms' 7 | 8 | const port = Number(process.env.port) || 3000 9 | 10 | const app = express() 11 | app.use(express.json()) 12 | 13 | const gameServer = new Server({ 14 | server: createServer(app) 15 | }); 16 | 17 | gameServer.define('match', rooms.Match) 18 | 19 | const monitorUrl = '/colyseus' 20 | app.use(monitorUrl, monitor()); 21 | 22 | gameServer.listen(port) 23 | 24 | console.log(`Game Server started on http://localhost:${ port }`); 25 | console.log(`Monitor started on http://localhost:${ port }${monitorUrl}`); -------------------------------------------------------------------------------- /Server/src/rooms/index.ts: -------------------------------------------------------------------------------- 1 | import Match from './match' 2 | 3 | export default { 4 | Match 5 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/actions/actionPlayerAdd.ts: -------------------------------------------------------------------------------- 1 | import { Action } from "./index"; 2 | import { IState } from "../state"; 3 | import { Client } from "colyseus"; 4 | import { Unit } from "../models/unit"; 5 | import { Player } from "../models/player"; 6 | import { PLAYER_ADD } from "./actionTypes"; 7 | 8 | export const actionPlayerAdd: Action = (room, state, isServer, client, payload) => { 9 | try { 10 | if (!isServer) throw 'action can only be called from server' 11 | if (!client) throw 'no client was passed' 12 | 13 | const unit = Unit.generate() 14 | 15 | state.stateUnits.addUnit(unit) 16 | 17 | var player = new Player(client.sessionId) 18 | player.idUnit = unit.id 19 | state.statePlayers.addPlayer(player) 20 | } catch (err) { 21 | console.error('Error', PLAYER_ADD, err) 22 | } 23 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/actions/actionPlayerRemove.ts: -------------------------------------------------------------------------------- 1 | import { Action } from "../actions/index"; 2 | import { IState } from "../state"; 3 | import { Client } from "colyseus"; 4 | import { PLAYER_REMOVE } from "./actionTypes"; 5 | import { Player } from "../models/player"; 6 | 7 | export const actionPlayerRemove: Action = (room, state, isServer, client, payload) => { 8 | try { 9 | if (!isServer) throw 'action can only be called from server' 10 | if (!client) throw 'no client was passed' 11 | 12 | const player: Player = state.statePlayers.players[client.sessionId] 13 | 14 | console.log(player) 15 | if (player?.idUnit) { 16 | state.stateUnits.removeUnit(player.idUnit) 17 | } 18 | 19 | state.statePlayers.removePlayer(client.sessionId) 20 | } catch (err) { 21 | console.error('Error', PLAYER_REMOVE, err) 22 | } 23 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/actions/actionTypes.ts: -------------------------------------------------------------------------------- 1 | //A 2 | //B 3 | //C 4 | //D 5 | //E 6 | //F 7 | //G 8 | //H 9 | //I 10 | //J 11 | //K 12 | //L 13 | //M 14 | export const UNIT_MOVE_TO: string = 'UNIT_MOVE_TO' 15 | //N 16 | //O 17 | //P 18 | export const PLAYER_ADD: string = 'PLAYER_ADD' 19 | export const PLAYER_REMOVE: string = 'PLAYER_REMOVE' 20 | //Q 21 | //R 22 | //S 23 | //T' 24 | //U 25 | //V 26 | //W 27 | //X 28 | //Y 29 | //Z -------------------------------------------------------------------------------- /Server/src/rooms/match/actions/actionUnitMoveTo.ts: -------------------------------------------------------------------------------- 1 | import { Action } from "../actions/index"; 2 | import { IState } from "../state"; 3 | import { Client } from "colyseus"; 4 | import { UNIT_MOVE_TO } from "./actionTypes"; 5 | import { Player } from "../models/player"; 6 | import { Unit } from "../models/unit"; 7 | import { Position } from "../models/position"; 8 | 9 | /* 10 | { 11 | "ACTION_TYPE": "UNIT_MOVE_TO", 12 | "payload": { 13 | "x": 2, 14 | "z": 8, 15 | "idUnit": "nGjQqMy5" 16 | } 17 | } 18 | */ 19 | 20 | export const actionUnitMoveTo: Action = (room, state, isServer, client, payload) => { 21 | try { 22 | if(!payload) throw 'payload is not defined' 23 | if(!payload.x) throw 'payload.x is not defined' 24 | if(!payload.z) throw 'payload.z is not defined' 25 | if(!payload.idUnit) throw 'payload.idUnit is not defined' 26 | 27 | if(!isServer) { 28 | const player: Player = state.statePlayers.players[client.sessionId] 29 | if(!player) throw 'could not find player' 30 | 31 | if(player.idUnit != payload.idUnit) throw 'player can not move an unit from another player' 32 | } 33 | 34 | const unit: Unit = state.stateUnits.units[payload.idUnit] 35 | if(!unit) throw 'could not find unit' 36 | 37 | const destination: Position = new Position(payload.x, 0, payload.z) 38 | 39 | const foundPath: any = state.navMesh.findPath({ x: unit.position.x, y: unit.position.z }, { x: destination.x, y: destination.z }); 40 | if (!foundPath || !foundPath.length) throw 'No path found' 41 | 42 | foundPath.shift() 43 | 44 | const path: Position[] = [] 45 | 46 | foundPath.forEach(item => { 47 | path.push(new Position(item.x, 0, item.y)) 48 | }); 49 | 50 | unit.setMoveTo(path) 51 | } catch (err) { 52 | console.error('Error', UNIT_MOVE_TO, err) 53 | } 54 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/actions/index.ts: -------------------------------------------------------------------------------- 1 | import { IState } from "../state" 2 | import * as actionTypes from './actionTypes' 3 | import { Client, Room } from 'colyseus' 4 | import { actionPlayerAdd } from './actionPlayerAdd' 5 | import { actionPlayerRemove } from './actionPlayerRemove' 6 | import { actionUnitMoveTo } from './actionUnitMoveTo' 7 | 8 | const actions: IActionTree = { 9 | [actionTypes.PLAYER_ADD]: actionPlayerAdd, 10 | [actionTypes.PLAYER_REMOVE]: actionPlayerRemove, 11 | [actionTypes.UNIT_MOVE_TO]: actionUnitMoveTo 12 | } 13 | export default actions 14 | 15 | export interface IActionTree { 16 | [key: string]: Action 17 | } 18 | 19 | export type Action = (room: Room, state: S, isServer: boolean, client?: R, payload?: any) => any; -------------------------------------------------------------------------------- /Server/src/rooms/match/index.ts: -------------------------------------------------------------------------------- 1 | import http from "http"; 2 | import { Room, Client } from "colyseus"; 3 | 4 | import { State, IState } from './state'; 5 | 6 | import actions, { Action } from './actions' 7 | import * as actionTypes from './actions/actionTypes'; 8 | import utility from "../../utility"; 9 | 10 | export default class Match extends Room { 11 | constructor () { 12 | console.log('----- NEW MATCH ROOM -----') 13 | super(); 14 | this.setState(new State()); 15 | } 16 | 17 | // When room is initialized 18 | async onCreate (options: any) { 19 | const navMesh = await utility.loadNavMesh('SampleSceneNavMesh') 20 | this.state.navMesh = navMesh; 21 | console.log('navmesh loaded') 22 | this.setPatchRate(1000 / 30); 23 | this.setSimulationInterval(() => this.update()); 24 | } 25 | 26 | // Authorize client based on provided options before WebSocket handshake is complete 27 | onAuth (client: Client, options: any, request: http.IncomingMessage) { 28 | return true; 29 | } 30 | 31 | // When client successfully join the room 32 | onJoin (client: Client, options: any, auth: any) { 33 | const actionPlayerAdd: Action = actions[actionTypes.PLAYER_ADD] 34 | actionPlayerAdd(this, this.state, true, client, null) 35 | } 36 | 37 | // When a client sends a message 38 | onMessage (client: Client, message: any) { 39 | console.log(client.sessionId) 40 | console.log(message) 41 | if (actions[message?.ACTION_TYPE]) { 42 | const action = actions[message.ACTION_TYPE] 43 | action(this, this.state, false, client, message.payload) 44 | } else { 45 | console.log('There is no action with this action type:', message?.ACTION_TYPE) 46 | } 47 | } 48 | 49 | // When a client leaves the room 50 | onLeave (client: Client, consented: boolean) { 51 | const actionPlayerRemove: Action = actions[actionTypes.PLAYER_REMOVE] 52 | actionPlayerRemove(this, this.state, true, client, null) 53 | } 54 | 55 | // Cleanup callback, called after there are no more clients in the room. (see `autoDispose`) 56 | onDispose () { } 57 | 58 | update () { 59 | for (var id in this.state?.stateUnits?.units) { 60 | this.state?.stateUnits?.units[id]?.update(this.clock.deltaTime) 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/models/player.ts: -------------------------------------------------------------------------------- 1 | import { Schema, type } from '@colyseus/schema' 2 | 3 | export class Player extends Schema { 4 | @type('string') public id: string 5 | @type('string') public idUnit: string 6 | 7 | constructor (id: string) { 8 | super(); 9 | this.id = id 10 | } 11 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/models/position.ts: -------------------------------------------------------------------------------- 1 | import { Schema, type } from "@colyseus/schema"; 2 | 3 | export class Position extends Schema { 4 | @type('number') 5 | public x: number 6 | @type('number') 7 | public y: number 8 | @type('number') 9 | public z: number 10 | 11 | constructor ( 12 | x: number, 13 | y: number, 14 | z: number, 15 | ) { 16 | super() 17 | this.x = x; 18 | this.y = y; 19 | this.z = z; 20 | } 21 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/state/index.ts: -------------------------------------------------------------------------------- 1 | import { Schema, type } from "@colyseus/schema" 2 | 3 | import { StatePlayers, IStatePlayers } from "./statePlayers" 4 | import { StateUnits, IStateUnits } from "./stateUnits" 5 | 6 | export class State extends Schema implements IState { 7 | @type(StatePlayers) public statePlayers: IStatePlayers = new StatePlayers() 8 | @type(StateUnits) public stateUnits: IStateUnits = new StateUnits() 9 | public navMesh: any; 10 | } 11 | 12 | export interface IState extends Schema { 13 | statePlayers: IStatePlayers 14 | stateUnits: IStateUnits 15 | navMesh: any 16 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/state/statePlayers.ts: -------------------------------------------------------------------------------- 1 | import { Schema, type, MapSchema } from "@colyseus/schema" 2 | import { Player } from '../models/player' 3 | 4 | export class StatePlayers extends Schema implements IStatePlayers { 5 | @type({ map: Player }) 6 | public players: MapSchema = new MapSchema(); 7 | 8 | public addPlayer (player: Player): void { 9 | this.players[player.id] = player 10 | console.log('added player') 11 | } 12 | 13 | public removePlayer (idPlayer: string): void { 14 | delete this.players[idPlayer] 15 | console.log('removed player') 16 | } 17 | } 18 | 19 | export interface IStatePlayers extends Schema { 20 | players: MapSchema 21 | 22 | addPlayer (player: Player): void 23 | removePlayer (idPlayer: string): void 24 | } -------------------------------------------------------------------------------- /Server/src/rooms/match/state/stateUnits.ts: -------------------------------------------------------------------------------- 1 | import { Schema, type, MapSchema } from "@colyseus/schema" 2 | import { Unit } from '../models/unit' 3 | 4 | export class StateUnits extends Schema implements IStateUnits { 5 | @type({ map: Unit }) 6 | public units: MapSchema = new MapSchema(); 7 | 8 | public addUnit (unit: Unit): void { 9 | this.units[unit.id] = unit 10 | console.log('added unit') 11 | } 12 | 13 | public removeUnit (idUnit: string): void { 14 | delete this.units[idUnit] 15 | console.log('removed unit') 16 | } 17 | } 18 | 19 | export interface IStateUnits extends Schema { 20 | units: MapSchema 21 | 22 | addUnit (unit: Unit): void 23 | removeUnit (idUnit: string): void 24 | } -------------------------------------------------------------------------------- /Server/src/utility/clamp.ts: -------------------------------------------------------------------------------- 1 | export function clamp(value: number, min: number, max: number) { 2 | return value < min ? min : value > max ? max : value; 3 | } -------------------------------------------------------------------------------- /Server/src/utility/index.ts: -------------------------------------------------------------------------------- 1 | import { distanceBetween } from './vector2' 2 | import { clamp } from './clamp' 3 | import { lerp } from './lerp' 4 | import { loadNavMesh } from './loadNavMesh' 5 | 6 | export default { 7 | distanceBetween, 8 | clamp, 9 | lerp, 10 | loadNavMesh 11 | } -------------------------------------------------------------------------------- /Server/src/utility/lerp.ts: -------------------------------------------------------------------------------- 1 | export function lerp(currentPosition: number, targetPosition: number, t: number): number { 2 | return currentPosition + t * (targetPosition - currentPosition) 3 | } -------------------------------------------------------------------------------- /Server/src/utility/loadNavMesh.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs-extra' 2 | import wavefrontObjParser from 'wavefront-obj-parser' 3 | import NavMesh from 'navmesh'; 4 | 5 | export async function loadNavMesh(fileNameNavMesh: string) { 6 | const fileNavMesh = await fs.readFile(`./data/${fileNameNavMesh}.obj`, 'utf8') 7 | var jsonNavMesh = wavefrontObjParser(fileNavMesh) 8 | const meshPolygonPoints = [] 9 | const vertexPositions = jsonNavMesh.vertexPositions 10 | const array = jsonNavMesh.vertexPositionIndices 11 | for (let index = 0; index < array.length; index += 4) { 12 | const aIndex = array[index]; 13 | const bIndex = array[index + 1] 14 | const cIndex = array[index + 2] 15 | meshPolygonPoints.push([ 16 | { 17 | x: vertexPositions[aIndex * 3], 18 | y: vertexPositions[(aIndex * 3) + 2] 19 | }, 20 | { 21 | x: vertexPositions[bIndex * 3], 22 | y: vertexPositions[(bIndex * 3) + 2] 23 | }, 24 | { 25 | x: vertexPositions[cIndex * 3], 26 | y: vertexPositions[(cIndex * 3) + 2] 27 | } 28 | ]) 29 | } 30 | const navMesh = new NavMesh(meshPolygonPoints); 31 | return navMesh 32 | } -------------------------------------------------------------------------------- /Server/src/utility/vector2.ts: -------------------------------------------------------------------------------- 1 | import BigNumber from "bignumber.js" 2 | 3 | export function distanceBetween(currentPostionX: number, currentPostionY: number, targetPositionX: number, targetPositionY: number): number { 4 | var a = new BigNumber(currentPostionX).minus(targetPositionX) 5 | var b = new BigNumber(currentPostionY).minus(targetPositionY) 6 | var aProduct = a.multipliedBy(a) 7 | var bProduct = b.multipliedBy(b) 8 | var abSum = aProduct.plus(bProduct) 9 | var distance = abSum.sqrt().toNumber() 10 | return distance 11 | } -------------------------------------------------------------------------------- /Server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "./dist/", 6 | "lib": [ 7 | "es2016", 8 | "dom" 9 | ], 10 | "experimentalDecorators": true, 11 | "noImplicitAny": false, 12 | "sourceMap": false, 13 | "resolveJsonModule": true, 14 | "esModuleInterop": true, 15 | "forceConsistentCasingInFileNames": true 16 | } 17 | } --------------------------------------------------------------------------------