├── .github └── workflows │ ├── wsnet2-dashboard.yml │ ├── wsnet2-dotnet.yml │ └── wsnet2-server.yml ├── .gitignore ├── LICENSE ├── README.md ├── _doc ├── README.md ├── csharp_client.md ├── docker.md ├── logger.md ├── query.md ├── room.md ├── roomoption.md ├── sample_game_s.png ├── sample_title_s.png ├── serializable.md ├── serializer.md ├── server_setup.md ├── user_auth.md ├── wsnet2client.md └── wsnet2settings.md ├── server ├── .gitignore ├── Dockerfile ├── Makefile ├── README.md ├── _doc │ ├── wsnet2-external.drawio.png │ └── wsnet2-internal.drawio.png ├── auth │ ├── auth.go │ ├── auth_test.go │ ├── mackey.go │ └── mackey_test.go ├── bin │ └── .gitkeep ├── binary │ ├── event.go │ ├── marshal.go │ ├── marshal_test.go │ ├── msg.go │ ├── msg_test.go │ ├── unmarshal_recursive.go │ ├── unmarshal_recursive_test.go │ ├── unsafe_string118.go │ └── unsafe_string120.go ├── client │ ├── README.md │ ├── accessinfo.go │ ├── connection.go │ ├── query.go │ ├── request.go │ ├── room.go │ └── room_test.go ├── cmd │ ├── wsnet2-bot │ │ ├── cmd │ │ │ ├── cover_test.go │ │ │ ├── load.go │ │ │ ├── root.go │ │ │ ├── scenario.go │ │ │ ├── soak.go │ │ │ └── watch.go │ │ └── main.go │ ├── wsnet2-game │ │ └── main.go │ ├── wsnet2-hub │ │ └── main.go │ ├── wsnet2-lobby │ │ └── main.go │ └── wsnet2-tool │ │ ├── cmd │ │ ├── apps.go │ │ ├── kick.go │ │ ├── oldroom.go │ │ ├── oldrooms.go │ │ ├── room.go │ │ ├── rooms.go │ │ ├── rooms_test.go │ │ ├── root.go │ │ └── servers.go │ │ └── main.go ├── common │ ├── const.go │ ├── grpcpool.go │ ├── props.go │ ├── ringbuf.go │ └── ringbuf_test.go ├── compose-multihost.yaml ├── compose.yaml ├── config │ ├── config.go │ ├── config_test.go │ └── testdata │ │ ├── dbauth │ │ └── test.toml ├── docker.toml ├── game │ ├── client.go │ ├── errors.go │ ├── interface.go │ ├── msg.go │ ├── peer.go │ ├── repository.go │ ├── repository_test.go │ ├── room.go │ └── service │ │ ├── grpc.go │ │ ├── pprof.go │ │ ├── service.go │ │ └── websocket.go ├── go.mod ├── go.sum ├── hub │ ├── hub.go │ ├── repository.go │ └── service │ │ ├── grpc.go │ │ ├── pprof.go │ │ ├── service.go │ │ └── websocket.go ├── lobby │ ├── README.md │ ├── api_structs.go │ ├── errors.go │ ├── game_cache.go │ ├── game_cache_test.go │ ├── hub_cache.go │ ├── hub_cache_test.go │ ├── main_test.go │ ├── prop_query.go │ ├── prop_query_test.go │ ├── room.go │ ├── room_cache.go │ └── service │ │ ├── api.go │ │ ├── pprof.go │ │ └── service.go ├── log │ ├── log.go │ └── log_test.go ├── metrics │ └── metrics.go ├── pb │ ├── app.proto │ ├── clientinfo.proto │ ├── clone.go │ ├── clone_test.go │ ├── gameservice.proto │ ├── roominfo.go │ ├── roominfo.proto │ ├── roomoption.proto │ ├── timestamp.go │ ├── timestamp.proto │ └── types.go ├── sql │ ├── 10-schema.sql │ ├── 90-docker.sql │ └── 99-update-trigger.sh ├── staticcheck.conf └── version.go ├── wsnet2-dashboard ├── README-ja.md ├── README.md ├── backend │ ├── .env │ ├── .eslintrc.js │ ├── .gitignore │ ├── .prettierrc.json │ ├── Dockerfile │ ├── Makefile │ ├── README-ja.md │ ├── README.md │ ├── go-binary │ │ ├── go.mod │ │ ├── go.sum │ │ └── main.go │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── context.ts │ │ ├── index.ts │ │ ├── plugins │ │ │ ├── binary.d.ts │ │ │ └── binary.js │ │ ├── routes │ │ │ ├── game.ts │ │ │ └── overview.ts │ │ ├── schema.ts │ │ └── types │ │ │ ├── index.ts │ │ │ ├── models │ │ │ ├── app.ts │ │ │ ├── game_server.ts │ │ │ ├── hub.ts │ │ │ ├── hub_server.ts │ │ │ ├── index.ts │ │ │ ├── player_log.ts │ │ │ ├── room.ts │ │ │ ├── room_history.ts │ │ │ └── scalars.ts │ │ │ └── resolvers │ │ │ ├── appResolver.ts │ │ │ ├── gameServerResolver.ts │ │ │ ├── hubResolver.ts │ │ │ ├── hubServerResolver.ts │ │ │ ├── index.ts │ │ │ ├── roomHistoryResolver.ts │ │ │ └── roomResolver.ts │ ├── tsconfig.eslint.json │ └── tsconfig.json ├── compose.yaml ├── frontend │ ├── .env │ ├── .gitignore │ ├── Dockerfile │ ├── Makefile │ ├── README-ja.md │ ├── README.md │ ├── apollo.config.js │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── apolloClient.ts │ │ ├── assets │ │ │ ├── logo.png │ │ │ └── logo.svg │ │ ├── components │ │ │ ├── AppsDataTable.vue │ │ │ ├── ClientsDataTable.vue │ │ │ ├── PairwiseDynamicTags.vue │ │ │ ├── PropsFilter.vue │ │ │ ├── RoomDetails.vue │ │ │ ├── RoomHistoryDataTable.vue │ │ │ ├── RoomsDataTable.vue │ │ │ ├── RoomsDebugMenu.vue │ │ │ ├── ServersDataTable.vue │ │ │ ├── SliderRange.vue │ │ │ └── UnknownObject.vue │ │ ├── env.d.ts │ │ ├── main.ts │ │ ├── router.ts │ │ ├── store │ │ │ ├── apps.ts │ │ │ ├── index.ts │ │ │ ├── overview.ts │ │ │ ├── roomHistories.ts │ │ │ ├── roomInfo.ts │ │ │ ├── rooms.ts │ │ │ ├── servers.ts │ │ │ └── settings.ts │ │ ├── styles │ │ │ └── _variables.scss │ │ ├── utils │ │ │ └── render.ts │ │ └── views │ │ │ ├── Apps.vue │ │ │ ├── GameServers.vue │ │ │ ├── Home.vue │ │ │ ├── HubServers.vue │ │ │ ├── RoomHistories.vue │ │ │ ├── Rooms.vue │ │ │ └── Settings.vue │ ├── tsconfig.json │ └── vite.config.ts └── images │ ├── demo.gif │ └── vscode.png ├── wsnet2-dotnet ├── .gitignore ├── README.md ├── WSNet2.Client │ ├── Client.cs │ └── WSNet2.Client.csproj ├── WSNet2.Core.Test │ ├── AuthDataGeneratorTest.cs │ ├── ClientTests.cs │ ├── EvPongTest.cs │ ├── EvResponseTest.cs │ ├── LoggerTests.cs │ ├── QueryTests.cs │ ├── SerializeTests.cs │ └── WSNet2.Core.Test.csproj ├── WSNet2.Sample │ ├── AppLogger.cs │ ├── BotClient.cs │ ├── MasterClient.cs │ ├── Program.cs │ └── WSNet2.Sample.csproj ├── WSNet2.sln └── build-commit ├── wsnet2-unity-mirror ├── .gitignore ├── Assets ├── Packages ├── ProjectSettings └── link.sh └── wsnet2-unity ├── .gitignore ├── Assets ├── MessagePack.meta ├── MessagePack │ ├── Scripts.meta │ └── Scripts │ │ ├── Annotations.meta │ │ ├── Annotations │ │ ├── Attributes.cs │ │ ├── Attributes.cs.meta │ │ ├── IMessagePackSerializationCallbackReceiver.cs │ │ └── IMessagePackSerializationCallbackReceiver.cs.meta │ │ ├── BitOperations.cs │ │ ├── BitOperations.cs.meta │ │ ├── BufferWriter.cs │ │ ├── BufferWriter.cs.meta │ │ ├── ExtensionHeader.cs │ │ ├── ExtensionHeader.cs.meta │ │ ├── ExtensionResult.cs │ │ ├── ExtensionResult.cs.meta │ │ ├── Formatters.meta │ │ ├── Formatters │ │ ├── CollectionFormatter.cs │ │ ├── CollectionFormatter.cs.meta │ │ ├── CollectionHelpers`2.cs │ │ ├── CollectionHelpers`2.cs.meta │ │ ├── DateTimeFormatters.cs │ │ ├── DateTimeFormatters.cs.meta │ │ ├── DictionaryFormatter.cs │ │ ├── DictionaryFormatter.cs.meta │ │ ├── DynamicObjectTypeFallbackFormatter.cs │ │ ├── DynamicObjectTypeFallbackFormatter.cs.meta │ │ ├── EnumAsStringFormatter`1.cs │ │ ├── EnumAsStringFormatter`1.cs.meta │ │ ├── GenericEnumFormatter`1.cs │ │ ├── GenericEnumFormatter`1.cs.meta │ │ ├── IMessagePackFormatter`1.cs │ │ ├── IMessagePackFormatter`1.cs.meta │ │ ├── IgnoreFormatter`1.cs │ │ ├── IgnoreFormatter`1.cs.meta │ │ ├── MultiDimensionalArrayFormatter.cs │ │ ├── MultiDimensionalArrayFormatter.cs.meta │ │ ├── NilFormatter.cs │ │ ├── NilFormatter.cs.meta │ │ ├── NullableFormatter.cs │ │ ├── NullableFormatter.cs.meta │ │ ├── PrimitiveObjectFormatter.cs │ │ ├── PrimitiveObjectFormatter.cs.meta │ │ ├── StandardClassLibraryFormatter.cs │ │ ├── StandardClassLibraryFormatter.cs.meta │ │ ├── TypelessFormatter.cs │ │ ├── TypelessFormatter.cs.meta │ │ ├── UnsafeBinaryFormatters.cs │ │ └── UnsafeBinaryFormatters.cs.meta │ │ ├── HashCode.cs │ │ ├── HashCode.cs.meta │ │ ├── IFormatterResolver.cs │ │ ├── IFormatterResolver.cs.meta │ │ ├── Internal.meta │ │ ├── Internal │ │ ├── AsymmetricKeyHashTable.cs │ │ ├── AsymmetricKeyHashTable.cs.meta │ │ ├── AutomataDictionary.cs │ │ ├── AutomataDictionary.cs.meta │ │ ├── ByteArrayStringHashTable.cs │ │ ├── ByteArrayStringHashTable.cs.meta │ │ ├── CodeGenHelpers.cs │ │ ├── CodeGenHelpers.cs.meta │ │ ├── DateTimeConstants.cs │ │ ├── DateTimeConstants.cs.meta │ │ ├── DynamicAssembly.cs │ │ ├── DynamicAssembly.cs.meta │ │ ├── ExpressionUtility.cs │ │ ├── ExpressionUtility.cs.meta │ │ ├── FarmHash.cs │ │ ├── FarmHash.cs.meta │ │ ├── GuidBits.cs │ │ ├── GuidBits.cs.meta │ │ ├── ILGeneratorExtensions.cs │ │ ├── ILGeneratorExtensions.cs.meta │ │ ├── ReflectionExtensions.cs │ │ ├── ReflectionExtensions.cs.meta │ │ ├── Sequence`1.cs │ │ ├── Sequence`1.cs.meta │ │ ├── ThreadsafeTypeKeyHashTable.cs │ │ ├── ThreadsafeTypeKeyHashTable.cs.meta │ │ ├── TinyJsonReader.cs │ │ ├── TinyJsonReader.cs.meta │ │ ├── UnsafeMemory.Low.cs │ │ └── UnsafeMemory.Low.cs.meta │ │ ├── LZ4.meta │ │ ├── LZ4 │ │ ├── LZ4Codec.Helper.cs │ │ ├── LZ4Codec.Helper.cs.meta │ │ ├── LZ4Codec.Safe.cs │ │ ├── LZ4Codec.Safe.cs.meta │ │ ├── LZ4Codec.Safe32.Dirty.cs │ │ ├── LZ4Codec.Safe32.Dirty.cs.meta │ │ ├── LZ4Codec.Safe64.Dirty.cs │ │ ├── LZ4Codec.Safe64.Dirty.cs.meta │ │ ├── LZ4Codec.Unsafe.cs │ │ ├── LZ4Codec.Unsafe.cs.meta │ │ ├── LZ4Codec.Unsafe32.Dirty.cs │ │ ├── LZ4Codec.Unsafe32.Dirty.cs.meta │ │ ├── LZ4Codec.Unsafe64.Dirty.cs │ │ ├── LZ4Codec.Unsafe64.Dirty.cs.meta │ │ ├── LZ4Codec.cs │ │ └── LZ4Codec.cs.meta │ │ ├── MessagePack.asmdef │ │ ├── MessagePack.asmdef.meta │ │ ├── MessagePackCode.cs │ │ ├── MessagePackCode.cs.meta │ │ ├── MessagePackCompression.cs │ │ ├── MessagePackCompression.cs.meta │ │ ├── MessagePackReader.cs │ │ ├── MessagePackReader.cs.meta │ │ ├── MessagePackSecurity.cs │ │ ├── MessagePackSecurity.cs.meta │ │ ├── MessagePackSerializationException.cs │ │ ├── MessagePackSerializationException.cs.meta │ │ ├── MessagePackSerializer.Json.cs │ │ ├── MessagePackSerializer.Json.cs.meta │ │ ├── MessagePackSerializer.NonGeneric.cs │ │ ├── MessagePackSerializer.NonGeneric.cs.meta │ │ ├── MessagePackSerializer.cs │ │ ├── MessagePackSerializer.cs.meta │ │ ├── MessagePackSerializerOptions.cs │ │ ├── MessagePackSerializerOptions.cs.meta │ │ ├── MessagePackStreamReader.cs │ │ ├── MessagePackStreamReader.cs.meta │ │ ├── MessagePackWriter.cs │ │ ├── MessagePackWriter.cs.meta │ │ ├── Nil.cs │ │ ├── Nil.cs.meta │ │ ├── Resolvers.meta │ │ ├── Resolvers │ │ ├── AttributeFormatterResolver.cs │ │ ├── AttributeFormatterResolver.cs.meta │ │ ├── BuiltinResolver.cs │ │ ├── BuiltinResolver.cs.meta │ │ ├── CachingFormatterResolver.cs │ │ ├── CachingFormatterResolver.cs.meta │ │ ├── CompositeResolver.cs │ │ ├── CompositeResolver.cs.meta │ │ ├── ContractlessReflectionObjectResolver.cs │ │ ├── ContractlessReflectionObjectResolver.cs.meta │ │ ├── DynamicEnumAsStringResolver.cs │ │ ├── DynamicEnumAsStringResolver.cs.meta │ │ ├── DynamicEnumResolver.cs │ │ ├── DynamicEnumResolver.cs.meta │ │ ├── DynamicGenericResolver.cs │ │ ├── DynamicGenericResolver.cs.meta │ │ ├── DynamicObjectResolver.cs │ │ ├── DynamicObjectResolver.cs.meta │ │ ├── DynamicUnionResolver.cs │ │ ├── DynamicUnionResolver.cs.meta │ │ ├── NativeDateTimeResolver.cs │ │ ├── NativeDateTimeResolver.cs.meta │ │ ├── NativeDecimalResolver.cs │ │ ├── NativeDecimalResolver.cs.meta │ │ ├── NativeGuidResolver.cs │ │ ├── NativeGuidResolver.cs.meta │ │ ├── PrimitiveObjectResolver.cs │ │ ├── PrimitiveObjectResolver.cs.meta │ │ ├── StandardResolver.cs │ │ ├── StandardResolver.cs.meta │ │ ├── StaticCompositeResolver.cs │ │ ├── StaticCompositeResolver.cs.meta │ │ ├── TypelessContractlessStandardResolver.cs │ │ ├── TypelessContractlessStandardResolver.cs.meta │ │ ├── TypelessObjectResolver.cs │ │ └── TypelessObjectResolver.cs.meta │ │ ├── SequencePool.cs │ │ ├── SequencePool.cs.meta │ │ ├── SequenceReader.cs │ │ ├── SequenceReader.cs.meta │ │ ├── SequenceReaderExtensions.cs │ │ ├── SequenceReaderExtensions.cs.meta │ │ ├── StreamPolyfillExtensions.cs │ │ ├── StreamPolyfillExtensions.cs.meta │ │ ├── StringEncoding.cs │ │ ├── StringEncoding.cs.meta │ │ ├── T4.meta │ │ ├── T4 │ │ ├── ForceSizePrimitiveFormatter.cs │ │ ├── ForceSizePrimitiveFormatter.cs.meta │ │ ├── MessagePackReader.Integers.cs │ │ ├── MessagePackReader.Integers.cs.meta │ │ ├── PrimitiveFormatter.cs │ │ ├── PrimitiveFormatter.cs.meta │ │ ├── TupleFormatter.cs │ │ ├── TupleFormatter.cs.meta │ │ ├── UnsafeMemory.cs │ │ ├── UnsafeMemory.cs.meta │ │ ├── ValueTupleFormatter.cs │ │ └── ValueTupleFormatter.cs.meta │ │ ├── ThisLibraryExtensionTypeCodes.cs │ │ ├── ThisLibraryExtensionTypeCodes.cs.meta │ │ ├── Unity.meta │ │ ├── Unity │ │ ├── Extension.meta │ │ ├── Extension │ │ │ ├── UnityBlitResolver.cs │ │ │ ├── UnityBlitResolver.cs.meta │ │ │ ├── UnsafeBlitFormatter.cs │ │ │ └── UnsafeBlitFormatter.cs.meta │ │ ├── Formatters.cs │ │ ├── Formatters.cs.meta │ │ ├── MessagePackWindow.cs │ │ ├── MessagePackWindow.cs.meta │ │ ├── UnityResolver.cs │ │ └── UnityResolver.cs.meta │ │ ├── Utilities.cs │ │ └── Utilities.cs.meta ├── Plugins.meta ├── Plugins │ ├── System.Buffers.dll │ ├── System.Buffers.dll.meta │ ├── System.Memory.dll │ ├── System.Memory.dll.meta │ ├── System.Runtime.CompilerServices.Unsafe.dll │ ├── System.Runtime.CompilerServices.Unsafe.dll.meta │ ├── System.Threading.Tasks.Extensions.dll │ └── System.Threading.Tasks.Extensions.dll.meta ├── Sample.meta ├── Sample │ ├── Ball.prefab │ ├── Ball.prefab.meta │ ├── BallView.cs │ ├── BallView.cs.meta │ ├── Bar.prefab │ ├── Bar.prefab.meta │ ├── BarView.cs │ ├── BarView.cs.meta │ ├── Circle.png │ ├── Circle.png.meta │ ├── G.cs │ ├── G.cs.meta │ ├── GameScene.cs │ ├── GameScene.cs.meta │ ├── InputFieldScript.cs │ ├── InputFieldScript.cs.meta │ ├── Logic.meta │ ├── Logic │ │ ├── Logger.cs │ │ ├── Logger.cs.meta │ │ ├── RPCBridge.cs │ │ ├── RPCBridge.cs.meta │ │ ├── Simulator.cs │ │ ├── Simulator.cs.meta │ │ ├── UnityType.cs │ │ ├── UnityType.cs.meta │ │ ├── WSNet2Helper.cs │ │ └── WSNet2Helper.cs.meta │ ├── MessagePack.generated.cs │ ├── MessagePack.generated.cs.meta │ ├── Square.png │ ├── Square.png.meta │ ├── TitleScene.cs │ └── TitleScene.cs.meta ├── Scenes.meta ├── Scenes │ ├── Game.unity │ ├── Game.unity.meta │ ├── Title.unity │ └── Title.unity.meta ├── WSNet2.meta └── WSNet2 │ ├── Scripts.meta │ └── Scripts │ ├── Core.meta │ ├── Core │ ├── AuthData.cs │ ├── AuthData.cs.meta │ ├── AuthDataGenerator.cs │ ├── AuthDataGenerator.cs.meta │ ├── CallbackPool.cs │ ├── CallbackPool.cs.meta │ ├── Connection.cs │ ├── Connection.cs.meta │ ├── DefaultHttpClient.cs │ ├── DefaultHttpClient.cs.meta │ ├── Event.meta │ ├── Event │ │ ├── EvClientProp.cs │ │ ├── EvClientProp.cs.meta │ │ ├── EvClosed.cs │ │ ├── EvClosed.cs.meta │ │ ├── EvJoined.cs │ │ ├── EvJoined.cs.meta │ │ ├── EvLeft.cs │ │ ├── EvLeft.cs.meta │ │ ├── EvMasterSwitched.cs │ │ ├── EvMasterSwitched.cs.meta │ │ ├── EvPeerReady.cs │ │ ├── EvPeerReady.cs.meta │ │ ├── EvPong.cs │ │ ├── EvPong.cs.meta │ │ ├── EvRPC.cs │ │ ├── EvRPC.cs.meta │ │ ├── EvRejoin.cs │ │ ├── EvRejoin.cs.meta │ │ ├── EvResponse.cs │ │ ├── EvResponse.cs.meta │ │ ├── EvRoomProp.cs │ │ ├── EvRoomProp.cs.meta │ │ ├── Event.cs │ │ └── Event.cs.meta │ ├── Exceptions.cs │ ├── Exceptions.cs.meta │ ├── IWSNet2Logger.cs │ ├── IWSNet2Logger.cs.meta │ ├── Logger.cs │ ├── Logger.cs.meta │ ├── MessagePack.meta │ ├── MessagePack │ │ ├── ClientInfo.cs │ │ ├── ClientInfo.cs.meta │ │ ├── JoinedRoom.cs │ │ ├── JoinedRoom.cs.meta │ │ ├── LobbyParams.cs │ │ ├── LobbyParams.cs.meta │ │ ├── LobbyResponse.cs │ │ ├── LobbyResponse.cs.meta │ │ ├── Query.Condition.cs │ │ ├── Query.Condition.cs.meta │ │ ├── RoomInfo.cs │ │ ├── RoomInfo.cs.meta │ │ ├── RoomOption.cs │ │ └── RoomOption.cs.meta │ ├── Msg.meta │ ├── Msg │ │ ├── Msg.cs │ │ ├── Msg.cs.meta │ │ ├── MsgPing.cs │ │ ├── MsgPing.cs.meta │ │ ├── MsgPool.cs │ │ └── MsgPool.cs.meta │ ├── NetworkInformer.cs │ ├── NetworkInformer.cs.meta │ ├── Player.cs │ ├── Player.cs.meta │ ├── PublicRoom.cs │ ├── PublicRoom.cs.meta │ ├── Query.cs │ ├── Query.cs.meta │ ├── Room.cs │ ├── Room.cs.meta │ ├── SerialReader.cs │ ├── SerialReader.cs.meta │ ├── SerialWriter.cs │ ├── SerialWriter.cs.meta │ ├── WSNet2Client.cs │ ├── WSNet2Client.cs.meta │ ├── WSNet2Serializer.cs │ ├── WSNet2Serializer.cs.meta │ ├── WSNet2Settings.cs │ └── WSNet2Settings.cs.meta │ ├── DefaultUnityLogger.cs │ ├── DefaultUnityLogger.cs.meta │ ├── WSNet2Service.cs │ └── WSNet2Service.cs.meta ├── Packages ├── manifest.json └── packages-lock.json └── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── NavMeshAreas.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset ├── XRSettings.asset └── boot.config /.github/workflows/wsnet2-dashboard.yml: -------------------------------------------------------------------------------- 1 | name: WSNet2 dashboard ci 2 | 3 | on: 4 | pull_request: 5 | branches: [ main ] 6 | paths: 7 | - '.github/workflows/wsnet2-dashboard.yml' 8 | - 'wsnet2-dashboard/**' 9 | - 'server/**' 10 | 11 | jobs: 12 | go-wasm: 13 | runs-on: "ubuntu-latest" 14 | defaults: 15 | run: 16 | working-directory: wsnet2-dashboard/backend 17 | steps: 18 | - uses: actions/checkout@v3 19 | 20 | - uses: actions/setup-go@v4 21 | with: 22 | go-version-file: "wsnet2-dashboard/backend/go-binary/go.mod" 23 | cache: true 24 | cache-dependency-path: "wsnet2-dashboard/backend/go-binary/go.sum" 25 | 26 | - uses: arduino/setup-protoc@v2 27 | with: 28 | version: '24.x' 29 | 30 | - run: make -C ../../server generate 31 | 32 | - run: make src/plugins/binary.wasm 33 | -------------------------------------------------------------------------------- /.github/workflows/wsnet2-dotnet.yml: -------------------------------------------------------------------------------- 1 | name: WSNet2 dotnet ci 2 | 3 | on: 4 | pull_request: 5 | branches: [ main ] 6 | paths: 7 | - '.github/workflows/wsnet2-dotnet.yml' 8 | - 'wsnet2-dotnet/**' 9 | - 'wsnet2-unity/**' 10 | 11 | jobs: 12 | dotnet: 13 | runs-on: "ubuntu-latest" 14 | defaults: 15 | run: 16 | working-directory: wsnet2-dotnet 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Setup .NET 20 | uses: actions/setup-dotnet@v3 21 | with: 22 | dotnet-version: "6.x" 23 | - name: dotnet build 24 | run: dotnet build WSNet2.sln 25 | - name: dotnet test 26 | run: dotnet test WSNet2.sln 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .markdown-preview.html 2 | .DS_Store 3 | .vscode/ 4 | *.local 5 | .log/ 6 | -------------------------------------------------------------------------------- /_doc/README.md: -------------------------------------------------------------------------------- 1 | # Documentations 2 | 3 | ## 使い方 4 | 5 | * [C#クライアントの使い方](csharp_client.md) 6 | * [Dockerを使ったローカルでの起動](docker.md) 7 | * [サーバの構築](server_setup.md) 8 | 9 | ## 機能詳細 10 | 11 | * [WSNet2のユーザ認証](user_auth.md) 12 | * [シリアライズ可能な型](serializable.md) 13 | * [シリアライザの使い方](serializer.md) 14 | * [WSNet2のLogger](logger.md) 15 | 16 | ## クラス詳細 17 | 18 | * [WSNet2Client](wsnet2client.md) 19 | * [RoomOption](roomoption.md) 20 | * [Room](room.md) 21 | * [Query](query.md) 22 | * [WSNet2Settings](wsnet2settings.md) 23 | -------------------------------------------------------------------------------- /_doc/docker.md: -------------------------------------------------------------------------------- 1 | # Dockerを使ったローカルでの起動 2 | 3 | ## 立ち上げ方 4 | 5 | ロカール環境にwsnet2のサーバ群を立ち上げるには、Dockerとdocker-composeが利用できます 6 | 7 | [リポジトリの`server`ディレクトリ](../server)で`docker-compose build`と`docker-compose up`を実行してください。 8 | 9 | ```BASH 10 | $ git clone git@github.jp.klab.com:WSNet/wsnet2 11 | $ cd wsnet2/server 12 | $ docker-compose build 13 | $ docker-compose up 14 | ``` 15 | 16 | ## 接続先情報 17 | 18 | - LobbyURL: http://localhost:8080 19 | - AppID: testapp 20 | - AppKey: testapppkey 21 | 22 | Unityから接続するための`WSNet2Client`は次のように取得します。 23 | 24 | ```C# 25 | var userId = "user1"; 26 | var authgen = new AuthDataGenerator(); 27 | 28 | var client = WSNet2Service.Instance.GetClient( 29 | "http://localhost:8080", 30 | "testapp", 31 | userId, 32 | authgen.Generate("testapppkey", userId)); 33 | ``` 34 | 35 | この`testapp`は初期状態で登録されています。 36 | 追加するには、DBの`app`テーブルにレコードを追加してください。 37 | 追加後、lobby、game、hubを再起動することで反映されます。 38 | 39 | DBへのアクセス方法: 40 | 41 | ```BASH 42 | $ docker exec -it wsnet2-db mysql -uwsnet -pwsnetpass wsnet2 43 | ``` 44 | 45 | ## コンテナ一覧 46 | 47 | - wsnet2-builder 48 | - wsnet2のバイナリをビルドする 49 | - wsnet2-lobby 50 | - Lobbyサーバ 51 | - クライアントからの部屋の作成や入室、部屋検索リクエストを受け付ける 52 | - wsnet2-game 53 | - Gameサーバ 54 | - 部屋を保持、クライアントからのwebsocket接続を受け付けてメッセージを送受信する 55 | - wsnet2-hub 56 | - 観戦Hubサーバ 57 | - Gameからのメッセージを観戦クライアントに中継する 58 | - wsnet2-db 59 | - データベース 60 | - 部屋の検索などに利用する 61 | -------------------------------------------------------------------------------- /_doc/sample_game_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/_doc/sample_game_s.png -------------------------------------------------------------------------------- /_doc/sample_title_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/_doc/sample_title_s.png -------------------------------------------------------------------------------- /_doc/serializable.md: -------------------------------------------------------------------------------- 1 | # シリアライズ可能な型 2 | 3 | ## 目次 4 | 5 | - [概要](#概要) 6 | - [型一覧](#型一覧) 7 | - [プリミティブ型](#プリミティブ型) 8 | - [IWSNet2Serializable型](#IWSNet2Serializable型) 9 | - [辞書型](#辞書型) 10 | - [配列・リスト](#配列リスト) 11 | - [Nullの扱い](#Nullの扱い) 12 | 13 | ## 概要 14 | 15 | 部屋とプレイヤーのプロパティ辞書の値や、RPCの引数には、シリアライズ可能な型のみ指定できます。 16 | WSNet2のシリアライザでは、型は基本的には保存されます。 17 | シリアライズやデシリアライズの詳細は[シリアライザの使い方](serializer.md)を参照してください。 18 | 19 | ## 型一覧 20 | 21 | ### プリミティブ型 22 | 23 | 次のプリミティブ型はそのままシリアライズできます。 24 | 25 | - `bool` 26 | - `sbyte` 27 | - `byte` 28 | - `char` 29 | - `short` 30 | - `ushort` 31 | - `int` 32 | - `uint` 33 | - `long` 34 | - `ulong` 35 | - `float` 36 | - `double` 37 | - `string` 38 | 39 | ### IWSNet2Serializable型 40 | 41 | [`IWSNet2Serializable`](serializer.md#IWSNet2Serializableインターフェイス)を実装した型は、 42 | `WSNet2Serializer`クラスに登録することでシリアライズ出来るようになります。 43 | 44 | ```C# 45 | static void Register(byte classID) where T : class, IWSNet2Serializable, new(); 46 | ``` 47 | 48 | 型ごとに1byteのclassIDを割り当てるため、最大256種類登録できます。 49 | 全てのクライアントで型とclassIDの対応は一致している必要があります。 50 | 51 | ### 辞書型 52 | 53 | キーが`string`で、値が「シリアライズ可能な型」の辞書`Dictionary`型がシリアライズできます。 54 | 値として辞書やリストを含めることもできます。 55 | 56 | ### 配列・リスト 57 | 58 | シリアライズ可能なプリミティブ型の配列(`int[]`など)はそのままシリアライズできます。 59 | 60 | `IWSNet2Serializable`を実装した単一の型`T`について、`List`と`T[]`もシリアライズ可能です。 61 | 62 | さらに、全要素が「シリアライズ可能な型」の`List`や`object[]`もシリアライズでき、 63 | この場合要素にリストや辞書をネストして含めることができます。 64 | 65 | ## Nullの扱い 66 | 67 | 文字列や`IWSNet2Serializable`、辞書、配列、リストは`null`にすることができ、 68 | 型なしのNullとしてシリアライズされます。 69 | 70 | デシリアライズ時には指定の型の`null`になります。 71 | -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | /pb/*.pb.go 18 | *_string.go 19 | bin/ 20 | /include/ 21 | /sql/trigger.d 22 | -------------------------------------------------------------------------------- /server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.23 2 | 3 | ARG protoc_ver="29.2" 4 | 5 | RUN apt-get update && apt-get install -y unzip && \ 6 | apt-get clean && rm -rf /var/lib/apt/lists/* && \ 7 | wget -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v${protoc_ver}/protoc-${protoc_ver}-linux-$(if [ $(uname -m) = "aarch64" ]; then echo aarch_64; else echo x86_64; fi).zip && \ 8 | unzip -o protoc.zip "bin/*" "include/*" -d /usr/local && \ 9 | rm protoc.zip 10 | 11 | RUN go install github.com/makiuchi-d/arelo@latest && \ 12 | git config --global --add safe.directory /repo 13 | -------------------------------------------------------------------------------- /server/_doc/wsnet2-external.drawio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/server/_doc/wsnet2-external.drawio.png -------------------------------------------------------------------------------- /server/_doc/wsnet2-internal.drawio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/server/_doc/wsnet2-internal.drawio.png -------------------------------------------------------------------------------- /server/auth/mackey_test.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import "testing" 4 | 5 | func TestMACKey(t *testing.T) { 6 | appkey := "testkey2" 7 | mackey := "testMACKey2" 8 | 9 | encMkey, err := EncryptMACKey(appkey, mackey) 10 | if err != nil { 11 | t.Fatalf("EncryptMACKey: %v", err) 12 | } 13 | 14 | r, err := DecryptMACKey(appkey, encMkey) 15 | if err != nil { 16 | t.Fatalf("DecryptMACKey: %v", err) 17 | } 18 | 19 | if r != mackey { 20 | t.Fatalf("decrypted = %q, wants %q", r, mackey) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /server/bin/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/server/bin/.gitkeep -------------------------------------------------------------------------------- /server/binary/unsafe_string118.go: -------------------------------------------------------------------------------- 1 | //go:build !go1.20 2 | 3 | package binary 4 | 5 | //go:inline 6 | func unsafeString(s []byte) string { 7 | return string(s) 8 | } 9 | -------------------------------------------------------------------------------- /server/binary/unsafe_string120.go: -------------------------------------------------------------------------------- 1 | //go:build go1.20 2 | 3 | package binary 4 | 5 | import "unsafe" 6 | 7 | //go:inline 8 | func unsafeString(s []byte) string { 9 | if len(s) == 0 { 10 | return "" 11 | } 12 | return unsafe.String(&s[0], len(s)) 13 | } 14 | -------------------------------------------------------------------------------- /server/client/accessinfo.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "time" 5 | 6 | "wsnet2/auth" 7 | ) 8 | 9 | // AccessInfo : WSNet2への接続に使う情報 10 | type AccessInfo struct { 11 | LobbyURL string 12 | AppId string 13 | UserId string 14 | MACKey string 15 | Bearer string 16 | EncMACKey string 17 | } 18 | 19 | // GenAccessinfo : AccessInfoを生成 20 | // 21 | // appkeyを知らないクライアントサイドは、この関数を使わずサーバから貰うこと 22 | func GenAccessInfo(lobby, appid, appkey, userid string) (*AccessInfo, error) { 23 | bearer, err := auth.GenerateAuthData(appkey, userid, time.Now()) 24 | if err != nil { 25 | return nil, err 26 | } 27 | mackey := auth.GenMACKey() 28 | encmackey, err := auth.EncryptMACKey(appkey, mackey) 29 | if err != nil { 30 | return nil, err 31 | } 32 | return &AccessInfo{ 33 | LobbyURL: lobby, 34 | AppId: appid, 35 | UserId: userid, 36 | MACKey: mackey, 37 | Bearer: bearer, 38 | EncMACKey: encmackey, 39 | }, nil 40 | } 41 | -------------------------------------------------------------------------------- /server/client/query.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "wsnet2/lobby" 4 | 5 | type Query []lobby.PropQueries 6 | 7 | func NewQuery() *Query { 8 | q := Query([]lobby.PropQueries{[]lobby.PropQuery{}}) 9 | return &q 10 | } 11 | 12 | func (q *Query) Equal(key string, val []byte) *Query { 13 | q.and(key, lobby.OpEqual, val) 14 | return q 15 | } 16 | 17 | func (q *Query) Not(key string, val []byte) *Query { 18 | q.and(key, lobby.OpNot, val) 19 | return q 20 | } 21 | 22 | func (q *Query) LessThan(key string, val []byte) *Query { 23 | q.and(key, lobby.OpLessThan, val) 24 | return q 25 | } 26 | 27 | func (q *Query) LessEqual(key string, val []byte) *Query { 28 | q.and(key, lobby.OpLessThanOrEqual, val) 29 | return q 30 | } 31 | 32 | func (q *Query) GreaterThan(key string, val []byte) *Query { 33 | q.and(key, lobby.OpGreaterThan, val) 34 | return q 35 | } 36 | 37 | func (q *Query) GreaterEqual(key string, val []byte) *Query { 38 | q.and(key, lobby.OpGreaterThanOrEqual, val) 39 | return q 40 | } 41 | 42 | func (q *Query) and(key string, op lobby.OpType, val []byte) { 43 | pq := lobby.PropQuery{Key: key, Op: op, Val: val} 44 | for i := range *q { 45 | (*q)[i] = append((*q)[i], pq) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /server/cmd/wsnet2-bot/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "wsnet2/cmd/wsnet2-bot/cmd" 4 | 5 | func main() { 6 | cmd.Execute() 7 | } 8 | -------------------------------------------------------------------------------- /server/cmd/wsnet2-lobby/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "os" 7 | "runtime/debug" 8 | "strings" 9 | "time" 10 | 11 | _ "github.com/go-sql-driver/mysql" 12 | "github.com/jmoiron/sqlx" 13 | 14 | "wsnet2" 15 | "wsnet2/config" 16 | "wsnet2/lobby/service" 17 | "wsnet2/log" 18 | ) 19 | 20 | func main() { 21 | if len(os.Args) < 2 { 22 | panic(fmt.Errorf("no config.toml specified")) 23 | } 24 | conf, err := config.Load(os.Args[1]) 25 | if err != nil { 26 | panic(fmt.Errorf("%+v\n", err)) 27 | } 28 | 29 | defer log.InitLogger(&conf.Lobby.LogConf)() 30 | log.SetLevel(log.Level(conf.Lobby.Loglevel)) 31 | log.Infof("WSNet2-Lobby") 32 | log.Infof("WSNet2Version: %v", wsnet2.Version) 33 | if bi, ok := debug.ReadBuildInfo(); ok { 34 | for _, s := range bi.Settings { 35 | if strings.HasPrefix(s.Key, "vcs.") { 36 | log.Infof("%v: %v", s.Key, s.Value) 37 | } 38 | } 39 | } 40 | 41 | db := sqlx.MustOpen("mysql", conf.Db.DSN()) 42 | maxConns := conf.Lobby.DbMaxConns 43 | if maxConns > 0 { 44 | db.SetMaxOpenConns(maxConns) 45 | db.SetMaxIdleConns(maxConns) 46 | log.Infof("DbMaxConns: %v", maxConns) 47 | } 48 | db.SetConnMaxLifetime(time.Duration(conf.Db.ConnMaxLifetime)) 49 | 50 | service, err := service.New(db, &conf.Lobby) 51 | if err != nil { 52 | panic(fmt.Errorf("%+v\n", err)) 53 | } 54 | 55 | ctx := context.Background() 56 | 57 | err = service.Serve(ctx) 58 | if err != nil { 59 | panic(fmt.Errorf("%+v\n", err)) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /server/cmd/wsnet2-tool/cmd/apps.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | type app struct { 10 | Id string `db:"id"` 11 | Name string `db:"name"` 12 | Key string `db:"key"` 13 | } 14 | 15 | // appsCmd represents the apps command 16 | var appsCmd = &cobra.Command{ 17 | Use: "apps", 18 | Short: "Show applications", 19 | Long: "Show applications registered on the DB", 20 | Run: func(cmd *cobra.Command, args []string) { 21 | const sql = "SELECT `id`, `key`, `name` FROM `app`" 22 | 23 | var apps []*app 24 | err := db.SelectContext(cmd.Context(), &apps, sql) 25 | if err != nil { 26 | panic(err) 27 | } 28 | 29 | cmd.SetOut(os.Stdout) 30 | if verbose { 31 | cmd.Println("id\tkey\tname") 32 | } 33 | 34 | for _, app := range apps { 35 | cmd.Printf("%s\t%s\t%q\n", app.Id, app.Key, app.Name) 36 | } 37 | }, 38 | } 39 | 40 | func init() { 41 | rootCmd.AddCommand(appsCmd) 42 | } 43 | -------------------------------------------------------------------------------- /server/cmd/wsnet2-tool/cmd/kick.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "wsnet2/pb" 5 | 6 | "golang.org/x/xerrors" 7 | 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | // kickCmd represents the kick command 12 | var kickCmd = &cobra.Command{ 13 | Use: "kick ", 14 | Short: "Kick the player", 15 | Long: `Kick the player from the specified room`, 16 | RunE: func(cmd *cobra.Command, args []string) error { 17 | if len(args) < 2 { 18 | return xerrors.Errorf("need player and room") 19 | } 20 | 21 | svrs, err := selectGrpcServers(cmd.Context(), args[1:2]) 22 | if err != nil { 23 | return err 24 | } 25 | svr, ok := svrs[args[1]] 26 | if !ok { 27 | return xerrors.Errorf("room not found: %v", args[1]) 28 | } 29 | 30 | conn, err := svr.Dial() 31 | if err != nil { 32 | return err 33 | } 34 | 35 | _, err = pb.NewGameClient(conn).Kick(cmd.Context(), &pb.KickReq{ 36 | AppId: svr.App, 37 | RoomId: svr.Room, 38 | ClientId: args[0], 39 | }) 40 | if err != nil { 41 | return err 42 | } 43 | 44 | return nil 45 | }, 46 | } 47 | 48 | func init() { 49 | rootCmd.AddCommand(kickCmd) 50 | } 51 | -------------------------------------------------------------------------------- /server/cmd/wsnet2-tool/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "wsnet2/cmd/wsnet2-tool/cmd" 4 | 5 | func main() { 6 | cmd.Execute() 7 | } 8 | -------------------------------------------------------------------------------- /server/common/const.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | const ( 4 | HostStatusStarting = 0 5 | HostStatusRunning = 1 6 | HostStatusClosing = 2 7 | 8 | RoomIdLen = 32 9 | RoomIdPattern = "^[0-9a-f]{32}$" 10 | ) 11 | -------------------------------------------------------------------------------- /server/common/grpcpool.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "sync" 5 | 6 | "google.golang.org/grpc" 7 | ) 8 | 9 | type GrpcPool struct { 10 | mu sync.Mutex 11 | opts []grpc.DialOption 12 | pool map[string]*grpc.ClientConn 13 | } 14 | 15 | func NewGrpcPool(options ...grpc.DialOption) *GrpcPool { 16 | return &GrpcPool{ 17 | opts: options, 18 | pool: make(map[string]*grpc.ClientConn), 19 | } 20 | } 21 | 22 | func (p *GrpcPool) Get(target string) (*grpc.ClientConn, error) { 23 | p.mu.Lock() 24 | defer p.mu.Unlock() 25 | 26 | cc, ok := p.pool[target] 27 | if ok { 28 | return cc, nil 29 | } 30 | 31 | cc, err := grpc.NewClient(target, p.opts...) 32 | if err != nil { 33 | return nil, err 34 | } 35 | p.pool[target] = cc 36 | return cc, nil 37 | } 38 | -------------------------------------------------------------------------------- /server/common/props.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "wsnet2/binary" 5 | 6 | "golang.org/x/xerrors" 7 | ) 8 | 9 | func InitProps(props []byte) (binary.Dict, []byte, error) { 10 | if len(props) == 0 || binary.Type(props[0]) == binary.TypeNull { 11 | dict := binary.Dict{} 12 | return dict, binary.MarshalDict(dict), nil 13 | } 14 | um, _, err := binary.Unmarshal(props) 15 | if err != nil { 16 | return nil, nil, err 17 | } 18 | dict, ok := um.(binary.Dict) 19 | if !ok { 20 | return nil, nil, xerrors.Errorf("type is not Dict: %v", binary.Type(props[0])) 21 | } 22 | return dict, props, nil 23 | } 24 | -------------------------------------------------------------------------------- /server/compose-multihost.yaml: -------------------------------------------------------------------------------- 1 | name: wsnet2 2 | services: 3 | game2: 4 | container_name: wsnet2-game2 5 | depends_on: 6 | - db 7 | build: . 8 | image: wsnet2-arelo 9 | environment: 10 | WSNET2_GAME_HOSTNAME: wsnet2-game2 11 | WSNET2_GAME_PUBLICNAME: localhost 12 | WSNET2_GAME_GRPCPORT: 19001 13 | WSNET2_GAME_WSPORT: 8001 14 | volumes: 15 | - ../:/repo 16 | - .log/2:/var/log/wsnet2 17 | working_dir: /repo/server 18 | command: arelo -t "bin" -p "bin/wsnet2-game" -s SIGINT -- bin/wsnet2-game docker.toml 19 | entrypoint: /wait-for-it.sh wsnet2-db:3306 -s -t 0 -- 20 | ports: 21 | - 19001:19001 22 | - 8001:8001 23 | - 3001:3000 24 | hub2: 25 | container_name: wsnet2-hub2 26 | depends_on: 27 | - db 28 | - game 29 | build: . 30 | image: wsnet2-arelo 31 | environment: 32 | WSNET2_GAME_HOSTNAME: wsnet2-hub2 33 | WSNET2_GAME_PUBLICNAME: localhost 34 | WSNET2_GAME_GRPCPORT: 19011 35 | WSNET2_GAME_WSPORT: 8011 36 | volumes: 37 | - ../:/repo 38 | - .log/2:/var/log/wsnet2 39 | working_dir: /repo/server 40 | command: arelo -t "bin" -p "bin/wsnet2-hub" -s SIGINT -- bin/wsnet2-hub docker.toml 41 | entrypoint: /wait-for-it.sh wsnet2-db:3306 -s -t 0 -- 42 | ports: 43 | - 19011:19011 44 | - 8011:8011 45 | - 3011:3000 46 | -------------------------------------------------------------------------------- /server/config/testdata/dbauth: -------------------------------------------------------------------------------- 1 | wsnetuser:wsnetpass -------------------------------------------------------------------------------- /server/config/testdata/test.toml: -------------------------------------------------------------------------------- 1 | [Database] 2 | host = "localhost" 3 | port = 3306 4 | authfile = "dbauth" 5 | dbname = "wsnet2" 6 | 7 | [Game] 8 | hostname = "wsnetgame.localhost" 9 | retry_count = 3 10 | heartbeat_interval = "10s" 11 | max_rooms = 123 12 | max_clients = 1234 13 | 14 | event_buf_size = 512 15 | wait_after_close = "1m" 16 | 17 | log_stdout_console = true 18 | log_stdout_level = 3 19 | log_path = "/tmp/wsnet2-game.log" 20 | log_max_size = 1 21 | log_max_backups = 2 22 | log_max_age = 3 23 | log_compress = true 24 | 25 | [Lobby] 26 | hostname = "wsnetlobby.localhost" 27 | unixpath = "/tmp/sock" 28 | net = "tcp" 29 | port = 8080 30 | valid_heartbeat = "30s" 31 | authdata_expire = "10s" 32 | log_path = "/tmp/wsnet2-lobby.log" 33 | -------------------------------------------------------------------------------- /server/docker.toml: -------------------------------------------------------------------------------- 1 | [Database] 2 | host = "wsnet2-db" 3 | port = 3306 4 | user = "wsnet" 5 | password = "wsnetpass" 6 | dbname = "wsnet2" 7 | 8 | [Game] 9 | log_stdout_console = true 10 | pprof_port = 3000 11 | 12 | default_deadline = 5 13 | default_loglevel = 5 14 | max_room_num = 999999 15 | 16 | db_max_conns = 80 17 | 18 | [Hub] 19 | log_stdout_console = true 20 | pprof_port = 3000 21 | 22 | default_loglevel = 5 23 | 24 | db_max_conns = 10 25 | 26 | [Lobby] 27 | log_stdout_console = true 28 | hostname = "localhost" 29 | net = "tcp" 30 | port = 8080 31 | pprof_port = 3000 32 | loglevel = 5 33 | 34 | db_max_conns = 10 35 | -------------------------------------------------------------------------------- /server/game/errors.go: -------------------------------------------------------------------------------- 1 | package game 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | 7 | "golang.org/x/xerrors" 8 | "google.golang.org/grpc/codes" 9 | ) 10 | 11 | // ErrorWithCode : gRPCのコードとerrorの組 12 | type ErrorWithCode interface { 13 | error 14 | Code() codes.Code 15 | IsNormal() bool 16 | } 17 | 18 | type errorWithCode struct { 19 | error 20 | code codes.Code 21 | isNormal bool 22 | } 23 | 24 | func WithCode(err error, code codes.Code) ErrorWithCode { 25 | if err == nil { 26 | return nil 27 | } 28 | var ewc ErrorWithCode 29 | if errors.As(err, &ewc) { 30 | return errorWithCode{err, code, ewc.IsNormal()} 31 | } 32 | 33 | return errorWithCode{err, code, false} 34 | } 35 | 36 | func NormalWithCode(err error, code codes.Code) ErrorWithCode { 37 | if err == nil { 38 | return nil 39 | } 40 | return errorWithCode{err, code, true} 41 | } 42 | 43 | func (e errorWithCode) Code() codes.Code { 44 | return e.code 45 | } 46 | 47 | func (e errorWithCode) IsNormal() bool { 48 | return e.isNormal 49 | } 50 | 51 | func (e errorWithCode) Unwrap() error { 52 | return e.error 53 | } 54 | 55 | func (e errorWithCode) Format(f fmt.State, c rune) { 56 | if m, ok := e.error.(xerrors.Formatter); ok { 57 | xerrors.FormatError(m, f, c) 58 | } else { 59 | f.Write([]byte(e.Error())) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /server/game/interface.go: -------------------------------------------------------------------------------- 1 | // clientとRoomを切り離すための抽象化レイヤー 2 | package game 3 | 4 | import ( 5 | "sync" 6 | "time" 7 | "wsnet2/config" 8 | "wsnet2/log" 9 | ) 10 | 11 | type RoomID string 12 | 13 | type IRoom interface { 14 | ID() RoomID 15 | Repo() IRepo 16 | 17 | ClientConf() *config.ClientConf 18 | 19 | Deadline() time.Duration 20 | WaitGroup() *sync.WaitGroup 21 | Logger() log.Logger 22 | 23 | // Done returns a channel which cloased when room is done. 24 | Done() <-chan struct{} 25 | 26 | SendMessage(msg Msg) 27 | } 28 | 29 | type IRepo interface { 30 | RemoveClient(c *Client) 31 | PlayerLog(c *Client, msg PlayerLogMsg) 32 | } 33 | -------------------------------------------------------------------------------- /server/go.mod: -------------------------------------------------------------------------------- 1 | module wsnet2 2 | 3 | go 1.23.0 4 | 5 | require ( 6 | github.com/DATA-DOG/go-sqlmock v1.5.2 7 | github.com/go-sql-driver/mysql v1.8.1 8 | github.com/google/go-cmp v0.6.0 9 | github.com/jmoiron/sqlx v1.4.0 10 | github.com/pelletier/go-toml v1.9.5 11 | github.com/shiguredo/websocket v1.6.1 12 | github.com/spf13/cobra v1.8.1 13 | github.com/vmihailenco/msgpack/v5 v5.4.1 14 | go.uber.org/zap v1.27.0 15 | golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da 16 | google.golang.org/grpc v1.69.2 17 | google.golang.org/protobuf v1.36.0 18 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 19 | ) 20 | 21 | require ( 22 | filippo.io/edwards25519 v1.1.0 // indirect 23 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 24 | github.com/spf13/pflag v1.0.5 // indirect 25 | github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect 26 | go.uber.org/multierr v1.11.0 // indirect 27 | golang.org/x/net v0.33.0 // indirect 28 | golang.org/x/sys v0.28.0 // indirect 29 | golang.org/x/text v0.21.0 // indirect 30 | google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect 31 | ) 32 | -------------------------------------------------------------------------------- /server/hub/service/pprof.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "context" 5 | _ "expvar" 6 | "fmt" 7 | "net/http" 8 | _ "net/http/pprof" 9 | 10 | "wsnet2/log" 11 | ) 12 | 13 | func (sv *HubService) servePprof(ctx context.Context) <-chan error { 14 | if sv.conf.PprofPort == 0 { 15 | return nil 16 | } 17 | 18 | errCh := make(chan error) 19 | 20 | sv.preparation.Add(1) 21 | go func() { 22 | laddr := fmt.Sprintf(":%d", sv.conf.PprofPort) 23 | log.Infof("hub pprof: %#v", laddr) 24 | 25 | sv.preparation.Done() 26 | errCh <- http.ListenAndServe(laddr, nil) 27 | }() 28 | 29 | return errCh 30 | } 31 | -------------------------------------------------------------------------------- /server/lobby/main_test.go: -------------------------------------------------------------------------------- 1 | package lobby 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "testing" 7 | 8 | _ "github.com/go-sql-driver/mysql" 9 | "github.com/jmoiron/sqlx" 10 | ) 11 | 12 | var ( 13 | lobbyDB *sqlx.DB 14 | ) 15 | 16 | func TestMain(m *testing.M) { 17 | var err error 18 | // ローカルで実行するときは次のようにしてDBを実行する 19 | // docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 --rm --name mysql mysql:8.0 20 | // 他のパッケージのテストが並列してDBを使ってもいいように、 lobby パッケージ専用のDBを作って実行している。 21 | // 22 | // NOTE: 23 | // - テスト実行用のcompose.yamlも用意した方がいいか? 24 | // - その場合はGitHub Actionでも docker compose を使ってDB起動して共通化できる 25 | // - dockertest か testcontainers を使うか? 26 | // - 別パッケージを並列にテスト実行することを考えたら、コンテナは論理DB作に比べてオーバーヘッドが大きい 27 | lobbyDB, err = sqlx.Connect("mysql", "root@tcp(127.0.0.1:3306)/") 28 | if err == nil { 29 | lobbyDB.MustExec("DROP DATABASE IF EXISTS wsnet2_test_lobby") 30 | lobbyDB.MustExec("CREATE DATABASE wsnet2_test_lobby") 31 | lobbyDB.Close() 32 | lobbyDB = sqlx.MustConnect("mysql", "root@tcp(127.0.0.1:3306)/wsnet2_test_lobby") 33 | } else { 34 | fmt.Printf("### failed to connect mysql: %v\n", err) 35 | // CI環境等でDBを使ったテストがスキップされても気づかない状況を避けるために、 36 | // 環境変数を使ってスキップではなく失敗扱いにする。 37 | if os.Getenv("WSNET2_FORCE_DB_TEST") == "" { 38 | fmt.Println(" runs only tests that do not require mysql") 39 | } else { 40 | fmt.Println(" failed because WSNET2_FORCE_DB_TEST is set") 41 | os.Exit(1) 42 | } 43 | } 44 | 45 | // 上の情報とテスト実行の出力の間に空行を挟んで見やすくする 46 | fmt.Println() 47 | os.Exit(m.Run()) 48 | } 49 | -------------------------------------------------------------------------------- /server/lobby/service/pprof.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "net/http" 7 | _ "net/http/pprof" 8 | 9 | "wsnet2/log" 10 | ) 11 | 12 | func (sv *LobbyService) servePprof(ctx context.Context) <-chan error { 13 | if sv.conf.PprofPort == 0 { 14 | return nil 15 | } 16 | 17 | errCh := make(chan error) 18 | 19 | go func() { 20 | laddr := fmt.Sprintf(":%d", sv.conf.PprofPort) 21 | log.Infof("lobby pprof: %#v", laddr) 22 | 23 | errCh <- http.ListenAndServe(laddr, nil) 24 | }() 25 | 26 | return errCh 27 | } 28 | -------------------------------------------------------------------------------- /server/lobby/service/service.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/jmoiron/sqlx" 7 | "golang.org/x/xerrors" 8 | 9 | "wsnet2/config" 10 | "wsnet2/lobby" 11 | ) 12 | 13 | type LobbyService struct { 14 | conf *config.LobbyConf 15 | roomService *lobby.RoomService 16 | } 17 | 18 | func New(db *sqlx.DB, conf *config.LobbyConf) (*LobbyService, error) { 19 | roomService, err := lobby.NewRoomService(db, conf) 20 | if err != nil { 21 | return nil, xerrors.Errorf("NewRoomService: %w", err) 22 | } 23 | return &LobbyService{ 24 | conf: conf, 25 | roomService: roomService, 26 | }, nil 27 | } 28 | 29 | func (s *LobbyService) Serve(ctx context.Context) error { 30 | ctx, cancel := context.WithCancel(ctx) 31 | defer cancel() 32 | 33 | var err error 34 | select { 35 | case <-ctx.Done(): 36 | case err = <-s.serveAPI(ctx): 37 | case err = <-s.servePprof(ctx): 38 | } 39 | return err 40 | } 41 | -------------------------------------------------------------------------------- /server/log/log_test.go: -------------------------------------------------------------------------------- 1 | package log_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "wsnet2/log" 7 | ) 8 | 9 | func TestLevel(t *testing.T) { 10 | log.SetLevel(log.INFO) 11 | old := log.SetLevel(log.ERROR) 12 | if old != log.INFO { 13 | t.Fatalf("old level = %v, wants %v", old, log.INFO) 14 | } 15 | if l := log.CurrentLevel(); l != log.ERROR { 16 | t.Fatalf("current level = %v, wants %v", l, log.ERROR) 17 | } 18 | } 19 | 20 | func TestStringer(t *testing.T) { 21 | if s, w := log.ALL.String(), "ALL"; s != w { 22 | t.Fatalf("string \"%v\" wants \"%v\"", s, w) 23 | } 24 | if s, w := log.DEBUG.String(), "DEBUG"; s != w { 25 | t.Fatalf("string \"%v\" wants \"%v\"", s, w) 26 | } 27 | if s, w := log.INFO.String(), "INFO"; s != w { 28 | t.Fatalf("string \"%v\" wants \"%v\"", s, w) 29 | } 30 | if s, w := log.ERROR.String(), "ERROR"; s != w { 31 | t.Fatalf("string \"%v\" wants \"%v\"", s, w) 32 | } 33 | if s, w := log.NOLOG.String(), "NOLOG"; s != w { 34 | t.Fatalf("string \"%v\" wants \"%v\"", s, w) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /server/metrics/metrics.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "expvar" 5 | ) 6 | 7 | var ( 8 | expmap = expvar.NewMap("wsnet2") 9 | Conns = new(expvar.Int) 10 | Rooms = new(expvar.Int) 11 | Hubs = new(expvar.Int) 12 | MessageSent = new(expvar.Int) 13 | MessageRecv = new(expvar.Int) 14 | ) 15 | 16 | func init() { 17 | expmap.Set("conns", Conns) 18 | expmap.Set("rooms", Rooms) 19 | expmap.Set("hubs", Hubs) 20 | expmap.Set("message_sent", MessageSent) 21 | expmap.Set("message_recv", MessageRecv) 22 | } 23 | -------------------------------------------------------------------------------- /server/pb/app.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package pb; 4 | option go_package = "wsnet2/pb"; 5 | 6 | message App { 7 | // @inject_tag: db:"id" 8 | string id = 1; 9 | 10 | // @inject_tag: db:"key" 11 | string key = 2; 12 | } 13 | -------------------------------------------------------------------------------- /server/pb/clientinfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package pb; 4 | option go_package = "wsnet2/pb"; 5 | 6 | message ClientInfo { 7 | string id = 1; 8 | bool is_hub = 2; 9 | bytes props = 15; 10 | } 11 | -------------------------------------------------------------------------------- /server/pb/clone.go: -------------------------------------------------------------------------------- 1 | package pb 2 | 3 | import ( 4 | "google.golang.org/protobuf/proto" 5 | ) 6 | 7 | func (src *RoomInfo) Clone() *RoomInfo { 8 | return proto.Clone(src).(*RoomInfo) 9 | } 10 | 11 | func (src *ClientInfo) Clone() *ClientInfo { 12 | return proto.Clone(src).(*ClientInfo) 13 | } 14 | 15 | func (src *Timestamp) Clone() *Timestamp { 16 | return proto.Clone(src).(*Timestamp) 17 | } 18 | -------------------------------------------------------------------------------- /server/pb/roominfo.go: -------------------------------------------------------------------------------- 1 | package pb 2 | 3 | import ( 4 | "database/sql/driver" 5 | "strconv" 6 | "time" 7 | 8 | "golang.org/x/xerrors" 9 | 10 | "github.com/vmihailenco/msgpack/v5" 11 | "google.golang.org/protobuf/types/known/timestamppb" 12 | ) 13 | 14 | func (r *RoomInfo) SetCreated(t time.Time) { 15 | if r.Created == nil { 16 | r.Created = &Timestamp{} 17 | } 18 | r.Created.Timestamp = timestamppb.New(t) 19 | } 20 | 21 | func (n *RoomNumber) Scan(val interface{}) error { 22 | switch v := val.(type) { 23 | case nil: 24 | n.Number = 0 25 | return nil 26 | case int64: 27 | n.Number = int32(v) 28 | return nil 29 | case []byte: 30 | num, err := strconv.Atoi(string(v)) 31 | if err != nil { 32 | return err 33 | } 34 | n.Number = int32(num) 35 | return nil 36 | } 37 | return xerrors.Errorf("invalid value type: %T %v", val, val) 38 | } 39 | 40 | func (n *RoomNumber) Value() (driver.Value, error) { 41 | if n.Number == 0 { 42 | return nil, nil 43 | } 44 | return int64(n.Number), nil 45 | } 46 | 47 | func (n *RoomNumber) EncodeMsgpack(enc *msgpack.Encoder) error { 48 | return enc.Encode(n.Number) 49 | } 50 | 51 | func (n *RoomNumber) DecodeMsgpack(dec *msgpack.Decoder) error { 52 | return dec.Decode(&n.Number) 53 | } 54 | -------------------------------------------------------------------------------- /server/pb/roominfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package pb; 4 | option go_package = "wsnet2/pb"; 5 | 6 | import "timestamp.proto"; 7 | 8 | message RoomInfo { 9 | // @inject_tag: db:"id" 10 | string id = 1; 11 | 12 | // @inject_tag: db:"app_id" 13 | string app_id = 2; 14 | 15 | // @inject_tag: db:"host_id" 16 | uint32 host_id = 3; 17 | 18 | // visible flag. if false, room is not shown in the search result. 19 | // @inject_tag: db:"visible" 20 | bool visible = 4; 21 | 22 | // joinable flag. if false, player cannot join to this room. 23 | // @inject_tag: db:"joinable" 24 | bool joinable = 5; 25 | 26 | // watchanble flag. if false, watcher cannot join to this room. 27 | // @inject_tag: db:"watchable" 28 | bool watchable = 6; 29 | 30 | // unique room number. 0 means not set. 31 | // @inject_tag: db:"number" 32 | RoomNumber number = 7; 33 | 34 | // @inject_tag: db:"search_group" 35 | uint32 search_group = 8; 36 | 37 | // max players count. this is not contained wachers. 38 | // @inject_tag: db:"max_players" 39 | uint32 max_players = 10; 40 | 41 | // players count 42 | // @inject_tag: db:"players" 43 | uint32 players = 11; 44 | 45 | // watchers count 46 | // @inject_tag: db:"watchers" 47 | uint32 watchers = 12; 48 | 49 | // properties shown in search result 50 | // @inject_tag: db:"props" 51 | bytes public_props = 13; 52 | 53 | // properties not shown in search result 54 | bytes private_props = 14; 55 | 56 | // @inject_tag: db:"created" 57 | Timestamp created = 15; 58 | } 59 | 60 | // RoomNumber をnullableにするための型 61 | message RoomNumber { 62 | int32 number = 1; 63 | } 64 | -------------------------------------------------------------------------------- /server/pb/roomoption.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package pb; 4 | option go_package = "wsnet2/pb"; 5 | 6 | message RoomOption { 7 | bool visible = 1; 8 | bool joinable = 2; 9 | bool watchable = 3; 10 | 11 | bool with_number = 7; 12 | uint32 search_group = 8; 13 | uint32 client_deadline = 9; 14 | uint32 max_players = 10; 15 | 16 | bytes public_props = 13; 17 | bytes private_props = 14; 18 | 19 | uint32 log_level = 15; 20 | } 21 | -------------------------------------------------------------------------------- /server/pb/timestamp.go: -------------------------------------------------------------------------------- 1 | package pb 2 | 3 | import ( 4 | "database/sql/driver" 5 | "fmt" 6 | "time" 7 | 8 | "github.com/vmihailenco/msgpack/v5" 9 | "google.golang.org/protobuf/types/known/timestamppb" 10 | ) 11 | 12 | func (ts *Timestamp) Scan(val interface{}) error { 13 | t, ok := val.(time.Time) 14 | if !ok { 15 | return fmt.Errorf("type is not date.Time: %T, %v", val, val) 16 | } 17 | ts.Timestamp = timestamppb.New(t) 18 | return nil 19 | } 20 | 21 | func (ts *Timestamp) Value() (driver.Value, error) { 22 | return ts.Timestamp.AsTime(), nil 23 | } 24 | 25 | func (ts *Timestamp) Time() time.Time { 26 | return ts.Timestamp.AsTime() 27 | } 28 | 29 | func (ts *Timestamp) EncodeMsgpack(enc *msgpack.Encoder) error { 30 | return enc.Encode(ts.Timestamp.Seconds) 31 | } 32 | 33 | func (ts *Timestamp) DecodeMsgpack(dec *msgpack.Decoder) error { 34 | var sec int64 35 | err := dec.Decode(&sec) 36 | if err != nil { 37 | return err 38 | } 39 | 40 | ts.Timestamp = timestamppb.New(time.Unix(sec, 0)) 41 | return nil 42 | } 43 | 44 | var _ msgpack.CustomEncoder = (*Timestamp)(nil) 45 | var _ msgpack.CustomDecoder = (*Timestamp)(nil) 46 | -------------------------------------------------------------------------------- /server/pb/timestamp.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package pb; 4 | option go_package = "wsnet2/pb"; 5 | 6 | import "google/protobuf/timestamp.proto"; 7 | 8 | message Timestamp { 9 | google.protobuf.Timestamp timestamp = 1; 10 | } 11 | -------------------------------------------------------------------------------- /server/pb/types.go: -------------------------------------------------------------------------------- 1 | package pb 2 | 3 | type AppId = string 4 | -------------------------------------------------------------------------------- /server/sql/90-docker.sql: -------------------------------------------------------------------------------- 1 | -- default apps 2 | INSERT INTO `app` (`id`, `name`, `key`) VALUES 3 | ('testapp', 'default test app', 'testapppkey'); 4 | -------------------------------------------------------------------------------- /server/sql/99-update-trigger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SCHEMA=/docker-entrypoint-initdb.d/10-schema.sql 3 | TRIGGER=/trigger.d/db.trigger 4 | [[ ! -e $TRIGGER || $SCHEMA -nt $TRIGGER ]] && touch $TRIGGER || true 5 | -------------------------------------------------------------------------------- /server/staticcheck.conf: -------------------------------------------------------------------------------- 1 | checks = ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-ST1005"] 2 | -------------------------------------------------------------------------------- /server/version.go: -------------------------------------------------------------------------------- 1 | package wsnet2 2 | 3 | var Version = "LOCAL" 4 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/.env: -------------------------------------------------------------------------------- 1 | NODE_ENV=development 2 | DATABASE_URL=mysql://wsnet:wsnetpass@wsnet2-db:3306/wsnet2 3 | FRONTEND_ORIGIN=http://localhost:8081 4 | SERVER_PORT=5555 5 | GRAPHQL_RESULT_MAX_SIZE=1000 6 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | es6: true, 5 | node: true, 6 | }, 7 | parser: "@typescript-eslint/parser", 8 | parserOptions: { 9 | sourceType: "module", 10 | ecmaVersion: 2021, 11 | tsconfigRootDir: __dirname, 12 | project: ["./tsconfig.eslint.json"], 13 | }, 14 | plugins: ["@typescript-eslint"], 15 | extends: [ 16 | "eslint:recommended", 17 | "plugin:@typescript-eslint/recommended", 18 | "plugin:@typescript-eslint/recommended-requiring-type-checking", 19 | "prettier", 20 | ], 21 | rules: {}, 22 | }; 23 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/.gitignore: -------------------------------------------------------------------------------- 1 | /prisma 2 | /src/pb 3 | /node_modules 4 | /src/plugins/binary.wasm 5 | /src/plugins/wasm_exec.js 6 | /.docker_node_modules 7 | /dist 8 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/.prettierrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:22.12.0-bookworm-slim 2 | 3 | RUN apt-get update && apt-get install -y wget make unzip && \ 4 | apt-get clean && rm -rf /var/lib/apt/lists/* && \ 5 | wget -O /wait-for-it.sh https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh > /dev/null 2>&1 && \ 6 | chmod +x /wait-for-it.sh 7 | 8 | ARG go_ver="1.23.4" 9 | ARG protoc_ver="29.2" 10 | 11 | ENV PATH=/root/go/bin:/go/bin:$PATH 12 | 13 | RUN cd / && \ 14 | wget -q -O go.tar.gz https://go.dev/dl/go${go_ver}.linux-$([ $(uname -m) = aarch64 ] && echo -n arm64 || echo -n amd64).tar.gz && \ 15 | tar xf go.tar.gz && \ 16 | rm go.tar.gz && \ 17 | go install github.com/makiuchi-d/arelo@latest && \ 18 | wget -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v${protoc_ver}/protoc-${protoc_ver}-linux-$(if [ $(uname -m) = "aarch64" ]; then echo aarch_64; else echo x86_64; fi).zip && \ 19 | unzip -o protoc.zip "bin/*" "include/*" -d /usr/local && \ 20 | rm protoc.zip 21 | 22 | WORKDIR /repo/wsnet2-dashboard/backend 23 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/go-binary/go.mod: -------------------------------------------------------------------------------- 1 | module wsnet2-dashboard/binary 2 | 3 | go 1.23.0 4 | 5 | require wsnet2 v0.0.0 6 | 7 | require ( 8 | github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect 9 | github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect 10 | golang.org/x/net v0.33.0 // indirect 11 | golang.org/x/sys v0.28.0 // indirect 12 | golang.org/x/text v0.21.0 // indirect 13 | golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect 14 | google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect 15 | google.golang.org/grpc v1.69.2 // indirect 16 | google.golang.org/protobuf v1.36.0 // indirect 17 | ) 18 | 19 | replace wsnet2 => ../../../server 20 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/go-binary/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "syscall/js" 7 | 8 | "wsnet2/binary" 9 | ) 10 | 11 | func main() { 12 | js.Global().Set("binary", map[string]any{ 13 | "UnmarshalRecursive": js.FuncOf(unmarshalRecursive), 14 | }) 15 | <-(chan struct{})(nil) 16 | } 17 | 18 | // unmarshalRecursive unmarshals binary formatted custom props. 19 | // binary.UnmarshalRecursive(arg number[]): { val: string, err: string } 20 | func unmarshalRecursive(this js.Value, args []js.Value) (ret any) { 21 | defer func() { 22 | if err := recover(); err != nil { 23 | ret = map[string]any{ 24 | "val": "", 25 | "err": "UnmarshalRecursive: " + err.(error).Error(), 26 | } 27 | } 28 | }() 29 | 30 | arg := args[0] 31 | len := arg.Length() 32 | b := make([]byte, len) 33 | for i := range len { 34 | v := arg.Index(i).Int() // can be panic 35 | if v > 255 { 36 | panic(fmt.Errorf("arg[%v]=%v > 255", i, v)) 37 | } 38 | b[i] = byte(v) 39 | } 40 | 41 | v, err := binary.UnmarshalRecursive(b) 42 | if err != nil { 43 | panic(err) 44 | } 45 | 46 | u, err := json.Marshal(v) 47 | if err != nil { 48 | panic(err) 49 | } 50 | 51 | return map[string]any{ 52 | "val": string(u), 53 | "err": "", 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wsnet2-dashboard-backend", 3 | "version": "0.0.3", 4 | "description": "Backend for wsnet2-dashboard", 5 | "main": "src/index.ts", 6 | "scripts": { 7 | "dev": "NODE_ENV=development DEBUG=* nodemon -r dotenv/config src/index.ts", 8 | "fix": "eslint src/**/*.ts --fix", 9 | "lint": "npx eslint src/**/*.ts", 10 | "generate": "npx prisma db pull && npx prisma generate", 11 | "build": "NODE_ENV=production tsc", 12 | "start": "NODE_ENV=production node dist/index.js" 13 | }, 14 | "keywords": [ 15 | "express" 16 | ], 17 | "author": "wang-li", 18 | "license": "ISC", 19 | "type": "module", 20 | "dependencies": { 21 | "@apollo/server": "^4.11.2", 22 | "@connectrpc/connect": "^2.0.0", 23 | "@connectrpc/connect-node": "^2.0.0", 24 | "@prisma/client": "^5.0.0", 25 | "cors": "^2.8.5", 26 | "dotenv": "^16.4.7", 27 | "express": "^4.21.2", 28 | "graphql": "^16.9.0", 29 | "mysql2": "^3.11.5", 30 | "nexus": "^1.3.0", 31 | "nexus-prisma": "^2.0.7", 32 | "reflect-metadata": "^0.2.2" 33 | }, 34 | "devDependencies": { 35 | "@bufbuild/protoc-gen-es": "^2.2.3", 36 | "@types/cors": "^2.8.17", 37 | "@types/express": "^4.17.21", 38 | "@types/graphql-iso-date": "^3.4.3", 39 | "@types/node": "^22.10.1", 40 | "eslint": "^9.16.0", 41 | "eslint-config-prettier": "^9.1.0", 42 | "prisma": "^5.0.0", 43 | "ts-node": "^10.9.2", 44 | "typescript": "^5.7.2" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/context.ts: -------------------------------------------------------------------------------- 1 | import { PrismaClient } from "@prisma/client"; 2 | import { Request } from "express"; 3 | 4 | const prisma = new PrismaClient(); 5 | 6 | export interface Context { 7 | request: Request; 8 | prisma: PrismaClient; 9 | } 10 | 11 | export function createContext(request: Request): Context { 12 | return { 13 | request, 14 | prisma, 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/index.ts: -------------------------------------------------------------------------------- 1 | import express from "express"; 2 | import cors from "cors"; 3 | import { ApolloServer } from "@apollo/server"; 4 | import { expressMiddleware } from "@apollo/server/express4"; 5 | // local imports 6 | import { schema } from "./schema.js"; 7 | import { createContext } from "./context.js"; 8 | // import routes 9 | import game from "./routes/game.js"; 10 | import overview from "./routes/overview.js"; 11 | 12 | async function init() { 13 | // consts 14 | const app = express(); 15 | const server = new ApolloServer({ 16 | schema: schema, 17 | }); 18 | 19 | // middlewares 20 | app.use( 21 | cors({ 22 | origin: [String(process.env.FRONTEND_ORIGIN)], 23 | }) 24 | ); 25 | 26 | // app.use(msgpack()); 27 | app.use(express.json()); 28 | app.use(express.urlencoded({ extended: true })); 29 | await server.start(); 30 | 31 | app.use( 32 | '/graphql', 33 | expressMiddleware(server, { 34 | context: async ({ req }) => createContext(req), 35 | }), 36 | ); 37 | 38 | // routes 39 | app.use("/game", game); 40 | app.use("/overview", overview); 41 | return app; 42 | } 43 | 44 | // start server 45 | init() 46 | .then((app) => { 47 | app.listen({ 48 | port: process.env.SERVER_PORT, 49 | // host: "0.0.0.0", 50 | callback: () => { 51 | console.log(`Start on port ${String(process.env.SERVER_PORT)}.`); 52 | }, 53 | }); 54 | }) 55 | .catch((err: Error) => { 56 | console.log(err.message); 57 | }); 58 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/plugins/binary.d.ts: -------------------------------------------------------------------------------- 1 | export declare type Unmarshaled = [unknown, object | null]; 2 | export function UnmarshalRecursive(src: UintArray): Unmarshaled; 3 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/plugins/binary.js: -------------------------------------------------------------------------------- 1 | import "./wasm_exec.js"; 2 | import fs from "node:fs"; 3 | import path from "node:path"; 4 | 5 | const dir = path.dirname(new URL(import.meta.url).pathname); 6 | const go = new Go(); 7 | 8 | const wasm = await WebAssembly.instantiate(fs.readFileSync(path.resolve(dir, "binary.wasm")), go.importObject); 9 | go.run(wasm.instance); 10 | const binary = globalThis.binary; 11 | 12 | export function UnmarshalRecursive(src) { 13 | const ret = binary.UnmarshalRecursive(src); 14 | if (ret.err != "") { 15 | return [null, ret.err] 16 | } 17 | return [JSON.parse(ret.val), null]; 18 | } 19 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/schema.ts: -------------------------------------------------------------------------------- 1 | import { makeSchema } from "nexus"; 2 | import * as types from "./types/index.js"; 3 | 4 | export const schema = makeSchema({ 5 | types, 6 | plugins: [], 7 | }); 8 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./models/index.js"; 2 | export * from "./resolvers/index.js"; 3 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/app.ts: -------------------------------------------------------------------------------- 1 | import { objectType } from "nexus"; 2 | import np from "nexus-prisma"; 3 | const { app } = np; 4 | 5 | export const appModel = objectType({ 6 | name: app.$name, 7 | description: app.$description, 8 | definition(t) { 9 | t.field(app.id); 10 | t.field(app.name); 11 | t.field(app.key); 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/game_server.ts: -------------------------------------------------------------------------------- 1 | import { objectType } from "nexus"; 2 | import np from "nexus-prisma"; 3 | const { game_server } = np; 4 | 5 | export const gameServerModel = objectType({ 6 | name: game_server.$name, 7 | description: game_server.$description, 8 | definition(t) { 9 | t.field(game_server.id); 10 | t.field(game_server.hostname); 11 | t.field(game_server.public_name); 12 | t.field(game_server.grpc_port); 13 | t.field(game_server.ws_port); 14 | t.field(game_server.status); 15 | t.field(game_server.heartbeat); 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/hub.ts: -------------------------------------------------------------------------------- 1 | import { objectType } from "nexus"; 2 | import np from "nexus-prisma"; 3 | const { hub } = np; 4 | 5 | export const hubModel = objectType({ 6 | name: hub.$name, 7 | description: hub.$description, 8 | definition(t) { 9 | t.field(hub.id); 10 | t.field(hub.host_id); 11 | t.field(hub.room_id); 12 | t.field(hub.watchers); 13 | t.field(hub.created); 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/hub_server.ts: -------------------------------------------------------------------------------- 1 | import { objectType } from "nexus"; 2 | import np from "nexus-prisma"; 3 | const { hub_server } = np; 4 | 5 | export const hubServerModel = objectType({ 6 | name: hub_server.$name, 7 | description: hub_server.$description, 8 | definition(t) { 9 | t.field(hub_server.id); 10 | t.field(hub_server.hostname); 11 | t.field(hub_server.public_name); 12 | t.field(hub_server.grpc_port); 13 | t.field(hub_server.ws_port); 14 | t.field(hub_server.status); 15 | t.field(hub_server.heartbeat); 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./app.js"; 2 | export * from "./game_server.js"; 3 | export * from "./hub_server.js"; 4 | export * from "./hub.js"; 5 | export * from "./room_history.js"; 6 | export * from "./room.js"; 7 | export * from "./scalars.js"; 8 | export * from "./player_log.js"; 9 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/player_log.ts: -------------------------------------------------------------------------------- 1 | import { objectType } from "nexus"; 2 | import np from "nexus-prisma"; 3 | const { player_log } = np; 4 | 5 | export const playerLogModel = objectType({ 6 | name: player_log.$name, 7 | description: player_log.$description, 8 | definition(t) { 9 | t.field(player_log.id); 10 | t.field(player_log.room_id); 11 | t.field(player_log.player_id); 12 | t.field(player_log.message); 13 | t.field(player_log.datetime); 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/room.ts: -------------------------------------------------------------------------------- 1 | import { objectType } from "nexus"; 2 | import np from "nexus-prisma"; 3 | const { room } = np; 4 | 5 | export const roomModel = objectType({ 6 | name: room.$name, 7 | description: room.$description, 8 | definition(t) { 9 | t.field(room.id); 10 | t.field(room.app_id); 11 | t.field(room.host_id); 12 | t.field(room.visible); 13 | t.field(room.joinable); 14 | t.field(room.watchable); 15 | t.field(room.number); 16 | t.field(room.search_group); 17 | t.field(room.max_players); 18 | t.field(room.players); 19 | t.field(room.watchers); 20 | t.field(room.props); 21 | t.field(room.created); 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/room_history.ts: -------------------------------------------------------------------------------- 1 | import { objectType } from "nexus"; 2 | import np from "nexus-prisma"; 3 | const { room_history } = np; 4 | 5 | export const roomHistoryModel = objectType({ 6 | name: room_history.$name, 7 | description: room_history.$description, 8 | definition(t) { 9 | t.field(room_history.id); 10 | t.field(room_history.app_id); 11 | t.field(room_history.host_id); 12 | t.field(room_history.room_id); 13 | t.field(room_history.number); 14 | t.field(room_history.search_group); 15 | t.field(room_history.max_players); 16 | t.field(room_history.public_props); 17 | t.field(room_history.private_props); 18 | t.field(room_history.created); 19 | t.field(room_history.closed); 20 | t.list.field("player_logs", { 21 | type: "player_log", 22 | resolve(parent, _args, ctx) { 23 | return ctx.prisma.player_log.findMany({ 24 | where: { room_id: parent.room_id }, 25 | orderBy: { id: "asc" }, 26 | take: Number(process.env.GRAPHQL_RESULT_MAX_SIZE), 27 | }); 28 | }, 29 | }); 30 | }, 31 | }); 32 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/models/scalars.ts: -------------------------------------------------------------------------------- 1 | import { scalarType } from "nexus"; 2 | import { 3 | GraphQLDateTime, 4 | GraphQLBigInt, 5 | GraphQLByte, 6 | GraphQLJSON, 7 | } from "graphql-scalars"; 8 | import * as binary from "../../plugins/binary.js"; 9 | 10 | export const dateTimeScalar = GraphQLDateTime; 11 | export const bigIntScalar = GraphQLBigInt; 12 | 13 | export const jsonScalar = scalarType({ 14 | name: "Json", 15 | asNexusMethod: "json", 16 | description: "Json custom scalar type", 17 | parseValue: GraphQLJSON.parseValue, 18 | serialize: GraphQLJSON.serialize, 19 | parseLiteral: GraphQLJSON.parseLiteral, 20 | }); 21 | 22 | export const bytesScalar = scalarType({ 23 | name: "Bytes", 24 | asNexusMethod: "bytes", 25 | description: "Bytes custom scalar type", 26 | parseValue: GraphQLByte.parseValue, 27 | serialize(value: unknown) { 28 | if (!(value instanceof Uint8Array)) { 29 | throw new Error('Value must be a Uint8Array'); 30 | } 31 | return binary.UnmarshalRecursive(value); 32 | }, 33 | parseLiteral: GraphQLByte.parseLiteral, 34 | }); 35 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/resolvers/appResolver.ts: -------------------------------------------------------------------------------- 1 | import { extendType, idArg, stringArg, nonNull } from "nexus"; 2 | import { Context } from "../../context.js"; 3 | import { Prisma } from "@prisma/client"; 4 | 5 | export const appQuery = extendType({ 6 | type: "Query", 7 | definition(t) { 8 | t.list.field("apps", { 9 | type: "app", 10 | description: "Get all apps", 11 | resolve(_, __, ctx: Context) { 12 | return ctx.prisma.app.findMany({ 13 | take: Number(process.env.GRAPHQL_RESULT_MAX_SIZE), 14 | }); 15 | }, 16 | }); 17 | 18 | t.field("appById", { 19 | type: "app", 20 | description: "Get unique app by id", 21 | args: { 22 | id: idArg(), 23 | }, 24 | resolve(_, { id }, ctx: Context) { 25 | return ctx.prisma.app.findUnique({ 26 | where: { id: String(id) }, 27 | }); 28 | }, 29 | }); 30 | }, 31 | }); 32 | 33 | export const appMutation = extendType({ 34 | type: "Mutation", 35 | definition(t) { 36 | t.field("createApp", { 37 | type: "app", 38 | description: "Create new app", 39 | args: { 40 | id: nonNull(idArg()), 41 | name: stringArg(), 42 | key: stringArg(), 43 | }, 44 | resolve(_, args: Prisma.appCreateInput, ctx: Context) { 45 | return ctx.prisma.app.create({ 46 | data: args, 47 | }); 48 | }, 49 | }); 50 | }, 51 | }); 52 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/resolvers/gameServerResolver.ts: -------------------------------------------------------------------------------- 1 | import { extendType, idArg } from "nexus"; 2 | import { Context } from "../../context.js"; 3 | 4 | export const gameServerQuery = extendType({ 5 | type: "Query", 6 | definition(t) { 7 | t.list.field("gameServers", { 8 | type: "game_server", 9 | description: "Get all game servers", 10 | resolve(_, __, ctx: Context) { 11 | return ctx.prisma.game_server.findMany({ 12 | take: Number(process.env.GRAPHQL_RESULT_MAX_SIZE), 13 | }); 14 | }, 15 | }); 16 | 17 | t.field("gameServerById", { 18 | type: "game_server", 19 | description: "Get unique game server by id", 20 | args: { 21 | id: idArg(), 22 | }, 23 | resolve(_, { id }, ctx: Context) { 24 | return ctx.prisma.game_server.findUnique({ 25 | where: { id: Number(id) }, 26 | }); 27 | }, 28 | }); 29 | }, 30 | }); 31 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/resolvers/hubResolver.ts: -------------------------------------------------------------------------------- 1 | import { extendType, idArg } from "nexus"; 2 | import { Context } from "../../context.js"; 3 | 4 | export const hubQuery = extendType({ 5 | type: "Query", 6 | definition(t) { 7 | t.list.field("hubs", { 8 | type: "hub", 9 | description: "Get all hubs", 10 | resolve(_, __, ctx: Context) { 11 | return ctx.prisma.hub.findMany({ 12 | take: Number(process.env.GRAPHQL_RESULT_MAX_SIZE), 13 | }); 14 | }, 15 | }); 16 | 17 | t.field("hubById", { 18 | type: "hub", 19 | description: "Get unique hub by id", 20 | args: { 21 | id: idArg(), 22 | }, 23 | resolve(_, { id }, ctx: Context) { 24 | return ctx.prisma.hub.findUnique({ 25 | where: { id: Number(id) }, 26 | }); 27 | }, 28 | }); 29 | }, 30 | }); 31 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/resolvers/hubServerResolver.ts: -------------------------------------------------------------------------------- 1 | import { extendType, idArg } from "nexus"; 2 | import { Context } from "../../context.js"; 3 | 4 | export const hubServerQuery = extendType({ 5 | type: "Query", 6 | definition(t) { 7 | t.list.field("hubServers", { 8 | type: "hub_server", 9 | description: "Get all hub servers", 10 | resolve(_, __, ctx: Context) { 11 | return ctx.prisma.hub_server.findMany({ 12 | take: Number(process.env.GRAPHQL_RESULT_MAX_SIZE), 13 | }); 14 | }, 15 | }); 16 | 17 | t.field("hubServerById", { 18 | type: "hub_server", 19 | description: "Get unique hub server by id", 20 | args: { 21 | id: idArg(), 22 | }, 23 | resolve(_, { id }, ctx: Context) { 24 | return ctx.prisma.hub_server.findUnique({ 25 | where: { id: Number(id) }, 26 | }); 27 | }, 28 | }); 29 | }, 30 | }); 31 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/src/types/resolvers/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./appResolver.js"; 2 | export * from "./gameServerResolver.js"; 3 | export * from "./hubResolver.js"; 4 | export * from "./hubServerResolver.js"; 5 | export * from "./roomResolver.js"; 6 | export * from "./roomHistoryResolver.js"; 7 | -------------------------------------------------------------------------------- /wsnet2-dashboard/backend/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": [ 4 | "src/**/*.ts", 5 | ".eslintrc.js" 6 | ], 7 | "exclude": [ 8 | "node_modules", 9 | "dist" 10 | ] 11 | } -------------------------------------------------------------------------------- /wsnet2-dashboard/compose.yaml: -------------------------------------------------------------------------------- 1 | name: wsnet2 2 | services: 3 | frontbuilder: 4 | container_name: wsnet2-dashboard-frontbuilder 5 | image: node:lts-alpine3.11 6 | profiles: 7 | - build 8 | env_file: 9 | - ../wsnet2-dashboard/frontend/.env 10 | volumes: 11 | - ..:/repo 12 | - ../wsnet2-dashboard/frontend/.docker_node_modules:/repo/wsnet2-dashboard/frontend/node_modules 13 | working_dir: /repo/wsnet2-dashboard/frontend 14 | command: ["sh", "-c", "npm install && npm run build"] 15 | frontend: 16 | container_name: wsnet2-dashboard-frontend 17 | image: nginx:stable-alpine 18 | volumes: 19 | - ../wsnet2-dashboard/frontend/dist:/usr/share/nginx/html 20 | ports: 21 | - 8081:80 22 | backend: 23 | container_name: wsnet2-dashboard-backend 24 | build: ../wsnet2-dashboard/backend 25 | image: wsnet2-dashboard-backend 26 | env_file: 27 | - ../wsnet2-dashboard/backend/.env 28 | volumes: 29 | - ..:/repo 30 | - ../wsnet2-dashboard/backend/.docker_node_modules:/repo/wsnet2-dashboard/backend/node_modules 31 | working_dir: /repo/wsnet2-dashboard/backend 32 | ports: 33 | - 5555:5555 34 | command: bash -c "make install-deps && arelo -t src -t ../../server/pb -t ../../server/sql -t ../../server/binary -i '**/.*' -i 'src/pb' -i 'node_modules' -p '**/*.{js,ts,proto,trigger}' -p '../../server/binary/*.go' -- /wait-for-it.sh wsnet2-db:3306 -s -t 0 -- make re-run" 35 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/.env: -------------------------------------------------------------------------------- 1 | NODE_ENV=development 2 | VITE_DEFAULT_SERVER_URI=http://localhost:5555 3 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.docker_node_modules 3 | /dist 4 | /dist-ssr 5 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | # build stage 2 | FROM node:lts-alpine3.11 as build-stage 3 | WORKDIR /app 4 | COPY ./ /app 5 | RUN npm install 6 | RUN npm run build 7 | 8 | # production stage 9 | FROM nginx:stable-alpine as production-stage 10 | COPY --from=build-stage /app/dist /usr/share/nginx/html 11 | EXPOSE 80 12 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/Makefile: -------------------------------------------------------------------------------- 1 | include .env 2 | 3 | .PHONY: build re-build install-deps clean 4 | 5 | build: install-deps re-build 6 | 7 | re-build: 8 | npm run build 9 | 10 | install-deps: 11 | npm install 12 | 13 | clean: 14 | rm -rf dist 15 | rm -rf node_modules 16 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/README-ja.md: -------------------------------------------------------------------------------- 1 | # ダッシュボードのフロントエンド 2 | 3 | [English](README.md) 4 | 5 | ダッシュボードの SPA、構成は `Vue 3 + Typescript + Vite`。UI は[NaiveUI](https://www.naiveui.com/en-US/os-theme)を採用。 6 | 7 | ## 環境変数 8 | 9 | | 環境変数名 | 説明 | 例 | 10 | | ----------------------- | ------------------------------------- | ----------------------- | 11 | | VITE_DEFAULT_SERVER_URI | dashboard サーバー URI のデフォルト値 | "http://localhost:5555" | 12 | 13 | ## IDE 環境 14 | 15 | - [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) 16 | 17 | ## npm コマンド一覧 18 | 19 | - `npm run dev`:開発サーバーを立ち上げる 20 | - `npm run build`:アプリのビルド(`./dist`に格納される) 21 | 22 | ## Dockerを使ったビルド 23 | 24 | ```bash 25 | cd wsnet2-dashboard 26 | docker compose run --rm frontbuilder 27 | ``` 28 | 29 | ビルドされたコードは `wsnet2-dashboard/frontend/dist` に格納される。 30 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/README.md: -------------------------------------------------------------------------------- 1 | # Frontend 2 | 3 | [日本語](README-ja.md) 4 | 5 | SPA built using `Vue 3 + Typescript + Vite`. [NaiveUI](https://www.naiveui.com/en-US/os-theme) is used for UI. 6 | 7 | ## Environment variables 8 | 9 | | Name | Description | Example | 10 | | ----------------------- | ---------------------------- | ----------------------- | 11 | | VITE_DEFAULT_SERVER_URI | Default dashboard server uri | "http://localhost:5555" | 12 | 13 | ## Development environment 14 | 15 | - [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) 16 | 17 | ## npm Commands 18 | 19 | - `npm run dev`:run development server 20 | - `npm run build`:build the application(stored at `./dist`) 21 | 22 | ## Build the application with Docker 23 | 24 | ```bash 25 | cd wsnet2-dashboard 26 | docker compose run --rm frontbuilder 27 | ``` 28 | 29 | The built code will be stored at `wsnet2-dashboard/frontend/dist`. 30 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/apollo.config.js: -------------------------------------------------------------------------------- 1 | // apollo.config.js 2 | module.exports = { 3 | client: { 4 | service: { 5 | name: "wsnet2-dashboard", 6 | // URL to the GraphQL API 7 | url: "http://localhost:5555/graphql", 8 | }, 9 | // Files processed by the extension 10 | includes: ["src/**/*.vue", "src/**/*.ts"], 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wsnet2-dashboard", 3 | "version": "0.1.2", 4 | "scripts": { 5 | "dev": "NODE_ENV=development vite", 6 | "build": "vue-tsc --noEmit && vite build", 7 | "preview": "NODE_ENV=development vite preview" 8 | }, 9 | "dependencies": { 10 | "@apollo/client": "^3.5.8", 11 | "chart.js": "^3.7.1", 12 | "graphql": "^15.8.0", 13 | "graphql-tag": "^2.12.6", 14 | "vite-plugin-package-version": "^1.0.2", 15 | "vue": "^3.2.25", 16 | "vue-chart-3": "^3.1.8", 17 | "vue-router": "^4.0.12", 18 | "vuex": "^4.0.2", 19 | "vuex-persist": "^3.1.3" 20 | }, 21 | "devDependencies": { 22 | "@vicons/antd": "^0.12.0", 23 | "@vicons/carbon": "^0.12.0", 24 | "@vicons/fa": "^0.12.0", 25 | "@vicons/fluent": "^0.12.0", 26 | "@vicons/ionicons4": "^0.12.0", 27 | "@vicons/ionicons5": "^0.12.0", 28 | "@vicons/material": "^0.12.0", 29 | "@vicons/tabler": "^0.12.0", 30 | "@vitejs/plugin-vue": "^2.0.0", 31 | "naive-ui": "^2.25.1", 32 | "typescript": "^4.4.4", 33 | "vfonts": "^0.0.3", 34 | "vite": "^2.9.16", 35 | "vue-tsc": "^0.29.8", 36 | "vuex-module-decorators": "^2.0.0" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-dashboard/frontend/public/favicon.ico -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/apolloClient.ts: -------------------------------------------------------------------------------- 1 | // graphql 2 | import { 3 | ApolloClient, 4 | createHttpLink, 5 | InMemoryCache, 6 | } from "@apollo/client/core"; 7 | 8 | // graphql 9 | export default new ApolloClient({ 10 | cache: new InMemoryCache(), 11 | }); 12 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-dashboard/frontend/src/assets/logo.png -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | Artboard 46 2 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/components/PropsFilter.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 34 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/components/SliderRange.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 44 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/components/UnknownObject.vue: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "*.vue" { 4 | import { DefineComponent } from "vue"; 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any>; 7 | export default component; 8 | } 9 | 10 | interface ImportMetaEnv { 11 | readonly VITE_DEFAULT_SERVER_URI: string; 12 | } 13 | 14 | interface ImportMeta { 15 | readonly env: ImportMetaEnv; 16 | } 17 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/main.ts: -------------------------------------------------------------------------------- 1 | // base 2 | import { createApp } from "vue"; 3 | 4 | // views 5 | import App from "@/App.vue"; 6 | 7 | // font 8 | import "vfonts/Lato.css"; 9 | 10 | // plugins 11 | import { store } from "./store"; 12 | import router from "./router"; 13 | 14 | const app = createApp(App); 15 | app.use(router); 16 | app.use(store); 17 | app.mount("#app"); 18 | 19 | export default app; 20 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/store/index.ts: -------------------------------------------------------------------------------- 1 | import { createStore } from "vuex"; 2 | import VuexPersistence from "vuex-persist"; 3 | 4 | const vuexLocal = new VuexPersistence({ 5 | storage: window.localStorage, 6 | modules: ["settings"], 7 | }); 8 | 9 | export const store = createStore({ 10 | plugins: [vuexLocal.plugin], 11 | }); 12 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/store/settings.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Module, 3 | VuexModule, 4 | Mutation, 5 | getModule, 6 | } from "vuex-module-decorators"; 7 | import { store } from "."; 8 | import apolloClient from "../apolloClient"; 9 | import { createHttpLink } from "@apollo/client/core"; 10 | 11 | @Module({ 12 | dynamic: true, 13 | namespaced: true, 14 | name: "settings", 15 | store: store, 16 | preserveState: localStorage.getItem("vuex") !== null, 17 | }) 18 | class SettingsModule extends VuexModule { 19 | serverAddress = ""; 20 | theme = "dark"; 21 | 22 | @Mutation 23 | setServerAddress(address: string) { 24 | this.serverAddress = address; 25 | apolloClient.setLink( 26 | createHttpLink({ 27 | uri: `${this.serverAddress}/graphql`, 28 | fetchOptions: { 29 | mode: "cors", 30 | }, 31 | }) 32 | ); 33 | } 34 | 35 | @Mutation 36 | setTheme(theme: string) { 37 | this.theme = theme; 38 | } 39 | } 40 | 41 | export default getModule(SettingsModule); 42 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/src/styles/_variables.scss: -------------------------------------------------------------------------------- 1 | // Place SASS variable overrides here 2 | // $font-size-root: 18px; 3 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": ".", 3 | "compilerOptions": { 4 | "experimentalDecorators": true, 5 | "target": "esnext", 6 | "useDefineForClassFields": true, 7 | "module": "esnext", 8 | "moduleResolution": "node", 9 | "strict": true, 10 | "jsx": "preserve", 11 | "sourceMap": true, 12 | "resolveJsonModule": true, 13 | "esModuleInterop": true, 14 | "lib": ["esnext", "dom"], 15 | "types": ["naive-ui/volar"] 16 | }, 17 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] 18 | } 19 | -------------------------------------------------------------------------------- /wsnet2-dashboard/frontend/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite"; 2 | import vue from "@vitejs/plugin-vue"; 3 | import path from "path"; 4 | import loadVersion from "vite-plugin-package-version"; 5 | 6 | // https://vitejs.dev/config/ 7 | export default defineConfig({ 8 | plugins: [vue(), loadVersion()], 9 | resolve: { 10 | alias: { 11 | "@": path.resolve(__dirname, "src"), 12 | vue: "vue/dist/vue.esm-bundler.js", 13 | }, 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /wsnet2-dashboard/images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-dashboard/images/demo.gif -------------------------------------------------------------------------------- /wsnet2-dashboard/images/vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-dashboard/images/vscode.png -------------------------------------------------------------------------------- /wsnet2-dotnet/README.md: -------------------------------------------------------------------------------- 1 | # .NETのサンプルとテスト 2 | 3 | ## WSNet2.Client 4 | 5 | CUIで入力メッセージを送受信するサンプルです。 6 | 7 | 単純な機能の動作確認に利用できます。 8 | 9 | ## WSNet2.Core.Test 10 | 11 | C#実装のユニットテストです。 12 | 13 | ## WSNet2.Sample 14 | 15 | Unityのサンプルと連携するMasterClientとBotのサンプルです。 16 | 17 | 使い方は[README.mdの使ってみる](../README.md#使ってみる)を見てください。 18 | -------------------------------------------------------------------------------- /wsnet2-dotnet/WSNet2.Client/WSNet2.Client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /wsnet2-dotnet/WSNet2.Core.Test/ClientTests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using System.Runtime.Serialization; 3 | 4 | namespace WSNet2.Core.Test 5 | { 6 | public class ClientTests 7 | { 8 | [SetUp] 9 | public void Setup() 10 | { 11 | } 12 | 13 | [Test] 14 | public void Test1() 15 | { 16 | Assert.Pass(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /wsnet2-dotnet/WSNet2.Core.Test/EvPongTest.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using System.Collections.Generic; 3 | 4 | namespace WSNet2.Core.Test 5 | { 6 | public class EvPongTest 7 | { 8 | [Test] 9 | public void TestEvPongPayload() 10 | { 11 | var payload = new byte[]{ 12 | (byte)Type.ULong, 1,2,3,4,5,6,7,8, 13 | (byte)Type.UInt, 0,0,0,9, 14 | (byte)Type.Dict, 2, 15 | 1, (byte)'a', 0, 9, (byte)Type.ULong, 2,3,4,5,6,7,8,9, 16 | 2, (byte)'b', (byte)'b', 0, 9, (byte)Type.ULong, 3,4,5,6,7,8,9,10, 17 | }; 18 | var explmts = new Dictionary() { { "a", 0x0203040506070809 }, { "bb", 0x030405060708090a } }; 19 | 20 | var reader = WSNet2Serializer.NewReader(payload); 21 | var ev = new EvPong(reader); 22 | var lmts = new Dictionary() { { "a", 1 }, { "bb", 2 } }; 23 | ev.GetLastMsgTimestamps(lmts); 24 | 25 | Assert.AreEqual(0x0102030405060708, ev.PingTimestamp); 26 | Assert.AreEqual(9, ev.WatcherCount); 27 | Assert.AreEqual(explmts, lmts); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /wsnet2-dotnet/WSNet2.Core.Test/LoggerTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | 4 | namespace WSNet2.Core.Test 5 | { 6 | public class WSNet2LoggerTests 7 | { 8 | class Payload : WSNet2LogPayload 9 | { 10 | public int Foo { get; set; } 11 | 12 | public override string ToString() 13 | { 14 | return $"App={AppId} User={UserId} Foo={Foo}"; 15 | } 16 | } 17 | 18 | class Logger : IWSNet2Logger 19 | { 20 | public string output { get; private set; } 21 | 22 | public Payload Payload { get; } = new Payload(); 23 | 24 | public void Log(WSNet2LogLevel logLevel, Exception exception, string format, params object[] args) 25 | { 26 | output = $"{logLevel}[{Payload}] {string.Format(format, args)}"; 27 | } 28 | } 29 | 30 | [Test] 31 | public void ExampleWSNet2Logger() 32 | { 33 | var logger = new Logger(); 34 | logger.Payload.Foo = 100; 35 | 36 | var cli = new WSNet2Client("https://example.com", "TestAppId", "TestUser", new AuthData("", "", ""), logger); 37 | 38 | logger.Log(WSNet2LogLevel.Warning, null, "Hello {0}", "World"); 39 | 40 | Assert.AreEqual("Warning[App=TestAppId User=TestUser Foo=100] Hello World", logger.output); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /wsnet2-dotnet/WSNet2.Core.Test/WSNet2.Core.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wsnet2-dotnet/WSNet2.Sample/WSNet2.Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wsnet2-dotnet/build-commit: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | cd $(dirname "$0") 3 | readonly RID=${RID:-linux-x64} 4 | readonly PUBLISH_DIR=$(pwd)/bin 5 | readonly COMMIT=$(git rev-parse --short HEAD) 6 | 7 | for proj in WSNet2.Client WSNet2.Core.Test WSNet2.Sample; do 8 | pushd ${proj} 9 | dotnet clean 10 | dotnet publish -c Release -r ${RID} -o ${PUBLISH_DIR}/${proj}-${COMMIT} \ 11 | --self-contained=true -p:UseAppHost=true -p:PublishReadyToRun=true 12 | popd 13 | done 14 | -------------------------------------------------------------------------------- /wsnet2-unity-mirror/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !link.sh 3 | -------------------------------------------------------------------------------- /wsnet2-unity-mirror/Assets: -------------------------------------------------------------------------------- 1 | ../wsnet2-unity/Assets -------------------------------------------------------------------------------- /wsnet2-unity-mirror/Packages: -------------------------------------------------------------------------------- 1 | ../wsnet2-unity/Packages -------------------------------------------------------------------------------- /wsnet2-unity-mirror/ProjectSettings: -------------------------------------------------------------------------------- 1 | ../wsnet2-unity/ProjectSettings -------------------------------------------------------------------------------- /wsnet2-unity-mirror/link.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ln -s ../wsnet2-unity/Assets 3 | #ln -s ../wsnet2-unity/Library 4 | ln -s ../wsnet2-unity/Packages 5 | ln -s ../wsnet2-unity/ProjectSettings 6 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 265fdccf7ba314d8bbd17dcda268c99d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8449c59239c854498b38a4b6d79c6ee4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Annotations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1604ea7b8929e4840b8aa80464840415 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Annotations/Attributes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db21d74c4f54408a9acd69873192155c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Annotations/IMessagePackSerializationCallbackReceiver.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace MessagePack 5 | { 6 | public interface IMessagePackSerializationCallbackReceiver 7 | { 8 | void OnBeforeSerialize(); 9 | 10 | void OnAfterDeserialize(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Annotations/IMessagePackSerializationCallbackReceiver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef32599edd0f43366891b8da5d4aed1e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/BitOperations.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | // 5 | 6 | #if !NETCOREAPP 7 | 8 | using System.Runtime.CompilerServices; 9 | 10 | // Some routines inspired by the Stanford Bit Twiddling Hacks by Sean Eron Anderson: 11 | // http://graphics.stanford.edu/~seander/bithacks.html 12 | 13 | namespace System.Numerics 14 | { 15 | /// 16 | /// Utility methods for intrinsic bit-twiddling operations. 17 | /// The methods use hardware intrinsics when available on the underlying platform, 18 | /// otherwise they use optimized software fallbacks. 19 | /// 20 | internal static class BitOperations 21 | { 22 | /// 23 | /// Rotates the specified value left by the specified number of bits. 24 | /// Similar in behavior to the x86 instruction ROL. 25 | /// 26 | /// The value to rotate. 27 | /// The number of bits to rotate by. 28 | /// Any value outside the range [0..31] is treated as congruent mod 32. 29 | /// The rotated value. 30 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 31 | public static uint RotateLeft(uint value, int offset) 32 | => (value << offset) | (value >> (32 - offset)); 33 | } 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/BitOperations.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c1e411a42f526567af32d094a9de348 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/BufferWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91a2222860edec5ff9ee6e4fe1af7668 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/ExtensionHeader.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace MessagePack 7 | { 8 | #if MESSAGEPACK_INTERNAL 9 | internal 10 | #else 11 | public 12 | #endif 13 | struct ExtensionHeader : IEquatable 14 | { 15 | public sbyte TypeCode { get; private set; } 16 | 17 | public uint Length { get; private set; } 18 | 19 | public ExtensionHeader(sbyte typeCode, uint length) 20 | { 21 | this.TypeCode = typeCode; 22 | this.Length = length; 23 | } 24 | 25 | public ExtensionHeader(sbyte typeCode, int length) 26 | { 27 | this.TypeCode = typeCode; 28 | this.Length = (uint)length; 29 | } 30 | 31 | public bool Equals(ExtensionHeader other) => this.TypeCode == other.TypeCode && this.Length == other.Length; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/ExtensionHeader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92a76851178ab369fbc386556cb866ce 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/ExtensionResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Buffers; 6 | 7 | namespace MessagePack 8 | { 9 | #if MESSAGEPACK_INTERNAL 10 | internal 11 | #else 12 | public 13 | #endif 14 | struct ExtensionResult 15 | { 16 | public ExtensionResult(sbyte typeCode, Memory data) 17 | { 18 | this.TypeCode = typeCode; 19 | this.Data = new ReadOnlySequence(data); 20 | } 21 | 22 | public ExtensionResult(sbyte typeCode, ReadOnlySequence data) 23 | { 24 | this.TypeCode = typeCode; 25 | this.Data = data; 26 | } 27 | 28 | public sbyte TypeCode { get; private set; } 29 | 30 | public ReadOnlySequence Data { get; private set; } 31 | 32 | public ExtensionHeader Header => new ExtensionHeader(this.TypeCode, (uint)this.Data.Length); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/ExtensionResult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 153f71ac242b4218d9debb5971c7b5d4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d778b8c5d747408ca5fde5f1f38192c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/CollectionFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f92b8946eec0ab476a689a0dfa8c2498 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/CollectionHelpers`2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25f9fe82ddb369c8f9600901293b80f8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/DateTimeFormatters.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e28b94bd9483c36efae78067f97c65cb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/DictionaryFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f0984a238b11bd2c97eb781371bb121 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/DynamicObjectTypeFallbackFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc47abc7cd51279d9ac40fe1da6ffa1d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/EnumAsStringFormatter`1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7cdc1e759af9873989648baa08f0350 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/GenericEnumFormatter`1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f3275d9a9f3275ec9cc43d6859964fe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/IMessagePackFormatter`1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd75a2bcccf20dfb6824d447ec99a1fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/IgnoreFormatter`1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System.Buffers; 5 | 6 | namespace MessagePack.Formatters 7 | { 8 | public sealed class IgnoreFormatter : IMessagePackFormatter 9 | { 10 | public void Serialize(ref MessagePackWriter writer, T value, MessagePackSerializerOptions options) 11 | { 12 | writer.WriteNil(); 13 | } 14 | 15 | public T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) 16 | { 17 | reader.Skip(); 18 | return default(T); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/IgnoreFormatter`1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64fa7163708478803a466c61cdb596d6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/MultiDimensionalArrayFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a4af86ee0f0a74de9e88b1fe8c9826d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/NilFormatter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | namespace MessagePack.Formatters 5 | { 6 | public class NilFormatter : IMessagePackFormatter 7 | { 8 | public static readonly IMessagePackFormatter Instance = new NilFormatter(); 9 | 10 | private NilFormatter() 11 | { 12 | } 13 | 14 | public void Serialize(ref MessagePackWriter writer, Nil value, MessagePackSerializerOptions options) 15 | { 16 | writer.WriteNil(); 17 | } 18 | 19 | public Nil Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) 20 | { 21 | return reader.ReadNil(); 22 | } 23 | } 24 | 25 | // NullableNil is same as Nil. 26 | public class NullableNilFormatter : IMessagePackFormatter 27 | { 28 | public static readonly IMessagePackFormatter Instance = new NullableNilFormatter(); 29 | 30 | private NullableNilFormatter() 31 | { 32 | } 33 | 34 | public void Serialize(ref MessagePackWriter writer, Nil? value, MessagePackSerializerOptions options) 35 | { 36 | writer.WriteNil(); 37 | } 38 | 39 | public Nil? Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) 40 | { 41 | return reader.ReadNil(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/NilFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 708c91d45dcbf19469504ec78aa2abee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/NullableFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88e906d65ee7d29d3ae1fb5865b8f6ab 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/PrimitiveObjectFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d46d293dc804af1669409cc12690a3ad 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/StandardClassLibraryFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dc8f5f9191421c21bd1ba87f5a70d27 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/TypelessFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe17a811684aa2fa786684f83f7fbbe7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Formatters/UnsafeBinaryFormatters.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c4fcfc3f496806c7915aba0cdb3f1ba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/HashCode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9909e9074ddc955f18803bd2037102f7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/IFormatterResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51a5ebbfbdf12b0cc80f0f57550f61a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f094ede08a37b426f933177853517129 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/AsymmetricKeyHashTable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6862254987b9738ab9482616a323c2b5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/AutomataDictionary.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc94f4e5525f7ba44b4e68f3cdcb1050 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/ByteArrayStringHashTable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28c84212e5b4fc4d7b4b66cdb741984d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/CodeGenHelpers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f2dcc1d826e7ff7da02bd691c4dd6a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/DateTimeConstants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | 6 | namespace MessagePack.Internal 7 | { 8 | internal static class DateTimeConstants 9 | { 10 | internal const long BclSecondsAtUnixEpoch = 62135596800; 11 | internal const int NanosecondsPerTick = 100; 12 | internal static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/DateTimeConstants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0cf18db43b878d71a216123e3309b65 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/DynamicAssembly.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f44ca64eddd25f5a896a2f72b21fcc9b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/ExpressionUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e2163b0f9d41a70599e1d5bd231a4b6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/FarmHash.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb5a050df97c09dd9b40337e9c0bbdcd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/GuidBits.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bb83f98e290402db9fcb6da74f773ca 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/ILGeneratorExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7fcc89bc1ce33b46b7e5d8bcaa7f0fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/ReflectionExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82787207c36d0a4a98d7f53b49ba1576 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/Sequence`1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19e730b2bfc50b981bdcd41c703daab2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/ThreadsafeTypeKeyHashTable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 517dd6b1707013015b06ebfbeeea1f2c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/TinyJsonReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adc1157b80c30cf2d8845336b9c1cfc2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Internal/UnsafeMemory.Low.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2126473180c3a7d3a8860c4fd8aa4183 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2de81a761dc1b48958d351138700acc0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4/LZ4Codec.Helper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f33bc878911a8855d8df41dd514c5a42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4/LZ4Codec.Safe.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fe9256cf4f62c6df8c144caef0ebc6a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4/LZ4Codec.Safe32.Dirty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e76c34fb36d14138b0196dbb3bdc544 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4/LZ4Codec.Safe64.Dirty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31798435f43678c67b458999c71cfbb3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4/LZ4Codec.Unsafe.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 719385c28cab29b71a262f02263f385e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4/LZ4Codec.Unsafe32.Dirty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44efef809614456e8a4d40559c526efa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4/LZ4Codec.Unsafe64.Dirty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa2e5105dcebe0410bb8ed76f622889f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/LZ4/LZ4Codec.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b67a7760eb98ee768b90af4f2d6d9dc4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePack.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MessagePack", 3 | "references": [], 4 | "optionalUnityReferences": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": true, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [] 13 | } -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePack.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddc6e27fff8ae94ed9ccb00c84df6e24 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackCode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d493a26c728a2e7d2abf11945f3486c3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackCompression.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 465ff1ba0b3de79669df07fa6a47971d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83f0995886fa5ea1fab77523785e1982 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackSecurity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26fcc356242b5925cb5329bd41e488c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackSerializationException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 839dc4ff13364b00e8d85ca4c6293047 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackSerializer.Json.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc00f1de4bb511e45840cd820c364204 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackSerializer.NonGeneric.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16a18255b8720219687e6195745bf4a3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7b51af2d7d3d2fb985dbe15e77b9461 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackSerializerOptions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97c761333b96605e78fae4ae77707e1b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackStreamReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 680529136fcef07e78156a87b5d33f1f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/MessagePackWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3855642516b66bac99136d08d7dd7a8e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Nil.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Buffers; 6 | 7 | namespace MessagePack 8 | { 9 | #if MESSAGEPACK_INTERNAL 10 | internal 11 | #else 12 | public 13 | #endif 14 | struct Nil : IEquatable 15 | { 16 | public static readonly Nil Default = default(Nil); 17 | 18 | public override bool Equals(object obj) 19 | { 20 | return obj is Nil; 21 | } 22 | 23 | public bool Equals(Nil other) 24 | { 25 | return true; 26 | } 27 | 28 | public override int GetHashCode() 29 | { 30 | return 0; 31 | } 32 | 33 | public override string ToString() 34 | { 35 | return "()"; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Nil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a76d2880a8f9b1f7b740d0c5e62a461 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 441b086484d604f76a3c2e3b160ab217 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/AttributeFormatterResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1da7b0fb18e1d4e79aeb7ac56ba9607 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/BuiltinResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22f2bfd36b9810653baff3342b3403e7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/CachingFormatterResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 961f65a9ca79040c5b3021c7612f3c08 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/CompositeResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed6833da3299a096c923be585b3372a1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/ContractlessReflectionObjectResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 953431b29940de61a8da84acda591d9e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/DynamicEnumAsStringResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54a09685d140ed621bbd779af8f4e6cc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/DynamicEnumResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56f454cdc164d6a03bcb2dd11fa9e73a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/DynamicGenericResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c97d6b550962b8536b1363db3bd98cae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/DynamicObjectResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14db1290355a2f56a919749640cbcc7c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/DynamicUnionResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90ad303c7072b2339bba5b667f71b34c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/NativeDateTimeResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bee453915d14c4376a4cf68b338f7f4a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/NativeDecimalResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 058b6071c8115560499afd0cc97e2fbd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/NativeGuidResolver.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using MessagePack.Formatters; 6 | 7 | namespace MessagePack.Resolvers 8 | { 9 | public sealed class NativeGuidResolver : IFormatterResolver 10 | { 11 | /// 12 | /// The singleton instance that can be used. 13 | /// 14 | public static readonly NativeGuidResolver Instance = new NativeGuidResolver(); 15 | 16 | private NativeGuidResolver() 17 | { 18 | } 19 | 20 | public IMessagePackFormatter GetFormatter() 21 | { 22 | return FormatterCache.Formatter; 23 | } 24 | 25 | private static object GetFormatterHelper(Type t) 26 | { 27 | if (t == typeof(Guid)) 28 | { 29 | return NativeGuidFormatter.Instance; 30 | } 31 | else if (t == typeof(Guid?)) 32 | { 33 | return new StaticNullableFormatter(NativeGuidFormatter.Instance); 34 | } 35 | 36 | return null; 37 | } 38 | 39 | private static class FormatterCache 40 | { 41 | public static readonly IMessagePackFormatter Formatter; 42 | 43 | static FormatterCache() 44 | { 45 | Formatter = (IMessagePackFormatter)GetFormatterHelper(typeof(T)); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/NativeGuidResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a800419f557b36754a52fca66a1ed462 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/PrimitiveObjectResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b5a40f7f1c67953c8b8066277e196f6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/StandardResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2273a153a02536bb1809f799fbfb2ceb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/StaticCompositeResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26c258a5a36d7dbf99caf4e98a7cbd53 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/TypelessContractlessStandardResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4b1e4648b37d6308ac35a0e31148ab0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Resolvers/TypelessObjectResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 857aa0d32f3e2955491df1c9d5bb6f5d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/SequencePool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd6feadb8ef11ef71b6f41d1dda885d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/SequenceReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbb8a87bafcd3e0c9ad1efa790e7943c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/SequenceReaderExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7badd702e46d7aef6ad8c347e9c0d0cf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/StreamPolyfillExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac9db623f6c6eb2f3aa9b726e830686f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/StringEncoding.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) All contributors. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Diagnostics; 6 | using System.Runtime.CompilerServices; 7 | using System.Runtime.InteropServices; 8 | using System.Text; 9 | 10 | namespace MessagePack 11 | { 12 | internal static class StringEncoding 13 | { 14 | internal static readonly Encoding UTF8 = new UTF8Encoding(false); 15 | 16 | #if !NETCOREAPP2_1 // Define the extension method only where an instance method does not already exist. 17 | internal static unsafe string GetString(this Encoding encoding, ReadOnlySpan bytes) 18 | { 19 | if (bytes.Length == 0) 20 | { 21 | return string.Empty; 22 | } 23 | 24 | fixed (byte* pBytes = bytes) 25 | { 26 | return encoding.GetString(pBytes, bytes.Length); 27 | } 28 | } 29 | #endif 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/StringEncoding.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d113f4a9f2be39b9cb4d38521393fd3e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/T4.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c263da74e651a4528a710f604f31c73c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/T4/ForceSizePrimitiveFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7eebcdcfb5f87535cb2728f1c21072c2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/T4/MessagePackReader.Integers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c9a5153765d7dad39b4cc6d78e16f2c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/T4/PrimitiveFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fcb53a5d362d2e38b66d0a88d35d78f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/T4/TupleFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21aa85f0a0973185698eec9b4ef8f3ba 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/T4/UnsafeMemory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba8adf167b655e2a5a091ac6af276bb3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/T4/ValueTupleFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dd3287be759a5f388a0a1f53b283b7d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/ThisLibraryExtensionTypeCodes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7117971732be36a9da8f6a510364b4e5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c5579cff6cad4cf8bf28b17ec4243f9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Unity/Extension.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ede3ccfc047964292be2bcfdb4105a8c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Unity/Extension/UnityBlitResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef834ed39aa3bf457860be80e97a5d9c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Unity/Extension/UnsafeBlitFormatter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2955ae5d4f31948548df2c805124f4c6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Unity/Formatters.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bccce8bedf4b84bfd8a5b74edf3f232f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Unity/MessagePackWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e1974f6daf2611d0b8a78fe6230f4a8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Unity/UnityResolver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b64d9daec5fd9b985abcb65adcf699 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/MessagePack/Scripts/Utilities.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 908e893ec90c3e0a4acd036922925d17 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 725893a11640f43b38cbe6322830dfe9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins/System.Buffers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-unity/Assets/Plugins/System.Buffers.dll -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins/System.Buffers.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce837d1683742b46ab956fb33360fafe 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: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins/System.Memory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-unity/Assets/Plugins/System.Memory.dll -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins/System.Memory.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 273576731295a11c1b7fca8490ef5afd 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: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins/System.Runtime.CompilerServices.Unsafe.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-unity/Assets/Plugins/System.Runtime.CompilerServices.Unsafe.dll -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins/System.Runtime.CompilerServices.Unsafe.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4ad452d6724491ca843aaee0eacf0e1 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: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins/System.Threading.Tasks.Extensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-unity/Assets/Plugins/System.Threading.Tasks.Extensions.dll -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Plugins/System.Threading.Tasks.Extensions.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d5fdfa6c0d89190186e8a6be326096d 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: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9b3148d134b79b4e93bd1c7e81cfff9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Ball.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cca719c4c658b4e24aa507f5345c4eab 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/BallView.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Sample 4 | { 5 | public class BallView : MonoBehaviour 6 | { 7 | Vector2 direction; 8 | float speed; 9 | 10 | /// 11 | /// 座標更新 12 | /// 13 | public void UpdatePosition(Logic.Ball ball) 14 | { 15 | direction = ball.Direction; 16 | transform.position = ball.Position; 17 | speed = ball.Speed; 18 | transform.localScale = new Vector3(ball.Radius / 2, ball.Radius / 2, 1); 19 | } 20 | 21 | // Start is called before the first frame update 22 | void Start() 23 | { 24 | } 25 | 26 | // Update is called once per frame 27 | void Update() 28 | { 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/BallView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bb6aa7b97533468fa8689b9f185192e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Bar.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b751ac46e22a34e849e62d60aec5a2cd 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/BarView.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Sample 4 | { 5 | public class BarView : MonoBehaviour 6 | { 7 | Vector2 direction; 8 | float speed; 9 | 10 | /// 11 | /// 座標更新 12 | /// 13 | public void UpdatePosition(Logic.Bar bar) 14 | { 15 | direction = bar.Direction; 16 | transform.position = bar.Position; 17 | speed = bar.Speed; 18 | transform.localScale = new Vector3(bar.Width / 4, bar.Height / 4, 1); 19 | } 20 | 21 | // Start is called before the first frame update 22 | void Start() 23 | { 24 | } 25 | 26 | // Update is called once per frame 27 | void Update() 28 | { 29 | } 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/BarView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 473829877fe9f4ac7a3d5c0e1fa58e2e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-unity/Assets/Sample/Circle.png -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/G.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using WSNet2; 3 | 4 | namespace Sample 5 | { 6 | /// 7 | /// グローバル変数 8 | /// 9 | public static class G 10 | { 11 | /// 12 | /// WSNet2クライアント 13 | /// 14 | public static WSNet2Client Client; 15 | 16 | /// 17 | /// 現在アクティブなゲームルーム 18 | /// 19 | public static Room GameRoom; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/G.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 563d1a6f60e514762a57dbc34c2f624d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/GameScene.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25885e0664920472296e5a87948aa51f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/InputFieldScript.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace Sample 7 | { 8 | /// 9 | /// InputField のデフォルト文字を設定するコンポーネント 10 | /// 11 | public class InputFieldScript : MonoBehaviour 12 | { 13 | public string deafultText; 14 | 15 | void Start() 16 | { 17 | if (this.deafultText != null) 18 | { 19 | var inputField = GetComponent(); 20 | inputField.text = deafultText; 21 | } 22 | } 23 | 24 | void Update() 25 | { 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/InputFieldScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cd3206fe4f724033a2132aee5006439 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Logic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efc55c352df4c4f65befa3aa0a03f12f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Logic/Logger.cs: -------------------------------------------------------------------------------- 1 | namespace Sample.Logic 2 | { 3 | static class Logger 4 | { 5 | public static void Debug(string format, params object[] args) 6 | { 7 | #if UNITY_5_3_OR_NEWER 8 | UnityEngine.Debug.Log(string.Format(format, args)); 9 | #else 10 | System.Console.WriteLine(string.Format(format, args)); 11 | #endif 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Logic/Logger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0cefc9704aff42bfb2dababed909eaf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Logic/RPCBridge.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4e59d482915bc27fac9a10482182a42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Logic/Simulator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3183f8895da3486c945f3e645e71e0d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Logic/UnityType.cs: -------------------------------------------------------------------------------- 1 | #if !UNITY_5_3_OR_NEWER 2 | 3 | namespace Sample.Logic 4 | { 5 | 6 | /// 7 | /// UnityEngine.Vector2 を Unity非依存の環境で処理するための型 8 | /// 9 | public struct Vector2 10 | { 11 | public float x; 12 | public float y; 13 | 14 | public Vector2(float x, float y) 15 | { 16 | this.x = x; 17 | this.y = y; 18 | } 19 | } 20 | 21 | /// 22 | /// UnityEngine.Vector3 を Unity非依存の環境で処理するための型 23 | /// 24 | public struct Vector3 25 | { 26 | public float x; 27 | public float y; 28 | public float z; 29 | 30 | public Vector3(float x, float y, float z) 31 | { 32 | this.x = x; 33 | this.y = y; 34 | this.z = z; 35 | } 36 | } 37 | 38 | } 39 | 40 | #endif -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Logic/UnityType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe62ac10735644ed7a288a1bd73d93bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Logic/WSNet2Helper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f17c27d4f7d05407bb14a13c37aaf0a3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/MessagePack.generated.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bafae0197874fb2f904ef1de9104f37 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-unity/Assets/Sample/Square.png -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Sample/TitleScene.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e34daee15d60c4969b9c254bd9e329ae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 832dcc4654e8f3446baf4bc9a1a5b761 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Scenes/Game.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82737b7036e8144ea9206f28ab7c68bd 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/Scenes/Title.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32bf42b2154c64d67b84ebc519decdd6 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a74a4a93862a5d04c8e59c7772606f0a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4bc6203056bafda45906dd5b6fc93f1a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a31c5aaef9c79314ba5dad4a17f34a80 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/AuthData.cs: -------------------------------------------------------------------------------- 1 | namespace WSNet2 2 | { 3 | public class AuthData 4 | { 5 | public string MACKey { get; } 6 | public string Bearer { get; } 7 | public string EncryptedMACKey { get; } 8 | 9 | public AuthData(string macKey, string bearer, string encMKey) 10 | { 11 | MACKey = macKey; 12 | Bearer = bearer; 13 | EncryptedMACKey = encMKey; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/AuthData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b047880f2eb38b740aac204526037037 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/AuthDataGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 119e96834b113e34db7b4781e9e8c180 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/CallbackPool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | 4 | namespace WSNet2 5 | { 6 | /// 7 | /// Callbackを溜めておいて後から実行できるようにするやつ. 8 | /// 9 | /// 10 | /// 11 | /// Unityではcallbackをメインスレッドで動かしたいので溜めておいて、 12 | /// メインスレッドでProcess()を呼び出すようにする。 13 | /// 14 | /// 15 | /// DotNetの場合にも適当なスレッドで定期的にProcess()を呼び出す必要がある。 16 | /// 17 | /// 18 | public class CallbackPool 19 | { 20 | ConcurrentQueue queue = new ConcurrentQueue(); 21 | Func isRunning; 22 | 23 | public CallbackPool() 24 | { 25 | isRunning = () => true; 26 | } 27 | 28 | public CallbackPool(Func isRunning) 29 | { 30 | this.isRunning = isRunning; 31 | } 32 | 33 | /// 34 | /// callbackをpoolに追加 35 | /// 36 | public void Add(Action callback) 37 | { 38 | queue.Enqueue(callback); 39 | } 40 | 41 | /// 42 | /// Callbackを追加された順に実行する 43 | /// 44 | public void Process() 45 | { 46 | while (isRunning()) 47 | { 48 | Action callback; 49 | 50 | if (!queue.TryDequeue(out callback)) 51 | { 52 | return; 53 | } 54 | 55 | callback(); 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/CallbackPool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0d584a45ddb7e64586b229ef8fce64a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Connection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4d47da2ffd13ab428194c861b50c245 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/DefaultHttpClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net.Http; 4 | using System.Threading.Tasks; 5 | 6 | namespace WSNet2 7 | { 8 | /// 9 | /// System.Net.Http.HttpClientを使ったPOSTの実装 10 | /// 11 | static class DefaultHttpClient 12 | { 13 | static HttpClient client; 14 | 15 | public static void Post(string url, IReadOnlyDictionary headers, byte[] content, TaskCompletionSource<(int, byte[])> tcs) 16 | { 17 | Task.Run(async () => 18 | { 19 | try 20 | { 21 | var request = new HttpRequestMessage(HttpMethod.Post, url); 22 | request.Content = new ByteArrayContent(content); 23 | foreach (var kv in headers) 24 | { 25 | request.Headers.Add(kv.Key, kv.Value); 26 | } 27 | 28 | client ??= new HttpClient(); 29 | var res = await client.SendAsync(request); 30 | var body = await res.Content.ReadAsByteArrayAsync(); 31 | 32 | tcs.TrySetResult(((int)res.StatusCode, body)); 33 | } 34 | catch (Exception e) 35 | { 36 | tcs.TrySetException(e); 37 | } 38 | }); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/DefaultHttpClient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 886b717e439330ff9aaa0f7644aae00c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c548901d58cde64face091ebeee0eb8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvClientProp.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace WSNet2 4 | { 5 | public class EvClientProp : Event 6 | { 7 | public string ClientID; 8 | 9 | Dictionary props; 10 | 11 | public EvClientProp(SerialReader reader) : base(EvType.ClientProp, reader) 12 | { 13 | ClientID = reader.ReadString(); 14 | props = null; 15 | } 16 | 17 | public Dictionary GetProps(IDictionary recycle = null) 18 | { 19 | if (props == null) 20 | { 21 | props = reader.ReadDict(recycle); 22 | } 23 | 24 | return props; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvClientProp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ac37d2b39eae8f48b112973c723e988 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvClosed.cs: -------------------------------------------------------------------------------- 1 | namespace WSNet2 2 | { 3 | public class EvClosed : Event 4 | { 5 | public string Description { get; private set; } 6 | 7 | public EvClosed(string description) : base(EvType.Closed, null) 8 | { 9 | Description = description; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvClosed.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbbbe89d2ab5fe646841612a828a204b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvJoined.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace WSNet2 4 | { 5 | /// 6 | /// プレイヤーが入室しました 7 | /// 8 | /// 9 | /// 10 | /// 自分自身の入室イベントも送られる(一番最初になるはず) 11 | /// 12 | /// 13 | public class EvJoined : Event 14 | { 15 | /// プレイヤーのID 16 | public string ClientID { get; private set; } 17 | 18 | /// プロパティ(内部保持用) 19 | Dictionary props; 20 | 21 | /// 22 | /// コンストラクタ 23 | /// 24 | /// 25 | /// 26 | /// Propsはこの時点ではまだデシリアライズせず、 27 | /// 必要になったタイミングでGetPropsを呼ぶことでデシリアライズする。 28 | /// 29 | /// 30 | public EvJoined(SerialReader reader) : base(EvType.Joined, reader) 31 | { 32 | ClientID = reader.ReadString(); 33 | props = null; 34 | } 35 | 36 | /// 37 | /// Propを取得 38 | /// 39 | /// 40 | /// 41 | /// 可能ならrecycleを再利用したいため、Unityのメインスレッドから呼ぶ必要がある。 42 | /// 43 | /// 44 | public Dictionary GetProps(IDictionary recycle = null) 45 | { 46 | if (props == null) 47 | { 48 | props = reader.ReadDict(recycle); 49 | } 50 | 51 | return props; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvJoined.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9398de39f252ef342a2d611055917578 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvLeft.cs: -------------------------------------------------------------------------------- 1 | namespace WSNet2 2 | { 3 | /// 4 | /// プレイヤーが退室しました 5 | /// 6 | public class EvLeft : Event 7 | { 8 | /// 退室したPlayer 9 | public string ClientID { get; private set; } 10 | public string MasterID { get; private set; } 11 | public string Message { get; private set; } 12 | 13 | /// 14 | /// コンストラクタ 15 | /// 16 | public EvLeft(SerialReader reader) : base(EvType.Left, reader) 17 | { 18 | ClientID = reader.ReadString(); 19 | MasterID = reader.ReadString(); 20 | Message = reader.ReadString(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvLeft.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b5dbcecb613d7b468e15cd02490e1c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvMasterSwitched.cs: -------------------------------------------------------------------------------- 1 | namespace WSNet2 2 | { 3 | /// 4 | /// マスタープレイヤーが交代しました 5 | /// 6 | public class EvMasterSwitched : Event 7 | { 8 | public string NewMasterId { get; private set; } 9 | 10 | /// 11 | /// コンストラクタ 12 | /// 13 | public EvMasterSwitched(SerialReader reader) : base(EvType.MasterSwitched, reader) 14 | { 15 | NewMasterId = reader.ReadString(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvMasterSwitched.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e82e4d1e855abe4a807ce7dc686f38b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvPeerReady.cs: -------------------------------------------------------------------------------- 1 | namespace WSNet2 2 | { 3 | /// 4 | /// Gameサーバ側のPeerの準備完了通知 5 | /// 6 | public class EvPeerReady : Event 7 | { 8 | /// 9 | /// Game側が最後に受け取ったMsgの通し番号 10 | /// 11 | /// 12 | /// 13 | /// クライアントはwebsocket接続した後、このEventを受け取るまでMsgを送信しない。 14 | /// このEvent受信後、LasMsgSeqNumの次のMsgから送りはじめる(再送含む)。 15 | /// 16 | /// 17 | public int LastMsgSeqNum { get; private set; } 18 | 19 | /// 20 | /// コンストラクタ 21 | /// 22 | public EvPeerReady(SerialReader reader) : base(EvType.PeerReady, reader) 23 | { 24 | LastMsgSeqNum = reader.Get24(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvPeerReady.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7ce2c06dada46c458701222cb863e30 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvPong.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace WSNet2 5 | { 6 | public class EvPong : Event 7 | { 8 | public ulong PingTimestamp { get; private set; } 9 | public ulong RTT { get; private set; } 10 | public uint WatcherCount { get; private set; } 11 | 12 | Dictionary lastMsgTimestamps; 13 | 14 | public EvPong(SerialReader reader) : base(EvType.Pong, reader) 15 | { 16 | var now = (ulong)((DateTimeOffset)DateTime.Now).ToUnixTimeMilliseconds(); 17 | 18 | PingTimestamp = reader.ReadULong(); 19 | WatcherCount = reader.ReadUInt(); 20 | RTT = now - PingTimestamp; 21 | } 22 | 23 | public void GetLastMsgTimestamps(Dictionary output) 24 | { 25 | if (lastMsgTimestamps == null) 26 | { 27 | lastMsgTimestamps = reader.ReadIntoULongDict(output); 28 | return; 29 | } 30 | 31 | foreach (var kv in lastMsgTimestamps) 32 | { 33 | output[kv.Key] = kv.Value; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvPong.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50a70d8693d09db4abfe4b77f4b65e46 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvRPC.cs: -------------------------------------------------------------------------------- 1 | namespace WSNet2 2 | { 3 | /// 4 | /// RPCイベント 5 | /// 6 | /// 7 | /// 8 | /// EvType.MessageのメッセージをRPCとして利用する。 9 | /// 10 | /// 11 | public class EvRPC : Event 12 | { 13 | /// 送信者 14 | public string SenderID { get; private set; } 15 | 16 | public byte RpcID { get; private set; } 17 | 18 | public SerialReader Reader { get { return reader; } } 19 | 20 | /// 21 | /// コンストラクタ 22 | /// 23 | /// 24 | /// 25 | /// メッセージの中身はまだデシリアライズしない。 26 | /// RPC呼び出し時にメインスレッドでデシリアライズする。 27 | /// 28 | /// 29 | public EvRPC(SerialReader reader) : base(EvType.Message, reader) 30 | { 31 | SenderID = reader.ReadString(); 32 | RpcID = reader.ReadByte(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvRPC.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58250fb0f9e25ba44b2cf88b21e46c60 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvRejoin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9b126c8f1d0383439e62746b17d3863 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvResponse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 134db531fd1b47d4084a943b67e65f62 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/EvRoomProp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3c284db26e50d5489b841a874206fac 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Event/Event.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f19974bbb41b4b4482f7c69bf3b3bbd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Exceptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WSNet2 4 | { 5 | /// 6 | /// ロビーで起こりうる正常系の例外 7 | /// 8 | public class LobbyNormalException : Exception 9 | { 10 | public LobbyNormalException(string message) : base(message) { } 11 | } 12 | 13 | /// 14 | /// サーバ側の部屋数上限に達した例外 15 | /// 16 | public class RoomLimitException : LobbyNormalException 17 | { 18 | public RoomLimitException(string message) : base(message) { } 19 | } 20 | 21 | /// 22 | /// 入室可能な部屋が見つからなかった例外 23 | /// 24 | public class RoomNotFoundException : LobbyNormalException 25 | { 26 | public RoomNotFoundException(string message) : base(message) { } 27 | } 28 | 29 | /// 30 | /// 満室で入室できなかった例外 31 | /// 32 | public class RoomFullException : LobbyNormalException 33 | { 34 | public RoomFullException(string message) : base(message) { } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Exceptions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 398df9627eda528409645bb5d244736b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/IWSNet2Logger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a3039bade36f5a41806a28ec756a59d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Logger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc1a9b630e06740bd92d8adad0442af2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0bdd7c484d4c4c43b27accf6bbcd846 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/ClientInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using MessagePack; 3 | 4 | namespace WSNet2 5 | { 6 | [MessagePackObject] 7 | public class ClientInfo 8 | { 9 | [Key("id")] 10 | public string Id; 11 | 12 | [Key("props")] 13 | public byte[] Props; 14 | 15 | public ClientInfo() 16 | { 17 | } 18 | 19 | public ClientInfo(string id, IDictionary props = null) 20 | { 21 | this.Id = id; 22 | 23 | var writer = WSNet2Serializer.GetWriter(); 24 | lock (writer) 25 | { 26 | writer.Reset(); 27 | writer.Write(props); 28 | var arr = (IList)writer.ArraySegment(); 29 | this.Props = new byte[arr.Count]; 30 | arr.CopyTo(this.Props, 0); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/ClientInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc105103400caf941b3e4cb36b67f835 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/JoinedRoom.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace WSNet2 4 | { 5 | [MessagePackObject] 6 | public class JoinedRoom 7 | { 8 | [Key("room_info")] 9 | public RoomInfo roomInfo; 10 | 11 | [Key("players")] 12 | public ClientInfo[] players; 13 | 14 | [Key("url")] 15 | public string url; 16 | 17 | [Key("auth_key")] 18 | public string authKey; 19 | 20 | [Key("master_id")] 21 | public string masterId; 22 | 23 | [Key("deadline")] 24 | public uint deadline; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/JoinedRoom.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30249fdadc7ecae49a472356f4e96ff1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/LobbyParams.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ef704fdd0d27384c8027f2629c12e28 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/LobbyResponse.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace WSNet2 4 | { 5 | [MessagePackObject] 6 | public class LobbyResponse 7 | { 8 | [Key("msg")] 9 | public string msg; 10 | 11 | [Key("type")] 12 | public LobbyResponseType type; 13 | 14 | [Key("room")] 15 | public JoinedRoom room; 16 | 17 | [Key("rooms")] 18 | public RoomInfo[] rooms; 19 | } 20 | 21 | public enum LobbyResponseType : byte 22 | { 23 | OK = 0, 24 | RoomLimit, 25 | NoRoomFound, 26 | RoomFull, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/LobbyResponse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e7c7e0e5f60ba149a5115eb31a490e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/Query.Condition.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace WSNet2 4 | { 5 | public partial class Query 6 | { 7 | public enum Op : byte 8 | { 9 | Equal = 0, 10 | Not, 11 | LessThan, 12 | LessEqual, 13 | GreaterThan, 14 | GreaterEqual, 15 | Contain, 16 | NotContain, 17 | } 18 | 19 | [MessagePackObject] 20 | public class Condition 21 | { 22 | [Key(0)] 23 | public string key; 24 | 25 | [Key(1)] 26 | public Op op; 27 | 28 | [Key(2)] 29 | public byte[] val; 30 | 31 | public Condition() { } 32 | 33 | public Condition(string key, Op op, byte[] val) 34 | { 35 | this.key = key; 36 | this.op = op; 37 | this.val = val; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/Query.Condition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3287cf48d3ac3fa4c8c60a13e486189a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/RoomInfo.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | namespace WSNet2 4 | { 5 | [MessagePackObject] 6 | public class RoomInfo 7 | { 8 | [Key("id")] 9 | public string id; 10 | 11 | [Key("app_id")] 12 | public string appId; 13 | 14 | [Key("host_id")] 15 | public uint hostId; 16 | 17 | [Key("visible")] 18 | public bool visible; 19 | 20 | [Key("joinable")] 21 | public bool joinable; 22 | 23 | [Key("watchable")] 24 | public bool watchable; 25 | 26 | [Key("number")] 27 | public int number; 28 | 29 | [Key("search_group")] 30 | public uint searchGroup; 31 | 32 | [Key("max_players")] 33 | public uint maxPlayers; 34 | 35 | [Key("players")] 36 | public uint players; 37 | 38 | [Key("watchers")] 39 | public uint watchers; 40 | 41 | [Key("public_props")] 42 | public byte[] publicProps; 43 | 44 | [Key("private_props")] 45 | public byte[] privateProps; 46 | 47 | [Key("created")] 48 | public long created; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/RoomInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c324108382bd32e4183d6f036270d403 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/MessagePack/RoomOption.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11f6be0e05570e64e8782ca8d46502e8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Msg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcec4bb69fd3b914d858485abdc2bcac 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Msg/Msg.cs: -------------------------------------------------------------------------------- 1 | namespace WSNet2 2 | { 3 | public enum MsgType 4 | { 5 | Ping = 1, 6 | 7 | Leave = MsgTypeExt.regularMsgType, 8 | RoomProp, 9 | ClientProp, 10 | SwitchMaster, 11 | Target, 12 | ToMaster, 13 | Broadcast, 14 | Kick, 15 | } 16 | 17 | static class MsgTypeExt 18 | { 19 | public const int regularMsgType = 30; 20 | 21 | public static bool IsRegular(this MsgType type) => (int)type >= regularMsgType; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Msg/Msg.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6be16d7382143594298993c923641898 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Msg/MsgPing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | 4 | namespace WSNet2 5 | { 6 | public class MsgPing 7 | { 8 | public ArraySegment Value { get; private set; } 9 | 10 | byte[] buf; 11 | HMAC hmac; 12 | int hsize; 13 | 14 | public MsgPing(HMAC hmac) 15 | { 16 | this.hmac = hmac; 17 | this.hsize = hmac.HashSize / 8; 18 | this.buf = new byte[9 + hsize]; 19 | buf[0] = (byte)MsgType.Ping; 20 | 21 | Value = new ArraySegment(buf); 22 | } 23 | 24 | public ulong SetTimestamp() 25 | { 26 | var now = DateTime.UtcNow; 27 | var unix = (ulong)((DateTimeOffset)now).ToUnixTimeMilliseconds(); 28 | 29 | buf[1] = (byte)((unix & 0xff00000000000000) >> 56); 30 | buf[2] = (byte)((unix & 0xff000000000000) >> 48); 31 | buf[3] = (byte)((unix & 0xff0000000000) >> 40); 32 | buf[4] = (byte)((unix & 0xff00000000) >> 32); 33 | buf[5] = (byte)((unix & 0xff000000) >> 24); 34 | buf[6] = (byte)((unix & 0xff0000) >> 16); 35 | buf[7] = (byte)((unix & 0xff00) >> 8); 36 | buf[8] = (byte)(unix & 0xff); 37 | 38 | byte[] hash; 39 | lock (hmac) 40 | { 41 | hash = hmac.ComputeHash(buf, 0, 9); 42 | } 43 | 44 | Buffer.BlockCopy(hash, 0, buf, 9, hsize); 45 | 46 | return unix; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Msg/MsgPing.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05c58859a0bba8b4d8f6e764e9178cad 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Msg/MsgPool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7d73d56fc0406641b08ce88cbb04114 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/NetworkInformer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17149eae6525cc74291ff90885dbae83 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Player.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace WSNet2 5 | { 6 | /// 7 | /// Room内にいるPlayer 8 | /// 9 | public class Player 10 | { 11 | /// ID 12 | public string Id { get; private set; } 13 | 14 | /// カスタムプロパティ 15 | /// 16 | /// 17 | /// 値はシリアライズ可能なものに限る 18 | /// 19 | /// 20 | public Dictionary Props; 21 | 22 | /// 23 | /// コンストラクタ 24 | /// 25 | public Player(ClientInfo info) 26 | { 27 | Id = info.Id; 28 | var reader = WSNet2Serializer.NewReader(info.Props); 29 | Props = reader.ReadDict(); 30 | } 31 | 32 | /// 33 | /// コンストラクタ 34 | /// 35 | public Player(string id, Dictionary props) 36 | { 37 | Id = id; 38 | Props = props; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Player.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f99140a927c49f943b3c0129ebfa77c2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/PublicRoom.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b318fac591435476aa75bd5dc55b32bf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Query.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3eb8401b1630e0c4aac9ec82930e90fe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/Room.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a1ff11d3c66f71459a79aa73106a296 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/SerialReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 049bbd7d9a577764bbe6e4a629b204f6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/SerialWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a212370bcaa925f4891908d8caa622af 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/WSNet2Client.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d1bc7ad7eb38c44f8f4378c1e5c3209 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/WSNet2Serializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7640a66e6eabe934c9db3941c5177ce9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/WSNet2Settings.cs: -------------------------------------------------------------------------------- 1 | namespace WSNet2 2 | { 3 | public class WSNet2Settings 4 | { 5 | /// 保持できるEventの数 6 | public static int EvPoolSize = 16; 7 | 8 | /// 各Eventのバッファサイズの初期値 9 | public static int EvBufInitialSize = 256; 10 | 11 | /// 保持できるMsgの数 12 | public static int MsgPoolSize = 16; 13 | 14 | /// 各Msgのバッファサイズの初期値 15 | public static int MsgBufInitialSize = 256; 16 | 17 | /// 接続タイムアウト 18 | public static int ConnectTimeoutMilliSec = 5000; 19 | 20 | /// 再接続インターバル (milli seconds) 21 | public static int RetryIntervalMilliSec = 2000; 22 | 23 | /// 最大Ping間隔 (milli seconds) 24 | /// Playerの最終Msg時刻のやりとりのため、ある程度で上限を設ける 25 | public static int MaxPingIntervalMilliSec = 10000; 26 | 27 | /// 最小Ping間隔 (milli seconds) 28 | public static int MinPingIntervalMilliSec = 1000; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/Core/WSNet2Settings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 056f6e62d0acf0a42b5a588ecc754cca 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/DefaultUnityLogger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2928fead67b0444efbae0f11130302b8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/Assets/WSNet2/Scripts/WSNet2Service.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b76a81ce167fd24eb162da426e58257 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /wsnet2-unity/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 | -------------------------------------------------------------------------------- /wsnet2-unity/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 | -------------------------------------------------------------------------------- /wsnet2-unity/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 | -------------------------------------------------------------------------------- /wsnet2-unity/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/Title.unity 10 | guid: 32bf42b2154c64d67b84ebc519decdd6 11 | - enabled: 1 12 | path: Assets/Scenes/Game.unity 13 | guid: 82737b7036e8144ea9206f28ab7c68bd 14 | m_configObjects: {} 15 | -------------------------------------------------------------------------------- /wsnet2-unity/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: 0 10 | m_DefaultBehaviorMode: 1 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: 0 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /wsnet2-unity/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /wsnet2-unity/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /wsnet2-unity/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 | -------------------------------------------------------------------------------- /wsnet2-unity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.10f1 2 | m_EditorVersionWithRevision: 2021.3.10f1 (1c7d0df0160b) 3 | -------------------------------------------------------------------------------- /wsnet2-unity/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 | -------------------------------------------------------------------------------- /wsnet2-unity/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 | -------------------------------------------------------------------------------- /wsnet2-unity/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /wsnet2-unity/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 | -------------------------------------------------------------------------------- /wsnet2-unity/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /wsnet2-unity/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 | } -------------------------------------------------------------------------------- /wsnet2-unity/ProjectSettings/boot.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KLab/wsnet2/540a76fe000c3dcfa430948189671595d03d27b3/wsnet2-unity/ProjectSettings/boot.config --------------------------------------------------------------------------------