From c8d4386deaa5e6c9f257ab8b5efb7c8db3848705 Mon Sep 17 00:00:00 2001 From: Kaioru Date: Thu, 1 Aug 2024 19:29:49 +0800 Subject: [PATCH] Remove existing projects --- Edelstein.sln | 98 --- src/Directory.Packages.props | 22 - .../Bindings/StageConfigLogin.cs | 12 - .../Edelstein.Application.Server.csproj | 25 - .../Edelstein.Application.Server/Program.cs | 18 - .../ProgramHandler.cs | 78 --- .../Properties/stage-login-1.json | 10 - .../Properties/stage-scania-1.json | 8 - .../Properties/stage-scania-2.json | 8 - .../ServiceHostStage.cs | 55 -- .../appsettings.json | 27 - .../packages.lock.json | 650 ------------------ src/common/Directory.Build.props | 4 - .../Edelstein.Common.Crypto/AESCipher.cs | 63 -- .../Edelstein.Common.Crypto.csproj | 7 - .../Edelstein.Common.Crypto/IGCipher.cs | 63 -- .../Edelstein.Common.Crypto/ShandaCipher.cs | 89 --- .../packages.lock.json | 27 - .../Contexts/LoginContextPipelines.cs | 19 - .../Edelstein.Common.Gameplay.Login.csproj | 6 - .../LoginStageSystem.cs | 25 - .../LoginStageUser.cs | 13 - .../packages.lock.json | 154 ----- .../AbstractStageSystem.cs | 32 - .../Edelstein.Common.Gameplay.csproj | 10 - .../Handling/IPacketHandler.cs | 15 - .../Handling/IPacketHandlerManager.cs | 15 - .../Handling/IPacketSerializer.cs | 11 - .../Handling/PacketHandlerManager.cs | 77 --- .../Handling/PacketRecvOperations.cs | 320 --------- .../Handling/PacketSendOperations.cs | 513 -------------- .../packages.lock.json | 138 ---- .../Codecs/NettyPacketDecoder.cs | 94 --- .../Codecs/NettyPacketEncoder.cs | 56 -- .../Codecs/NettyPacketState.cs | 7 - .../Edelstein.Common.Network.DotNetty.csproj | 17 - .../Handlers/NettyTransportAcceptorHandler.cs | 84 --- .../NettyTransportConnectorHandler.cs | 79 --- .../NettyAttributes.cs | 9 - .../NettySocket.cs | 35 - .../Transports/NettyTransportAcceptor.cs | 50 -- .../Transports/NettyTransportAcceptorState.cs | 47 -- .../Transports/NettyTransportConnector.cs | 46 -- .../NettyTransportConnectorState.cs | 40 -- .../packages.lock.json | 155 ----- .../MigrationEntityConfiguration.cs | 26 - .../ServerEntityConfiguration.cs | 16 - .../ServerEntityGameConfiguration.cs | 15 - .../ServerEntityLoginConfiguration.cs | 15 - .../ServerEntityShopConfiguration.cs | 15 - .../ServerEntityTradeConfiguration.cs | 15 - .../SessionEntityConfiguration.cs | 20 - .../Edelstein.Common.Services.Server.csproj | 20 - .../Entities/MigrationEntity.cs | 21 - .../Entities/ServerEntity.cs | 22 - .../Entities/ServerEntityGame.cs | 9 - .../Entities/ServerEntityLogin.cs | 5 - .../Entities/ServerEntityShop.cs | 8 - .../Entities/ServerEntityTrade.cs | 8 - .../Entities/SessionEntity.cs | 14 - .../MigrationService.cs | 108 --- ...20240414130627_AddBaseEntities.Designer.cs | 210 ------ .../20240414130627_AddBaseEntities.cs | 112 --- ...4142710_AddTokenToServerEntity.Designer.cs | 213 ------ .../20240414142710_AddTokenToServerEntity.cs | 29 - ..._AddTimestampToMigrationEntity.Designer.cs | 219 ------ ...414145500_AddTimestampToMigrationEntity.cs | 41 -- ...14151943_AddKeyToSessionEntity.Designer.cs | 222 ------ .../20240414151943_AddKeyToSessionEntity.cs | 29 - .../ServerDbContextModelSnapshot.cs | 219 ------ .../ServerDbContext.cs | 21 - .../ServerDbContextFactory.cs | 23 - .../ServerMappingProfile.cs | 21 - .../ServerService.cs | 373 ---------- .../SessionService.cs | 222 ------ .../devsettings.json | 5 - .../packages.lock.json | 481 ------------- .../Buffers/Packet.cs | 35 - .../Buffers/PacketMemoryStream.cs | 8 - .../Buffers/PacketReader.cs | 60 -- .../Buffers/PacketWriter.cs | 108 --- .../Edelstein.Common.Utilities.csproj | 11 - .../Pipelines/Pipeline.cs | 45 -- .../Pipelines/PipelineContext.cs | 10 - .../Pipelines/PipelineStep.cs | 12 - .../Pipelines/PipelineStepComparer.cs | 15 - .../Repositories/Repository.cs | 31 - .../Templates/TemplateCollection.cs | 21 - .../Templates/TemplateCollectionLazy.cs | 21 - .../TemplateCollectionProviderEager.cs | 16 - .../TemplateCollectionProviderLazy.cs | 19 - .../TemplateCollectionProviderLazyHolder.cs | 7 - .../Templates/TemplateManager.cs | 26 - .../packages.lock.json | 36 - .../Contexts/ILoginContextPipelines.cs | 7 - .../Edelstein.Protocol.Gameplay.Login.csproj | 6 - .../ILoginStageSystem.cs | 9 - .../ILoginStageSystemOptions.cs | 5 - .../ILoginStageUser.cs | 3 - .../packages.lock.json | 102 --- .../Contexts/IStageContextPipelines.cs | 13 - .../Contracts/UserOnDisconnect.cs | 7 - .../Contracts/UserOnException.cs | 10 - .../Contracts/UserOnPacket.cs | 10 - .../Edelstein.Protocol.Gameplay.csproj | 9 - .../Edelstein.Protocol.Gameplay/IStage.cs | 11 - .../IStageSystem.cs | 11 - .../Edelstein.Protocol.Gameplay/IStageUser.cs | 10 - .../packages.lock.json | 95 --- .../Edelstein.Protocol.Network.csproj | 5 - .../Edelstein.Protocol.Network/ISocket.cs | 20 - .../ISocketAdapter.cs | 13 - .../Edelstein.Protocol.Network/ISocketUser.cs | 12 - .../ISocketUserCreator.cs | 7 - .../Transports/ITransportAcceptor.cs | 8 - .../Transports/ITransportConnector.cs | 8 - .../Transports/ITransportContext.cs | 16 - .../Transports/TransportState.cs | 7 - .../Transports/TransportVersion.cs | 7 - .../packages.lock.json | 16 - .../Contracts/MigrationEntry.cs | 15 - .../Contracts/MigrationResult.cs | 12 - .../Requests/MigrationClaimRequest.cs | 11 - .../Requests/MigrationStartRequest.cs | 9 - .../Responses/MigrationClaimResponse.cs | 10 - .../Contracts/Responses/MigrationResponse.cs | 9 - ...elstein.Protocol.Services.Migration.csproj | 7 - .../IMigrationEntry.cs | 12 - .../IMigrationService.cs | 14 - .../packages.lock.json | 80 --- .../Requests/ServerDeregisterRequest.cs | 10 - .../Requests/ServerGetByIDRequest.cs | 9 - .../ServerGetGameByWorldAndChannelRequest.cs | 10 - .../Requests/ServerGetGameByWorldRequest.cs | 9 - .../Requests/ServerGetShopByWorldRequest.cs | 9 - .../Requests/ServerGetTradeByWorldRequest.cs | 9 - .../Requests/ServerRegisterRequest.cs | 10 - .../Contracts/Requests/ServerUpdateRequest.cs | 10 - .../Responses/ServerGetAllResponse.cs | 12 - .../Responses/ServerGetOneResponse.cs | 11 - .../Responses/ServerRegisterResponse.cs | 10 - .../Contracts/Responses/ServerResponse.cs | 9 - .../Contracts/ServerEntry.cs | 11 - .../Contracts/ServerEntryGame.cs | 10 - .../Contracts/ServerEntryLogin.cs | 6 - .../Contracts/ServerEntryShop.cs | 9 - .../Contracts/ServerEntryTrade.cs | 9 - .../Contracts/ServerResult.cs | 12 - .../Edelstein.Protocol.Services.Server.csproj | 7 - .../IServerEntry.cs | 9 - .../IServerEntryGame.cs | 7 - .../IServerEntryLogin.cs | 3 - .../IServerEntryShop.cs | 6 - .../IServerEntryTrade.cs | 6 - .../IServerService.cs | 32 - .../packages.lock.json | 80 --- .../Contracts/Requests/SessionEndRequest.cs | 10 - .../SessionGetByActiveAccountRequest.cs | 9 - .../SessionGetByActiveCharacterRequest.cs | 9 - .../Contracts/Requests/SessionStartRequest.cs | 10 - .../Requests/SessionUpdateCharacterRequest.cs | 11 - .../Requests/SessionUpdateServerRequest.cs | 11 - .../Responses/SessionGetOneResponse.cs | 10 - .../Contracts/Responses/SessionResponse.cs | 9 - .../Contracts/SessionEntry.cs | 12 - .../Contracts/SessionResult.cs | 12 - ...Edelstein.Protocol.Services.Session.csproj | 7 - .../ISessionEntry.cs | 9 - .../ISessionService.cs | 20 - .../packages.lock.json | 80 --- .../Buffers/IPacket.cs | 9 - .../Buffers/IPacketReader.cs | 28 - .../Buffers/IPacketWriter.cs | 27 - .../Edelstein.Protocol.Utilities.csproj | 6 - .../Pipelines/IPipeline.cs | 12 - .../Pipelines/IPipelineContext.cs | 8 - .../Pipelines/IPipelinePlug.cs | 8 - .../Pipelines/PipelinePriority.cs | 18 - .../Repositories/IQueriedRepository.cs | 11 - .../Repositories/IReadOnlyRepository.cs | 9 - .../Repositories/IRepository.cs | 11 - .../Repositories/IRepositoryEntry.cs | 6 - .../Methods/IRepositoryMethodDelete.cs | 11 - .../Methods/IRepositoryMethodInsert.cs | 10 - .../Methods/IRepositoryMethodRetrieve.cs | 10 - .../Methods/IRepositoryMethodRetrieveAll.cs | 11 - .../Methods/IRepositoryMethodUpdate.cs | 10 - .../Templates/ITemplate.cs | 5 - .../Templates/ITemplateCollection.cs | 11 - .../Templates/ITemplateCollectionProvider.cs | 11 - .../Templates/ITemplateManager.cs | 8 - .../packages.lock.json | 13 - 192 files changed, 7992 deletions(-) delete mode 100644 src/app/Edelstein.Application.Server/Bindings/StageConfigLogin.cs delete mode 100644 src/app/Edelstein.Application.Server/Edelstein.Application.Server.csproj delete mode 100644 src/app/Edelstein.Application.Server/Program.cs delete mode 100644 src/app/Edelstein.Application.Server/ProgramHandler.cs delete mode 100644 src/app/Edelstein.Application.Server/Properties/stage-login-1.json delete mode 100644 src/app/Edelstein.Application.Server/Properties/stage-scania-1.json delete mode 100644 src/app/Edelstein.Application.Server/Properties/stage-scania-2.json delete mode 100644 src/app/Edelstein.Application.Server/ServiceHostStage.cs delete mode 100644 src/app/Edelstein.Application.Server/appsettings.json delete mode 100644 src/app/Edelstein.Application.Server/packages.lock.json delete mode 100644 src/common/Edelstein.Common.Crypto/AESCipher.cs delete mode 100644 src/common/Edelstein.Common.Crypto/Edelstein.Common.Crypto.csproj delete mode 100644 src/common/Edelstein.Common.Crypto/IGCipher.cs delete mode 100644 src/common/Edelstein.Common.Crypto/ShandaCipher.cs delete mode 100644 src/common/Edelstein.Common.Crypto/packages.lock.json delete mode 100644 src/common/Edelstein.Common.Gameplay.Login/Contexts/LoginContextPipelines.cs delete mode 100644 src/common/Edelstein.Common.Gameplay.Login/Edelstein.Common.Gameplay.Login.csproj delete mode 100644 src/common/Edelstein.Common.Gameplay.Login/LoginStageSystem.cs delete mode 100644 src/common/Edelstein.Common.Gameplay.Login/LoginStageUser.cs delete mode 100644 src/common/Edelstein.Common.Gameplay.Login/packages.lock.json delete mode 100644 src/common/Edelstein.Common.Gameplay/AbstractStageSystem.cs delete mode 100644 src/common/Edelstein.Common.Gameplay/Edelstein.Common.Gameplay.csproj delete mode 100644 src/common/Edelstein.Common.Gameplay/Handling/IPacketHandler.cs delete mode 100644 src/common/Edelstein.Common.Gameplay/Handling/IPacketHandlerManager.cs delete mode 100644 src/common/Edelstein.Common.Gameplay/Handling/IPacketSerializer.cs delete mode 100644 src/common/Edelstein.Common.Gameplay/Handling/PacketHandlerManager.cs delete mode 100644 src/common/Edelstein.Common.Gameplay/Handling/PacketRecvOperations.cs delete mode 100644 src/common/Edelstein.Common.Gameplay/Handling/PacketSendOperations.cs delete mode 100644 src/common/Edelstein.Common.Gameplay/packages.lock.json delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketDecoder.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketEncoder.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketState.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Edelstein.Common.Network.DotNetty.csproj delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Handlers/NettyTransportAcceptorHandler.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Handlers/NettyTransportConnectorHandler.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/NettyAttributes.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/NettySocket.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportAcceptor.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportAcceptorState.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportConnector.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportConnectorState.cs delete mode 100644 src/common/Edelstein.Common.Network.DotNetty/packages.lock.json delete mode 100644 src/common/Edelstein.Common.Services.Server/Configurations/MigrationEntityConfiguration.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityConfiguration.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityGameConfiguration.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityLoginConfiguration.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityShopConfiguration.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityTradeConfiguration.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Configurations/SessionEntityConfiguration.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Edelstein.Common.Services.Server.csproj delete mode 100644 src/common/Edelstein.Common.Services.Server/Entities/MigrationEntity.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Entities/ServerEntity.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Entities/ServerEntityGame.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Entities/ServerEntityLogin.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Entities/ServerEntityShop.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Entities/ServerEntityTrade.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Entities/SessionEntity.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/MigrationService.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/20240414130627_AddBaseEntities.Designer.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/20240414130627_AddBaseEntities.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/20240414142710_AddTokenToServerEntity.Designer.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/20240414142710_AddTokenToServerEntity.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/20240414145500_AddTimestampToMigrationEntity.Designer.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/20240414145500_AddTimestampToMigrationEntity.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/20240414151943_AddKeyToSessionEntity.Designer.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/20240414151943_AddKeyToSessionEntity.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/Migrations/ServerDbContextModelSnapshot.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/ServerDbContext.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/ServerDbContextFactory.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/ServerMappingProfile.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/ServerService.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/SessionService.cs delete mode 100644 src/common/Edelstein.Common.Services.Server/devsettings.json delete mode 100644 src/common/Edelstein.Common.Services.Server/packages.lock.json delete mode 100644 src/common/Edelstein.Common.Utilities/Buffers/Packet.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Buffers/PacketMemoryStream.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Buffers/PacketReader.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Buffers/PacketWriter.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Edelstein.Common.Utilities.csproj delete mode 100644 src/common/Edelstein.Common.Utilities/Pipelines/Pipeline.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Pipelines/PipelineContext.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Pipelines/PipelineStep.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Pipelines/PipelineStepComparer.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Repositories/Repository.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Templates/TemplateCollection.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionLazy.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderEager.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderLazy.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderLazyHolder.cs delete mode 100644 src/common/Edelstein.Common.Utilities/Templates/TemplateManager.cs delete mode 100644 src/common/Edelstein.Common.Utilities/packages.lock.json delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay.Login/Contexts/ILoginContextPipelines.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay.Login/Edelstein.Protocol.Gameplay.Login.csproj delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageSystem.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageSystemOptions.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageUser.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay.Login/packages.lock.json delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/Contexts/IStageContextPipelines.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnDisconnect.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnException.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnPacket.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/Edelstein.Protocol.Gameplay.csproj delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/IStage.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/IStageSystem.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/IStageUser.cs delete mode 100644 src/protocol/Edelstein.Protocol.Gameplay/packages.lock.json delete mode 100644 src/protocol/Edelstein.Protocol.Network/Edelstein.Protocol.Network.csproj delete mode 100644 src/protocol/Edelstein.Protocol.Network/ISocket.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/ISocketAdapter.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/ISocketUser.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/ISocketUserCreator.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/Transports/ITransportAcceptor.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/Transports/ITransportConnector.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/Transports/ITransportContext.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/Transports/TransportState.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/Transports/TransportVersion.cs delete mode 100644 src/protocol/Edelstein.Protocol.Network/packages.lock.json delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/Contracts/MigrationEntry.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/Contracts/MigrationResult.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Requests/MigrationClaimRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Requests/MigrationStartRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Responses/MigrationClaimResponse.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Responses/MigrationResponse.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/Edelstein.Protocol.Services.Migration.csproj delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/IMigrationEntry.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/IMigrationService.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Migration/packages.lock.json delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerDeregisterRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetByIDRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetGameByWorldAndChannelRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetGameByWorldRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetShopByWorldRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetTradeByWorldRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerRegisterRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerUpdateRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerGetAllResponse.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerGetOneResponse.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerRegisterResponse.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerResponse.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntry.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryGame.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryLogin.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryShop.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryTrade.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerResult.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/Edelstein.Protocol.Services.Server.csproj delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/IServerEntry.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/IServerEntryGame.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/IServerEntryLogin.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/IServerEntryShop.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/IServerEntryTrade.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/IServerService.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Server/packages.lock.json delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionEndRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionGetByActiveAccountRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionGetByActiveCharacterRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionStartRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionUpdateCharacterRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionUpdateServerRequest.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/Responses/SessionGetOneResponse.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/Responses/SessionResponse.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/SessionEntry.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Contracts/SessionResult.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/Edelstein.Protocol.Services.Session.csproj delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/ISessionEntry.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/ISessionService.cs delete mode 100644 src/protocol/Edelstein.Protocol.Services.Session/packages.lock.json delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacket.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacketReader.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacketWriter.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Edelstein.Protocol.Utilities.csproj delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipeline.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipelineContext.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipelinePlug.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Pipelines/PipelinePriority.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/IQueriedRepository.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/IReadOnlyRepository.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/IRepository.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/IRepositoryEntry.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodDelete.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodInsert.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodRetrieve.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodRetrieveAll.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodUpdate.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplate.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateCollection.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateCollectionProvider.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateManager.cs delete mode 100644 src/protocol/Edelstein.Protocol.Utilities/packages.lock.json diff --git a/Edelstein.sln b/Edelstein.sln index 9ace93224..3f36c371a 100644 --- a/Edelstein.sln +++ b/Edelstein.sln @@ -25,34 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "protocol", "protocol", "{82 src\protocol\Directory.Build.props = src\protocol\Directory.Build.props EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Services.Session", "src\protocol\Edelstein.Protocol.Services.Session\Edelstein.Protocol.Services.Session.csproj", "{5AA56CCA-0711-4F1E-956D-6A9ECB62AA6E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Services.Server", "src\protocol\Edelstein.Protocol.Services.Server\Edelstein.Protocol.Services.Server.csproj", "{4848921A-A7B3-4C66-84F7-2C284CB77CFD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Utilities", "src\protocol\Edelstein.Protocol.Utilities\Edelstein.Protocol.Utilities.csproj", "{558B0F6E-70A3-47E9-A535-C1443496F54B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Services.Migration", "src\protocol\Edelstein.Protocol.Services.Migration\Edelstein.Protocol.Services.Migration.csproj", "{0AF6EE24-F488-4417-8F52-9D0FAA4EFD21}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Common.Services.Server", "src\common\Edelstein.Common.Services.Server\Edelstein.Common.Services.Server.csproj", "{DE8C4F65-D97D-400C-BB4B-47BC5D96BED0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Application.Server", "src\app\Edelstein.Application.Server\Edelstein.Application.Server.csproj", "{01432518-BA0E-463E-B7E6-79844D4CFE2C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Gameplay", "src\protocol\Edelstein.Protocol.Gameplay\Edelstein.Protocol.Gameplay.csproj", "{D6FDEE10-8451-46DD-9E1D-9908421A88AD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Gameplay.Login", "src\protocol\Edelstein.Protocol.Gameplay.Login\Edelstein.Protocol.Gameplay.Login.csproj", "{A1E4A5D9-9A57-44EC-B21A-F564B87D3CE3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Common.Utilities", "src\common\Edelstein.Common.Utilities\Edelstein.Common.Utilities.csproj", "{F1FEDB7F-F984-47BE-9C14-24D8919E097B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Common.Gameplay.Login", "src\common\Edelstein.Common.Gameplay.Login\Edelstein.Common.Gameplay.Login.csproj", "{5D28B5BC-5EF8-4F0C-BD9D-9307E19071D0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Network", "src\protocol\Edelstein.Protocol.Network\Edelstein.Protocol.Network.csproj", "{406AF08D-7BF4-4C00-A959-60D5D4601295}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Common.Network.DotNetty", "src\common\Edelstein.Common.Network.DotNetty\Edelstein.Common.Network.DotNetty.csproj", "{F94D12DC-FDC8-48F2-9EF0-7F229AF1A9CC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Common.Crypto", "src\common\Edelstein.Common.Crypto\Edelstein.Common.Crypto.csproj", "{2B8D2564-3DF1-42B2-9A50-0AAD2E8A8AE8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Common.Gameplay", "src\common\Edelstein.Common.Gameplay\Edelstein.Common.Gameplay.csproj", "{F66379E6-CAB8-4E63-BB0C-94B98F021A29}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -65,77 +37,7 @@ Global {FED60761-FD6B-4EBD-B896-FAFB2D991E13} = {0C8602E7-AED6-43A4-BA0F-165EAB963D07} {E50DFCDF-39D5-4D0D-A46E-94D11D795087} = {0C8602E7-AED6-43A4-BA0F-165EAB963D07} {82D7864B-19AD-484C-BD2E-897F05B5852C} = {0C8602E7-AED6-43A4-BA0F-165EAB963D07} - {5AA56CCA-0711-4F1E-956D-6A9ECB62AA6E} = {82D7864B-19AD-484C-BD2E-897F05B5852C} - {4848921A-A7B3-4C66-84F7-2C284CB77CFD} = {82D7864B-19AD-484C-BD2E-897F05B5852C} - {558B0F6E-70A3-47E9-A535-C1443496F54B} = {82D7864B-19AD-484C-BD2E-897F05B5852C} - {0AF6EE24-F488-4417-8F52-9D0FAA4EFD21} = {82D7864B-19AD-484C-BD2E-897F05B5852C} - {DE8C4F65-D97D-400C-BB4B-47BC5D96BED0} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087} - {01432518-BA0E-463E-B7E6-79844D4CFE2C} = {FED60761-FD6B-4EBD-B896-FAFB2D991E13} - {D6FDEE10-8451-46DD-9E1D-9908421A88AD} = {82D7864B-19AD-484C-BD2E-897F05B5852C} - {A1E4A5D9-9A57-44EC-B21A-F564B87D3CE3} = {82D7864B-19AD-484C-BD2E-897F05B5852C} - {F1FEDB7F-F984-47BE-9C14-24D8919E097B} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087} - {5D28B5BC-5EF8-4F0C-BD9D-9307E19071D0} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087} - {406AF08D-7BF4-4C00-A959-60D5D4601295} = {82D7864B-19AD-484C-BD2E-897F05B5852C} - {F94D12DC-FDC8-48F2-9EF0-7F229AF1A9CC} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087} - {2B8D2564-3DF1-42B2-9A50-0AAD2E8A8AE8} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087} - {F66379E6-CAB8-4E63-BB0C-94B98F021A29} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087} EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5AA56CCA-0711-4F1E-956D-6A9ECB62AA6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5AA56CCA-0711-4F1E-956D-6A9ECB62AA6E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5AA56CCA-0711-4F1E-956D-6A9ECB62AA6E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5AA56CCA-0711-4F1E-956D-6A9ECB62AA6E}.Release|Any CPU.Build.0 = Release|Any CPU - {4848921A-A7B3-4C66-84F7-2C284CB77CFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4848921A-A7B3-4C66-84F7-2C284CB77CFD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4848921A-A7B3-4C66-84F7-2C284CB77CFD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4848921A-A7B3-4C66-84F7-2C284CB77CFD}.Release|Any CPU.Build.0 = Release|Any CPU - {558B0F6E-70A3-47E9-A535-C1443496F54B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {558B0F6E-70A3-47E9-A535-C1443496F54B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {558B0F6E-70A3-47E9-A535-C1443496F54B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {558B0F6E-70A3-47E9-A535-C1443496F54B}.Release|Any CPU.Build.0 = Release|Any CPU - {0AF6EE24-F488-4417-8F52-9D0FAA4EFD21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0AF6EE24-F488-4417-8F52-9D0FAA4EFD21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0AF6EE24-F488-4417-8F52-9D0FAA4EFD21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0AF6EE24-F488-4417-8F52-9D0FAA4EFD21}.Release|Any CPU.Build.0 = Release|Any CPU - {DE8C4F65-D97D-400C-BB4B-47BC5D96BED0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DE8C4F65-D97D-400C-BB4B-47BC5D96BED0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DE8C4F65-D97D-400C-BB4B-47BC5D96BED0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DE8C4F65-D97D-400C-BB4B-47BC5D96BED0}.Release|Any CPU.Build.0 = Release|Any CPU - {01432518-BA0E-463E-B7E6-79844D4CFE2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {01432518-BA0E-463E-B7E6-79844D4CFE2C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {01432518-BA0E-463E-B7E6-79844D4CFE2C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {01432518-BA0E-463E-B7E6-79844D4CFE2C}.Release|Any CPU.Build.0 = Release|Any CPU - {D6FDEE10-8451-46DD-9E1D-9908421A88AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D6FDEE10-8451-46DD-9E1D-9908421A88AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D6FDEE10-8451-46DD-9E1D-9908421A88AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D6FDEE10-8451-46DD-9E1D-9908421A88AD}.Release|Any CPU.Build.0 = Release|Any CPU - {A1E4A5D9-9A57-44EC-B21A-F564B87D3CE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1E4A5D9-9A57-44EC-B21A-F564B87D3CE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1E4A5D9-9A57-44EC-B21A-F564B87D3CE3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1E4A5D9-9A57-44EC-B21A-F564B87D3CE3}.Release|Any CPU.Build.0 = Release|Any CPU - {F1FEDB7F-F984-47BE-9C14-24D8919E097B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1FEDB7F-F984-47BE-9C14-24D8919E097B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1FEDB7F-F984-47BE-9C14-24D8919E097B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1FEDB7F-F984-47BE-9C14-24D8919E097B}.Release|Any CPU.Build.0 = Release|Any CPU - {5D28B5BC-5EF8-4F0C-BD9D-9307E19071D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5D28B5BC-5EF8-4F0C-BD9D-9307E19071D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5D28B5BC-5EF8-4F0C-BD9D-9307E19071D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5D28B5BC-5EF8-4F0C-BD9D-9307E19071D0}.Release|Any CPU.Build.0 = Release|Any CPU - {406AF08D-7BF4-4C00-A959-60D5D4601295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {406AF08D-7BF4-4C00-A959-60D5D4601295}.Debug|Any CPU.Build.0 = Debug|Any CPU - {406AF08D-7BF4-4C00-A959-60D5D4601295}.Release|Any CPU.ActiveCfg = Release|Any CPU - {406AF08D-7BF4-4C00-A959-60D5D4601295}.Release|Any CPU.Build.0 = Release|Any CPU - {F94D12DC-FDC8-48F2-9EF0-7F229AF1A9CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F94D12DC-FDC8-48F2-9EF0-7F229AF1A9CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F94D12DC-FDC8-48F2-9EF0-7F229AF1A9CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F94D12DC-FDC8-48F2-9EF0-7F229AF1A9CC}.Release|Any CPU.Build.0 = Release|Any CPU - {2B8D2564-3DF1-42B2-9A50-0AAD2E8A8AE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B8D2564-3DF1-42B2-9A50-0AAD2E8A8AE8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B8D2564-3DF1-42B2-9A50-0AAD2E8A8AE8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B8D2564-3DF1-42B2-9A50-0AAD2E8A8AE8}.Release|Any CPU.Build.0 = Release|Any CPU - {F66379E6-CAB8-4E63-BB0C-94B98F021A29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F66379E6-CAB8-4E63-BB0C-94B98F021A29}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F66379E6-CAB8-4E63-BB0C-94B98F021A29}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F66379E6-CAB8-4E63-BB0C-94B98F021A29}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 7bd172c66..b6daf61d6 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -1,27 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/app/Edelstein.Application.Server/Bindings/StageConfigLogin.cs b/src/app/Edelstein.Application.Server/Bindings/StageConfigLogin.cs deleted file mode 100644 index d80329b3e..000000000 --- a/src/app/Edelstein.Application.Server/Bindings/StageConfigLogin.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Edelstein.Protocol.Gameplay.Login; -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. - -namespace Edelstein.Application.Server.Bindings; - -public record StageConfigLogin : ILoginStageSystemOptions -{ - public string ID { get; init; } - - public string Host { get; init; } - public int Port { get; init; } -} diff --git a/src/app/Edelstein.Application.Server/Edelstein.Application.Server.csproj b/src/app/Edelstein.Application.Server/Edelstein.Application.Server.csproj deleted file mode 100644 index 57af7bb18..000000000 --- a/src/app/Edelstein.Application.Server/Edelstein.Application.Server.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - PreserveNewest - Always - %(Filename)%(Extension) - - - - - - - - diff --git a/src/app/Edelstein.Application.Server/Program.cs b/src/app/Edelstein.Application.Server/Program.cs deleted file mode 100644 index 073edd805..000000000 --- a/src/app/Edelstein.Application.Server/Program.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.CommandLine; -using System.IO; -using Edelstein.Application.Server; - -var commandRoot = new RootCommand( - "A mushroom game server emulator" -); -var argumentFile = new Argument( - "file or directory path", - () => new FileInfo(AppDomain.CurrentDomain.BaseDirectory), - "The file or directory path to stage json file(s)" -); - -commandRoot.AddArgument(argumentFile); -commandRoot.SetHandler(ProgramHandler.ExecuteRoot, argumentFile); - -await commandRoot.InvokeAsync(args); diff --git a/src/app/Edelstein.Application.Server/ProgramHandler.cs b/src/app/Edelstein.Application.Server/ProgramHandler.cs deleted file mode 100644 index e607ca7db..000000000 --- a/src/app/Edelstein.Application.Server/ProgramHandler.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Edelstein.Application.Server.Bindings; -using Edelstein.Common.Gameplay.Login; -using Edelstein.Protocol.Gameplay.Login; -using Edelstein.Protocol.Gameplay.Login.Contexts; -using Edelstein.Protocol.Network.Transports; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Serilog; - -namespace Edelstein.Application.Server; - -internal static class ProgramHandler -{ - public async static Task ExecuteRoot(FileInfo file) - { - var builder = Host.CreateApplicationBuilder(); - - builder.Services.AddSerilog((_, configuration) => configuration.ReadFrom.Configuration(builder.Configuration)); - - builder.Services.AddEdelsteinCommonUtilities(); - builder.Services.AddEdelsteinCommonGameplay(); - builder.Services.AddEdelsteinCommonGameplayLogin(); - - var configFileInfos = (file.Attributes & FileAttributes.Directory) != 0 - ? file.Directory?.GetFiles() ?? Array.Empty() - : new[]{ file }; - var version = new TransportVersion(95, "1", 8); - - foreach (var configFile in configFileInfos.Where(f => f.Extension == ".json")) - { - var config = new ConfigurationBuilder() - .AddJsonFile(configFile.FullName, false, false) - .Build(); - - try - { - switch (config["Type"]) - { - case "Login": - builder.Services.AddSingleton(p => - { - var loginConfig = new StageConfigLogin(); - var loginSystem = new LoginStageSystem( - loginConfig, - p.GetRequiredService() - ); - - config.Bind(loginConfig); - - return new ServiceHostStage( - p.GetRequiredService>>(), - version, - loginConfig, - loginSystem - ); - }); - break; - default: - continue; - } - } - catch (Exception) - { - // ignored - } - } - - var host = builder.Build(); - - await host.RunAsync(); - } -} diff --git a/src/app/Edelstein.Application.Server/Properties/stage-login-1.json b/src/app/Edelstein.Application.Server/Properties/stage-login-1.json deleted file mode 100644 index 20bbddd5d..000000000 --- a/src/app/Edelstein.Application.Server/Properties/stage-login-1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Type": "Login", - "ID": "Login-1", - "Host": "127.0.0.1", - "Port": 8484, - "Worlds": [ - 0, - 1 - ] -} \ No newline at end of file diff --git a/src/app/Edelstein.Application.Server/Properties/stage-scania-1.json b/src/app/Edelstein.Application.Server/Properties/stage-scania-1.json deleted file mode 100644 index 1604c08b3..000000000 --- a/src/app/Edelstein.Application.Server/Properties/stage-scania-1.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Type": "Game", - "ID": "Scania-1", - "Host": "127.0.0.1", - "Port": 7575, - "WorldID": 0, - "ChannelID": 0 -} \ No newline at end of file diff --git a/src/app/Edelstein.Application.Server/Properties/stage-scania-2.json b/src/app/Edelstein.Application.Server/Properties/stage-scania-2.json deleted file mode 100644 index f77fab41d..000000000 --- a/src/app/Edelstein.Application.Server/Properties/stage-scania-2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Type": "Game", - "ID": "Scania-2", - "Host": "127.0.0.1", - "Port": 7576, - "WorldID": 0, - "ChannelID": 0 -} \ No newline at end of file diff --git a/src/app/Edelstein.Application.Server/ServiceHostStage.cs b/src/app/Edelstein.Application.Server/ServiceHostStage.cs deleted file mode 100644 index 2d40f1744..000000000 --- a/src/app/Edelstein.Application.Server/ServiceHostStage.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; -using Edelstein.Common.Network.DotNetty.Transports; -using Edelstein.Protocol.Gameplay; -using Edelstein.Protocol.Network.Transports; -using Edelstein.Protocol.Services.Server; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -namespace Edelstein.Application.Server; - -public class ServiceHostStage( - ILogger> logger, - TransportVersion version, - IServerEntry settings, - IStageSystem system -) : IHostedService - where TStageUser : class, IStageUser - where TStageSystem : IStageSystem -{ - private ITransportContext? Context { get; set; } - - public async Task StartAsync(CancellationToken cancellationToken) - { - var acceptor = new NettyTransportAcceptor( - version, - system, - system - ); - - Context = await acceptor.Accept(settings.Host, settings.Port); - logger.LogInformation( - "{ID} socket acceptor for v{Version}.{Patch} (Locale {Locale}) bound at {Host}:{Port}", - settings.ID, - version.Major, version.Patch, version.Locale, - settings.Host, settings.Port - ); - } - - public async Task StopAsync(CancellationToken cancellationToken) - { - logger.LogInformation( - "{ID} socket acceptor shutting down, this may take awhile..", - settings.ID - ); - - if (Context != null) - await Context.Close(); - - logger.LogInformation( - "{ID} socket acceptor finished shutting down", - settings.ID - ); - } -} diff --git a/src/app/Edelstein.Application.Server/appsettings.json b/src/app/Edelstein.Application.Server/appsettings.json deleted file mode 100644 index 48b4bdcfc..000000000 --- a/src/app/Edelstein.Application.Server/appsettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "ConnectionStrings": { - "Pgsql": "host=db;database=edelstein;" - }, - "Serilog": { - "Using": [ - "Serilog.Sinks.Console", - "Serilog.Sinks.File" - ], - "MinimumLevel": "Information", - "WriteTo": [ - { - "Name": "Console", - "Args": { - "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console" - } - }, - { - "Name": "File", - "Args": { - "path": "logs/log.txt", - "rollingInterval": "Day" - } - } - ] - } -} diff --git a/src/app/Edelstein.Application.Server/packages.lock.json b/src/app/Edelstein.Application.Server/packages.lock.json deleted file mode 100644 index 61577fcc3..000000000 --- a/src/app/Edelstein.Application.Server/packages.lock.json +++ /dev/null @@ -1,650 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "Microsoft.EntityFrameworkCore.Relational": { - "type": "Direct", - "requested": "[9.0.0-preview.3.24172.4, )", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "dte8CsWFJEt4nrDGm8QDsr98YZ52RkavC0KBtobZ7wxZ/rKGUlgicv7EOKmy1DhI2ya7mWqmHwkwgBc0bxPzYg==", - "dependencies": { - "Microsoft.EntityFrameworkCore": "9.0.0-preview.3.24172.4", - "Microsoft.Extensions.Configuration.Abstractions": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Hosting": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "ItYHpdqVp5/oFLT5QqbopnkKlyFG9EW/9nhM6/yfObeKt6Su0wkBio6AizgRHGNwhJuAtlE5VIjow5JOTrip6w==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.Configuration.Binder": "8.0.0", - "Microsoft.Extensions.Configuration.CommandLine": "8.0.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "8.0.0", - "Microsoft.Extensions.Configuration.FileExtensions": "8.0.0", - "Microsoft.Extensions.Configuration.Json": "8.0.0", - "Microsoft.Extensions.Configuration.UserSecrets": "8.0.0", - "Microsoft.Extensions.DependencyInjection": "8.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Diagnostics": "8.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "Microsoft.Extensions.FileProviders.Physical": "8.0.0", - "Microsoft.Extensions.Hosting.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging": "8.0.0", - "Microsoft.Extensions.Logging.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging.Configuration": "8.0.0", - "Microsoft.Extensions.Logging.Console": "8.0.0", - "Microsoft.Extensions.Logging.Debug": "8.0.0", - "Microsoft.Extensions.Logging.EventLog": "8.0.0", - "Microsoft.Extensions.Logging.EventSource": "8.0.0", - "Microsoft.Extensions.Options": "8.0.0" - } - }, - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Serilog": { - "type": "Direct", - "requested": "[3.1.1, )", - "resolved": "3.1.1", - "contentHash": "P6G4/4Kt9bT635bhuwdXlJ2SCqqn2nhh4gqFqQueCOr9bK/e7W9ll/IoX1Ter948cV2Z/5+5v8pAfJYUISY03A==" - }, - "Serilog.Extensions.Hosting": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "db0OcbWeSCvYQkHWu6n0v40N4kKaTAXNjlM3BKvcbwvNzYphQFcBR+36eQ/7hMMwOkJvAyLC2a9/jNdUL5NjtQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Hosting.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging.Abstractions": "8.0.0", - "Serilog": "3.1.1", - "Serilog.Extensions.Logging": "8.0.0" - } - }, - "Serilog.Settings.Configuration": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "nR0iL5HwKj5v6ULo3/zpP8NMcq9E2pxYA6XKTSWCbugVs4YqPyvaqaKOY+OMpPivKp7zMEpax2UKHnDodbRB0Q==", - "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "8.0.0", - "Microsoft.Extensions.DependencyModel": "8.0.0", - "Serilog": "3.1.1" - } - }, - "Serilog.Sinks.Console": { - "type": "Direct", - "requested": "[5.0.1, )", - "resolved": "5.0.1", - "contentHash": "6Jt8jl9y2ey8VV7nVEUAyjjyxjAQuvd5+qj4XYAT9CwcsvR70HHULGBeD+K2WCALFXf7CFsNQT4lON6qXcu2AA==", - "dependencies": { - "Serilog": "3.1.1" - } - }, - "Serilog.Sinks.File": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "uwV5hdhWPwUH1szhO8PJpFiahqXmzPzJT/sOijH/kFgUx+cyoDTMM8MHD0adw9+Iem6itoibbUXHYslzXsLEAg==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "System.CommandLine": { - "type": "Direct", - "requested": "[2.0.0-beta4.22272.1, )", - "resolved": "2.0.0-beta4.22272.1", - "contentHash": "1uqED/q2H0kKoLJ4+hI2iPSBSEdTuhfCYADeJrAqERmiGQ2NNacYKRNEQ+gFbU4glgVyK8rxI+ZOe1onEtr/Pg==" - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Microsoft.EntityFrameworkCore.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "kXxQ0X4VO9lot9D6pU2QkBI7BKsTHSMUC7sw9XLjIpW6TErMEq9k8p8buapJssQNjYsaMpSAqvBSV7D1yCzczQ==" - }, - "Microsoft.EntityFrameworkCore.Analyzers": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "O967hNSzxByRR/AXKygnHYyYtfpuORtQS6vR0mbrXmXD0EDbZI3uj6CDvuHN2RzizFqkw19sBWdkF5ckbscNVQ==" - }, - "Microsoft.Extensions.Caching.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "P65stJCenLENUnl33FtSE2VueD5unLBYZ5DefAzetq5+fSia8engFE8tElNvV3VoVY430hmEHJoxQAN+cUvQVg==", - "dependencies": { - "Microsoft.Extensions.Primitives": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Caching.Memory": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "Aho8wQMeWhOOpQ+dthZR2KcR8ZF/c9WzoorKqOLGPbyIl+LuJH3fFlaFpFESwbrz7NbijwcJyzsSDPYCND3Lwg==", - "dependencies": { - "Microsoft.Extensions.Caching.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Logging.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Options": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Primitives": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Configuration": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.Configuration.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "LAZhuLfRq6ZFBLYMMXrnY7bUtn5tiIF1vsRhA40XuTMc593VoaXNp0IjBHwfbWqRjYGPuRYL5LGG0qP3mp+9/Q==", - "dependencies": { - "Microsoft.Extensions.Primitives": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Configuration.Binder": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "mBMoXLsr5s1y2zOHWmKsE9veDcx8h1x/c3rz4baEdQKTeDcmQAPNbB54Pi/lhFO3K431eEq6PFbMgLaa6PHFfA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0" - } - }, - "Microsoft.Extensions.Configuration.CommandLine": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "NZuZMz3Q8Z780nKX3ifV1fE7lS+6pynDHK71OfU4OZ1ItgvDOhyOC7E6z+JMZrAj63zRpwbdldYFk499t3+1dQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0" - } - }, - "Microsoft.Extensions.Configuration.EnvironmentVariables": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "plvZ0ZIpq+97gdPNNvhwvrEZ92kNml9hd1pe3idMA7svR0PztdzVLkoWLcRFgySYXUJc3kSM3Xw3mNFMo/bxRA==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0" - } - }, - "Microsoft.Extensions.Configuration.FileExtensions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "McP+Lz/EKwvtCv48z0YImw+L1gi1gy5rHhNaNIY2CrjloV+XY8gydT8DjMR6zWeL13AFK+DioVpppwAuO1Gi1w==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "Microsoft.Extensions.FileProviders.Physical": "8.0.0", - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.Configuration.UserSecrets": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "ihDHu2dJYQird9pl2CbdwuNDfvCZdOS0S7SPlNfhPt0B81UTT+yyZKz2pimFZGUp3AfuBRnqUCxB2SjsZKHVUw==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.Configuration.Json": "8.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "Microsoft.Extensions.FileProviders.Physical": "8.0.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "9pc1Xlg99FqX1I57VtPv6fbhcrmOoA7p3/b+DwxAENaFz5JJt50CsVRq8WAvR5Fa+grFziewP3A/W0x9q5NYTw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "3176Psy4JxVCJI9L57MyLXt+0HmCylzFmblmmG4GNbxCArrt8slJGWootNRj7rJBh1CPNXOI3nwk9VvDLj/8oQ==" - }, - "Microsoft.Extensions.DependencyModel": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "NSmDw3K0ozNDgShSIpsZcbFIzBX4w28nDag+TfaQujkXGazBm+lid5onlWoCBy4VsLxqnnKjEBbGSJVWJMf43g==", - "dependencies": { - "System.Text.Encodings.Web": "8.0.0", - "System.Text.Json": "8.0.0" - } - }, - "Microsoft.Extensions.Diagnostics": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "3PZp/YSkIXrF7QK7PfC1bkyRYwqOHpWFad8Qx+4wkuumAeXo1NHaxpS9LboNA9OvNSAu+QOVlXbMyoY+pHSqcw==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Diagnostics.Abstractions": "8.0.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0" - } - }, - "Microsoft.Extensions.Diagnostics.Abstractions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "JHYCQG7HmugNYUhOl368g+NMxYE/N/AiclCYRNlgCY9eVyiBkOHMwK4x60RYMxv9EL3+rmj1mqHvdCiPpC+D4Q==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Options": "8.0.0", - "System.Diagnostics.DiagnosticSource": "8.0.0" - } - }, - "Microsoft.Extensions.FileProviders.Abstractions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "ZbaMlhJlpisjuWbvXr4LdAst/1XxH3vZ6A0BsgTphZ2L4PGuxRLz7Jr/S7mkAAnOn78Vu0fKhEgNF5JO3zfjqQ==", - "dependencies": { - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.FileProviders.Physical": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "UboiXxpPUpwulHvIAVE36Knq0VSHaAmfrFkegLyBZeaADuKezJ/AIXYAW8F5GBlGk/VaibN2k/Zn1ca8YAfVdA==", - "dependencies": { - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "Microsoft.Extensions.FileSystemGlobbing": "8.0.0", - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.FileSystemGlobbing": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "OK+670i7esqlQrPjdIKRbsyMCe9g5kSLpRRQGSr4Q58AOYEe/hCnfLZprh7viNisSUUQZmMrbbuDaIrP+V1ebQ==" - }, - "Microsoft.Extensions.Hosting.Abstractions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "AG7HWwVRdCHlaA++1oKDxLsXIBxmDpMPb3VoyOoAghEWnkUvEAdYQUwnV4jJbAaa/nMYNiEh5ByoLauZBEiovg==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Diagnostics.Abstractions": "8.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging.Abstractions": "8.0.0" - } - }, - "Microsoft.Extensions.Logging": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "jxyapuSpRYSvKPhwb+XPs1h5qyjB7FywdiigHpgi1yIV5Vo/cD46CnhiS0upBxoB8+c1uj+auqHcLtVHhZOWaw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Logging.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Options": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Logging.Configuration": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "ixXXV0G/12g6MXK65TLngYN9V5hQQRuV+fZi882WIoVJT7h5JvoYoxTEwCgdqwLjSneqh1O+66gM8sMr9z/rsQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.Configuration.Binder": "8.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging": "8.0.0", - "Microsoft.Extensions.Logging.Abstractions": "8.0.0", - "Microsoft.Extensions.Options": "8.0.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0" - } - }, - "Microsoft.Extensions.Logging.Console": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "e+48o7DztoYog+PY430lPxrM4mm3PbA6qucvQtUDDwVo4MO+ejMw7YGc/o2rnxbxj4isPxdfKFzTxvXMwAz83A==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging": "8.0.0", - "Microsoft.Extensions.Logging.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging.Configuration": "8.0.0", - "Microsoft.Extensions.Options": "8.0.0", - "System.Text.Json": "8.0.0" - } - }, - "Microsoft.Extensions.Logging.Debug": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "dt0x21qBdudHLW/bjMJpkixv858RRr8eSomgVbU8qljOyfrfDGi1JQvpF9w8S7ziRPtRKisuWaOwFxJM82GxeA==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging": "8.0.0", - "Microsoft.Extensions.Logging.Abstractions": "8.0.0" - } - }, - "Microsoft.Extensions.Logging.EventLog": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "3X9D3sl7EmOu7vQp5MJrmIJBl5XSdOhZPYXUeFfYa6Nnm9+tok8x3t3IVPLhm7UJtPOU61ohFchw8rNm9tIYOQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging": "8.0.0", - "Microsoft.Extensions.Logging.Abstractions": "8.0.0", - "Microsoft.Extensions.Options": "8.0.0", - "System.Diagnostics.EventLog": "8.0.0" - } - }, - "Microsoft.Extensions.Logging.EventSource": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "oKcPMrw+luz2DUAKhwFXrmFikZWnyc8l2RKoQwqU3KIZZjcfoJE0zRHAnqATfhRZhtcbjl/QkiY2Xjxp0xu+6w==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Logging": "8.0.0", - "Microsoft.Extensions.Logging.Abstractions": "8.0.0", - "Microsoft.Extensions.Options": "8.0.0", - "Microsoft.Extensions.Primitives": "8.0.0", - "System.Text.Json": "8.0.0" - } - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "r74tRvh++amfqCHaCpKwERcN59xoLhFD9VrHFca+p1u0olWo7qKAO+uZDC4tXFEtgr307/AD4xRApyji3Tk99A==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Primitives": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Options.ConfigurationExtensions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "0f4DMRqEd50zQh+UyJc+/HiBsZ3vhAQALgdkcQEalSH1L2isdC7Yj54M3cyo5e+BeO5fcBQ7Dxly8XiBBcvRgw==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.Configuration.Binder": "8.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", - "Microsoft.Extensions.Options": "8.0.0", - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "+Z0U5wqkxw687YJZijjQ/rwtIfv5nxrR3XuStq//klsyzqYoXMur2chHoHA9x+TkFzIZm8KX+Dr/jwaOdq28Jw==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "YEAMWu1UnWgf1c1KP85l1SgXGfiVo0Rz6x08pCiPOIBt2Qe18tcZLvdBUuV5o1QHvrs8FAry9wTIhgBRtjIlEg==", - "dependencies": { - "Microsoft.Extensions.Logging": "8.0.0", - "Serilog": "3.1.1" - } - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "1.5.0", - "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "c9xLpVz6PL9lp/djOWtk5KPDZq3cSYpmXoJQY524EOtuFl5z9ZtsotpsyrDW40U1DRnQSYvcPKEUV0X//u6gkQ==" - }, - "System.Diagnostics.EventLog": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==" - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==" - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "OdrZO2WjkiEG6ajEFRABTRCi/wuXQPxeV6g8xvUJqdxMvvuCCEk86zPla8UiIQJz3durtUEbNyY/3lIhS0yZvQ==", - "dependencies": { - "System.Text.Encodings.Web": "8.0.0" - } - }, - "edelstein.common.crypto": { - "type": "Project" - }, - "edelstein.common.gameplay": { - "type": "Project", - "dependencies": { - "Edelstein.Common.Utilities": "[1.0.0, )", - "Edelstein.Protocol.Gameplay": "[1.0.0, )", - "Edelstein.Protocol.Services.Server": "[1.0.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[9.0.0-preview.3.24172.9, )" - } - }, - "edelstein.common.gameplay.login": { - "type": "Project", - "dependencies": { - "Edelstein.Common.Gameplay": "[1.0.0, )", - "Edelstein.Protocol.Gameplay.Login": "[1.0.0, )" - } - }, - "edelstein.common.network.dotnetty": { - "type": "Project", - "dependencies": { - "DotNetty.Buffers": "[0.7.6, )", - "DotNetty.Codecs": "[0.7.6, )", - "DotNetty.Common": "[0.7.6, )", - "DotNetty.Handlers": "[0.7.6, )", - "DotNetty.Transport": "[0.7.6, )", - "Edelstein.Common.Crypto": "[1.0.0, )", - "Edelstein.Common.Utilities": "[1.0.0, )", - "Edelstein.Protocol.Network": "[1.0.0, )" - } - }, - "edelstein.common.utilities": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )", - "Microsoft.IO.RecyclableMemoryStream": "[3.0.0, )" - } - }, - "edelstein.protocol.gameplay": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Network": "[1.0.0, )", - "Edelstein.Protocol.Services.Server": "[1.0.0, )" - } - }, - "edelstein.protocol.gameplay.login": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Gameplay": "[1.0.0, )", - "Edelstein.Protocol.Services.Server": "[1.0.0, )" - } - }, - "edelstein.protocol.network": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )" - } - }, - "edelstein.protocol.services.server": { - "type": "Project", - "dependencies": { - "protobuf-net.Grpc": "[1.1.1, )" - } - }, - "edelstein.protocol.utilities": { - "type": "Project" - }, - "DotNetty.Buffers": { - "type": "CentralTransitive", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "JVYypDugRG4m3hbS0drCC79vX93zqjn5w+U4ti/KXjTIzcQ/UVHrCgs7ZgJfWRUQLfgfQB0daYQtE18lKD8pHg==", - "dependencies": { - "DotNetty.Common": "0.7.6", - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "DotNetty.Codecs": { - "type": "CentralTransitive", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "XBZy/m3+V8PBUHHHbFKaRBE0+knTCitcE8oKCQn4jZybH25mCZ1vTwj3BRuPYdNpzh74Op32Hj4ZXF+DMx/oAg==", - "dependencies": { - "DotNetty.Buffers": "0.7.6", - "DotNetty.Common": "0.7.6", - "DotNetty.Transport": "0.7.6", - "System.Collections.Immutable": "1.5.0" - } - }, - "DotNetty.Common": { - "type": "CentralTransitive", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "dmK8Njfh2Y4qnz99lLK0evoc46FPL5WOnHMLlavNZ6zqC5/bKgqGsJFoXbhVPkSYDp58g2euI64dhY0cvOUOZQ==", - "dependencies": { - "Microsoft.Extensions.Logging": "5.0.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "DotNetty.Handlers": { - "type": "CentralTransitive", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "6sSMp0Md8DbpyOAV9IjiR30uzaLrxAbJTcwFFpMJM1+EJhvPz6Ywt0RqoV6+lseq6zqBjMq2jbPTKcqPoqNYIA==", - "dependencies": { - "DotNetty.Buffers": "0.7.6", - "DotNetty.Codecs": "0.7.6", - "DotNetty.Common": "0.7.6", - "DotNetty.Transport": "0.7.6" - } - }, - "DotNetty.Transport": { - "type": "CentralTransitive", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "EVQ5FihFPdWmw7v6l/4iyMepj49vZT11kWQNJ0ApC4KzkdJJ6LM/7NDUgghyxbO0e25nfQRtkGLP5EZAEo7QDA==", - "dependencies": { - "DotNetty.Buffers": "0.7.6", - "DotNetty.Common": "0.7.6" - } - }, - "Microsoft.EntityFrameworkCore": { - "type": "CentralTransitive", - "requested": "[9.0.0-preview.3.24172.4, )", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "8048WxaAf8UHdeaBlfkvUZMjH42zKOfaFEQHLTi5xqs7TDjiH69yHfrk0wLG56FeMX/d0Fm0QyO5Q1fAKDUDNA==", - "dependencies": { - "Microsoft.EntityFrameworkCore.Abstractions": "9.0.0-preview.3.24172.4", - "Microsoft.EntityFrameworkCore.Analyzers": "9.0.0-preview.3.24172.4", - "Microsoft.Extensions.Caching.Memory": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Logging": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Configuration.Json": { - "type": "CentralTransitive", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "C2wqUoh9OmRL1akaCcKSTmRU8z0kckfImG7zLNI8uyi47Lp+zd5LWAD17waPQEqCz3ioWOCrFUo+JJuoeZLOBw==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.Configuration.FileExtensions": "8.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "System.Text.Json": "8.0.0" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[9.0.0-preview.3.24172.9, )", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "b9wNSdoc20aarUp1ktpS2ERzO9MDqLflH2TmW/CXmjEnCli8CQ5gI+BeTyHa3j4RXwuhJiV4ssvthXYQj5rpWQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.IO.RecyclableMemoryStream": { - "type": "CentralTransitive", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "irv0HuqoH8Ig5i2fO+8dmDNdFdsrO+DoQcedwIlb810qpZHBNQHZLW7C/AHBQDgLLpw2T96vmMAy/aE4Yj55Sg==" - }, - "protobuf-net.Grpc": { - "type": "CentralTransitive", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - } - } - } -} \ No newline at end of file diff --git a/src/common/Directory.Build.props b/src/common/Directory.Build.props index d4bf1ac3f..3eaad973a 100644 --- a/src/common/Directory.Build.props +++ b/src/common/Directory.Build.props @@ -2,8 +2,4 @@ - - - - \ No newline at end of file diff --git a/src/common/Edelstein.Common.Crypto/AESCipher.cs b/src/common/Edelstein.Common.Crypto/AESCipher.cs deleted file mode 100644 index 9b6dddab1..000000000 --- a/src/common/Edelstein.Common.Crypto/AESCipher.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Buffers; -using System.Security.Cryptography; - -namespace Edelstein.Common.Crypto; - -public class AESCipher -{ - private readonly ICryptoTransform _transformer; - - public AESCipher() : this(new byte[] { 0x13, 0x08, 0x06, 0xb4, 0x1b, 0x0f, 0x33, 0x52 }) - { - } - - public AESCipher(ReadOnlySpan userKey) - { - var expandedKey = new byte[userKey.Length * 4]; - var cipher = Aes.Create(); - - for (var i = 0; i < userKey.Length; i++) - expandedKey[i * 4] = userKey[i]; - - cipher.KeySize = 256; - cipher.Key = expandedKey; - cipher.Mode = CipherMode.ECB; - _transformer = cipher.CreateEncryptor(); - } - - public void Transform(Span input, int remaining, uint pSrc) - { - var length = 0x5B0; - var start = 0; - - const int srcExpL = sizeof(int) * 4; - var srcExp = ArrayPool.Shared.Rent(srcExpL); - var srcBytes = BitConverter.GetBytes(pSrc); - - while (remaining > 0) - { - for (var i = 0; i < srcExpL; ++i) - srcExp[i] = srcBytes[i % 4]; - - if (remaining < length) - length = remaining; - - for (var i = start; i < start + length; ++i) - { - var sub = i - start; - - if (sub % srcExpL == 0) - _transformer.TransformBlock(srcExp, 0, srcExpL, srcExp, 0); - - input[i] ^= srcExp[sub % srcExpL]; - } - - start += length; - remaining -= length; - length = 0x5B4; - } - - ArrayPool.Shared.Return(srcExp); - } -} diff --git a/src/common/Edelstein.Common.Crypto/Edelstein.Common.Crypto.csproj b/src/common/Edelstein.Common.Crypto/Edelstein.Common.Crypto.csproj deleted file mode 100644 index 330f95a07..000000000 --- a/src/common/Edelstein.Common.Crypto/Edelstein.Common.Crypto.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - true - - - diff --git a/src/common/Edelstein.Common.Crypto/IGCipher.cs b/src/common/Edelstein.Common.Crypto/IGCipher.cs deleted file mode 100644 index 92e1b8477..000000000 --- a/src/common/Edelstein.Common.Crypto/IGCipher.cs +++ /dev/null @@ -1,63 +0,0 @@ -namespace Edelstein.Common.Crypto; - -public class IGCipher -{ - private readonly byte[] _shuffle; - private readonly uint _key; - - public IGCipher() : this(new byte[] - { - 0xEC, 0x3F, 0x77, 0xA4, 0x45, 0xD0, 0x71, 0xBF, 0xB7, 0x98, 0x20, 0xFC, 0x4B, 0xE9, 0xB3, 0xE1, - 0x5C, 0x22, 0xF7, 0x0C, 0x44, 0x1B, 0x81, 0xBD, 0x63, 0x8D, 0xD4, 0xC3, 0xF2, 0x10, 0x19, 0xE0, - 0xFB, 0xA1, 0x6E, 0x66, 0xEA, 0xAE, 0xD6, 0xCE, 0x06, 0x18, 0x4E, 0xEB, 0x78, 0x95, 0xDB, 0xBA, - 0xB6, 0x42, 0x7A, 0x2A, 0x83, 0x0B, 0x54, 0x67, 0x6D, 0xE8, 0x65, 0xE7, 0x2F, 0x07, 0xF3, 0xAA, - 0x27, 0x7B, 0x85, 0xB0, 0x26, 0xFD, 0x8B, 0xA9, 0xFA, 0xBE, 0xA8, 0xD7, 0xCB, 0xCC, 0x92, 0xDA, - 0xF9, 0x93, 0x60, 0x2D, 0xDD, 0xD2, 0xA2, 0x9B, 0x39, 0x5F, 0x82, 0x21, 0x4C, 0x69, 0xF8, 0x31, - 0x87, 0xEE, 0x8E, 0xAD, 0x8C, 0x6A, 0xBC, 0xB5, 0x6B, 0x59, 0x13, 0xF1, 0x04, 0x00, 0xF6, 0x5A, - 0x35, 0x79, 0x48, 0x8F, 0x15, 0xCD, 0x97, 0x57, 0x12, 0x3E, 0x37, 0xFF, 0x9D, 0x4F, 0x51, 0xF5, - 0xA3, 0x70, 0xBB, 0x14, 0x75, 0xC2, 0xB8, 0x72, 0xC0, 0xED, 0x7D, 0x68, 0xC9, 0x2E, 0x0D, 0x62, - 0x46, 0x17, 0x11, 0x4D, 0x6C, 0xC4, 0x7E, 0x53, 0xC1, 0x25, 0xC7, 0x9A, 0x1C, 0x88, 0x58, 0x2C, - 0x89, 0xDC, 0x02, 0x64, 0x40, 0x01, 0x5D, 0x38, 0xA5, 0xE2, 0xAF, 0x55, 0xD5, 0xEF, 0x1A, 0x7C, - 0xA7, 0x5B, 0xA6, 0x6F, 0x86, 0x9F, 0x73, 0xE6, 0x0A, 0xDE, 0x2B, 0x99, 0x4A, 0x47, 0x9C, 0xDF, - 0x09, 0x76, 0x9E, 0x30, 0x0E, 0xE4, 0xB2, 0x94, 0xA0, 0x3B, 0x34, 0x1D, 0x28, 0x0F, 0x36, 0xE3, - 0x23, 0xB4, 0x03, 0xD8, 0x90, 0xC8, 0x3C, 0xFE, 0x5E, 0x32, 0x24, 0x50, 0x1F, 0x3A, 0x43, 0x8A, - 0x96, 0x41, 0x74, 0xAC, 0x52, 0x33, 0xF0, 0xD9, 0x29, 0x80, 0xB1, 0x16, 0xD3, 0xAB, 0x91, 0xB9, - 0x84, 0x7F, 0x61, 0x1E, 0xCF, 0xC5, 0xD1, 0x56, 0x3D, 0xCA, 0xF4, 0x05, 0xC6, 0xE5, 0x08, 0x49 - }) - { - } - - public IGCipher(byte[] shuffle, uint key = 0xC65053F2) - { - _shuffle = shuffle; - _key = key; - } - - public unsafe uint Hash(uint pSrc, int nLen, uint dwKey) - { - if (dwKey == 0) dwKey = _key; - if (nLen <= 0) return _key; - - var ptrDwKey = &dwKey; - - for (var i = 0; i < nLen; i++) - { - var ptrPSrc = &pSrc; - - fixed (byte* pShuffle = _shuffle) - { - *((byte*)ptrDwKey + 0) += - (byte)(*(pShuffle + *((byte*)ptrDwKey + 1)) - *((byte*)ptrPSrc + i)); - *((byte*)ptrDwKey + 1) -= - (byte)(*((byte*)ptrDwKey + 2) ^ *(pShuffle + *((byte*)ptrPSrc + i))); - *((byte*)ptrDwKey + 2) ^= - (byte)(*((byte*)ptrPSrc + i) + *(pShuffle + *((byte*)ptrDwKey + 3))); - *((byte*)ptrDwKey + 3) = - (byte)(*((byte*)ptrDwKey + 3) - *(byte*)ptrDwKey + *(pShuffle + *((byte*)ptrPSrc + i))); - *ptrDwKey = *ptrDwKey << 3 | *ptrDwKey >> 29; - } - } - - return dwKey; - } -} diff --git a/src/common/Edelstein.Common.Crypto/ShandaCipher.cs b/src/common/Edelstein.Common.Crypto/ShandaCipher.cs deleted file mode 100644 index fa271628e..000000000 --- a/src/common/Edelstein.Common.Crypto/ShandaCipher.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; - -namespace Edelstein.Common.Crypto; - -public class ShandaCipher -{ - public static void EncryptTransform(Span input, int size) - { - for (var i = 0; i < 3; i++) - { - byte a = 0; - byte c; - for (var j = size; j > 0; j--) - { - c = input[size - j]; - c = RollLeft(c, 3); - c = (byte)(c + j); - c ^= a; - a = c; - c = RollRight(a, j); - c ^= 0xFF; - c += 0x48; - input[size - j] = c; - } - - a = 0; - for (var j = size; j > 0; j--) - { - c = input[j - 1]; - c = RollLeft(c, 4); - c = (byte)(c + j); - c ^= a; - a = c; - c ^= 0x13; - c = RollRight(c, 3); - input[j - 1] = c; - } - } - } - - public static void DecryptTransform(Span input, int size) - { - for (var i = 0; i < 3; i++) - { - byte a; - byte b = 0; - byte c; - for (var j = size; j > 0; j--) - { - c = input[j - 1]; - c = RollLeft(c, 3); - c ^= 0x13; - a = c; - c ^= b; - c = (byte)(c - j); - c = RollRight(c, 4); - b = a; - input[j - 1] = c; - } - - b = 0; - for (var j = size; j > 0; j--) - { - c = input[size - j]; - c -= 0x48; - c ^= 0xFF; - c = RollLeft(c, j); - a = c; - c ^= b; - c = (byte)(c - j); - c = RollRight(c, 3); - b = a; - input[size - j] = c; - } - } - } - - private static byte RollLeft(byte value, int shift) - { - var num = (uint)(value << shift % 8); - return (byte)(num & 0xff | num >> 8); - } - - private static byte RollRight(byte value, int shift) - { - var num = (uint)(value << 8 >> shift % 8); - return (byte)(num & 0xff | num >> 8); - } -} diff --git a/src/common/Edelstein.Common.Crypto/packages.lock.json b/src/common/Edelstein.Common.Crypto/packages.lock.json deleted file mode 100644 index a51481db6..000000000 --- a/src/common/Edelstein.Common.Crypto/packages.lock.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "Injectio": { - "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "7b7IdkoJA1ecyHYjstI0TraeilfaRdwmoBpR09oOYxuOTHYvKjPm5Odvjcdp6WMjcQF2WUs7xm169w9uXEgA1g==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" - } - }, - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==" - } - } - } -} \ No newline at end of file diff --git a/src/common/Edelstein.Common.Gameplay.Login/Contexts/LoginContextPipelines.cs b/src/common/Edelstein.Common.Gameplay.Login/Contexts/LoginContextPipelines.cs deleted file mode 100644 index d76d8e6a8..000000000 --- a/src/common/Edelstein.Common.Gameplay.Login/Contexts/LoginContextPipelines.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Edelstein.Protocol.Gameplay.Contracts; -using Edelstein.Protocol.Gameplay.Login; -using Edelstein.Protocol.Gameplay.Login.Contexts; -using Edelstein.Protocol.Utilities.Pipelines; -using Injectio.Attributes; - -namespace Edelstein.Common.Gameplay.Login.Contexts; - -[RegisterScoped] -public class LoginContextPipelines( - IPipeline> userOnPacketPipeline, - IPipeline> userOnExceptionPipeline, - IPipeline> userOnDisconnectPipeline -) : ILoginContextPipelines -{ - public IPipeline> UserOnPacketPipeline { get; } = userOnPacketPipeline; - public IPipeline> UserOnExceptionPipeline { get; } = userOnExceptionPipeline; - public IPipeline> UserOnDisconnectPipeline { get; } = userOnDisconnectPipeline; -} diff --git a/src/common/Edelstein.Common.Gameplay.Login/Edelstein.Common.Gameplay.Login.csproj b/src/common/Edelstein.Common.Gameplay.Login/Edelstein.Common.Gameplay.Login.csproj deleted file mode 100644 index 5e2a01e8e..000000000 --- a/src/common/Edelstein.Common.Gameplay.Login/Edelstein.Common.Gameplay.Login.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/common/Edelstein.Common.Gameplay.Login/LoginStageSystem.cs b/src/common/Edelstein.Common.Gameplay.Login/LoginStageSystem.cs deleted file mode 100644 index fc4b90a0c..000000000 --- a/src/common/Edelstein.Common.Gameplay.Login/LoginStageSystem.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Edelstein.Protocol.Gameplay.Contracts; -using Edelstein.Protocol.Gameplay.Login; -using Edelstein.Protocol.Gameplay.Login.Contexts; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Utilities.Pipelines; - -namespace Edelstein.Common.Gameplay.Login; - -public class LoginStageSystem( - ILoginStageSystemOptions options, - ILoginContextPipelines pipelines -) : AbstractStageSystem, ILoginStageSystem -{ - public override string ID => options.ID; - - protected override IPipeline> UserOnPacketPipeline => pipelines.UserOnPacketPipeline; - protected override IPipeline> UserOnExceptionPipeline => pipelines.UserOnExceptionPipeline; - protected override IPipeline> UserOnDisconnectPipeline => pipelines.UserOnDisconnectPipeline; - - public ILoginStageSystemOptions Options => options; - public ILoginContextPipelines Pipelines => pipelines; - - public override ILoginStageUser CreateUser(ISocket socket) - => new LoginStageUser(this, socket); -} diff --git a/src/common/Edelstein.Common.Gameplay.Login/LoginStageUser.cs b/src/common/Edelstein.Common.Gameplay.Login/LoginStageUser.cs deleted file mode 100644 index 169d4b2a5..000000000 --- a/src/common/Edelstein.Common.Gameplay.Login/LoginStageUser.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Edelstein.Protocol.Gameplay.Login; -using Edelstein.Protocol.Network; - -namespace Edelstein.Common.Gameplay.Login; - -public class LoginStageUser( - ILoginStageSystem system, - ISocket socket -) : ILoginStageUser -{ - public ILoginStageSystem System { get; } = system; - public ISocket Socket { get; } = socket; -} diff --git a/src/common/Edelstein.Common.Gameplay.Login/packages.lock.json b/src/common/Edelstein.Common.Gameplay.Login/packages.lock.json deleted file mode 100644 index 19011b5d7..000000000 --- a/src/common/Edelstein.Common.Gameplay.Login/packages.lock.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "Injectio": { - "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "7b7IdkoJA1ecyHYjstI0TraeilfaRdwmoBpR09oOYxuOTHYvKjPm5Odvjcdp6WMjcQF2WUs7xm169w9uXEgA1g==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" - } - }, - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "3176Psy4JxVCJI9L57MyLXt+0HmCylzFmblmmG4GNbxCArrt8slJGWootNRj7rJBh1CPNXOI3nwk9VvDLj/8oQ==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - }, - "edelstein.common.gameplay": { - "type": "Project", - "dependencies": { - "Edelstein.Common.Utilities": "[1.0.0, )", - "Edelstein.Protocol.Gameplay": "[1.0.0, )", - "Edelstein.Protocol.Services.Server": "[1.0.0, )", - "Microsoft.Extensions.Logging.Abstractions": "[9.0.0-preview.3.24172.9, )" - } - }, - "edelstein.common.utilities": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )", - "Microsoft.IO.RecyclableMemoryStream": "[3.0.0, )" - } - }, - "edelstein.protocol.gameplay": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Network": "[1.0.0, )", - "Edelstein.Protocol.Services.Server": "[1.0.0, )" - } - }, - "edelstein.protocol.gameplay.login": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Gameplay": "[1.0.0, )", - "Edelstein.Protocol.Services.Server": "[1.0.0, )" - } - }, - "edelstein.protocol.network": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )" - } - }, - "edelstein.protocol.services.server": { - "type": "Project", - "dependencies": { - "protobuf-net.Grpc": "[1.1.1, )" - } - }, - "edelstein.protocol.utilities": { - "type": "Project" - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[9.0.0-preview.3.24172.9, )", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "b9wNSdoc20aarUp1ktpS2ERzO9MDqLflH2TmW/CXmjEnCli8CQ5gI+BeTyHa3j4RXwuhJiV4ssvthXYQj5rpWQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.IO.RecyclableMemoryStream": { - "type": "CentralTransitive", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "irv0HuqoH8Ig5i2fO+8dmDNdFdsrO+DoQcedwIlb810qpZHBNQHZLW7C/AHBQDgLLpw2T96vmMAy/aE4Yj55Sg==" - }, - "protobuf-net.Grpc": { - "type": "CentralTransitive", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - } - } - } -} \ No newline at end of file diff --git a/src/common/Edelstein.Common.Gameplay/AbstractStageSystem.cs b/src/common/Edelstein.Common.Gameplay/AbstractStageSystem.cs deleted file mode 100644 index 25771fe6f..000000000 --- a/src/common/Edelstein.Common.Gameplay/AbstractStageSystem.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Threading.Tasks; -using Edelstein.Protocol.Gameplay; -using Edelstein.Protocol.Gameplay.Contracts; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Utilities.Buffers; -using Edelstein.Protocol.Utilities.Pipelines; - -namespace Edelstein.Common.Gameplay; - -public abstract class AbstractStageSystem : - IStageSystem - where TStageUser : IStageUser - where TStageSystem : IStageSystem -{ - public abstract string ID { get; } - - protected abstract IPipeline> UserOnPacketPipeline { get; } - protected abstract IPipeline> UserOnExceptionPipeline { get; } - protected abstract IPipeline> UserOnDisconnectPipeline { get; } - - public abstract TStageUser CreateUser(ISocket socket); - - public Task OnPacket(TStageUser user, IPacket packet) - => UserOnPacketPipeline.Process(new UserOnPacket(user, packet)); - - public Task OnException(TStageUser user, Exception exception) - => UserOnExceptionPipeline.Process(new UserOnException(user, exception)); - - public Task OnDisconnect(TStageUser user) - => UserOnDisconnectPipeline.Process(new UserOnDisconnect(user)); -} diff --git a/src/common/Edelstein.Common.Gameplay/Edelstein.Common.Gameplay.csproj b/src/common/Edelstein.Common.Gameplay/Edelstein.Common.Gameplay.csproj deleted file mode 100644 index 44a6c695e..000000000 --- a/src/common/Edelstein.Common.Gameplay/Edelstein.Common.Gameplay.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/common/Edelstein.Common.Gameplay/Handling/IPacketHandler.cs b/src/common/Edelstein.Common.Gameplay/Handling/IPacketHandler.cs deleted file mode 100644 index 4549f24e9..000000000 --- a/src/common/Edelstein.Common.Gameplay/Handling/IPacketHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Threading.Tasks; -using Edelstein.Protocol.Gameplay; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Common.Gameplay.Handling; - -public interface IPacketHandler - where TStageUser : IStageUser - where TStageSystem : IStageSystem -{ - short Operation { get; } - - bool Check(TStageUser user); - Task Handle(TStageUser user, IPacketReader reader); -} diff --git a/src/common/Edelstein.Common.Gameplay/Handling/IPacketHandlerManager.cs b/src/common/Edelstein.Common.Gameplay/Handling/IPacketHandlerManager.cs deleted file mode 100644 index a967ae793..000000000 --- a/src/common/Edelstein.Common.Gameplay/Handling/IPacketHandlerManager.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Threading.Tasks; -using Edelstein.Protocol.Gameplay; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Common.Gameplay.Handling; - -public interface IPacketHandlerManager - where TStageUser : IStageUser - where TStageSystem : IStageSystem -{ - void Add(IPacketHandler handler); - void Remove(IPacketHandler handler); - - Task Process(TStageUser user, IPacket packet); -} diff --git a/src/common/Edelstein.Common.Gameplay/Handling/IPacketSerializer.cs b/src/common/Edelstein.Common.Gameplay/Handling/IPacketSerializer.cs deleted file mode 100644 index 1060ff7f1..000000000 --- a/src/common/Edelstein.Common.Gameplay/Handling/IPacketSerializer.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Edelstein.Protocol.Gameplay; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Common.Gameplay.Handling; - -public interface IPacketSerializer - where TStageUser : IStageUser - where TStageSystem : IStageSystem -{ - TObject? Serialize(TStageUser user, IPacketReader reader); -} diff --git a/src/common/Edelstein.Common.Gameplay/Handling/PacketHandlerManager.cs b/src/common/Edelstein.Common.Gameplay/Handling/PacketHandlerManager.cs deleted file mode 100644 index b95c2d03e..000000000 --- a/src/common/Edelstein.Common.Gameplay/Handling/PacketHandlerManager.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Edelstein.Common.Utilities.Buffers; -using Edelstein.Protocol.Gameplay; -using Edelstein.Protocol.Utilities.Buffers; -using Injectio.Attributes; -using Microsoft.Extensions.Logging; - -namespace Edelstein.Common.Gameplay.Handling; - -[RegisterScoped(ImplementationType = typeof(PacketHandlerManager<,>), ServiceType = typeof(IPacketHandlerManager<,>))] -public class PacketHandlerManager( - ILogger> logger -) : IPacketHandlerManager - where TStageUser : IStageUser - where TStageSystem : IStageSystem -{ - private readonly Dictionary> _handlers = new(); - private readonly ILogger _logger = logger; - - public PacketHandlerManager( - ILogger> logger, - IEnumerable> handlers - ) : this(logger) - { - foreach (var handler in handlers) Add(handler); - } - - public void Add(IPacketHandler handler) - { - if (_handlers.ContainsKey(handler.Operation)) - _logger.LogWarning( - "Overriding packet handler for operation 0x{Operation:X} ({OperationName}) to {Handler}", - handler.Operation, Enum.GetName((PacketRecvOperations)handler.Operation), handler.GetType().Name - ); - else - _logger.LogDebug( - "Set packet handler for operation 0x{Operation:X} ({OperationName}) to {Handler}", - handler.Operation, Enum.GetName((PacketRecvOperations)handler.Operation), handler.GetType().Name - ); - _handlers[handler.Operation] = handler; - } - - public void Remove(IPacketHandler handler) - { - _logger.LogWarning( - "Removing packet handler for operation 0x{Operation:X} ({OperationName})", - handler.Operation, Enum.GetName((PacketRecvOperations)handler.Operation) - ); - _handlers.Remove(handler.Operation); - } - - public async Task Process(TStageUser user, IPacket packet) - { - using var reader = new PacketReader(packet.Buffer); - var operation = reader.ReadShort(); - var handler = _handlers.GetValueOrDefault(operation); - - if (handler == null) - { - _logger.LogWarning( - "Unhandled packet operation 0x{Operation:X} ({OperationName})", - operation, Enum.GetName((PacketRecvOperations)operation) - ); - return; - } - - if (handler.Check(user)) - await handler.Handle(user, reader); - - _logger.LogDebug( - "Handled packet operation 0x{Operation:X} ({OperationName}) with {Available} available bytes left", - operation, Enum.GetName((PacketRecvOperations)operation), reader.Available - ); - } -} diff --git a/src/common/Edelstein.Common.Gameplay/Handling/PacketRecvOperations.cs b/src/common/Edelstein.Common.Gameplay/Handling/PacketRecvOperations.cs deleted file mode 100644 index de45936a7..000000000 --- a/src/common/Edelstein.Common.Gameplay/Handling/PacketRecvOperations.cs +++ /dev/null @@ -1,320 +0,0 @@ -namespace Edelstein.Common.Gameplay.Handling; - -public enum PacketRecvOperations : short -{ - BEGIN_SOCKET = 0x0, - CheckPassword = 0x1, - GuestIDLogin = 0x2, - AccountInfoRequest = 0x3, - WorldInfoRequest = 0x4, - SelectWorld = 0x5, - CheckUserLimit = 0x6, - ConfirmEULA = 0x7, - SetGender = 0x8, - CheckPinCode = 0x9, - UpdatePinCode = 0xA, - WorldRequest = 0xB, - LogoutWorld = 0xC, - ViewAllChar = 0xD, - SelectCharacterByVAC = 0xE, - VACFlagSet = 0xF, - CheckNameChangePossible = 0x10, - RegisterNewCharacter = 0x11, - CheckTransferWorldPossible = 0x12, - SelectCharacter = 0x13, - MigrateIn = 0x14, - CheckDuplicatedID = 0x15, - CreateNewCharacter = 0x16, - CreateNewCharacterInCS = 0x17, - DeleteCharacter = 0x18, - AliveAck = 0x19, - ExceptionLog = 0x1A, - SecurityPacket = 0x1B, - EnableSPWRequest = 0x1C, - CheckSPWRequest = 0x1D, - EnableSPWRequestByACV = 0x1E, - CheckSPWRequestByACV = 0x1F, - CheckOTPRequest = 0x20, - CheckDeleteCharacterOTP = 0x21, - CreateSecurityHandle = 0x22, - SSOErrorLog = 0x23, - ClientDumpLog = 0x24, - CheckExtraCharInfo = 0x25, - CreateNewCharacter_Ex = 0x26, - END_SOCKET = 0x27, - BEGIN_USER = 0x28, - UserTransferFieldRequest = 0x29, - UserTransferChannelRequest = 0x2A, - UserMigrateToCashShopRequest = 0x2B, - UserMove = 0x2C, - UserSitRequest = 0x2D, - UserPortableChairSitRequest = 0x2E, - UserMeleeAttack = 0x2F, - UserShootAttack = 0x30, - UserMagicAttack = 0x31, - UserBodyAttack = 0x32, - UserMovingShootAttackPrepare = 0x33, - UserHit = 0x34, - UserAttackUser = 0x35, - UserChat = 0x36, - UserADBoardClose = 0x37, - UserEmotion = 0x38, - UserActivateEffectItem = 0x39, - UserUpgradeTombEffect = 0x3A, - UserHP = 0x3B, - Premium = 0x3C, - UserBanMapByMob = 0x3D, - UserMonsterBookSetCover = 0x3E, - UserSelectNpc = 0x3F, - UserRemoteShopOpenRequest = 0x40, - UserScriptMessageAnswer = 0x41, - UserShopRequest = 0x42, - UserTrunkRequest = 0x43, - UserEntrustedShopRequest = 0x44, - UserStoreBankRequest = 0x45, - UserParcelRequest = 0x46, - UserEffectLocal = 0x47, - ShopScannerRequest = 0x48, - ShopLinkRequest = 0x49, - AdminShopRequest = 0x4A, - UserGatherItemRequest = 0x4B, - UserSortItemRequest = 0x4C, - UserChangeSlotPositionRequest = 0x4D, - UserStatChangeItemUseRequest = 0x4E, - UserStatChangeItemCancelRequest = 0x4F, - UserStatChangeByPortableChairRequest = 0x50, - UserMobSummonItemUseRequest = 0x51, - UserPetFoodItemUseRequest = 0x52, - UserTamingMobFoodItemUseRequest = 0x53, - UserScriptItemUseRequest = 0x54, - UserConsumeCashItemUseRequest = 0x55, - UserDestroyPetItemRequest = 0x56, - UserBridleItemUseRequest = 0x57, - UserSkillLearnItemUseRequest = 0x58, - UserSkillResetItemUseRequest = 0x59, - UserShopScannerItemUseRequest = 0x5A, - UserMapTransferItemUseRequest = 0x5B, - UserPortalScrollUseRequest = 0x5C, - UserUpgradeItemUseRequest = 0x5D, - UserHyperUpgradeItemUseRequest = 0x5E, - UserItemOptionUpgradeItemUseRequest = 0x5F, - UserUIOpenItemUseRequest = 0x60, - UserItemReleaseRequest = 0x61, - UserAbilityUpRequest = 0x62, - UserAbilityMassUpRequest = 0x63, - UserChangeStatRequest = 0x64, - UserChangeStatRequestByItemOption = 0x65, - UserSkillUpRequest = 0x66, - UserSkillUseRequest = 0x67, - UserSkillCancelRequest = 0x68, - UserSkillPrepareRequest = 0x69, - UserDropMoneyRequest = 0x6A, - UserGivePopularityRequest = 0x6B, - UserPartyRequest = 0x6C, - UserCharacterInfoRequest = 0x6D, - UserActivatePetRequest = 0x6E, - UserTemporaryStatUpdateRequest = 0x6F, - UserPortalScriptRequest = 0x70, - UserPortalTeleportRequest = 0x71, - UserMapTransferRequest = 0x72, - UserAntiMacroItemUseRequest = 0x73, - UserAntiMacroSkillUseRequest = 0x74, - UserAntiMacroQuestionResult = 0x75, - UserClaimRequest = 0x76, - UserQuestRequest = 0x77, - UserCalcDamageStatSetRequest = 0x78, - UserThrowGrenade = 0x79, - UserMacroSysDataModified = 0x7A, - UserSelectNpcItemUseRequest = 0x7B, - UserLotteryItemUseRequest = 0x7C, - UserItemMakeRequest = 0x7D, - UserSueCharacterRequest = 0x7E, - UserUseGachaponBoxRequest = 0x7F, - UserUseGachaponRemoteRequest = 0x80, - UserUseWaterOfLife = 0x81, - UserRepairDurabilityAll = 0x82, - UserRepairDurability = 0x83, - UserQuestRecordSetState = 0x84, - UserClientTimerEndRequest = 0x85, - UserFollowCharacterRequest = 0x86, - UserFollowCharacterWithdraw = 0x87, - UserSelectPQReward = 0x88, - UserRequestPQReward = 0x89, - SetPassenserResult = 0x8A, - BroadcastMsg = 0x8B, - GroupMessage = 0x8C, - Whisper = 0x8D, - CoupleMessage = 0x8E, - Messenger = 0x8F, - MiniRoom = 0x90, - PartyRequest = 0x91, - PartyResult = 0x92, - ExpeditionRequest = 0x93, - PartyAdverRequest = 0x94, - GuildRequest = 0x95, - GuildResult = 0x96, - Admin = 0x97, - Log = 0x98, - FriendRequest = 0x99, - MemoRequest = 0x9A, - MemoFlagRequest = 0x9B, - EnterTownPortalRequest = 0x9C, - EnterOpenGateRequest = 0x9D, - SlideRequest = 0x9E, - FuncKeyMappedModified = 0x9F, - RPSGame = 0xA0, - MarriageRequest = 0xA1, - WeddingWishListRequest = 0xA2, - WeddingProgress = 0xA3, - GuestBless = 0xA4, - BoobyTrapAlert = 0xA5, - StalkBegin = 0xA6, - AllianceRequest = 0xA7, - AllianceResult = 0xA8, - FamilyChartRequest = 0xA9, - FamilyInfoRequest = 0xAA, - FamilyRegisterJunior = 0xAB, - FamilyUnregisterJunior = 0xAC, - FamilyUnregisterParent = 0xAD, - FamilyJoinResult = 0xAE, - FamilyUsePrivilege = 0xAF, - FamilySetPrecept = 0xB0, - FamilySummonResult = 0xB1, - ChatBlockUserReq = 0xB2, - GuildBBS = 0xB3, - UserMigrateToITCRequest = 0xB4, - UserExpUpItemUseRequest = 0xB5, - UserTempExpUseRequest = 0xB6, - NewYearCardRequest = 0xB7, - RandomMorphRequest = 0xB8, - CashItemGachaponRequest = 0xB9, - CashGachaponOpenRequest = 0xBA, - ChangeMaplePointRequest = 0xBB, - TalkToTutor = 0xBC, - RequestIncCombo = 0xBD, - MobCrcKeyChangedReply = 0xBE, - RequestSessionValue = 0xBF, - UpdateGMBoard = 0xC0, - AccountMoreInfo = 0xC1, - FindFriend = 0xC2, - AcceptAPSPEvent = 0xC3, - UserDragonBallBoxRequest = 0xC4, - UserDragonBallSummonRequest = 0xC5, - BEGIN_PET = 0xC6, - PetMove = 0xC7, - PetAction = 0xC8, - PetInteractionRequest = 0xC9, - PetDropPickUpRequest = 0xCA, - PetStatChangeItemUseRequest = 0xCB, - PetUpdateExceptionListRequest = 0xCC, - END_PET = 0xCD, - BEGIN_SUMMONED = 0xCE, - SummonedMove = 0xCF, - SummonedAttack = 0xD0, - SummonedHit = 0xD1, - SummonedSkill = 0xD2, - Remove = 0xD3, - END_SUMMONED = 0xD4, - BEGIN_DRAGON = 0xD5, - DragonMove = 0xD6, - END_DRAGON = 0xD7, - QuickslotKeyMappedModified = 0xD8, - PassiveskillInfoUpdate = 0xD9, - UpdateScreenSetting = 0xDA, - UserAttackUser_Specific = 0xDB, - UserPamsSongUseRequest = 0xDC, - QuestGuideRequest = 0xDD, - UserRepeatEffectRemove = 0xDE, - END_USER = 0xDF, - BEGIN_FIELD = 0xE0, - BEGIN_LIFEPOOL = 0xE1, - BEGIN_MOB = 0xE2, - MobMove = 0xE3, - MobApplyCtrl = 0xE4, - MobDropPickUpRequest = 0xE5, - MobHitByObstacle = 0xE6, - MobHitByMob = 0xE7, - MobSelfDestruct = 0xE8, - MobAttackMob = 0xE9, - MobSkillDelayEnd = 0xEA, - MobTimeBombEnd = 0xEB, - MobEscortCollision = 0xEC, - MobRequestEscortInfo = 0xED, - MobEscortStopEndRequest = 0xEE, - END_MOB = 0xEF, - BEGIN_NPC = 0xF0, - NpcMove = 0xF1, - NpcSpecialAction = 0xF2, - END_NPC = 0xF3, - END_LIFEPOOL = 0xF4, - BEGIN_DROPPOOL = 0xF5, - DropPickUpRequest = 0xF6, - END_DROPPOOL = 0xF7, - BEGIN_REACTORPOOL = 0xF8, - ReactorHit = 0xF9, - ReactorTouch = 0xFA, - RequireFieldObstacleStatus = 0xFB, - END_REACTORPOOL = 0xFC, - BEGIN_EVENT_FIELD = 0xFD, - EventStart = 0xFE, - SnowBallHit = 0xFF, - SnowBallTouch = 0x100, - CoconutHit = 0x101, - TournamentMatchTable = 0x102, - PulleyHit = 0x103, - END_EVENT_FIELD = 0x104, - BEGIN_MONSTER_CARNIVAL_FIELD = 0x105, - MCarnivalRequest = 0x106, - END_MONSTER_CARNIVAL_FIELD = 0x107, - CONTISTATE = 0x108, - BEGIN_PARTY_MATCH = 0x109, - INVITE_PARTY_MATCH = 0x10A, - CANCEL_INVITE_PARTY_MATCH = 0x10B, - END_PARTY_MATCH = 0x10C, - RequestFootHoldInfo = 0x10D, - FootHoldInfo = 0x10E, - END_FIELD = 0x10F, - BEGIN_CASHSHOP = 0x110, - CashShopChargeParamRequest = 0x111, - CashShopQueryCashRequest = 0x112, - CashShopCashItemRequest = 0x113, - CashShopCheckCouponRequest = 0x114, - CashShopGiftMateInfoRequest = 0x115, - END_CASHSHOP = 0x116, - CheckSSN2OnCreateNewCharacter = 0x117, - CheckSPWOnCreateNewCharacter = 0x118, - FirstSSNOnCreateNewCharacter = 0x119, - BEGIN_RAISE = 0x11A, - RaiseRefesh = 0x11B, - RaiseUIState = 0x11C, - RaiseIncExp = 0x11D, - RaiseAddPiece = 0x11E, - END_RAISE = 0x11F, - SendMateMail = 0x120, - RequestGuildBoardAuthKey = 0x121, - RequestConsultAuthKey = 0x122, - RequestClassCompetitionAuthKey = 0x123, - RequestWebBoardAuthKey = 0x124, - BEGIN_ITEMUPGRADE = 0x125, - GoldHammerRequest = 0x126, - GoldHammerComplete = 0x127, - ItemUpgradeComplete = 0x128, - END_ITEMUPGRADE = 0x129, - BEGIN_BATTLERECORD = 0x12A, - BATTLERECORD_ONOFF_REQUEST = 0x12B, - END_BATTLERECORD = 0x12C, - BEGIN_MAPLETV = 0x12D, - MapleTVSendMessageRequest = 0x12E, - MapleTVUpdateViewCount = 0x12F, - END_MAPLETV = 0x130, - BEGIN_ITC = 0x131, - ITCChargeParamRequest = 0x132, - ITCQueryCashRequest = 0x133, - ITCItemRequest = 0x134, - END_ITC = 0x135, - BEGIN_CHARACTERSALE = 0x136, - CheckDuplicatedIDInCS = 0x137, - END_CHARACTERSALE = 0x138, - LogoutGiftSelect = 0x139, - NO = 0x13A -} diff --git a/src/common/Edelstein.Common.Gameplay/Handling/PacketSendOperations.cs b/src/common/Edelstein.Common.Gameplay/Handling/PacketSendOperations.cs deleted file mode 100644 index aae658886..000000000 --- a/src/common/Edelstein.Common.Gameplay/Handling/PacketSendOperations.cs +++ /dev/null @@ -1,513 +0,0 @@ -namespace Edelstein.Common.Gameplay.Handling; - -public enum PacketSendOperations : short -{ - BEGIN_SOCKET = 0x0, - CheckPasswordResult = 0x0, - GuestIDLoginResult = 0x1, - AccountInfoResult = 0x2, - CheckUserLimitResult = 0x3, - SetAccountResult = 0x4, - ConfirmEULAResult = 0x5, - CheckPinCodeResult = 0x6, - UpdatePinCodeResult = 0x7, - ViewAllCharResult = 0x8, - SelectCharacterByVACResult = 0x9, - WorldInformation = 0xA, - SelectWorldResult = 0xB, - SelectCharacterResult = 0xC, - CheckDuplicatedIDResult = 0xD, - CreateNewCharacterResult = 0xE, - DeleteCharacterResult = 0xF, - MigrateCommand = 0x10, - AliveReq = 0x11, - AuthenCodeChanged = 0x12, - AuthenMessage = 0x13, - SecurityPacket = 0x14, - EnableSPWResult = 0x15, - DeleteCharacterOTPRequest = 0x16, - CheckCrcResult = 0x17, - LatestConnectedWorld = 0x18, - RecommendWorldMessage = 0x19, - CheckExtraCharInfoResult = 0x1A, - CheckSPWResult = 0x1B, - END_SOCKET = 0x1B, - BEGIN_CHARACTERDATA = 0x1C, - InventoryOperation = 0x1C, - InventoryGrow = 0x1D, - StatChanged = 0x1E, - TemporaryStatSet = 0x1F, - TemporaryStatReset = 0x20, - ForcedStatSet = 0x21, - ForcedStatReset = 0x22, - ChangeSkillRecordResult = 0x23, - SkillUseResult = 0x24, - GivePopularityResult = 0x25, - Message = 0x26, - SendOpenFullClientLink = 0x27, - MemoResult = 0x28, - MapTransferResult = 0x29, - AntiMacroResult = 0x2A, - InitialQuizStart = 0x2B, - ClaimResult = 0x2C, - SetClaimSvrAvailableTime = 0x2D, - ClaimSvrStatusChanged = 0x2E, - SetTamingMobInfo = 0x2F, - QuestClear = 0x30, - EntrustedShopCheckResult = 0x31, - SkillLearnItemResult = 0x32, - SkillResetItemResult = 0x33, - GatherItemResult = 0x34, - SortItemResult = 0x35, - RemoteShopOpenResult = 0x36, - SueCharacterResult = 0x37, - MigrateToCashShopResult = 0x38, - TradeMoneyLimit = 0x39, - SetGender = 0x3A, - GuildBBS = 0x3B, - PetDeadMessage = 0x3C, - CharacterInfo = 0x3D, - PartyResult = 0x3E, - ExpeditionRequest = 0x3F, - ExpeditionNoti = 0x40, - FriendResult = 0x41, - GuildRequest = 0x42, - GuildResult = 0x43, - AllianceResult = 0x44, - TownPortal = 0x45, - OpenGate = 0x46, - BroadcastMsg = 0x47, - IncubatorResult = 0x48, - ShopScannerResult = 0x49, - ShopLinkResult = 0x4A, - MarriageRequest = 0x4B, - MarriageResult = 0x4C, - WeddingGiftResult = 0x4D, - MarriedPartnerMapTransfer = 0x4E, - CashPetFoodResult = 0x4F, - SetWeekEventMessage = 0x50, - SetPotionDiscountRate = 0x51, - BridleMobCatchFail = 0x52, - ImitatedNPCResult = 0x53, - ImitatedNPCData = 0x54, - LimitedNPCDisableInfo = 0x55, - MonsterBookSetCard = 0x56, - MonsterBookSetCover = 0x57, - HourChanged = 0x58, - MiniMapOnOff = 0x59, - ConsultAuthkeyUpdate = 0x5A, - ClassCompetitionAuthkeyUpdate = 0x5B, - WebBoardAuthkeyUpdate = 0x5C, - SessionValue = 0x5D, - PartyValue = 0x5E, - FieldSetVariable = 0x5F, - BonusExpRateChanged = 0x60, - PotionDiscountRateChanged = 0x61, - FamilyChartResult = 0x62, - FamilyInfoResult = 0x63, - FamilyResult = 0x64, - FamilyJoinRequest = 0x65, - FamilyJoinRequestResult = 0x66, - FamilyJoinAccepted = 0x67, - FamilyPrivilegeList = 0x68, - FamilyFamousPointIncResult = 0x69, - FamilyNotifyLoginOrLogout = 0x6A, - FamilySetPrivilege = 0x6B, - FamilySummonRequest = 0x6C, - NotifyLevelUp = 0x6D, - NotifyWedding = 0x6E, - NotifyJobChange = 0x6F, - IncRateChanged = 0x70, - MapleTVUseRes = 0x71, - AvatarMegaphoneRes = 0x72, - AvatarMegaphoneUpdateMessage = 0x73, - AvatarMegaphoneClearMessage = 0x74, - CancelNameChangeResult = 0x75, - CancelTransferWorldResult = 0x76, - DestroyShopResult = 0x77, - FAKEGMNOTICE = 0x78, - SuccessInUseGachaponBox = 0x79, - NewYearCardRes = 0x7A, - RandomMorphRes = 0x7B, - CancelNameChangeByOther = 0x7C, - SetBuyEquipExt = 0x7D, - SetPassenserRequest = 0x7E, - ScriptProgressMessage = 0x7F, - DataCRCCheckFailed = 0x80, - CakePieEventResult = 0x81, - UpdateGMBoard = 0x82, - ShowSlotMessage = 0x83, - WildHunterInfo = 0x84, - AccountMoreInfo = 0x85, - FindFirend = 0x86, - StageChange = 0x87, - DragonBallBox = 0x88, - AskUserWhetherUsePamsSong = 0x89, - TransferChannel = 0x8A, - DisallowedDeliveryQuestList = 0x8B, - MacroSysDataInit = 0x8C, - END_CHARACTERDATA = 0x8C, - BEGIN_STAGE = 0x8D, - SetField = 0x8D, - SetITC = 0x8E, - SetCashShop = 0x8F, - END_STAGE = 0x8F, - BEGIN_MAP = 0x90, - SetBackgroundEffect = 0x90, - SetMapObjectVisible = 0x91, - ClearBackgroundEffect = 0x92, - END_MAP = 0x92, - BEGIN_FIELD = 0x93, - TransferFieldReqIgnored = 0x93, - TransferChannelReqIgnored = 0x94, - FieldSpecificData = 0x95, - GroupMessage = 0x96, - Whisper = 0x97, - CoupleMessage = 0x98, - MobSummonItemUseResult = 0x99, - FieldEffect = 0x9A, - FieldObstacleOnOff = 0x9B, - FieldObstacleOnOffStatus = 0x9C, - FieldObstacleAllReset = 0x9D, - BlowWeather = 0x9E, - PlayJukeBox = 0x9F, - AdminResult = 0xA0, - Quiz = 0xA1, - Desc = 0xA2, - Clock = 0xA3, - CONTIMOVE = 0xA4, - CONTISTATE = 0xA5, - SetQuestClear = 0xA6, - SetQuestTime = 0xA7, - Warn = 0xA8, - SetObjectState = 0xA9, - DestroyClock = 0xAA, - ShowArenaResult = 0xAB, - StalkResult = 0xAC, - MassacreIncGauge = 0xAD, - MassacreResult = 0xAE, - QuickslotMappedInit = 0xAF, - FootHoldInfo = 0xB0, - RequestFootHoldInfo = 0xB1, - FieldKillCount = 0xB2, - BEGIN_USERPOOL = 0xB3, - UserEnterField = 0xB3, - UserLeaveField = 0xB4, - BEGIN_USERCOMMON = 0xB5, - UserChat = 0xB5, - UserChatNLCPQ = 0xB6, - UserADBoard = 0xB7, - UserMiniRoomBalloon = 0xB8, - UserConsumeItemEffect = 0xB9, - UserItemUpgradeEffect = 0xBA, - UserItemHyperUpgradeEffect = 0xBB, - UserItemOptionUpgradeEffect = 0xBC, - UserItemReleaseEffect = 0xBD, - UserItemUnreleaseEffect = 0xBE, - UserHitByUser = 0xBF, - UserTeslaTriangle = 0xC0, - UserFollowCharacter = 0xC1, - UserShowPQReward = 0xC2, - UserSetPhase = 0xC3, - SetPortalUsable = 0xC4, - ShowPamsSongResult = 0xC5, - BEGIN_PET = 0xC6, - PetActivated = 0xC6, - PetEvol = 0xC7, - PetTransferField = 0xC8, - PetMove = 0xC9, - PetAction = 0xCA, - PetNameChanged = 0xCB, - PetLoadExceptionList = 0xCC, - PetActionCommand = 0xCD, - END_PET = 0xCD, - BEGIN_DRAGON = 0xCE, - DragonEnterField = 0xCE, - DragonMove = 0xCF, - DragonLeaveField = 0xD0, - END_DRAGON = 0xD0, - END_USERCOMMON = 0xD1, - BEGIN_USERREMOTE = 0xD2, - UserMove = 0xD2, - UserMeleeAttack = 0xD3, - UserShootAttack = 0xD4, - UserMagicAttack = 0xD5, - UserBodyAttack = 0xD6, - UserSkillPrepare = 0xD7, - UserMovingShootAttackPrepare = 0xD8, - UserSkillCancel = 0xD9, - UserHit = 0xDA, - UserEmotion = 0xDB, - UserSetActiveEffectItem = 0xDC, - UserShowUpgradeTombEffect = 0xDD, - UserSetActivePortableChair = 0xDE, - UserAvatarModified = 0xDF, - UserEffectRemote = 0xE0, - UserTemporaryStatSet = 0xE1, - UserTemporaryStatReset = 0xE2, - UserHP = 0xE3, - UserGuildNameChanged = 0xE4, - UserGuildMarkChanged = 0xE5, - UserThrowGrenade = 0xE6, - END_USERREMOTE = 0xE6, - BEGIN_USERLOCAL = 0xE7, - UserSitResult = 0xE7, - UserEmotionLocal = 0xE8, - UserEffectLocal = 0xE9, - UserTeleport = 0xEA, - Premium = 0xEB, - MesoGive_Succeeded = 0xEC, - MesoGive_Failed = 0xED, - Random_Mesobag_Succeed = 0xEE, - Random_Mesobag_Failed = 0xEF, - FieldFadeInOut = 0xF0, - FieldFadeOutForce = 0xF1, - UserQuestResult = 0xF2, - NotifyHPDecByField = 0xF3, - UserPetSkillChanged = 0xF4, - UserBalloonMsg = 0xF5, - PlayEventSound = 0xF6, - PlayMinigameSound = 0xF7, - UserMakerResult = 0xF8, - UserOpenConsultBoard = 0xF9, - UserOpenClassCompetitionPage = 0xFA, - UserOpenUI = 0xFB, - UserOpenUIWithOption = 0xFC, - SetDirectionMode = 0xFD, - SetStandAloneMode = 0xFE, - UserHireTutor = 0xFF, - UserTutorMsg = 0x100, - IncCombo = 0x101, - UserRandomEmotion = 0x102, - ResignQuestReturn = 0x103, - PassMateName = 0x104, - SetRadioSchedule = 0x105, - UserOpenSkillGuide = 0x106, - UserNoticeMsg = 0x107, - UserChatMsg = 0x108, - UserBuffzoneEffect = 0x109, - UserGoToCommoditySN = 0x10A, - UserDamageMeter = 0x10B, - UserTimeBombAttack = 0x10C, - UserPassiveMove = 0x10D, - UserFollowCharacterFailed = 0x10E, - UserRequestVengeance = 0x10F, - UserRequestExJablin = 0x110, - UserAskAPSPEvent = 0x111, - QuestGuideResult = 0x112, - UserDeliveryQuest = 0x113, - SkillCooltimeSet = 0x114, - END_USERLOCAL = 0x114, - END_USERPOOL = 0x115, - BEGIN_SUMMONED = 0x116, - SummonedEnterField = 0x116, - SummonedLeaveField = 0x117, - SummonedMove = 0x118, - SummonedAttack = 0x119, - SummonedSkill = 0x11A, - SummonedHit = 0x11B, - END_SUMMONED = 0x11B, - BEGIN_MOBPOOL = 0x11C, - MobEnterField = 0x11C, - MobLeaveField = 0x11D, - MobChangeController = 0x11E, - BEGIN_MOB = 0x11F, - MobMove = 0x11F, - MobCtrlAck = 0x120, - MobCtrlHint = 0x121, - MobStatSet = 0x122, - MobStatReset = 0x123, - MobSuspendReset = 0x124, - MobAffected = 0x125, - MobDamaged = 0x126, - MobSpecialEffectBySkill = 0x127, - MobHPChange = 0x128, - MobCrcKeyChanged = 0x129, - MobHPIndicator = 0x12A, - MobCatchEffect = 0x12B, - MobEffectByItem = 0x12C, - MobSpeaking = 0x12D, - MobChargeCount = 0x12E, - MobSkillDelay = 0x12F, - MobRequestResultEscortInfo = 0x130, - MobEscortStopEndPermmision = 0x131, - MobEscortStopSay = 0x132, - MobEscortReturnBefore = 0x133, - MobNextAttack = 0x134, - MobAttackedByMob = 0x135, - END_MOB = 0x135, - END_MOBPOOL = 0x136, - BEGIN_NPCPOOL = 0x137, - NpcEnterField = 0x137, - NpcLeaveField = 0x138, - NpcChangeController = 0x139, - BEGIN_NPC = 0x13A, - NpcMove = 0x13A, - NpcUpdateLimitedInfo = 0x13B, - NpcSpecialAction = 0x13C, - END_NPC = 0x13C, - BEGIN_NPCTEMPLATE = 0x13D, - NpcSetScript = 0x13D, - END_NPCTEMPLATE = 0x13D, - END_NPCPOOL = 0x13E, - BEGIN_EMPLOYEEPOOL = 0x13F, - EmployeeEnterField = 0x13F, - EmployeeLeaveField = 0x140, - EmployeeMiniRoomBalloon = 0x141, - END_EMPLOYEEPOOL = 0x141, - BEGIN_DROPPOOL = 0x142, - DropEnterField = 0x142, - DropReleaseAllFreeze = 0x143, - DropLeaveField = 0x144, - END_DROPPOOL = 0x144, - BEGIN_MESSAGEBOXPOOL = 0x145, - CreateMessageBoxFailed = 0x145, - MessageBoxEnterField = 0x146, - MessageBoxLeaveField = 0x147, - END_MESSAGEBOXPOOL = 0x147, - BEGIN_AFFECTEDAREAPOOL = 0x148, - AffectedAreaCreated = 0x148, - AffectedAreaRemoved = 0x149, - END_AFFECTEDAREAPOOL = 0x149, - BEGIN_TOWNPORTALPOOL = 0x14A, - TownPortalCreated = 0x14A, - TownPortalRemoved = 0x14B, - END_TOWNPORTALPOOL = 0x14B, - BEGIN_OPENGATEPOOL = 0x14C, - OpenGateCreated = 0x14C, - OpenGateRemoved = 0x14D, - END_OPENGATEPOOL = 0x14D, - BEGIN_REACTORPOOL = 0x14E, - ReactorChangeState = 0x14E, - ReactorMove = 0x14F, - ReactorEnterField = 0x150, - ReactorLeaveField = 0x151, - END_REACTORPOOL = 0x151, - BEGIN_ETCFIELDOBJ = 0x152, - SnowBallState = 0x152, - SnowBallHit = 0x153, - SnowBallMsg = 0x154, - SnowBallTouch = 0x155, - CoconutHit = 0x156, - CoconutScore = 0x157, - HealerMove = 0x158, - PulleyStateChange = 0x159, - MCarnivalEnter = 0x15A, - MCarnivalPersonalCP = 0x15B, - MCarnivalTeamCP = 0x15C, - MCarnivalResultSuccess = 0x15D, - MCarnivalResultFail = 0x15E, - MCarnivalDeath = 0x15F, - MCarnivalMemberOut = 0x160, - MCarnivalGameResult = 0x161, - ArenaScore = 0x162, - BattlefieldEnter = 0x163, - BattlefieldScore = 0x164, - BattlefieldTeamChanged = 0x165, - WitchtowerScore = 0x166, - HontaleTimer = 0x167, - ChaosZakumTimer = 0x168, - HontailTimer = 0x169, - ZakumTimer = 0x16A, - END_ETCFIELDOBJ = 0x16A, - BEGIN_SCRIPT = 0x16B, - ScriptMessage = 0x16B, - END_SCRIPT = 0x16B, - BEGIN_SHOP = 0x16C, - OpenShopDlg = 0x16C, - ShopResult = 0x16D, - END_SHOP = 0x16D, - BEGIN_ADMINSHOP = 0x16E, - AdminShopResult = 0x16E, - AdminShopCommodity = 0x16F, - END_ADMINSHOP = 0x16F, - TrunkResult = 0x170, - BEGIN_STOREBANK = 0x171, - StoreBankGetAllResult = 0x171, - StoreBankResult = 0x172, - END_STOREBANK = 0x172, - RPSGame = 0x173, - Messenger = 0x174, - MiniRoom = 0x175, - BEGIN_TOURNAMENT = 0x176, - Tournament = 0x176, - TournamentMatchTable = 0x177, - TournamentSetPrize = 0x178, - TournamentNoticeUEW = 0x179, - TournamentAvatarInfo = 0x17A, - END_TOURNAMENT = 0x17A, - BEGIN_WEDDING = 0x17B, - WeddingProgress = 0x17B, - WeddingCremonyEnd = 0x17C, - END_WEDDING = 0x17C, - Parcel = 0x17D, - END_FIELD = 0x17D, - BEGIN_CASHSHOP = 0x17E, - CashShopChargeParamResult = 0x17E, - CashShopQueryCashResult = 0x17F, - CashShopCashItemResult = 0x180, - CashShopPurchaseExpChanged = 0x181, - CashShopGiftMateInfoResult = 0x182, - CashShopCheckDuplicatedIDResult = 0x183, - CashShopCheckNameChangePossibleResult = 0x184, - CashShopRegisterNewCharacterResult = 0x185, - CashShopCheckTransferWorldPossibleResult = 0x186, - CashShopGachaponStampItemResult = 0x187, - CashShopCashItemGachaponResult = 0x188, - CashShopCashGachaponOpenResult = 0x189, - ChangeMaplePointResult = 0x18A, - CashShopOneADay = 0x18B, - CashShopNoticeFreeCashItem = 0x18C, - CashShopMemberShopResult = 0x18D, - END_CASHSHOP = 0x18D, - BEGIN_FUNCKEYMAPPED = 0x18E, - FuncKeyMappedInit = 0x18E, - PetConsumeItemInit = 0x18F, - PetConsumeMPItemInit = 0x190, - END_FUNCKEYMAPPED = 0x190, - CheckSSN2OnCreateNewCharacterResult = 0x191, - CheckSPWOnCreateNewCharacterResult = 0x192, - FirstSSNOnCreateNewCharacterResult = 0x193, - BEGIN_MAPLETV = 0x194, - MapleTVUpdateMessage = 0x195, - MapleTVClearMessage = 0x196, - MapleTVSendMessageResult = 0x197, - BroadSetFlashChangeEvent = 0x198, - END_MAPLETV = 0x199, - BEGIN_ITC = 0x19A, - ITCChargeParamResult = 0x19A, - ITCQueryCashResult = 0x19B, - ITCNormalItemResult = 0x19C, - END_ITC = 0x19C, - BEGIN_CHARACTERSALE = 0x19D, - CheckDuplicatedIDResultInCS = 0x19D, - CreateNewCharacterResultInCS = 0x19E, - CreateNewCharacterFailInCS = 0x19F, - CharacterSale = 0x1A0, - END_CHARACTERSALE = 0x1A0, - BEGIN_GOLDHAMMER = 0x1A1, - GoldHammere_s = 0x1A1, - GoldHammerResult = 0x1A2, - GoldHammere_e = 0x1A3, - END_GOLDHAMMER = 0x1A3, - BEGIN_BATTLERECORD = 0x1A4, - BattleRecord_s = 0x1A4, - BattleRecordDotDamageInfo = 0x1A5, - BattleRecordRequestResult = 0x1A6, - BattleRecord_e = 0x1A7, - END_BATTLERECORD = 0x1A7, - BEGIN_ITEMUPGRADE = 0x1A8, - ItemUpgrade_s = 0x1A8, - ItemUpgradeResult = 0x1A9, - ItemUpgradeFail = 0x1AA, - ItemUpgrade_e = 0x1AB, - END_ITEMUPGRADE = 0x1AB, - BEGIN_VEGA = 0x1AC, - Vega_s = 0x1AC, - VegaResult = 0x1AD, - VegaFail = 0x1AE, - Vega_e = 0x1AF, - END_VEGA = 0x1AF, - LogoutGift = 0x1B0, - NO = 0x1B1 -} diff --git a/src/common/Edelstein.Common.Gameplay/packages.lock.json b/src/common/Edelstein.Common.Gameplay/packages.lock.json deleted file mode 100644 index 1e857adc4..000000000 --- a/src/common/Edelstein.Common.Gameplay/packages.lock.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "Injectio": { - "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "7b7IdkoJA1ecyHYjstI0TraeilfaRdwmoBpR09oOYxuOTHYvKjPm5Odvjcdp6WMjcQF2WUs7xm169w9uXEgA1g==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Direct", - "requested": "[9.0.0-preview.3.24172.9, )", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "b9wNSdoc20aarUp1ktpS2ERzO9MDqLflH2TmW/CXmjEnCli8CQ5gI+BeTyHa3j4RXwuhJiV4ssvthXYQj5rpWQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9" - } - }, - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "3176Psy4JxVCJI9L57MyLXt+0HmCylzFmblmmG4GNbxCArrt8slJGWootNRj7rJBh1CPNXOI3nwk9VvDLj/8oQ==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - }, - "edelstein.common.utilities": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )", - "Microsoft.IO.RecyclableMemoryStream": "[3.0.0, )" - } - }, - "edelstein.protocol.gameplay": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Network": "[1.0.0, )", - "Edelstein.Protocol.Services.Server": "[1.0.0, )" - } - }, - "edelstein.protocol.network": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )" - } - }, - "edelstein.protocol.services.server": { - "type": "Project", - "dependencies": { - "protobuf-net.Grpc": "[1.1.1, )" - } - }, - "edelstein.protocol.utilities": { - "type": "Project" - }, - "Microsoft.IO.RecyclableMemoryStream": { - "type": "CentralTransitive", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "irv0HuqoH8Ig5i2fO+8dmDNdFdsrO+DoQcedwIlb810qpZHBNQHZLW7C/AHBQDgLLpw2T96vmMAy/aE4Yj55Sg==" - }, - "protobuf-net.Grpc": { - "type": "CentralTransitive", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - } - } - } -} \ No newline at end of file diff --git a/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketDecoder.cs b/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketDecoder.cs deleted file mode 100644 index 12b489fc1..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketDecoder.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System.Buffers; -using System.Collections.Generic; -using DotNetty.Buffers; -using DotNetty.Codecs; -using DotNetty.Transport.Channels; -using Edelstein.Common.Crypto; -using Edelstein.Common.Utilities.Buffers; -using Edelstein.Protocol.Network.Transports; - -namespace Edelstein.Common.Network.DotNetty.Codecs; - -public class NettyPacketDecoder( - TransportVersion transportVersion, - AESCipher aesCipher, - IGCipher igCipher -) : ReplayingDecoder(NettyPacketState.DecodingHeader) -{ - private short _length; - - private short _sequence; - - protected override void Decode(IChannelHandlerContext context, IByteBuffer input, List output) - { - var socket = context.Channel.GetAttribute(NettyAttributes.SocketKey).Get(); - - switch (State) - { - case NettyPacketState.DecodingHeader: - if (socket != null) - { - if (input.ReadableBytes < 4) - { - RequestReplay(); - return; - } - - var sequence = input.ReadShortLE(); - var length = input.ReadShortLE(); - - if (socket.IsDataEncrypted) length ^= sequence; - - _sequence = sequence; - _length = length; - } - else - { - if (input.ReadableBytes < 2) - { - RequestReplay(); - return; - } - - _length = input.ReadShortLE(); - } - - Checkpoint(NettyPacketState.DecodingPayload); - return; - case NettyPacketState.DecodingPayload: - if (input.ReadableBytes < _length) - { - RequestReplay(); - return; - } - - var buffer = ArrayPool.Shared.Rent(_length); - - input.ReadBytes(buffer, 0, _length); - Checkpoint(NettyPacketState.DecodingHeader); - - if (_length < 0x2) return; - - if (socket != null) - { - var seqRecv = socket.SeqRecv; - var version = (short)(seqRecv >> 16) ^ _sequence; - - if (!(version == -(transportVersion.Major + 1) || - version == transportVersion.Major)) return; - - if (socket.IsDataEncrypted) - { - aesCipher.Transform(buffer, _length, seqRecv); - ShandaCipher.DecryptTransform(buffer, _length); - } - - socket.SeqRecv = igCipher.Hash(seqRecv, 4, 0); - } - - output.Add(new Packet(buffer)); - ArrayPool.Shared.Return(buffer); - return; - } - } -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketEncoder.cs b/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketEncoder.cs deleted file mode 100644 index 4e6ab7b0d..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketEncoder.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Buffers; -using DotNetty.Buffers; -using DotNetty.Codecs; -using DotNetty.Transport.Channels; -using Edelstein.Common.Crypto; -using Edelstein.Protocol.Network.Transports; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Common.Network.DotNetty.Codecs; - -public class NettyPacketEncoder( - TransportVersion transportVersion, - AESCipher aesCipher, - IGCipher igCipher -) : MessageToByteEncoder -{ - - protected override void Encode( - IChannelHandlerContext context, - IPacket message, - IByteBuffer output - ) - { - var socket = context.Channel.GetAttribute(NettyAttributes.SocketKey).Get(); - var dataLen = message.Length; - var buffer = ArrayPool.Shared.Rent(dataLen); - - Array.Copy(message.Buffer, buffer, dataLen); - - if (socket != null) - { - var seqSend = socket.SeqSend; - var rawSeq = (short)(seqSend >> 16 ^ -(transportVersion.Major + 1)); - - if (socket.IsDataEncrypted) - { - ShandaCipher.EncryptTransform(buffer, dataLen); - aesCipher.Transform(buffer, dataLen, seqSend); - } - - output.WriteShortLE(rawSeq); - output.WriteShortLE(dataLen ^ rawSeq); - output.WriteBytes(buffer, 0, dataLen); - - socket.SeqSend = igCipher.Hash(seqSend, 4, 0); - } - else - { - output.WriteShortLE(dataLen); - output.WriteBytes(buffer, 0, dataLen); - } - - ArrayPool.Shared.Return(buffer); - } -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketState.cs b/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketState.cs deleted file mode 100644 index 3ca5fb7e5..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Codecs/NettyPacketState.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Edelstein.Common.Network.DotNetty.Codecs; - -public enum NettyPacketState -{ - DecodingHeader, - DecodingPayload -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/Edelstein.Common.Network.DotNetty.csproj b/src/common/Edelstein.Common.Network.DotNetty/Edelstein.Common.Network.DotNetty.csproj deleted file mode 100644 index b6322a03d..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Edelstein.Common.Network.DotNetty.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/common/Edelstein.Common.Network.DotNetty/Handlers/NettyTransportAcceptorHandler.cs b/src/common/Edelstein.Common.Network.DotNetty/Handlers/NettyTransportAcceptorHandler.cs deleted file mode 100644 index fb629296d..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Handlers/NettyTransportAcceptorHandler.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using DotNetty.Common.Utilities; -using DotNetty.Transport.Channels; -using Edelstein.Common.Utilities.Buffers; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Network.Transports; -using Edelstein.Protocol.Utilities.Buffers; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Common.Network.DotNetty.Handlers; - -public class NettyTransportAcceptorHandler( - TransportVersion version, - ISocketUserCreator creator, - ISocketAdapter socketAdapter, - IRepository sockets -) : ChannelHandlerAdapter - where TSocketUser : class, ISocketUser -{ - private readonly AttributeKey _userKey = AttributeKey.ValueOf("User"); - - public override void ChannelActive(IChannelHandlerContext context) - { - var random = new Random(); - var newSocket = new NettySocket( - context.Channel, - (uint)random.Next(), - (uint)random.Next() - ); - var newUser = creator.CreateUser(newSocket); - using var handshake = new PacketWriter(); - - handshake.WriteShort(version.Major); - handshake.WriteString(version.Patch); - handshake.WriteInt((int)newSocket.SeqRecv); - handshake.WriteInt((int)newSocket.SeqSend); - handshake.WriteByte(version.Locale); - - var packet = new PacketWriter() - .WriteShort(version.Major) - .WriteString(version.Patch) - .WriteInt((int)newSocket.SeqRecv) - .WriteInt((int)newSocket.SeqSend) - .WriteByte(version.Locale); - - _ = newSocket.Dispatch(packet.Build()); - - context.Channel.GetAttribute(NettyAttributes.SocketKey).Set(newSocket); - context.Channel.GetAttribute(_userKey).Set(newUser); - - _ = sockets.Insert(newSocket); - } - - public override void ChannelInactive(IChannelHandlerContext context) - { - var user = context.Channel.GetAttribute(_userKey).Get(); - - socketAdapter.OnDisconnect(user); - base.ChannelInactive(context); - - if (user == null) return; - - _ = sockets.Delete(user.Socket); - } - - public override void ChannelRead(IChannelHandlerContext context, object message) - { - var user = context.Channel.GetAttribute(_userKey).Get(); - using var packet = (IPacket)message; - - if (user == null) return; - - socketAdapter.OnPacket(user, packet); - } - - public override void ExceptionCaught(IChannelHandlerContext context, Exception exception) - { - var user = context.Channel.GetAttribute(_userKey).Get(); - - if (user == null) return; - - socketAdapter.OnException(user, exception); - } -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/Handlers/NettyTransportConnectorHandler.cs b/src/common/Edelstein.Common.Network.DotNetty/Handlers/NettyTransportConnectorHandler.cs deleted file mode 100644 index 482b89afd..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Handlers/NettyTransportConnectorHandler.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using DotNetty.Common.Utilities; -using DotNetty.Transport.Channels; -using Edelstein.Common.Utilities.Buffers; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Network.Transports; -using Edelstein.Protocol.Utilities.Buffers; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Common.Network.DotNetty.Handlers; - -public class NettyTransportConnectorHandler( - TransportVersion transportVersion, - ISocketUserCreator creator, - ISocketAdapter socketAdapter, - IRepository sockets -) : ChannelHandlerAdapter - where TSocketUser : class, ISocketUser -{ - private readonly AttributeKey _userKey = AttributeKey.ValueOf("User"); - - public override void ChannelRead(IChannelHandlerContext context, object message) - { - var user = context.Channel.GetAttribute(_userKey).Get(); - using var packet = (IPacket)message; - - if (user != null) - { - socketAdapter.OnPacket(user, packet); - } - else - { - using var reader = new PacketReader(packet); - var version = reader.ReadShort(); - var patch = reader.ReadString(); - var seqSend = reader.ReadUInt(); - var seqRecv = reader.ReadUInt(); - var locale = reader.ReadByte(); - - if (version != transportVersion.Major) return; - if (patch != transportVersion.Patch) return; - if (locale != transportVersion.Locale) return; - - var newSocket = new NettySocket( - context.Channel, - seqSend, - seqRecv - ); - var newAdapter = creator.CreateUser(newSocket); - - context.Channel.GetAttribute(NettyAttributes.SocketKey).Set(newSocket); - context.Channel.GetAttribute(_userKey).Set(newAdapter); - - _ = sockets.Insert(newSocket); - } - } - - public override void ChannelInactive(IChannelHandlerContext context) - { - var user = context.Channel.GetAttribute(_userKey).Get(); - - socketAdapter.OnDisconnect(user); - base.ChannelInactive(context); - - if (user == null) return; - - _ = sockets.Delete(user.Socket); - } - - - public override void ExceptionCaught(IChannelHandlerContext context, Exception exception) - { - var user = context.Channel.GetAttribute(_userKey).Get(); - - if (user == null) return; - - socketAdapter.OnException(user, exception); - } -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/NettyAttributes.cs b/src/common/Edelstein.Common.Network.DotNetty/NettyAttributes.cs deleted file mode 100644 index 6b6aff2ec..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/NettyAttributes.cs +++ /dev/null @@ -1,9 +0,0 @@ -using DotNetty.Common.Utilities; -using Edelstein.Protocol.Network; - -namespace Edelstein.Common.Network.DotNetty; - -public static class NettyAttributes -{ - public static readonly AttributeKey SocketKey = AttributeKey.ValueOf("Socket"); -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/NettySocket.cs b/src/common/Edelstein.Common.Network.DotNetty/NettySocket.cs deleted file mode 100644 index f5665b6aa..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/NettySocket.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Net; -using System.Threading.Tasks; -using DotNetty.Transport.Channels; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Common.Network.DotNetty; - -public class NettySocket( - IChannel channel, - uint seqSend, - uint seqRecv, - bool isDataEncrypted = true -) - : ISocket -{ - - public string ID => channel.Id.AsLongText(); - - public EndPoint AddressLocal => channel.LocalAddress; - public EndPoint AddressRemote => channel.RemoteAddress; - - public uint SeqSend { get; set; } = seqSend; - public uint SeqRecv { get; set; } = seqRecv; - - public bool IsDataEncrypted { get; } = isDataEncrypted; - - public async Task Dispatch(IPacket packet) - { - if (channel.IsWritable) - await channel.WriteAndFlushAsync(packet); - } - - public Task Close() => channel.DisconnectAsync(); -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportAcceptor.cs b/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportAcceptor.cs deleted file mode 100644 index 62d340802..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportAcceptor.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Threading.Tasks; -using DotNetty.Handlers.Timeout; -using DotNetty.Transport.Bootstrapping; -using DotNetty.Transport.Channels; -using DotNetty.Transport.Channels.Sockets; -using Edelstein.Common.Crypto; -using Edelstein.Common.Network.DotNetty.Codecs; -using Edelstein.Common.Network.DotNetty.Handlers; -using Edelstein.Common.Utilities.Repositories; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Network.Transports; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Common.Network.DotNetty.Transports; - -public class NettyTransportAcceptor( - TransportVersion version, - ISocketUserCreator creator, - ISocketAdapter socketAdapter -) : ITransportAcceptor - where TSocketUser : class, ISocketUser -{ - private readonly IRepository _sockets = new Repository(); - - public async Task Accept(string host, int port) - { - var aesCipher = new AESCipher(); - var igCipher = new IGCipher(); - - var group0 = new MultithreadEventLoopGroup(); - var group1 = new MultithreadEventLoopGroup(); - var channel = await new ServerBootstrap() - .Group(group0, group1) - .Channel() - .Option(ChannelOption.SoBacklog, 1024) - .ChildHandler(new ActionChannelInitializer(ch => - { - ch.Pipeline.AddLast( - new ReadTimeoutHandler(TimeSpan.FromMinutes(5)), - new NettyPacketDecoder(version, aesCipher, igCipher), - new NettyTransportAcceptorHandler(version, creator, socketAdapter, _sockets), - new NettyPacketEncoder(version, aesCipher, igCipher) - ); - })) - .BindAsync(port); - - return new NettyTransportAcceptorState(channel, group0, group1, version, _sockets); - } -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportAcceptorState.cs b/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportAcceptorState.cs deleted file mode 100644 index 1ff262948..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportAcceptorState.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using DotNetty.Transport.Channels; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Network.Transports; -using Edelstein.Protocol.Utilities.Buffers; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Common.Network.DotNetty.Transports; - -public class NettyTransportAcceptorState( - IChannel channel, - IEventLoopGroup group0, - IEventLoopGroup group1, - TransportVersion version, - IReadOnlyRepository sockets -) - : ITransportContext -{ - - public TransportState State => channel.Active ? TransportState.Opened : TransportState.Closed; - public TransportVersion Version { get; } = version; - - public IReadOnlyRepository Sockets { get; } = sockets; - - public async Task Dispatch(IPacket packet) - => await Task.WhenAll((await Sockets.RetrieveAll()).Select(s => s.Dispatch(packet))); - - public async Task Close() - { - await Task.WhenAll((await Sockets.RetrieveAll()).Select(s => s.Close())); - await channel.CloseAsync(); - -#if (DEBUG) - var t0 = group0.ShutdownGracefullyAsync(TimeSpan.Zero, TimeSpan.Zero); - var t1 = group1.ShutdownGracefullyAsync(TimeSpan.Zero, TimeSpan.Zero); - - await Task.WhenAll(t0, t1); -#else - var t0 = group0.ShutdownGracefullyAsync(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10)); - var t1 = group1.ShutdownGracefullyAsync(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10)); - - await Task.WhenAll(t0, t1); -#endif - } -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportConnector.cs b/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportConnector.cs deleted file mode 100644 index f3d1d7176..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportConnector.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Threading.Tasks; -using DotNetty.Transport.Bootstrapping; -using DotNetty.Transport.Channels; -using DotNetty.Transport.Channels.Sockets; -using Edelstein.Common.Crypto; -using Edelstein.Common.Network.DotNetty.Codecs; -using Edelstein.Common.Network.DotNetty.Handlers; -using Edelstein.Common.Utilities.Repositories; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Network.Transports; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Common.Network.DotNetty.Transports; - -public class NettyTransportConnector( - TransportVersion version, - ISocketUserCreator creator, - ISocketAdapter socketAdapter -) : ITransportConnector - where TSocketUser : class, ISocketUser -{ - private readonly IRepository _sockets = new Repository(); - - public async Task Connect(string host, int port) - { - var aesCipher = new AESCipher(); - var igCipher = new IGCipher(); - - var group0 = new MultithreadEventLoopGroup(); - var channel = await new Bootstrap() - .Group(group0) - .Channel() - .Option(ChannelOption.TcpNodelay, true) - .Handler(new ActionChannelInitializer(ch => - { - ch.Pipeline.AddLast( - new NettyPacketDecoder(version, aesCipher, igCipher), - new NettyTransportConnectorHandler(version, creator, socketAdapter, _sockets), - new NettyPacketEncoder(version, aesCipher, igCipher) - ); - })) - .BindAsync(port); - - return new NettyTransportConnectorState(channel, group0, version, _sockets); - } -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportConnectorState.cs b/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportConnectorState.cs deleted file mode 100644 index cfe069da7..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/Transports/NettyTransportConnectorState.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using DotNetty.Transport.Channels; -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Network.Transports; -using Edelstein.Protocol.Utilities.Buffers; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Common.Network.DotNetty.Transports; - -public class NettyTransportConnectorState( - IChannel channel, - IEventLoopGroup group0, - TransportVersion version, - IReadOnlyRepository sockets -) - : ITransportContext -{ - - public TransportState State => channel.Active ? TransportState.Opened : TransportState.Closed; - public TransportVersion Version { get; } = version; - - public IReadOnlyRepository Sockets { get; } = sockets; - - public async Task Dispatch(IPacket packet) - => await Task.WhenAll((await Sockets.RetrieveAll()).Select(s => s.Dispatch(packet))); - - public async Task Close() - { - await Task.WhenAll((await Sockets.RetrieveAll()).Select(s => s.Close())); - await channel.CloseAsync(); - -#if (DEBUG) - await group0.ShutdownGracefullyAsync(TimeSpan.Zero, TimeSpan.Zero); -#else - await group0.ShutdownGracefullyAsync(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(5)); -#endif - } -} diff --git a/src/common/Edelstein.Common.Network.DotNetty/packages.lock.json b/src/common/Edelstein.Common.Network.DotNetty/packages.lock.json deleted file mode 100644 index 6660eb86d..000000000 --- a/src/common/Edelstein.Common.Network.DotNetty/packages.lock.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "DotNetty.Buffers": { - "type": "Direct", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "JVYypDugRG4m3hbS0drCC79vX93zqjn5w+U4ti/KXjTIzcQ/UVHrCgs7ZgJfWRUQLfgfQB0daYQtE18lKD8pHg==", - "dependencies": { - "DotNetty.Common": "0.7.6", - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "DotNetty.Codecs": { - "type": "Direct", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "XBZy/m3+V8PBUHHHbFKaRBE0+knTCitcE8oKCQn4jZybH25mCZ1vTwj3BRuPYdNpzh74Op32Hj4ZXF+DMx/oAg==", - "dependencies": { - "DotNetty.Buffers": "0.7.6", - "DotNetty.Common": "0.7.6", - "DotNetty.Transport": "0.7.6", - "System.Collections.Immutable": "1.5.0" - } - }, - "DotNetty.Common": { - "type": "Direct", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "dmK8Njfh2Y4qnz99lLK0evoc46FPL5WOnHMLlavNZ6zqC5/bKgqGsJFoXbhVPkSYDp58g2euI64dhY0cvOUOZQ==", - "dependencies": { - "Microsoft.Extensions.Logging": "5.0.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "DotNetty.Handlers": { - "type": "Direct", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "6sSMp0Md8DbpyOAV9IjiR30uzaLrxAbJTcwFFpMJM1+EJhvPz6Ywt0RqoV6+lseq6zqBjMq2jbPTKcqPoqNYIA==", - "dependencies": { - "DotNetty.Buffers": "0.7.6", - "DotNetty.Codecs": "0.7.6", - "DotNetty.Common": "0.7.6", - "DotNetty.Transport": "0.7.6" - } - }, - "DotNetty.Transport": { - "type": "Direct", - "requested": "[0.7.6, )", - "resolved": "0.7.6", - "contentHash": "EVQ5FihFPdWmw7v6l/4iyMepj49vZT11kWQNJ0ApC4KzkdJJ6LM/7NDUgghyxbO0e25nfQRtkGLP5EZAEo7QDA==", - "dependencies": { - "DotNetty.Buffers": "0.7.6", - "DotNetty.Common": "0.7.6" - } - }, - "Injectio": { - "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "7b7IdkoJA1ecyHYjstI0TraeilfaRdwmoBpR09oOYxuOTHYvKjPm5Odvjcdp6WMjcQF2WUs7xm169w9uXEgA1g==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" - } - }, - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "Rc2kb/p3Ze6cP6rhFC3PJRdWGbLvSHZc0ev7YlyeU6FmHciDMLrhoVoTUEzKPhN5ZjFgKF1Cf5fOz8mCMIkvpA==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==" - }, - "Microsoft.Extensions.Logging": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "MgOwK6tPzB6YNH21wssJcw/2MKwee8b2gI7SllYfn6rvTpIrVvVS5HAjSU2vqSku1fwqRvWP0MdIi14qjd93Aw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection": "5.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0", - "Microsoft.Extensions.Logging.Abstractions": "5.0.0", - "Microsoft.Extensions.Options": "5.0.0" - } - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "CBvR92TCJ5uBIdd9/HzDSrxYak+0W/3+yxrNg8Qm6Bmrkh5L+nu6m3WeazQehcZ5q1/6dDA7J5YdQjim0165zg==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "5.0.0", - "Microsoft.Extensions.Primitives": "5.0.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "cI/VWn9G1fghXrNDagX9nYaaB/nokkZn0HYAawGaELQrl8InSezfe9OnfPZLcJq3esXxygh3hkq2c3qoV3SDyQ==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "1.5.0", - "contentHash": "EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==" - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "edelstein.common.crypto": { - "type": "Project" - }, - "edelstein.common.utilities": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )", - "Microsoft.IO.RecyclableMemoryStream": "[3.0.0, )" - } - }, - "edelstein.protocol.network": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )" - } - }, - "edelstein.protocol.utilities": { - "type": "Project" - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[9.0.0-preview.3.24172.9, )", - "resolved": "5.0.0", - "contentHash": "NxP6ahFcBnnSfwNBi2KH2Oz8Xl5Sm2krjId/jRR3I7teFphwiUoUeZPwTNA21EX+5PtjqmyAvKaOeBXcJjcH/w==" - }, - "Microsoft.IO.RecyclableMemoryStream": { - "type": "CentralTransitive", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "irv0HuqoH8Ig5i2fO+8dmDNdFdsrO+DoQcedwIlb810qpZHBNQHZLW7C/AHBQDgLLpw2T96vmMAy/aE4Yj55Sg==" - } - } - } -} \ No newline at end of file diff --git a/src/common/Edelstein.Common.Services.Server/Configurations/MigrationEntityConfiguration.cs b/src/common/Edelstein.Common.Services.Server/Configurations/MigrationEntityConfiguration.cs deleted file mode 100644 index 492319223..000000000 --- a/src/common/Edelstein.Common.Services.Server/Configurations/MigrationEntityConfiguration.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Edelstein.Common.Services.Server.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Edelstein.Common.Services.Server.Configurations; - -public class MigrationEntityConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("migrations"); - - builder.HasKey(m => m.AccountID); - builder.HasKey(m => m.CharacterID); - builder - .HasOne(m => m.FromServer) - .WithMany(p => p.MigrationOut) - .HasForeignKey(m => m.FromServerID) - .OnDelete(DeleteBehavior.Cascade); - builder - .HasOne(m => m.ToServer) - .WithMany(p => p.MigrationIn) - .HasForeignKey(m => m.ToServerID) - .OnDelete(DeleteBehavior.Cascade); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityConfiguration.cs b/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityConfiguration.cs deleted file mode 100644 index 5b16a6451..000000000 --- a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityConfiguration.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Edelstein.Common.Services.Server.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Edelstein.Common.Services.Server.Configurations; - -public class ServerEntityConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("servers"); - - builder.HasKey(e => e.ID); - builder.HasDiscriminator().HasValue("Server"); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityGameConfiguration.cs b/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityGameConfiguration.cs deleted file mode 100644 index 8fd07ba87..000000000 --- a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityGameConfiguration.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Edelstein.Common.Services.Server.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Edelstein.Common.Services.Server.Configurations; - -public class ServerEntityGameConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("servers"); - - builder.HasDiscriminator().HasValue("Game"); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityLoginConfiguration.cs b/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityLoginConfiguration.cs deleted file mode 100644 index 0b2e2f5e7..000000000 --- a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityLoginConfiguration.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Edelstein.Common.Services.Server.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Edelstein.Common.Services.Server.Configurations; - -public class ServerEntityLoginConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("servers"); - - builder.HasDiscriminator().HasValue("Login"); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityShopConfiguration.cs b/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityShopConfiguration.cs deleted file mode 100644 index b35bbfd04..000000000 --- a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityShopConfiguration.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Edelstein.Common.Services.Server.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Edelstein.Common.Services.Server.Configurations; - -public class ServerEntityShopConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("servers"); - - builder.HasDiscriminator().HasValue("Shop"); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityTradeConfiguration.cs b/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityTradeConfiguration.cs deleted file mode 100644 index c739862cb..000000000 --- a/src/common/Edelstein.Common.Services.Server/Configurations/ServerEntityTradeConfiguration.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Edelstein.Common.Services.Server.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Edelstein.Common.Services.Server.Configurations; - -public class ServerEntityTradeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("servers"); - - builder.HasDiscriminator().HasValue("Trade"); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Configurations/SessionEntityConfiguration.cs b/src/common/Edelstein.Common.Services.Server/Configurations/SessionEntityConfiguration.cs deleted file mode 100644 index a7cf8925a..000000000 --- a/src/common/Edelstein.Common.Services.Server/Configurations/SessionEntityConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Edelstein.Common.Services.Server.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Edelstein.Common.Services.Server.Configurations; - -public class SessionEntityConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("sessions"); - - builder.HasKey(m => m.ActiveAccount); - builder - .HasOne(m => m.Server) - .WithMany(p => p.Sessions) - .HasForeignKey(m => m.ServerID) - .OnDelete(DeleteBehavior.Cascade); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Edelstein.Common.Services.Server.csproj b/src/common/Edelstein.Common.Services.Server/Edelstein.Common.Services.Server.csproj deleted file mode 100644 index 97516578d..000000000 --- a/src/common/Edelstein.Common.Services.Server/Edelstein.Common.Services.Server.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/src/common/Edelstein.Common.Services.Server/Entities/MigrationEntity.cs b/src/common/Edelstein.Common.Services.Server/Entities/MigrationEntity.cs deleted file mode 100644 index 88ed367f3..000000000 --- a/src/common/Edelstein.Common.Services.Server/Entities/MigrationEntity.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Edelstein.Protocol.Services.Migration; - -namespace Edelstein.Common.Services.Server.Entities; - -public record MigrationEntity : IMigrationEntry -{ - public required int AccountID { get; set; } - public required int CharacterID { get; set; } - - public required ServerEntity FromServer { get; set; } - public required string FromServerID { get; set; } - - public required ServerEntity ToServer { get; set; } - public required string ToServerID { get; set; } - - public required long Key { get; set; } - - public DateTime DateUpdated { get; set; } - public DateTime DateExpire { get; set; } -} diff --git a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntity.cs b/src/common/Edelstein.Common.Services.Server/Entities/ServerEntity.cs deleted file mode 100644 index 735f9705d..000000000 --- a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntity.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using Edelstein.Protocol.Services.Server; - -namespace Edelstein.Common.Services.Server.Entities; - -public record ServerEntity : IServerEntry -{ - public required string ID { get; set; } - - public required string Host { get; set; } - public required int Port { get; set; } - - public required long Token { get; set; } - - public required DateTime DateUpdated { get; set; } - public required DateTime DateExpire { get; set; } - - public required ICollection Sessions { get; set; } = new List(); - public required ICollection MigrationOut { get; set; } = new List(); - public required ICollection MigrationIn { get; set; } = new List(); -} diff --git a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityGame.cs b/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityGame.cs deleted file mode 100644 index 5d4fe895a..000000000 --- a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityGame.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Edelstein.Protocol.Services.Server; - -namespace Edelstein.Common.Services.Server.Entities; - -public record ServerEntityGame : ServerEntity, IServerEntryGame -{ - public required int WorldID { get; set; } - public required int ChannelID { get; set; } -} diff --git a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityLogin.cs b/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityLogin.cs deleted file mode 100644 index 64056c4b8..000000000 --- a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityLogin.cs +++ /dev/null @@ -1,5 +0,0 @@ -using Edelstein.Protocol.Services.Server; - -namespace Edelstein.Common.Services.Server.Entities; - -public record ServerEntityLogin : ServerEntity, IServerEntryLogin; diff --git a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityShop.cs b/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityShop.cs deleted file mode 100644 index c487bc811..000000000 --- a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityShop.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Edelstein.Protocol.Services.Server; - -namespace Edelstein.Common.Services.Server.Entities; - -public record ServerEntityShop : ServerEntity, IServerEntryShop -{ - public required int WorldID { get; set; } -} diff --git a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityTrade.cs b/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityTrade.cs deleted file mode 100644 index 679d17282..000000000 --- a/src/common/Edelstein.Common.Services.Server/Entities/ServerEntityTrade.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Edelstein.Protocol.Services.Server; - -namespace Edelstein.Common.Services.Server.Entities; - -public record ServerEntityTrade : ServerEntity, IServerEntryTrade -{ - public required int WorldID { get; set; } -} diff --git a/src/common/Edelstein.Common.Services.Server/Entities/SessionEntity.cs b/src/common/Edelstein.Common.Services.Server/Entities/SessionEntity.cs deleted file mode 100644 index c2c067299..000000000 --- a/src/common/Edelstein.Common.Services.Server/Entities/SessionEntity.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Edelstein.Protocol.Services.Session; - -namespace Edelstein.Common.Services.Server.Entities; - -public record SessionEntity : ISessionEntry -{ - public required ServerEntity Server { get; set; } - public required string ServerID { get; set; } - - public required int ActiveAccount { get; set; } - public required int? ActiveCharacter { get; set; } - - public required long Key { get; set; } -} diff --git a/src/common/Edelstein.Common.Services.Server/MigrationService.cs b/src/common/Edelstein.Common.Services.Server/MigrationService.cs deleted file mode 100644 index 208869dda..000000000 --- a/src/common/Edelstein.Common.Services.Server/MigrationService.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Threading.Tasks; -using AutoMapper; -using Edelstein.Common.Services.Server.Entities; -using Edelstein.Protocol.Services.Migration; -using Edelstein.Protocol.Services.Migration.Contracts; -using Edelstein.Protocol.Services.Migration.Contracts.Requests; -using Edelstein.Protocol.Services.Migration.Contracts.Responses; -using Microsoft.EntityFrameworkCore; -using ProtoBuf.Grpc; - -namespace Edelstein.Common.Services.Server; - -public class MigrationService( - IDbContextFactory dbFactory, - IMapper mapper -) : IMigrationService -{ - private static readonly TimeSpan Expiry = TimeSpan.FromMinutes(1); - - public async Task Start(MigrationStartRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.Migrations - .FirstOrDefaultAsync(m => m.AccountID == request.Migration.AccountID); - - if (existing != null) - { - if (existing.DateExpire < now) db.Migrations.Remove(existing); - else - return new MigrationResponse - { - Result = MigrationResult.FailedAlreadyStarted - }; - } - - var entity = mapper.Map(request.Migration); - - entity.DateUpdated = now; - entity.DateExpire = now.Add(Expiry); - - db.Migrations.Add(entity); - await db.SaveChangesAsync(); - return new MigrationResponse - { - Result = MigrationResult.Success - }; - } - catch (Exception) - { - return new MigrationResponse - { - Result = MigrationResult.FailedUnknown - }; - } - } - - public async Task Claim(MigrationClaimRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.Migrations - .FirstOrDefaultAsync(m => m.CharacterID == request.CharacterID); - - if (existing == null || existing.DateExpire < now) - return new MigrationClaimResponse - { - Result = MigrationResult.FailedNotStarted, - Migration = null - }; - - if (existing.Key != request.Key) - return new MigrationClaimResponse - { - Result = MigrationResult.FailedInvalidKey, - Migration = null - }; - if (existing.ToServerID != request.ServerID) - return new MigrationClaimResponse - { - Result = MigrationResult.FailedInvalidServer, - Migration = null - }; - - db.Migrations.Remove(existing); - await db.SaveChangesAsync(); - - return new MigrationClaimResponse - { - Result = MigrationResult.FailedNotStarted, - Migration = mapper.Map(existing) - }; - } - catch (Exception) - { - return new MigrationClaimResponse - { - Result = MigrationResult.FailedUnknown, - Migration = null - }; - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/20240414130627_AddBaseEntities.Designer.cs b/src/common/Edelstein.Common.Services.Server/Migrations/20240414130627_AddBaseEntities.Designer.cs deleted file mode 100644 index fb97c562a..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/20240414130627_AddBaseEntities.Designer.cs +++ /dev/null @@ -1,210 +0,0 @@ -// -using System; -using Edelstein.Common.Services.Server; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - [DbContext(typeof(ServerDbContext))] - [Migration("20240414130627_AddBaseEntities")] - partial class AddBaseEntities - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.Property("CharacterID") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CharacterID")); - - b.Property("AccountID") - .HasColumnType("integer"); - - b.Property("FromServerID") - .IsRequired() - .HasColumnType("text"); - - b.Property("Key") - .HasColumnType("bigint"); - - b.Property("ToServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("CharacterID"); - - b.HasIndex("FromServerID"); - - b.HasIndex("ToServerID"); - - b.ToTable("migrations", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Property("ID") - .HasColumnType("text"); - - b.Property("DateExpire") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Host") - .IsRequired() - .HasColumnType("text"); - - b.Property("Port") - .HasColumnType("integer"); - - b.HasKey("ID"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator("Discriminator").HasValue("Server"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.Property("ActiveAccount") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ActiveAccount")); - - b.Property("ActiveCharacter") - .HasColumnType("integer"); - - b.Property("ServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("ActiveAccount"); - - b.HasIndex("ServerID"); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityGame", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("ChannelID") - .HasColumnType("integer"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Game"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityLogin", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Login"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityShop", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityShop_WorldID"); - }); - - b.HasDiscriminator().HasValue("Shop"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityTrade", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityTrade_WorldID"); - }); - - b.HasDiscriminator().HasValue("Trade"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "FromServer") - .WithMany("MigrationOut") - .HasForeignKey("FromServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "ToServer") - .WithMany("MigrationIn") - .HasForeignKey("ToServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FromServer"); - - b.Navigation("ToServer"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "Server") - .WithMany("Sessions") - .HasForeignKey("ServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Navigation("MigrationIn"); - - b.Navigation("MigrationOut"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/20240414130627_AddBaseEntities.cs b/src/common/Edelstein.Common.Services.Server/Migrations/20240414130627_AddBaseEntities.cs deleted file mode 100644 index a9d0b8b30..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/20240414130627_AddBaseEntities.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - /// - public partial class AddBaseEntities : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "servers", - columns: table => new - { - ID = table.Column(type: "text", nullable: false), - Host = table.Column(type: "text", nullable: false), - Port = table.Column(type: "integer", nullable: false), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false), - DateExpire = table.Column(type: "timestamp with time zone", nullable: false), - Discriminator = table.Column(type: "character varying(8)", maxLength: 8, nullable: false), - WorldID = table.Column(type: "integer", nullable: true), - ChannelID = table.Column(type: "integer", nullable: true), - ServerEntityShop_WorldID = table.Column(type: "integer", nullable: true), - ServerEntityTrade_WorldID = table.Column(type: "integer", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_servers", x => x.ID); - }); - - migrationBuilder.CreateTable( - name: "migrations", - columns: table => new - { - CharacterID = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - AccountID = table.Column(type: "integer", nullable: false), - FromServerID = table.Column(type: "text", nullable: false), - ToServerID = table.Column(type: "text", nullable: false), - Key = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_migrations", x => x.CharacterID); - table.ForeignKey( - name: "FK_migrations_servers_FromServerID", - column: x => x.FromServerID, - principalTable: "servers", - principalColumn: "ID", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_migrations_servers_ToServerID", - column: x => x.ToServerID, - principalTable: "servers", - principalColumn: "ID", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "sessions", - columns: table => new - { - ActiveAccount = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ServerID = table.Column(type: "text", nullable: false), - ActiveCharacter = table.Column(type: "integer", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_sessions", x => x.ActiveAccount); - table.ForeignKey( - name: "FK_sessions_servers_ServerID", - column: x => x.ServerID, - principalTable: "servers", - principalColumn: "ID", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_migrations_FromServerID", - table: "migrations", - column: "FromServerID"); - - migrationBuilder.CreateIndex( - name: "IX_migrations_ToServerID", - table: "migrations", - column: "ToServerID"); - - migrationBuilder.CreateIndex( - name: "IX_sessions_ServerID", - table: "sessions", - column: "ServerID"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "migrations"); - - migrationBuilder.DropTable( - name: "sessions"); - - migrationBuilder.DropTable( - name: "servers"); - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/20240414142710_AddTokenToServerEntity.Designer.cs b/src/common/Edelstein.Common.Services.Server/Migrations/20240414142710_AddTokenToServerEntity.Designer.cs deleted file mode 100644 index 603217744..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/20240414142710_AddTokenToServerEntity.Designer.cs +++ /dev/null @@ -1,213 +0,0 @@ -// -using System; -using Edelstein.Common.Services.Server; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - [DbContext(typeof(ServerDbContext))] - [Migration("20240414142710_AddTokenToServerEntity")] - partial class AddTokenToServerEntity - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.Property("CharacterID") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CharacterID")); - - b.Property("AccountID") - .HasColumnType("integer"); - - b.Property("FromServerID") - .IsRequired() - .HasColumnType("text"); - - b.Property("Key") - .HasColumnType("bigint"); - - b.Property("ToServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("CharacterID"); - - b.HasIndex("FromServerID"); - - b.HasIndex("ToServerID"); - - b.ToTable("migrations", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Property("ID") - .HasColumnType("text"); - - b.Property("DateExpire") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Host") - .IsRequired() - .HasColumnType("text"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("Token") - .HasColumnType("bigint"); - - b.HasKey("ID"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator("Discriminator").HasValue("Server"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.Property("ActiveAccount") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ActiveAccount")); - - b.Property("ActiveCharacter") - .HasColumnType("integer"); - - b.Property("ServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("ActiveAccount"); - - b.HasIndex("ServerID"); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityGame", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("ChannelID") - .HasColumnType("integer"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Game"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityLogin", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Login"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityShop", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityShop_WorldID"); - }); - - b.HasDiscriminator().HasValue("Shop"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityTrade", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityTrade_WorldID"); - }); - - b.HasDiscriminator().HasValue("Trade"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "FromServer") - .WithMany("MigrationOut") - .HasForeignKey("FromServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "ToServer") - .WithMany("MigrationIn") - .HasForeignKey("ToServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FromServer"); - - b.Navigation("ToServer"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "Server") - .WithMany("Sessions") - .HasForeignKey("ServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Navigation("MigrationIn"); - - b.Navigation("MigrationOut"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/20240414142710_AddTokenToServerEntity.cs b/src/common/Edelstein.Common.Services.Server/Migrations/20240414142710_AddTokenToServerEntity.cs deleted file mode 100644 index e04fd206d..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/20240414142710_AddTokenToServerEntity.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - /// - public partial class AddTokenToServerEntity : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Token", - table: "servers", - type: "bigint", - nullable: false, - defaultValue: 0L); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Token", - table: "servers"); - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/20240414145500_AddTimestampToMigrationEntity.Designer.cs b/src/common/Edelstein.Common.Services.Server/Migrations/20240414145500_AddTimestampToMigrationEntity.Designer.cs deleted file mode 100644 index 83d503724..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/20240414145500_AddTimestampToMigrationEntity.Designer.cs +++ /dev/null @@ -1,219 +0,0 @@ -// -using System; -using Edelstein.Common.Services.Server; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - [DbContext(typeof(ServerDbContext))] - [Migration("20240414145500_AddTimestampToMigrationEntity")] - partial class AddTimestampToMigrationEntity - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.Property("CharacterID") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CharacterID")); - - b.Property("AccountID") - .HasColumnType("integer"); - - b.Property("DateExpire") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("FromServerID") - .IsRequired() - .HasColumnType("text"); - - b.Property("Key") - .HasColumnType("bigint"); - - b.Property("ToServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("CharacterID"); - - b.HasIndex("FromServerID"); - - b.HasIndex("ToServerID"); - - b.ToTable("migrations", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Property("ID") - .HasColumnType("text"); - - b.Property("DateExpire") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Host") - .IsRequired() - .HasColumnType("text"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("Token") - .HasColumnType("bigint"); - - b.HasKey("ID"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator("Discriminator").HasValue("Server"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.Property("ActiveAccount") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ActiveAccount")); - - b.Property("ActiveCharacter") - .HasColumnType("integer"); - - b.Property("ServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("ActiveAccount"); - - b.HasIndex("ServerID"); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityGame", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("ChannelID") - .HasColumnType("integer"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Game"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityLogin", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Login"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityShop", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityShop_WorldID"); - }); - - b.HasDiscriminator().HasValue("Shop"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityTrade", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityTrade_WorldID"); - }); - - b.HasDiscriminator().HasValue("Trade"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "FromServer") - .WithMany("MigrationOut") - .HasForeignKey("FromServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "ToServer") - .WithMany("MigrationIn") - .HasForeignKey("ToServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FromServer"); - - b.Navigation("ToServer"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "Server") - .WithMany("Sessions") - .HasForeignKey("ServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Navigation("MigrationIn"); - - b.Navigation("MigrationOut"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/20240414145500_AddTimestampToMigrationEntity.cs b/src/common/Edelstein.Common.Services.Server/Migrations/20240414145500_AddTimestampToMigrationEntity.cs deleted file mode 100644 index 3dc5d362d..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/20240414145500_AddTimestampToMigrationEntity.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - /// - public partial class AddTimestampToMigrationEntity : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DateExpire", - table: "migrations", - type: "timestamp with time zone", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "DateUpdated", - table: "migrations", - type: "timestamp with time zone", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "DateExpire", - table: "migrations"); - - migrationBuilder.DropColumn( - name: "DateUpdated", - table: "migrations"); - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/20240414151943_AddKeyToSessionEntity.Designer.cs b/src/common/Edelstein.Common.Services.Server/Migrations/20240414151943_AddKeyToSessionEntity.Designer.cs deleted file mode 100644 index f17df4e01..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/20240414151943_AddKeyToSessionEntity.Designer.cs +++ /dev/null @@ -1,222 +0,0 @@ -// -using System; -using Edelstein.Common.Services.Server; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - [DbContext(typeof(ServerDbContext))] - [Migration("20240414151943_AddKeyToSessionEntity")] - partial class AddKeyToSessionEntity - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.Property("CharacterID") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CharacterID")); - - b.Property("AccountID") - .HasColumnType("integer"); - - b.Property("DateExpire") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("FromServerID") - .IsRequired() - .HasColumnType("text"); - - b.Property("Key") - .HasColumnType("bigint"); - - b.Property("ToServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("CharacterID"); - - b.HasIndex("FromServerID"); - - b.HasIndex("ToServerID"); - - b.ToTable("migrations", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Property("ID") - .HasColumnType("text"); - - b.Property("DateExpire") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Host") - .IsRequired() - .HasColumnType("text"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("Token") - .HasColumnType("bigint"); - - b.HasKey("ID"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator("Discriminator").HasValue("Server"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.Property("ActiveAccount") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ActiveAccount")); - - b.Property("ActiveCharacter") - .HasColumnType("integer"); - - b.Property("Key") - .HasColumnType("bigint"); - - b.Property("ServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("ActiveAccount"); - - b.HasIndex("ServerID"); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityGame", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("ChannelID") - .HasColumnType("integer"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Game"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityLogin", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Login"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityShop", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityShop_WorldID"); - }); - - b.HasDiscriminator().HasValue("Shop"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityTrade", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityTrade_WorldID"); - }); - - b.HasDiscriminator().HasValue("Trade"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "FromServer") - .WithMany("MigrationOut") - .HasForeignKey("FromServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "ToServer") - .WithMany("MigrationIn") - .HasForeignKey("ToServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FromServer"); - - b.Navigation("ToServer"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "Server") - .WithMany("Sessions") - .HasForeignKey("ServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Navigation("MigrationIn"); - - b.Navigation("MigrationOut"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/20240414151943_AddKeyToSessionEntity.cs b/src/common/Edelstein.Common.Services.Server/Migrations/20240414151943_AddKeyToSessionEntity.cs deleted file mode 100644 index 1d644c39e..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/20240414151943_AddKeyToSessionEntity.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - /// - public partial class AddKeyToSessionEntity : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Key", - table: "sessions", - type: "bigint", - nullable: false, - defaultValue: 0L); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Key", - table: "sessions"); - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/Migrations/ServerDbContextModelSnapshot.cs b/src/common/Edelstein.Common.Services.Server/Migrations/ServerDbContextModelSnapshot.cs deleted file mode 100644 index 3c941e781..000000000 --- a/src/common/Edelstein.Common.Services.Server/Migrations/ServerDbContextModelSnapshot.cs +++ /dev/null @@ -1,219 +0,0 @@ -// -using System; -using Edelstein.Common.Services.Server; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Edelstein.Common.Services.Server.Migrations -{ - [DbContext(typeof(ServerDbContext))] - partial class ServerDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.Property("CharacterID") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("CharacterID")); - - b.Property("AccountID") - .HasColumnType("integer"); - - b.Property("DateExpire") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("FromServerID") - .IsRequired() - .HasColumnType("text"); - - b.Property("Key") - .HasColumnType("bigint"); - - b.Property("ToServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("CharacterID"); - - b.HasIndex("FromServerID"); - - b.HasIndex("ToServerID"); - - b.ToTable("migrations", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Property("ID") - .HasColumnType("text"); - - b.Property("DateExpire") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .HasColumnType("timestamp with time zone"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(8) - .HasColumnType("character varying(8)"); - - b.Property("Host") - .IsRequired() - .HasColumnType("text"); - - b.Property("Port") - .HasColumnType("integer"); - - b.Property("Token") - .HasColumnType("bigint"); - - b.HasKey("ID"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator("Discriminator").HasValue("Server"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.Property("ActiveAccount") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ActiveAccount")); - - b.Property("ActiveCharacter") - .HasColumnType("integer"); - - b.Property("Key") - .HasColumnType("bigint"); - - b.Property("ServerID") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("ActiveAccount"); - - b.HasIndex("ServerID"); - - b.ToTable("sessions", (string)null); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityGame", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("ChannelID") - .HasColumnType("integer"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Game"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityLogin", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.ToTable("servers", (string)null); - - b.HasDiscriminator().HasValue("Login"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityShop", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityShop_WorldID"); - }); - - b.HasDiscriminator().HasValue("Shop"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntityTrade", b => - { - b.HasBaseType("Edelstein.Common.Services.Server.Entities.ServerEntity"); - - b.Property("WorldID") - .HasColumnType("integer"); - - b.ToTable("servers", null, t => - { - t.Property("WorldID") - .HasColumnName("ServerEntityTrade_WorldID"); - }); - - b.HasDiscriminator().HasValue("Trade"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.MigrationEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "FromServer") - .WithMany("MigrationOut") - .HasForeignKey("FromServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "ToServer") - .WithMany("MigrationIn") - .HasForeignKey("ToServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FromServer"); - - b.Navigation("ToServer"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.SessionEntity", b => - { - b.HasOne("Edelstein.Common.Services.Server.Entities.ServerEntity", "Server") - .WithMany("Sessions") - .HasForeignKey("ServerID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Server"); - }); - - modelBuilder.Entity("Edelstein.Common.Services.Server.Entities.ServerEntity", b => - { - b.Navigation("MigrationIn"); - - b.Navigation("MigrationOut"); - - b.Navigation("Sessions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/ServerDbContext.cs b/src/common/Edelstein.Common.Services.Server/ServerDbContext.cs deleted file mode 100644 index 7cee7288d..000000000 --- a/src/common/Edelstein.Common.Services.Server/ServerDbContext.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Edelstein.Common.Services.Server.Entities; -using Microsoft.EntityFrameworkCore; - -namespace Edelstein.Common.Services.Server; - -public class ServerDbContext(DbContextOptions options) : DbContext(options) -{ - public const string ConnectionStringKey = "Pgsql"; - - public DbSet Servers { get; set; } = null!; - public DbSet LoginServers { get; set; } = null!; - public DbSet GameServers { get; set; } = null!; - public DbSet ShopServers { get; set; } = null!; - public DbSet TradeServers { get; set; } = null!; - - public DbSet Sessions { get; set; } = null!; - public DbSet Migrations { get; set; } = null!; - - protected override void OnModelCreating(ModelBuilder builder) - => builder.ApplyConfigurationsFromAssembly(typeof(ServerDbContext).Assembly); -} diff --git a/src/common/Edelstein.Common.Services.Server/ServerDbContextFactory.cs b/src/common/Edelstein.Common.Services.Server/ServerDbContextFactory.cs deleted file mode 100644 index 0e9da3ab4..000000000 --- a/src/common/Edelstein.Common.Services.Server/ServerDbContextFactory.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; -using Microsoft.Extensions.Configuration; - -namespace Edelstein.Common.Services.Server; - -public class ServerDbContextFactory : IDesignTimeDbContextFactory -{ - public ServerDbContext CreateDbContext(string[] args) - { - var configuration = new ConfigurationBuilder() - .SetBasePath(AppDomain.CurrentDomain.BaseDirectory) - .AddJsonFile("appsettings.json", true) - .AddJsonFile("devsettings.json", true) - .AddJsonFile("devsettings.Development.json", true) - .Build(); - var connection = configuration.GetConnectionString(ServerDbContext.ConnectionStringKey); - var builder = new DbContextOptionsBuilder().UseNpgsql(connection); - - return new ServerDbContext(builder.Options); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/ServerMappingProfile.cs b/src/common/Edelstein.Common.Services.Server/ServerMappingProfile.cs deleted file mode 100644 index f2b3d887a..000000000 --- a/src/common/Edelstein.Common.Services.Server/ServerMappingProfile.cs +++ /dev/null @@ -1,21 +0,0 @@ -using AutoMapper; -using Edelstein.Common.Services.Server.Entities; -using Edelstein.Protocol.Services.Migration.Contracts; -using Edelstein.Protocol.Services.Server.Contracts; -using Edelstein.Protocol.Services.Session.Contracts; - -namespace Edelstein.Common.Services.Server; - -public class ServerMappingProfile : Profile -{ - public ServerMappingProfile() - { - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - } -} diff --git a/src/common/Edelstein.Common.Services.Server/ServerService.cs b/src/common/Edelstein.Common.Services.Server/ServerService.cs deleted file mode 100644 index 45ebdd90f..000000000 --- a/src/common/Edelstein.Common.Services.Server/ServerService.cs +++ /dev/null @@ -1,373 +0,0 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using System.Threading.Tasks; -using AutoMapper; -using Edelstein.Common.Services.Server.Entities; -using Edelstein.Protocol.Services.Server; -using Edelstein.Protocol.Services.Server.Contracts; -using Edelstein.Protocol.Services.Server.Contracts.Requests; -using Edelstein.Protocol.Services.Server.Contracts.Responses; -using Microsoft.EntityFrameworkCore; -using ProtoBuf.Grpc; - -namespace Edelstein.Common.Services.Server; - -public class ServerService( - IDbContextFactory dbFactory, - IMapper mapper -) : IServerService -{ - private static readonly TimeSpan Expiry = TimeSpan.FromMinutes(5); - - public Task RegisterLogin(ServerRegisterRequest request, CallContext context = default) - => Register(mapper.Map(request.Server)); - - public Task RegisterGame(ServerRegisterRequest request, CallContext context = default) - => Register(mapper.Map(request.Server)); - - public Task RegisterShop(ServerRegisterRequest request, CallContext context = default) - => Register(mapper.Map(request.Server)); - - public Task RegisterTrade(ServerRegisterRequest request, CallContext context = default) - => Register(mapper.Map(request.Server)); - - public async Task Update(ServerUpdateRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.Servers.FirstOrDefaultAsync(s => s.ID.Equals(request.ServerID)); - - if (existing == null || existing.DateExpire < now) - return new ServerResponse - { - Result = ServerResult.FailedNotRegistered - }; - - if (existing.Token != request.Token) - return new ServerResponse - { - Result = ServerResult.FailedInvalidToken - }; - - existing.DateUpdated = now; - existing.DateExpire = now.Add(Expiry); - - db.Servers.Update(existing); - await db.SaveChangesAsync(); - - return new ServerResponse - { - Result = ServerResult.Success - }; - } - catch (Exception) - { - return new ServerResponse - { - Result = ServerResult.FailedUnknown - }; - } - } - - public async Task Deregister(ServerDeregisterRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var existing = await db.Servers.FindAsync(request.ServerID); - - if (existing == null) - return new ServerResponse - { - Result = ServerResult.FailedNotRegistered - }; - - if (existing.Token != request.Token) - return new ServerResponse - { - Result = ServerResult.FailedInvalidToken - }; - - db.Servers.Remove(existing); - await db.SaveChangesAsync(); - return new ServerResponse - { - Result = ServerResult.Success - }; - } - catch (Exception) - { - return new ServerResponse - { - Result = ServerResult.FailedUnknown - }; - } - } - - public async Task> GetByID(ServerGetByIDRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.Servers.FirstOrDefaultAsync(s => s.ID.Equals(request.ServerID)); - - if (existing == null || existing.DateExpire < now) - return new ServerGetOneResponse - { - Result = ServerResult.FailedNotFound, - Server = null - }; - - return new ServerGetOneResponse - { - Result = ServerResult.Success, - Server = mapper.Map(existing) - }; - } - catch (Exception) - { - return new ServerGetOneResponse - { - Result = ServerResult.FailedUnknown, - Server = null - }; - } - } - - public async Task> GetGameByWorldAndChannel(ServerGetGameByWorldAndChannelRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.GameServers - .FirstOrDefaultAsync(s => s.WorldID == request.WorldID && s.ChannelID == request.ChannelID); - - if (existing == null || existing.DateExpire < now) - return new ServerGetOneResponse - { - Result = ServerResult.FailedNotFound, - Server = null - }; - - return new ServerGetOneResponse - { - Result = ServerResult.Success, - Server = mapper.Map(existing) - }; - } - catch (Exception) - { - return new ServerGetOneResponse - { - Result = ServerResult.FailedUnknown, - Server = null - }; - } - } - - public async Task> GetGameByWorld(ServerGetGameByWorldRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.GameServers - .Where(s => s.WorldID == request.WorldID) - .ToListAsync(); - - return new ServerGetAllResponse - { - Result = ServerResult.Success, - Servers = existing - .Where(s => s.DateExpire > now) - .Select(mapper.Map) - .ToImmutableArray() - }; - } - catch (Exception) - { - return new ServerGetAllResponse - { - Result = ServerResult.FailedUnknown, - Servers = Enumerable.Empty() - }; - } - } - - public async Task> GetShopByWorld(ServerGetShopByWorldRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.ShopServers - .FirstOrDefaultAsync(s => s.WorldID == request.WorldID); - - if (existing == null || existing.DateExpire < now) - return new ServerGetOneResponse - { - Result = ServerResult.FailedNotFound, - Server = null - }; - - return new ServerGetOneResponse - { - Result = ServerResult.Success, - Server = mapper.Map(existing) - }; - } - catch (Exception) - { - return new ServerGetOneResponse - { - Result = ServerResult.FailedUnknown, - Server = null - }; - } - } - - public async Task> GetTradeByWorld(ServerGetTradeByWorldRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.TradeServers - .FirstOrDefaultAsync(s => s.WorldID == request.WorldID); - - if (existing == null || existing.DateExpire < now) - return new ServerGetOneResponse - { - Result = ServerResult.FailedNotFound, - Server = null - }; - - return new ServerGetOneResponse - { - Result = ServerResult.Success, - Server = mapper.Map(existing) - }; - } - catch (Exception) - { - return new ServerGetOneResponse - { - Result = ServerResult.FailedUnknown, - Server = null - }; - } - } - - public async Task> GetAll(CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.Servers.ToListAsync(); - - return new ServerGetAllResponse - { - Result = ServerResult.Success, - Servers = existing - .Where(s => s.DateExpire > now) - .Select(mapper.Map) - .ToImmutableArray() - }; - } - catch (Exception) - { - return new ServerGetAllResponse - { - Result = ServerResult.Unknown, - Servers = Enumerable.Empty() - }; - } - } - - private async Task Register(ServerEntity entity) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.Servers.FindAsync(entity.ID); - - if (existing != null) - { - if (existing.DateExpire < now) - { - db.Servers.Remove(existing); - await db.SaveChangesAsync(); - } - else - return new ServerRegisterResponse - { - Result = ServerResult.FailedAlreadyRegistered, - Token = null - }; - } - - entity.Token = new Random().NextInt64(); - entity.DateUpdated = now; - entity.DateExpire = now.Add(Expiry); - - switch (entity) - { - case ServerEntityLogin login: - await db.LoginServers.AddAsync(login); - break; - case ServerEntityGame game: - if (db.GameServers.Any(s => s.WorldID == game.WorldID && s.ChannelID == game.ChannelID)) - return new ServerRegisterResponse - { - Result = ServerResult.FailedAlreadyRegistered, - Token = null - }; - await db.GameServers.AddAsync(game); - break; - case ServerEntityShop shop: - if (db.ShopServers.Any(s => s.WorldID == shop.WorldID)) - return new ServerRegisterResponse - { - Result = ServerResult.FailedAlreadyRegistered, - Token = null - }; - await db.ShopServers.AddAsync(shop); - break; - case ServerEntityTrade trade: - if (db.TradeServers.Any(s => s.WorldID == trade.WorldID)) - return new ServerRegisterResponse - { - Result = ServerResult.FailedAlreadyRegistered, - Token = null - }; - await db.TradeServers.AddAsync(trade); - break; - default: - await db.Servers.AddAsync(entity); - break; - } - - await db.SaveChangesAsync(); - return new ServerRegisterResponse - { - Result = ServerResult.Success, - Token = entity.Token - }; - } - catch (Exception) - { - return new ServerRegisterResponse - { - Result = ServerResult.FailedUnknown, - Token = null - }; - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/SessionService.cs b/src/common/Edelstein.Common.Services.Server/SessionService.cs deleted file mode 100644 index e6787e672..000000000 --- a/src/common/Edelstein.Common.Services.Server/SessionService.cs +++ /dev/null @@ -1,222 +0,0 @@ -using System; -using System.Threading.Tasks; -using AutoMapper; -using Edelstein.Common.Services.Server.Entities; -using Edelstein.Protocol.Services.Session; -using Edelstein.Protocol.Services.Session.Contracts; -using Edelstein.Protocol.Services.Session.Contracts.Requests; -using Edelstein.Protocol.Services.Session.Contracts.Responses; -using Microsoft.EntityFrameworkCore; -using ProtoBuf.Grpc; - -namespace Edelstein.Common.Services.Server; - -public class SessionService( - IDbContextFactory dbFactory, - IMapper mapper -) : ISessionService -{ - public async Task Start(SessionStartRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var now = DateTime.UtcNow; - var existing = await db.Sessions.FindAsync(request.Session.ActiveAccount); - - if (existing != null) - { - var migration = await db.Migrations - .FirstOrDefaultAsync(m => m.AccountID == request.Session.ActiveAccount); - - if (migration == null || migration.DateExpire > now) - return new SessionResponse - { - Result = SessionResult.FailedAlreadyStarted - }; - - db.Sessions.Remove(existing); - db.Migrations.Remove(migration); - } - - var entity = mapper.Map(request.Session); - - entity.Key = request.Key; - db.Sessions.Add(entity); - await db.SaveChangesAsync(); - return new SessionResponse - { - Result = SessionResult.Success - }; - } - catch (Exception) - { - return new SessionResponse - { - Result = SessionResult.FailedUnknown - }; - } - } - - public async Task End(SessionEndRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var session = await db.Sessions.FindAsync(request.AccountID); - - if (session == null) - return new SessionResponse - { - Result = SessionResult.FailedNotStarted - }; - if (session.Key != request.Key) - return new SessionResponse - { - Result = SessionResult.FailedInvalidKey - }; - - db.Sessions.Remove(session); - await db.SaveChangesAsync(); - return new SessionResponse - { - Result = SessionResult.Success - }; - } - catch (Exception) - { - return new SessionResponse - { - Result = SessionResult.FailedUnknown - }; - } - } - - public async Task UpdateServer(SessionUpdateServerRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var session = await db.Sessions.FindAsync(request.ServerID); - - if (session == null) - return new SessionResponse - { - Result = SessionResult.FailedNotStarted - }; - if (session.Key != request.Key) - return new SessionResponse - { - Result = SessionResult.FailedInvalidKey - }; - - session.ServerID = request.ServerID; - db.Sessions.Update(session); - await db.SaveChangesAsync(); - return new SessionResponse - { - Result = SessionResult.Success - }; - } - catch (Exception) - { - return new SessionResponse - { - Result = SessionResult.FailedUnknown - }; - } - } - - public async Task UpdateCharacter(SessionUpdateCharacterRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var session = await db.Sessions.FindAsync(request.AccountID); - - if (session == null) - return new SessionResponse - { - Result = SessionResult.FailedNotStarted - }; - if (session.Key != request.Key) - return new SessionResponse - { - Result = SessionResult.FailedInvalidKey - }; - - session.ActiveCharacter = request.CharacterID; - db.Sessions.Update(session); - await db.SaveChangesAsync(); - return new SessionResponse - { - Result = SessionResult.Success - }; - } - catch (Exception) - { - return new SessionResponse - { - Result = SessionResult.FailedUnknown - }; - } - } - - public async Task GetByActiveAccount(SessionGetByActiveAccountRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var session = await db.Sessions.FirstOrDefaultAsync(s => s.ActiveAccount == request.AccountID); - - return session == null - ? new SessionGetOneResponse - { - Result = SessionResult.FailedNotFound, - Session = null - } - : new SessionGetOneResponse - { - Result = SessionResult.Success, - Session = mapper.Map(session) - }; - } - catch (Exception) - { - return new SessionGetOneResponse - { - Result = SessionResult.FailedUnknown, - Session = null - }; - } - } - - public async Task GetByActiveCharacter(SessionGetByActiveCharacterRequest request, CallContext context = default) - { - try - { - await using var db = await dbFactory.CreateDbContextAsync(); - var session = await db.Sessions.FirstOrDefaultAsync(s => s.ActiveCharacter == request.CharacterID); - - return session == null - ? new SessionGetOneResponse - { - Result = SessionResult.FailedNotFound, - Session = null - } - : new SessionGetOneResponse - { - Result = SessionResult.Success, - Session = mapper.Map(session) - }; - } - catch (Exception) - { - return new SessionGetOneResponse - { - Result = SessionResult.FailedUnknown, - Session = null - }; - } - } -} diff --git a/src/common/Edelstein.Common.Services.Server/devsettings.json b/src/common/Edelstein.Common.Services.Server/devsettings.json deleted file mode 100644 index 8966b0a9d..000000000 --- a/src/common/Edelstein.Common.Services.Server/devsettings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ConnectionStrings": { - "Pgsql": "host=127.0.0.1;database=edelstein;" - } -} \ No newline at end of file diff --git a/src/common/Edelstein.Common.Services.Server/packages.lock.json b/src/common/Edelstein.Common.Services.Server/packages.lock.json deleted file mode 100644 index 708a6634c..000000000 --- a/src/common/Edelstein.Common.Services.Server/packages.lock.json +++ /dev/null @@ -1,481 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "AutoMapper": { - "type": "Direct", - "requested": "[13.0.1, )", - "resolved": "13.0.1", - "contentHash": "/Fx1SbJ16qS7dU4i604Sle+U9VLX+WSNVJggk6MupKVkYvvBm4XqYaeFuf67diHefHKHs50uQIS2YEDFhPCakQ==", - "dependencies": { - "Microsoft.Extensions.Options": "6.0.0" - } - }, - "Injectio": { - "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "7b7IdkoJA1ecyHYjstI0TraeilfaRdwmoBpR09oOYxuOTHYvKjPm5Odvjcdp6WMjcQF2WUs7xm169w9uXEgA1g==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" - } - }, - "Microsoft.EntityFrameworkCore": { - "type": "Direct", - "requested": "[9.0.0-preview.3.24172.4, )", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "8048WxaAf8UHdeaBlfkvUZMjH42zKOfaFEQHLTi5xqs7TDjiH69yHfrk0wLG56FeMX/d0Fm0QyO5Q1fAKDUDNA==", - "dependencies": { - "Microsoft.EntityFrameworkCore.Abstractions": "9.0.0-preview.3.24172.4", - "Microsoft.EntityFrameworkCore.Analyzers": "9.0.0-preview.3.24172.4", - "Microsoft.Extensions.Caching.Memory": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Logging": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.EntityFrameworkCore.Design": { - "type": "Direct", - "requested": "[9.0.0-preview.3.24172.4, )", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "MW4yPgMn8PU09axdz1lZt1ciKKFXwwEV8lLVPW3looHfl9NIxxzM8YHosIcp0srV7fkyvmLJ3nEQZMiilWgjpA==", - "dependencies": { - "Humanizer.Core": "2.14.1", - "Microsoft.CodeAnalysis.CSharp.Workspaces": "4.8.0", - "Microsoft.EntityFrameworkCore.Relational": "9.0.0-preview.3.24172.4", - "Microsoft.Extensions.DependencyModel": "9.0.0-preview.3.24172.9", - "Mono.TextTemplating": "3.0.0-preview-0052-g5d0f76c785" - } - }, - "Microsoft.Extensions.Configuration.Json": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "C2wqUoh9OmRL1akaCcKSTmRU8z0kckfImG7zLNI8uyi47Lp+zd5LWAD17waPQEqCz3ioWOCrFUo+JJuoeZLOBw==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.Configuration.FileExtensions": "8.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "System.Text.Json": "8.0.0" - } - }, - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Npgsql.EntityFrameworkCore.PostgreSQL": { - "type": "Direct", - "requested": "[8.0.2, )", - "resolved": "8.0.2", - "contentHash": "eoZPynwkZTWFTgnocvXORuCL2yFZtscrUdqVhjxiRULpC7BMg9zhLM5oDZAU5PoX1PgN77hmkKE4a3PQiHqh7Q==", - "dependencies": { - "Microsoft.EntityFrameworkCore": "8.0.2", - "Microsoft.EntityFrameworkCore.Abstractions": "8.0.2", - "Microsoft.EntityFrameworkCore.Relational": "8.0.2", - "Npgsql": "8.0.2" - } - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Humanizer.Core": { - "type": "Transitive", - "resolved": "2.14.1", - "contentHash": "lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==" - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "3aeMZ1N0lJoSyzqiP03hqemtb1BijhsJADdobn/4nsMJ8V1H+CrpuduUe4hlRdx+ikBQju1VGjMD1GJ3Sk05Eg==" - }, - "Microsoft.CodeAnalysis.Analyzers": { - "type": "Transitive", - "resolved": "3.3.4", - "contentHash": "AxkxcPR+rheX0SmvpLVIGLhOUXAKG56a64kV9VQZ4y9gR9ZmPXnqZvHJnmwLSwzrEP6junUF11vuc+aqo5r68g==" - }, - "Microsoft.CodeAnalysis.Common": { - "type": "Transitive", - "resolved": "4.8.0", - "contentHash": "/jR+e/9aT+BApoQJABlVCKnnggGQbvGh7BKq2/wI1LamxC+LbzhcLj4Vj7gXCofl1n4E521YfF9w0WcASGg/KA==", - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.3.4", - "System.Collections.Immutable": "7.0.0", - "System.Reflection.Metadata": "7.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.CodeAnalysis.CSharp": { - "type": "Transitive", - "resolved": "4.8.0", - "contentHash": "+3+qfdb/aaGD8PZRCrsdobbzGs1m9u119SkkJt8e/mk3xLJz/udLtS2T6nY27OTXxBBw10HzAbC8Z9w08VyP/g==", - "dependencies": { - "Microsoft.CodeAnalysis.Common": "[4.8.0]" - } - }, - "Microsoft.CodeAnalysis.CSharp.Workspaces": { - "type": "Transitive", - "resolved": "4.8.0", - "contentHash": "3amm4tq4Lo8/BGvg9p3BJh3S9nKq2wqCXfS7138i69TUpo/bD+XvD0hNurpEBtcNZhi1FyutiomKJqVF39ugYA==", - "dependencies": { - "Humanizer.Core": "2.14.1", - "Microsoft.CodeAnalysis.CSharp": "[4.8.0]", - "Microsoft.CodeAnalysis.Common": "[4.8.0]", - "Microsoft.CodeAnalysis.Workspaces.Common": "[4.8.0]" - } - }, - "Microsoft.CodeAnalysis.Workspaces.Common": { - "type": "Transitive", - "resolved": "4.8.0", - "contentHash": "LXyV+MJKsKRu3FGJA3OmSk40OUIa/dQCFLOnm5X8MNcujx7hzGu8o+zjXlb/cy5xUdZK2UKYb9YaQ2E8m9QehQ==", - "dependencies": { - "Humanizer.Core": "2.14.1", - "Microsoft.Bcl.AsyncInterfaces": "7.0.0", - "Microsoft.CodeAnalysis.Common": "[4.8.0]", - "System.Composition": "7.0.0", - "System.IO.Pipelines": "7.0.0", - "System.Threading.Channels": "7.0.0" - } - }, - "Microsoft.EntityFrameworkCore.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "kXxQ0X4VO9lot9D6pU2QkBI7BKsTHSMUC7sw9XLjIpW6TErMEq9k8p8buapJssQNjYsaMpSAqvBSV7D1yCzczQ==" - }, - "Microsoft.EntityFrameworkCore.Analyzers": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "O967hNSzxByRR/AXKygnHYyYtfpuORtQS6vR0mbrXmXD0EDbZI3uj6CDvuHN2RzizFqkw19sBWdkF5ckbscNVQ==" - }, - "Microsoft.Extensions.Caching.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "P65stJCenLENUnl33FtSE2VueD5unLBYZ5DefAzetq5+fSia8engFE8tElNvV3VoVY430hmEHJoxQAN+cUvQVg==", - "dependencies": { - "Microsoft.Extensions.Primitives": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Caching.Memory": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "Aho8wQMeWhOOpQ+dthZR2KcR8ZF/c9WzoorKqOLGPbyIl+LuJH3fFlaFpFESwbrz7NbijwcJyzsSDPYCND3Lwg==", - "dependencies": { - "Microsoft.Extensions.Caching.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Logging.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Options": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Primitives": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Configuration": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.Configuration.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "LAZhuLfRq6ZFBLYMMXrnY7bUtn5tiIF1vsRhA40XuTMc593VoaXNp0IjBHwfbWqRjYGPuRYL5LGG0qP3mp+9/Q==", - "dependencies": { - "Microsoft.Extensions.Primitives": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Configuration.FileExtensions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "McP+Lz/EKwvtCv48z0YImw+L1gi1gy5rHhNaNIY2CrjloV+XY8gydT8DjMR6zWeL13AFK+DioVpppwAuO1Gi1w==", - "dependencies": { - "Microsoft.Extensions.Configuration": "8.0.0", - "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "Microsoft.Extensions.FileProviders.Physical": "8.0.0", - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "9pc1Xlg99FqX1I57VtPv6fbhcrmOoA7p3/b+DwxAENaFz5JJt50CsVRq8WAvR5Fa+grFziewP3A/W0x9q5NYTw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "3176Psy4JxVCJI9L57MyLXt+0HmCylzFmblmmG4GNbxCArrt8slJGWootNRj7rJBh1CPNXOI3nwk9VvDLj/8oQ==" - }, - "Microsoft.Extensions.DependencyModel": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "AgbzDbctU049MeHHn27cqLWDBc+ZkWeiX0+HrwsE930VZfbn3gRSsSPaks4P/CMJOOnrYjXJjxl3aYsIY9Jl4A==", - "dependencies": { - "System.Text.Encodings.Web": "9.0.0-preview.3.24172.9", - "System.Text.Json": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.FileProviders.Abstractions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "ZbaMlhJlpisjuWbvXr4LdAst/1XxH3vZ6A0BsgTphZ2L4PGuxRLz7Jr/S7mkAAnOn78Vu0fKhEgNF5JO3zfjqQ==", - "dependencies": { - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.FileProviders.Physical": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "UboiXxpPUpwulHvIAVE36Knq0VSHaAmfrFkegLyBZeaADuKezJ/AIXYAW8F5GBlGk/VaibN2k/Zn1ca8YAfVdA==", - "dependencies": { - "Microsoft.Extensions.FileProviders.Abstractions": "8.0.0", - "Microsoft.Extensions.FileSystemGlobbing": "8.0.0", - "Microsoft.Extensions.Primitives": "8.0.0" - } - }, - "Microsoft.Extensions.FileSystemGlobbing": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "OK+670i7esqlQrPjdIKRbsyMCe9g5kSLpRRQGSr4Q58AOYEe/hCnfLZprh7viNisSUUQZmMrbbuDaIrP+V1ebQ==" - }, - "Microsoft.Extensions.Logging": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "jxyapuSpRYSvKPhwb+XPs1h5qyjB7FywdiigHpgi1yIV5Vo/cD46CnhiS0upBxoB8+c1uj+auqHcLtVHhZOWaw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Logging.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Options": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "r74tRvh++amfqCHaCpKwERcN59xoLhFD9VrHFca+p1u0olWo7qKAO+uZDC4tXFEtgr307/AD4xRApyji3Tk99A==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9", - "Microsoft.Extensions.Primitives": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "+Z0U5wqkxw687YJZijjQ/rwtIfv5nxrR3XuStq//klsyzqYoXMur2chHoHA9x+TkFzIZm8KX+Dr/jwaOdq28Jw==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "Mono.TextTemplating": { - "type": "Transitive", - "resolved": "3.0.0-preview-0052-g5d0f76c785", - "contentHash": "VP/+5Djwzv/Ves5kbuzWENNMh7COnXSDVKgAuljvyoX49T/72lXkzzAorpXQNx812lD/MxUqpO8GVyizEO+7OA==", - "dependencies": { - "System.CodeDom": "6.0.0" - } - }, - "Npgsql": { - "type": "Transitive", - "resolved": "8.0.2", - "contentHash": "MuJzLoWCaQhQAR3oh66YR0Ir6mxuezncGX3f8wxvAc21g0+9HICktJQlqMoODhxztZKXE5k9GxRxqUAN+vPb4g==", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "8.0.0" - } - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "System.CodeDom": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "CPc6tWO1LAer3IzfZufDBRL+UZQcj5uS207NHALQzP84Vp/z6wF0Aa0YZImOQY8iStY0A2zI/e3ihKNPfUm8XA==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==" - }, - "System.Composition": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "tRwgcAkDd85O8Aq6zHDANzQaq380cek9lbMg5Qma46u5BZXq/G+XvIYmu+UI+BIIZ9zssXLYrkTykEqxxvhcmg==", - "dependencies": { - "System.Composition.AttributedModel": "7.0.0", - "System.Composition.Convention": "7.0.0", - "System.Composition.Hosting": "7.0.0", - "System.Composition.Runtime": "7.0.0", - "System.Composition.TypedParts": "7.0.0" - } - }, - "System.Composition.AttributedModel": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "2QzClqjElKxgI1jK1Jztnq44/8DmSuTSGGahXqQ4TdEV0h9s2KikQZIgcEqVzR7OuWDFPGLHIprBJGQEPr8fAQ==" - }, - "System.Composition.Convention": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "IMhTlpCs4HmlD8B+J8/kWfwX7vrBBOs6xyjSTzBlYSs7W4OET4tlkR/Sg9NG8jkdJH9Mymq0qGdYS1VPqRTBnQ==", - "dependencies": { - "System.Composition.AttributedModel": "7.0.0" - } - }, - "System.Composition.Hosting": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "eB6gwN9S+54jCTBJ5bpwMOVerKeUfGGTYCzz3QgDr1P55Gg/Wb27ShfPIhLMjmZ3MoAKu8uUSv6fcCdYJTN7Bg==", - "dependencies": { - "System.Composition.Runtime": "7.0.0" - } - }, - "System.Composition.Runtime": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "aZJ1Zr5Txe925rbo4742XifEyW0MIni1eiUebmcrP3HwLXZ3IbXUj4MFMUH/RmnJOAQiS401leg/2Sz1MkApDw==" - }, - "System.Composition.TypedParts": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "ZK0KNPfbtxVceTwh+oHNGUOYV2WNOHReX2AXipuvkURC7s/jPwoWfsu3SnDBDgofqbiWr96geofdQ2erm/KTHg==", - "dependencies": { - "System.Composition.AttributedModel": "7.0.0", - "System.Composition.Hosting": "7.0.0", - "System.Composition.Runtime": "7.0.0" - } - }, - "System.IO.Pipelines": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "jRn6JYnNPW6xgQazROBLSfpdoczRw694vO5kKvMcNnpXuolEixUyw6IBuBs2Y2mlSX/LdLvyyWmfXhaI3ND1Yg==" - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "MclTG61lsD9sYdpNz9xsKBzjsmsfCtcMZYXz/IUr2zlhaTaABonlr1ESeompTgM+Xk+IwtGYU7/voh3YWB/fWw==", - "dependencies": { - "System.Collections.Immutable": "7.0.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "VIW80zwKmeI0VU75E31zb+sW/BX4T3EHcxfPauOr141wQ5NzhoSX1jP7jE28ZSYAVRIPvjSZzlD93Srxl9MU3Q==" - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "Ls1WYDtUv7asMLd5HNJHDIPCQnpJSyA0r1ruVwE5xYzLzwD0qRwXjMQBJ5t76EMx5VQAvdqvrj6vlRPCbs2XkQ==", - "dependencies": { - "System.Text.Encodings.Web": "9.0.0-preview.3.24172.9" - } - }, - "System.Threading.Channels": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "qmeeYNROMsONF6ndEZcIQ+VxR4Q/TX/7uIVLJqtwIWL7dDWeh0l1UIqgo4wYyjG//5lUNhwkLDSFl+pAWO6oiA==" - }, - "edelstein.protocol.services.migration": { - "type": "Project", - "dependencies": { - "protobuf-net.Grpc": "[1.1.1, )" - } - }, - "edelstein.protocol.services.server": { - "type": "Project", - "dependencies": { - "protobuf-net.Grpc": "[1.1.1, )" - } - }, - "edelstein.protocol.services.session": { - "type": "Project", - "dependencies": { - "protobuf-net.Grpc": "[1.1.1, )" - } - }, - "Microsoft.EntityFrameworkCore.Relational": { - "type": "CentralTransitive", - "requested": "[9.0.0-preview.3.24172.4, )", - "resolved": "9.0.0-preview.3.24172.4", - "contentHash": "dte8CsWFJEt4nrDGm8QDsr98YZ52RkavC0KBtobZ7wxZ/rKGUlgicv7EOKmy1DhI2ya7mWqmHwkwgBc0bxPzYg==", - "dependencies": { - "Microsoft.EntityFrameworkCore": "9.0.0-preview.3.24172.4", - "Microsoft.Extensions.Configuration.Abstractions": "9.0.0-preview.3.24172.9" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[9.0.0-preview.3.24172.9, )", - "resolved": "9.0.0-preview.3.24172.9", - "contentHash": "b9wNSdoc20aarUp1ktpS2ERzO9MDqLflH2TmW/CXmjEnCli8CQ5gI+BeTyHa3j4RXwuhJiV4ssvthXYQj5rpWQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.0-preview.3.24172.9" - } - }, - "protobuf-net.Grpc": { - "type": "CentralTransitive", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - } - } - } -} \ No newline at end of file diff --git a/src/common/Edelstein.Common.Utilities/Buffers/Packet.cs b/src/common/Edelstein.Common.Utilities/Buffers/Packet.cs deleted file mode 100644 index 7a88b4168..000000000 --- a/src/common/Edelstein.Common.Utilities/Buffers/Packet.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Buffers; -using System.IO; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Common.Utilities.Buffers; - -public class Packet : IPacket -{ - public Packet(byte[] buffer) - { - Length = buffer.Length; - Buffer = ArrayPool.Shared.Rent(Length); - - Array.Copy(buffer, Buffer, Length); - } - - public Packet(Stream stream) - { - Length = (int)stream.Length; - Buffer = ArrayPool.Shared.Rent(Length); - - var position = stream.Position; - - stream.Position = 0; - _ = stream.Read(Buffer, 0, Length); - stream.Position = position; - } - - public int Length { get; } - public byte[] Buffer { get; } - - public void Dispose() - => ArrayPool.Shared.Return(Buffer); -} diff --git a/src/common/Edelstein.Common.Utilities/Buffers/PacketMemoryStream.cs b/src/common/Edelstein.Common.Utilities/Buffers/PacketMemoryStream.cs deleted file mode 100644 index 26174d69d..000000000 --- a/src/common/Edelstein.Common.Utilities/Buffers/PacketMemoryStream.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Microsoft.IO; - -namespace Edelstein.Common.Utilities.Buffers; - -internal static class PacketMemoryStream -{ - internal static readonly RecyclableMemoryStreamManager Shared = new(); -} diff --git a/src/common/Edelstein.Common.Utilities/Buffers/PacketReader.cs b/src/common/Edelstein.Common.Utilities/Buffers/PacketReader.cs deleted file mode 100644 index c161385a3..000000000 --- a/src/common/Edelstein.Common.Utilities/Buffers/PacketReader.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.IO; -using System.Text; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Common.Utilities.Buffers; - -public class PacketReader : IPacketReader -{ - private readonly Encoding _encoding = Encoding.ASCII; - private readonly BinaryReader _reader; - private readonly MemoryStream _stream; - - public PacketReader(byte[] buffer) - { - _stream = PacketMemoryStream.Shared.GetStream(buffer); - _reader = new BinaryReader(_stream); - } - - public PacketReader(IPacket packet) : this(packet.Buffer) - { - } - - public PacketReader() : this(Array.Empty()) - { - } - - public long Cursor => _stream.Position; - public long Available => _stream.Length - _stream.Position; - - public byte ReadByte() => _reader.ReadByte(); - public bool ReadBool() => _reader.ReadBoolean(); - - public short ReadShort() => _reader.ReadInt16(); - public ushort ReadUShort() => _reader.ReadUInt16(); - - public int ReadInt() => _reader.ReadInt32(); - public uint ReadUInt() => _reader.ReadUInt32(); - - public long ReadLong() => _reader.ReadInt64(); - public ulong ReadULong() => _reader.ReadUInt64(); - - public double ReadDouble() => _reader.ReadDouble(); - - public string ReadString(short? length = null) => _encoding.GetString(_reader.ReadBytes(length ?? ReadShort())); - - public byte[] ReadBytes(short length) => _reader.ReadBytes(length); - - public IPacketReader Skip(short length) - { - ReadBytes(length); - return this; - } - - public void Dispose() - { - _reader.Dispose(); - _stream.Dispose(); - } -} diff --git a/src/common/Edelstein.Common.Utilities/Buffers/PacketWriter.cs b/src/common/Edelstein.Common.Utilities/Buffers/PacketWriter.cs deleted file mode 100644 index 5f32cdcba..000000000 --- a/src/common/Edelstein.Common.Utilities/Buffers/PacketWriter.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.IO; -using System.Text; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Common.Utilities.Buffers; - -public class PacketWriter : IPacketWriter -{ - private readonly Encoding _encoding = Encoding.ASCII; - private readonly MemoryStream _stream; - private readonly BinaryWriter _writer; - - public PacketWriter() - { - _stream = new MemoryStream(); - _writer = new BinaryWriter(_stream); - } - - public PacketWriter(Enum operation) : this() => WriteShort(Convert.ToInt16(operation)); - - public long Length => _stream.Length; - - public IPacketWriter WriteByte(byte value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteBool(bool value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteShort(short value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteUShort(ushort value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteInt(int value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteUInt(uint value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteLong(long value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteULong(ulong value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteDouble(double value) - { - _writer.Write(value); - return this; - } - - public IPacketWriter WriteString(string value, short? length = null) - { - if (length.HasValue) - { - if (value.Length > length) value = value[..length.Value]; - WriteBytes(_encoding.GetBytes(value.PadRight(length.Value, '\0'))); - } - else - { - WriteShort((short)_encoding.GetByteCount(value)); - WriteBytes(_encoding.GetBytes(value)); - } - - return this; - } - - public IPacketWriter WriteBytes(byte[] value) - { - _writer.Write(value); - return this; - } - - public IPacket Build() - => new Packet(_stream); - - public void Dispose() - { - _writer.Dispose(); - _stream.Dispose(); - } -} diff --git a/src/common/Edelstein.Common.Utilities/Edelstein.Common.Utilities.csproj b/src/common/Edelstein.Common.Utilities/Edelstein.Common.Utilities.csproj deleted file mode 100644 index 274f059a9..000000000 --- a/src/common/Edelstein.Common.Utilities/Edelstein.Common.Utilities.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/common/Edelstein.Common.Utilities/Pipelines/Pipeline.cs b/src/common/Edelstein.Common.Utilities/Pipelines/Pipeline.cs deleted file mode 100644 index 247197318..000000000 --- a/src/common/Edelstein.Common.Utilities/Pipelines/Pipeline.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Pipelines; -using Injectio.Attributes; - -namespace Edelstein.Common.Utilities.Pipelines; - -[RegisterScoped(ImplementationType = typeof(Pipeline<>), ServiceType = typeof(IPipeline<>))] -public class Pipeline() : IPipeline -{ - private readonly ICollection> _steps = new SortedSet>(new PipelineStepComparer()); - - public Pipeline(IEnumerable> plugs) : this() - { - foreach (var plug in plugs) - _steps.Add(new PipelineStep(PipelinePriority.Reserved, plug)); - } - - public void Add(int priority, IPipelinePlug plug) - => _steps.Add(new PipelineStep(priority, plug)); - - public void Add(IPipelinePlug plug) - => Add(PipelinePriority.Normal, plug); - - public void Remove(IPipelinePlug plug) - { - var part = _steps.FirstOrDefault(p => p.Plug == plug); - if (part != null) _steps.Remove(part); - } - - public async Task Process(TMessage message) - { - var ctx = new PipelineContext(); - - foreach (var part in _steps) - { - await part.Plug.Handle(ctx, message); - if (ctx.IsRequestedCancellation) - break; - } - - return ctx; - } -} diff --git a/src/common/Edelstein.Common.Utilities/Pipelines/PipelineContext.cs b/src/common/Edelstein.Common.Utilities/Pipelines/PipelineContext.cs deleted file mode 100644 index cc231779c..000000000 --- a/src/common/Edelstein.Common.Utilities/Pipelines/PipelineContext.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Edelstein.Protocol.Utilities.Pipelines; - -namespace Edelstein.Common.Utilities.Pipelines; - -public class PipelineContext : IPipelineContext -{ - public bool IsRequestedCancellation { get; private set; } - - public void Cancel() => IsRequestedCancellation = true; -} diff --git a/src/common/Edelstein.Common.Utilities/Pipelines/PipelineStep.cs b/src/common/Edelstein.Common.Utilities/Pipelines/PipelineStep.cs deleted file mode 100644 index 8427b3ad3..000000000 --- a/src/common/Edelstein.Common.Utilities/Pipelines/PipelineStep.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Edelstein.Protocol.Utilities.Pipelines; - -namespace Edelstein.Common.Utilities.Pipelines; - -internal class PipelineStep( - int priority, - IPipelinePlug plug -) -{ - public int Priority { get; } = priority; - public IPipelinePlug Plug { get; } = plug; -} diff --git a/src/common/Edelstein.Common.Utilities/Pipelines/PipelineStepComparer.cs b/src/common/Edelstein.Common.Utilities/Pipelines/PipelineStepComparer.cs deleted file mode 100644 index 3e02ebbe3..000000000 --- a/src/common/Edelstein.Common.Utilities/Pipelines/PipelineStepComparer.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; - -namespace Edelstein.Common.Utilities.Pipelines; - -internal class PipelineStepComparer : IComparer> -{ - public int Compare(PipelineStep? x, PipelineStep? y) - { - if (ReferenceEquals(x, y)) return 0; - if (ReferenceEquals(null, y)) return 1; - if (ReferenceEquals(null, x)) return -1; - var a = x.Priority.CompareTo(y.Priority); - return a == 0 ? x.Plug.GetHashCode().CompareTo(y.Plug.GetHashCode()) : a; - } -} diff --git a/src/common/Edelstein.Common.Utilities/Repositories/Repository.cs b/src/common/Edelstein.Common.Utilities/Repositories/Repository.cs deleted file mode 100644 index baca38073..000000000 --- a/src/common/Edelstein.Common.Utilities/Repositories/Repository.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Common.Utilities.Repositories; - -public class Repository : IRepository - where TKey : notnull - where TEntry : IRepositoryEntry -{ - private readonly IDictionary _dictionary = new ConcurrentDictionary(); - - public virtual Task Retrieve(TKey key) - => Task.FromResult(_dictionary.TryGetValue(key, out var result) ? result : default); - - public virtual Task Insert(TEntry entry) - => Task.FromResult(_dictionary[entry.ID] = entry); - - public virtual Task Update(TEntry entry) - => Task.FromResult(_dictionary[entry.ID] = entry); - - public virtual Task Delete(TKey key) - => Task.FromResult(_dictionary.Remove(key)); - - public virtual Task Delete(TEntry entry) - => Task.FromResult(_dictionary.Remove(entry.ID)); - - public virtual Task> RetrieveAll() - => Task.FromResult(_dictionary.Values); -} diff --git a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollection.cs b/src/common/Edelstein.Common.Utilities/Templates/TemplateCollection.cs deleted file mode 100644 index 54eae9d93..000000000 --- a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollection.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Templates; - -namespace Edelstein.Common.Utilities.Templates; - -public class TemplateCollection( - IReadOnlyDictionary templates -) : - ITemplateCollection - where TTemplate : ITemplate -{ - public int Count => templates.Count; - - public Task Retrieve(int key) - => Task.FromResult(templates.TryGetValue(key, out var result) ? result : default); - - public Task> RetrieveAll() - => Task.FromResult>(templates.Values.ToImmutableArray()); -} diff --git a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionLazy.cs b/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionLazy.cs deleted file mode 100644 index c0f8ea229..000000000 --- a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionLazy.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Templates; - -namespace Edelstein.Common.Utilities.Templates; - -public class TemplateCollectionLazy( - IReadOnlyDictionary> providers -) : - ITemplateCollection - where TTemplate : ITemplate -{ - public int Count => providers.Count; - - public async Task Retrieve(int key) - => providers.TryGetValue(key, out var provider) ? await provider.Provide() : default; - - public async Task> RetrieveAll() - => await Task.WhenAll(providers.Values.Select(p => p.Provide())); -} diff --git a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderEager.cs b/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderEager.cs deleted file mode 100644 index bd01609f1..000000000 --- a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderEager.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Templates; - -namespace Edelstein.Common.Utilities.Templates; - -public class TemplateCollectionProviderEager( - int id, - TTemplate template -) : ITemplateCollectionProvider - where TTemplate : ITemplate -{ - - public int ID { get; } = id; - - public Task Provide() => Task.FromResult(template); -} diff --git a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderLazy.cs b/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderLazy.cs deleted file mode 100644 index 3791d0d80..000000000 --- a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderLazy.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Templates; - -namespace Edelstein.Common.Utilities.Templates; - -public class TemplateCollectionProviderLazy( - int id, - Func func -) : ITemplateCollectionProvider - where TTemplate : ITemplate -{ - private TTemplate? _template = default; - - public int ID { get; } = id; - - public Task Provide() - => Task.FromResult(_template ??= func.Invoke()); -} diff --git a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderLazyHolder.cs b/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderLazyHolder.cs deleted file mode 100644 index bd47ef303..000000000 --- a/src/common/Edelstein.Common.Utilities/Templates/TemplateCollectionProviderLazyHolder.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Edelstein.Protocol.Utilities.Templates; - -namespace Edelstein.Common.Utilities.Templates; - -public record TemplateCollectionProviderLazyHolder( - TTemplate Template -) where TTemplate : ITemplate; diff --git a/src/common/Edelstein.Common.Utilities/Templates/TemplateManager.cs b/src/common/Edelstein.Common.Utilities/Templates/TemplateManager.cs deleted file mode 100644 index f9995502b..000000000 --- a/src/common/Edelstein.Common.Utilities/Templates/TemplateManager.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Templates; -using Injectio.Attributes; - -namespace Edelstein.Common.Utilities.Templates; - -[RegisterScoped(ImplementationType = typeof(TemplateManager<>), ServiceType = typeof(ITemplateManager<>))] -public class TemplateManager : - ITemplateManager - where TTemplate : ITemplate -{ - private readonly IDictionary> _providers = new Dictionary>(); - - public int Count => _providers.Count; - - public async Task Retrieve(int key) => - _providers.TryGetValue(key, out var provider) ? await provider.Provide() : default; - - public async Task> RetrieveAll() => - await Task.WhenAll(_providers.Values.Select(p => p.Provide())); - - public Task> Insert(ITemplateCollectionProvider entry) => - Task.FromResult(_providers[entry.ID] = entry); -} diff --git a/src/common/Edelstein.Common.Utilities/packages.lock.json b/src/common/Edelstein.Common.Utilities/packages.lock.json deleted file mode 100644 index 1a692d31b..000000000 --- a/src/common/Edelstein.Common.Utilities/packages.lock.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "Injectio": { - "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "7b7IdkoJA1ecyHYjstI0TraeilfaRdwmoBpR09oOYxuOTHYvKjPm5Odvjcdp6WMjcQF2WUs7xm169w9uXEgA1g==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0" - } - }, - "Microsoft.IO.RecyclableMemoryStream": { - "type": "Direct", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "irv0HuqoH8Ig5i2fO+8dmDNdFdsrO+DoQcedwIlb810qpZHBNQHZLW7C/AHBQDgLLpw2T96vmMAy/aE4Yj55Sg==" - }, - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==" - }, - "edelstein.protocol.utilities": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/src/protocol/Edelstein.Protocol.Gameplay.Login/Contexts/ILoginContextPipelines.cs b/src/protocol/Edelstein.Protocol.Gameplay.Login/Contexts/ILoginContextPipelines.cs deleted file mode 100644 index 3ec2f70cb..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay.Login/Contexts/ILoginContextPipelines.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Edelstein.Protocol.Gameplay.Contexts; - -namespace Edelstein.Protocol.Gameplay.Login.Contexts; - -public interface ILoginContextPipelines : IStageContextPipelines -{ -} diff --git a/src/protocol/Edelstein.Protocol.Gameplay.Login/Edelstein.Protocol.Gameplay.Login.csproj b/src/protocol/Edelstein.Protocol.Gameplay.Login/Edelstein.Protocol.Gameplay.Login.csproj deleted file mode 100644 index 79f38ca8f..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay.Login/Edelstein.Protocol.Gameplay.Login.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageSystem.cs b/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageSystem.cs deleted file mode 100644 index 47af41d5c..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageSystem.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Edelstein.Protocol.Gameplay.Login.Contexts; - -namespace Edelstein.Protocol.Gameplay.Login; - -public interface ILoginStageSystem : IStageSystem -{ - ILoginStageSystemOptions Options { get; } - ILoginContextPipelines Pipelines { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageSystemOptions.cs b/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageSystemOptions.cs deleted file mode 100644 index e34eaca16..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageSystemOptions.cs +++ /dev/null @@ -1,5 +0,0 @@ -using Edelstein.Protocol.Services.Server; - -namespace Edelstein.Protocol.Gameplay.Login; - -public interface ILoginStageSystemOptions : IServerEntryLogin; diff --git a/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageUser.cs b/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageUser.cs deleted file mode 100644 index 4d98ca436..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay.Login/ILoginStageUser.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Edelstein.Protocol.Gameplay.Login; - -public interface ILoginStageUser : IStageUser; diff --git a/src/protocol/Edelstein.Protocol.Gameplay.Login/packages.lock.json b/src/protocol/Edelstein.Protocol.Gameplay.Login/packages.lock.json deleted file mode 100644 index 0469f8640..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay.Login/packages.lock.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - }, - "edelstein.protocol.gameplay": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Network": "[1.0.0, )", - "Edelstein.Protocol.Services.Server": "[1.0.0, )" - } - }, - "edelstein.protocol.network": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )" - } - }, - "edelstein.protocol.services.server": { - "type": "Project", - "dependencies": { - "protobuf-net.Grpc": "[1.1.1, )" - } - }, - "edelstein.protocol.utilities": { - "type": "Project" - }, - "protobuf-net.Grpc": { - "type": "CentralTransitive", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - } - } - } -} \ No newline at end of file diff --git a/src/protocol/Edelstein.Protocol.Gameplay/Contexts/IStageContextPipelines.cs b/src/protocol/Edelstein.Protocol.Gameplay/Contexts/IStageContextPipelines.cs deleted file mode 100644 index a72e8dc55..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/Contexts/IStageContextPipelines.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Edelstein.Protocol.Gameplay.Contracts; -using Edelstein.Protocol.Utilities.Pipelines; - -namespace Edelstein.Protocol.Gameplay.Contexts; - -public interface IStageContextPipelines - where TStageUser : IStageUser - where TStageSystem : IStageSystem -{ - IPipeline> UserOnPacketPipeline { get; } - IPipeline> UserOnExceptionPipeline { get; } - IPipeline> UserOnDisconnectPipeline { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnDisconnect.cs b/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnDisconnect.cs deleted file mode 100644 index 6cc208b65..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnDisconnect.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Edelstein.Protocol.Gameplay.Contracts; - -public record UserOnDisconnect( - TStageUser User -) - where TStageUser : IStageUser - where TStageSystem : IStageSystem; diff --git a/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnException.cs b/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnException.cs deleted file mode 100644 index 6490ba9ad..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnException.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace Edelstein.Protocol.Gameplay.Contracts; - -public record UserOnException( - TStageUser User, - Exception Exception -) - where TStageUser : IStageUser - where TStageSystem : IStageSystem; diff --git a/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnPacket.cs b/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnPacket.cs deleted file mode 100644 index a13e943da..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/Contracts/UserOnPacket.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Protocol.Gameplay.Contracts; - -public record UserOnPacket( - TStageUser User, - IPacket Packet -) - where TStageUser : IStageUser - where TStageSystem : IStageSystem; diff --git a/src/protocol/Edelstein.Protocol.Gameplay/Edelstein.Protocol.Gameplay.csproj b/src/protocol/Edelstein.Protocol.Gameplay/Edelstein.Protocol.Gameplay.csproj deleted file mode 100644 index 56a6182fc..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/Edelstein.Protocol.Gameplay.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/protocol/Edelstein.Protocol.Gameplay/IStage.cs b/src/protocol/Edelstein.Protocol.Gameplay/IStage.cs deleted file mode 100644 index 2c3e222a4..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/IStage.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Gameplay; - -public interface IStage - where TStageSystem : IStageSystem - where TStageUser : IStageUser -{ - Task Enter(TStageUser user); - Task Leave(TStageUser user); -} diff --git a/src/protocol/Edelstein.Protocol.Gameplay/IStageSystem.cs b/src/protocol/Edelstein.Protocol.Gameplay/IStageSystem.cs deleted file mode 100644 index cf0a2cf2a..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/IStageSystem.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Edelstein.Protocol.Network; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Protocol.Gameplay; - -public interface IStageSystem : - IRepositoryEntry, - ISocketUserCreator, - ISocketAdapter - where TStageUser : IStageUser - where TStageSystem : IStageSystem; diff --git a/src/protocol/Edelstein.Protocol.Gameplay/IStageUser.cs b/src/protocol/Edelstein.Protocol.Gameplay/IStageUser.cs deleted file mode 100644 index de19d0cc0..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/IStageUser.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Edelstein.Protocol.Network; - -namespace Edelstein.Protocol.Gameplay; - -public interface IStageUser : ISocketUser - where TStageSystem : IStageSystem - where TStageUser : IStageUser -{ - TStageSystem System { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Gameplay/packages.lock.json b/src/protocol/Edelstein.Protocol.Gameplay/packages.lock.json deleted file mode 100644 index c07abc1c6..000000000 --- a/src/protocol/Edelstein.Protocol.Gameplay/packages.lock.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - }, - "edelstein.protocol.network": { - "type": "Project", - "dependencies": { - "Edelstein.Protocol.Utilities": "[1.0.0, )" - } - }, - "edelstein.protocol.services.server": { - "type": "Project", - "dependencies": { - "protobuf-net.Grpc": "[1.1.1, )" - } - }, - "edelstein.protocol.utilities": { - "type": "Project" - }, - "protobuf-net.Grpc": { - "type": "CentralTransitive", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - } - } - } -} \ No newline at end of file diff --git a/src/protocol/Edelstein.Protocol.Network/Edelstein.Protocol.Network.csproj b/src/protocol/Edelstein.Protocol.Network/Edelstein.Protocol.Network.csproj deleted file mode 100644 index d39623aa9..000000000 --- a/src/protocol/Edelstein.Protocol.Network/Edelstein.Protocol.Network.csproj +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/protocol/Edelstein.Protocol.Network/ISocket.cs b/src/protocol/Edelstein.Protocol.Network/ISocket.cs deleted file mode 100644 index 75a80abde..000000000 --- a/src/protocol/Edelstein.Protocol.Network/ISocket.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Net; -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Buffers; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Protocol.Network; - -public interface ISocket : IRepositoryEntry -{ - EndPoint AddressLocal { get; } - EndPoint AddressRemote { get; } - - uint SeqSend { get; set; } - uint SeqRecv { get; set; } - - bool IsDataEncrypted { get; } - - Task Dispatch(IPacket packet); - Task Close(); -} diff --git a/src/protocol/Edelstein.Protocol.Network/ISocketAdapter.cs b/src/protocol/Edelstein.Protocol.Network/ISocketAdapter.cs deleted file mode 100644 index f9330d906..000000000 --- a/src/protocol/Edelstein.Protocol.Network/ISocketAdapter.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Protocol.Network; - -public interface ISocketAdapter - where TSocketUser : ISocketUser -{ - Task OnPacket(TSocketUser user, IPacket packet); - Task OnException(TSocketUser user, Exception exception); - Task OnDisconnect(TSocketUser user); -} diff --git a/src/protocol/Edelstein.Protocol.Network/ISocketUser.cs b/src/protocol/Edelstein.Protocol.Network/ISocketUser.cs deleted file mode 100644 index a70ca6c87..000000000 --- a/src/protocol/Edelstein.Protocol.Network/ISocketUser.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Buffers; - -namespace Edelstein.Protocol.Network; - -public interface ISocketUser -{ - ISocket Socket { get; } - - Task Dispatch(IPacket packet) => Socket.Dispatch(packet); - Task Disconnect() => Socket.Close(); -} diff --git a/src/protocol/Edelstein.Protocol.Network/ISocketUserCreator.cs b/src/protocol/Edelstein.Protocol.Network/ISocketUserCreator.cs deleted file mode 100644 index 65546746e..000000000 --- a/src/protocol/Edelstein.Protocol.Network/ISocketUserCreator.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Edelstein.Protocol.Network; - -public interface ISocketUserCreator - where TSocketUser : ISocketUser -{ - TSocketUser CreateUser(ISocket socket); -} diff --git a/src/protocol/Edelstein.Protocol.Network/Transports/ITransportAcceptor.cs b/src/protocol/Edelstein.Protocol.Network/Transports/ITransportAcceptor.cs deleted file mode 100644 index 2ab7d6d03..000000000 --- a/src/protocol/Edelstein.Protocol.Network/Transports/ITransportAcceptor.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Network.Transports; - -public interface ITransportAcceptor -{ - Task Accept(string host, int port); -} diff --git a/src/protocol/Edelstein.Protocol.Network/Transports/ITransportConnector.cs b/src/protocol/Edelstein.Protocol.Network/Transports/ITransportConnector.cs deleted file mode 100644 index a39b92fd8..000000000 --- a/src/protocol/Edelstein.Protocol.Network/Transports/ITransportConnector.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Network.Transports; - -public interface ITransportConnector -{ - Task Connect(string host, int port); -} diff --git a/src/protocol/Edelstein.Protocol.Network/Transports/ITransportContext.cs b/src/protocol/Edelstein.Protocol.Network/Transports/ITransportContext.cs deleted file mode 100644 index fb5247caa..000000000 --- a/src/protocol/Edelstein.Protocol.Network/Transports/ITransportContext.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Buffers; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Protocol.Network.Transports; - -public interface ITransportContext -{ - TransportState State { get; } - TransportVersion Version { get; } - - IReadOnlyRepository Sockets { get; } - - Task Dispatch(IPacket packet); - Task Close(); -} diff --git a/src/protocol/Edelstein.Protocol.Network/Transports/TransportState.cs b/src/protocol/Edelstein.Protocol.Network/Transports/TransportState.cs deleted file mode 100644 index 65dfdd5cb..000000000 --- a/src/protocol/Edelstein.Protocol.Network/Transports/TransportState.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Edelstein.Protocol.Network.Transports; - -public enum TransportState -{ - Closed, - Opened -} diff --git a/src/protocol/Edelstein.Protocol.Network/Transports/TransportVersion.cs b/src/protocol/Edelstein.Protocol.Network/Transports/TransportVersion.cs deleted file mode 100644 index 23f2b4eef..000000000 --- a/src/protocol/Edelstein.Protocol.Network/Transports/TransportVersion.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Edelstein.Protocol.Network.Transports; - -public record TransportVersion( - short Major, - string Patch, - byte Locale -); diff --git a/src/protocol/Edelstein.Protocol.Network/packages.lock.json b/src/protocol/Edelstein.Protocol.Network/packages.lock.json deleted file mode 100644 index ec86e02e5..000000000 --- a/src/protocol/Edelstein.Protocol.Network/packages.lock.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "edelstein.protocol.utilities": { - "type": "Project" - } - } - } -} \ No newline at end of file diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/MigrationEntry.cs b/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/MigrationEntry.cs deleted file mode 100644 index de688ed50..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/MigrationEntry.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Migration.Contracts; - -[DataContract] -public record MigrationEntry : IMigrationEntry -{ - [DataMember(Order = 1)] public required int AccountID { get; init; } - [DataMember(Order = 2)] public required int CharacterID { get; init; } - - [DataMember(Order = 3)] public required string FromServerID { get; init; } - [DataMember(Order = 4)] public required string ToServerID { get; init; } - - [DataMember(Order = 5)] public required long Key { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/MigrationResult.cs b/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/MigrationResult.cs deleted file mode 100644 index 22ed593e6..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/MigrationResult.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Edelstein.Protocol.Services.Migration.Contracts; - -public enum MigrationResult -{ - Unknown = 0x0, - Success = 0x1, - FailedUnknown = 0x2, - FailedAlreadyStarted = 0x3, - FailedNotStarted = 0x4, - FailedInvalidKey = 0x5, - FailedInvalidServer = 0x6 -} diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Requests/MigrationClaimRequest.cs b/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Requests/MigrationClaimRequest.cs deleted file mode 100644 index ae8f6e93a..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Requests/MigrationClaimRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Migration.Contracts.Requests; - -[DataContract] -public record MigrationClaimRequest -{ - [DataMember(Order = 1)] public required int CharacterID { get; init; } - [DataMember(Order = 2)] public required string ServerID { get; init; } - [DataMember(Order = 3)] public required long Key { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Requests/MigrationStartRequest.cs b/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Requests/MigrationStartRequest.cs deleted file mode 100644 index 9e3d46728..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Requests/MigrationStartRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Migration.Contracts.Requests; - -[DataContract] -public record MigrationStartRequest -{ - [DataMember(Order = 1)] public required MigrationEntry Migration { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Responses/MigrationClaimResponse.cs b/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Responses/MigrationClaimResponse.cs deleted file mode 100644 index 905b09bc1..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Responses/MigrationClaimResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Migration.Contracts.Responses; - -[DataContract] -public record MigrationClaimResponse -{ - [DataMember(Order = 1)] public required MigrationResult Result { get; init; } - [DataMember(Order = 2)] public required MigrationEntry? Migration { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Responses/MigrationResponse.cs b/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Responses/MigrationResponse.cs deleted file mode 100644 index c4fdc4f5e..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/Contracts/Responses/MigrationResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Migration.Contracts.Responses; - -[DataContract] -public record MigrationResponse -{ - [DataMember(Order = 1)] public required MigrationResult Result { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/Edelstein.Protocol.Services.Migration.csproj b/src/protocol/Edelstein.Protocol.Services.Migration/Edelstein.Protocol.Services.Migration.csproj deleted file mode 100644 index e04727f4c..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/Edelstein.Protocol.Services.Migration.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/IMigrationEntry.cs b/src/protocol/Edelstein.Protocol.Services.Migration/IMigrationEntry.cs deleted file mode 100644 index 8cf1ae602..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/IMigrationEntry.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Edelstein.Protocol.Services.Migration; - -public interface IMigrationEntry -{ - int AccountID { get; } - int CharacterID { get; } - - string FromServerID { get; } - string ToServerID { get; } - - long Key { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/IMigrationService.cs b/src/protocol/Edelstein.Protocol.Services.Migration/IMigrationService.cs deleted file mode 100644 index 0e51253eb..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/IMigrationService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.ServiceModel; -using System.Threading.Tasks; -using Edelstein.Protocol.Services.Migration.Contracts.Requests; -using Edelstein.Protocol.Services.Migration.Contracts.Responses; -using ProtoBuf.Grpc; - -namespace Edelstein.Protocol.Services.Migration; - -[ServiceContract] -public interface IMigrationService -{ - [OperationContract] Task Start(MigrationStartRequest request, CallContext context = default); - [OperationContract] Task Claim(MigrationClaimRequest request, CallContext context = default); -} diff --git a/src/protocol/Edelstein.Protocol.Services.Migration/packages.lock.json b/src/protocol/Edelstein.Protocol.Services.Migration/packages.lock.json deleted file mode 100644 index f0613d411..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Migration/packages.lock.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "protobuf-net.Grpc": { - "type": "Direct", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - } - } - } -} \ No newline at end of file diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerDeregisterRequest.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerDeregisterRequest.cs deleted file mode 100644 index b004192a7..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerDeregisterRequest.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Requests; - -[DataContract] -public record ServerDeregisterRequest -{ - [DataMember(Order = 1)] public required string ServerID { get; init; } - [DataMember(Order = 2)] public required long Token { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetByIDRequest.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetByIDRequest.cs deleted file mode 100644 index 02ac76777..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetByIDRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Requests; - -[DataContract] -public record ServerGetByIDRequest -{ - [DataMember(Order = 1)] public required string ServerID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetGameByWorldAndChannelRequest.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetGameByWorldAndChannelRequest.cs deleted file mode 100644 index ed700d740..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetGameByWorldAndChannelRequest.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Requests; - -[DataContract] -public record ServerGetGameByWorldAndChannelRequest -{ - [DataMember(Order = 1)] public required int WorldID { get; init; } - [DataMember(Order = 2)] public required int ChannelID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetGameByWorldRequest.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetGameByWorldRequest.cs deleted file mode 100644 index 114038adc..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetGameByWorldRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Requests; - -[DataContract] -public record ServerGetGameByWorldRequest -{ - [DataMember(Order = 1)] public required int WorldID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetShopByWorldRequest.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetShopByWorldRequest.cs deleted file mode 100644 index a0c869a3f..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetShopByWorldRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Requests; - -[DataContract] -public record ServerGetShopByWorldRequest -{ - [DataMember(Order = 1)] public required int WorldID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetTradeByWorldRequest.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetTradeByWorldRequest.cs deleted file mode 100644 index ed05e8e8b..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerGetTradeByWorldRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Requests; - -[DataContract] -public record ServerGetTradeByWorldRequest -{ - [DataMember(Order = 1)] public required int WorldID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerRegisterRequest.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerRegisterRequest.cs deleted file mode 100644 index c4b868cfb..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerRegisterRequest.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Requests; - -[DataContract] -public record ServerRegisterRequest - where TServerEntry : ServerEntry -{ - [DataMember(Order = 1)] public required TServerEntry Server { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerUpdateRequest.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerUpdateRequest.cs deleted file mode 100644 index f3aac5167..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Requests/ServerUpdateRequest.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Requests; - -[DataContract] -public record ServerUpdateRequest -{ - [DataMember(Order = 1)] public required string ServerID { get; init; } - [DataMember(Order = 2)] public required long Token { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerGetAllResponse.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerGetAllResponse.cs deleted file mode 100644 index d0c8f53cb..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerGetAllResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Responses; - -[DataContract] -public record ServerGetAllResponse - where TServerEntry : ServerEntry -{ - [DataMember(Order = 1)] public required ServerResult Result { get; init; } - [DataMember(Order = 2)] public required IEnumerable Servers { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerGetOneResponse.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerGetOneResponse.cs deleted file mode 100644 index eb595e250..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerGetOneResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Responses; - -[DataContract] -public record ServerGetOneResponse - where TServerEntry : ServerEntry -{ - [DataMember(Order = 1)] public required ServerResult Result { get; init; } - [DataMember(Order = 2)] public required TServerEntry? Server { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerRegisterResponse.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerRegisterResponse.cs deleted file mode 100644 index 200222b74..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerRegisterResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Responses; - -[DataContract] -public record ServerRegisterResponse -{ - [DataMember(Order = 1)] public required ServerResult Result { get; init; } - [DataMember(Order = 2)] public required long? Token { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerResponse.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerResponse.cs deleted file mode 100644 index c1e871aaf..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/Responses/ServerResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts.Responses; - -[DataContract] -public record ServerResponse -{ - [DataMember(Order = 1)] public required ServerResult Result { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntry.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntry.cs deleted file mode 100644 index ef241b5e2..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntry.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts; - -[DataContract] -public record ServerEntry : IServerEntry -{ - [DataMember(Order = 1)] public required string ID { get; init; } - [DataMember(Order = 2)] public required string Host { get; init; } - [DataMember(Order = 3)] public required int Port { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryGame.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryGame.cs deleted file mode 100644 index 5f49d54e8..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryGame.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts; - -[DataContract] -public record ServerEntryGame : ServerEntry, IServerEntryGame -{ - [DataMember(Order = 4)] public required int WorldID { get; init; } - [DataMember(Order = 5)] public required int ChannelID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryLogin.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryLogin.cs deleted file mode 100644 index 7336fc82a..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryLogin.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts; - -[DataContract] -public record ServerEntryLogin : ServerEntry, IServerEntryLogin; diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryShop.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryShop.cs deleted file mode 100644 index ba4883cae..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryShop.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts; - -[DataContract] -public record ServerEntryShop : ServerEntry, IServerEntryShop -{ - [DataMember(Order = 4)] public required int WorldID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryTrade.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryTrade.cs deleted file mode 100644 index ac5b154f4..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerEntryTrade.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Server.Contracts; - -[DataContract] -public record ServerEntryTrade : ServerEntry, IServerEntryTrade -{ - [DataMember(Order = 4)] public required int WorldID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerResult.cs b/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerResult.cs deleted file mode 100644 index 7b093f293..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Contracts/ServerResult.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Edelstein.Protocol.Services.Server.Contracts; - -public enum ServerResult -{ - Unknown = 0x0, - Success = 0x1, - FailedUnknown = 0x2, - FailedAlreadyRegistered = 0x3, - FailedNotRegistered = 0x4, - FailedNotFound = 0x5, - FailedInvalidToken = 0x6 -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/Edelstein.Protocol.Services.Server.csproj b/src/protocol/Edelstein.Protocol.Services.Server/Edelstein.Protocol.Services.Server.csproj deleted file mode 100644 index fc500a690..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/Edelstein.Protocol.Services.Server.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntry.cs b/src/protocol/Edelstein.Protocol.Services.Server/IServerEntry.cs deleted file mode 100644 index e8a8b0446..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntry.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Edelstein.Protocol.Services.Server; - -public interface IServerEntry -{ - string ID { get; } - - string Host { get; } - int Port { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryGame.cs b/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryGame.cs deleted file mode 100644 index fd0f9bc88..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryGame.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Edelstein.Protocol.Services.Server; - -public interface IServerEntryGame : IServerEntry -{ - int WorldID { get; } - int ChannelID { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryLogin.cs b/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryLogin.cs deleted file mode 100644 index 97f875487..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryLogin.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Edelstein.Protocol.Services.Server; - -public interface IServerEntryLogin : IServerEntry; diff --git a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryShop.cs b/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryShop.cs deleted file mode 100644 index 96eb2142a..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryShop.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Edelstein.Protocol.Services.Server; - -public interface IServerEntryShop : IServerEntry -{ - int WorldID { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryTrade.cs b/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryTrade.cs deleted file mode 100644 index ad081541f..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/IServerEntryTrade.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Edelstein.Protocol.Services.Server; - -public interface IServerEntryTrade : IServerEntry -{ - int WorldID { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/IServerService.cs b/src/protocol/Edelstein.Protocol.Services.Server/IServerService.cs deleted file mode 100644 index b708d5b07..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/IServerService.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ServiceModel; -using System.Threading.Tasks; -using Edelstein.Protocol.Services.Server.Contracts; -using Edelstein.Protocol.Services.Server.Contracts.Requests; -using Edelstein.Protocol.Services.Server.Contracts.Responses; -using ProtoBuf.Grpc; - -namespace Edelstein.Protocol.Services.Server; - -[ServiceContract] -public interface IServerService -{ - [OperationContract] Task RegisterLogin(ServerRegisterRequest request, CallContext context = default); - [OperationContract] Task RegisterGame(ServerRegisterRequest request, CallContext context = default); - [OperationContract] Task RegisterShop(ServerRegisterRequest request, CallContext context = default); - [OperationContract] Task RegisterTrade(ServerRegisterRequest request, CallContext context = default); - - [OperationContract] Task Update(ServerUpdateRequest request, CallContext context = default); - - [OperationContract] Task Deregister(ServerDeregisterRequest request, CallContext context = default); - - [OperationContract] Task> GetByID(ServerGetByIDRequest request, CallContext context = default); - - [OperationContract] Task> GetGameByWorldAndChannel(ServerGetGameByWorldAndChannelRequest request, CallContext context = default); - [OperationContract] Task> GetGameByWorld(ServerGetGameByWorldRequest request, CallContext context = default); - - [OperationContract] Task> GetShopByWorld(ServerGetShopByWorldRequest request, CallContext context = default); - - [OperationContract] Task> GetTradeByWorld(ServerGetTradeByWorldRequest request, CallContext context = default); - - [OperationContract] Task> GetAll(CallContext context = default); -} diff --git a/src/protocol/Edelstein.Protocol.Services.Server/packages.lock.json b/src/protocol/Edelstein.Protocol.Services.Server/packages.lock.json deleted file mode 100644 index f0613d411..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Server/packages.lock.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "protobuf-net.Grpc": { - "type": "Direct", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - } - } - } -} \ No newline at end of file diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionEndRequest.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionEndRequest.cs deleted file mode 100644 index 7aacd8cef..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionEndRequest.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts.Requests; - -[DataContract] -public record SessionEndRequest -{ - [DataMember(Order = 1)] public required int AccountID { get; init; } - [DataMember(Order = 2)] public required long Key { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionGetByActiveAccountRequest.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionGetByActiveAccountRequest.cs deleted file mode 100644 index f69085bbd..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionGetByActiveAccountRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts.Requests; - -[DataContract] -public record SessionGetByActiveAccountRequest -{ - [DataMember(Order = 1)] public required int AccountID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionGetByActiveCharacterRequest.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionGetByActiveCharacterRequest.cs deleted file mode 100644 index 473a006c4..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionGetByActiveCharacterRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts.Requests; - -[DataContract] -public record SessionGetByActiveCharacterRequest -{ - [DataMember(Order = 1)] public required int CharacterID { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionStartRequest.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionStartRequest.cs deleted file mode 100644 index 258c30572..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionStartRequest.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts.Requests; - -[DataContract] -public record SessionStartRequest -{ - [DataMember(Order = 1)] public required SessionEntry Session { get; init; } - [DataMember(Order = 2)] public required long Key { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionUpdateCharacterRequest.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionUpdateCharacterRequest.cs deleted file mode 100644 index e68efaf8f..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionUpdateCharacterRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts.Requests; - -[DataContract] -public record SessionUpdateCharacterRequest -{ - [DataMember(Order = 1)] public required int CharacterID { get; init; } - [DataMember(Order = 2)] public required int AccountID { get; init; } - [DataMember(Order = 3)] public required long Key { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionUpdateServerRequest.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionUpdateServerRequest.cs deleted file mode 100644 index f813b2e9a..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Requests/SessionUpdateServerRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts.Requests; - -[DataContract] -public record SessionUpdateServerRequest -{ - [DataMember(Order = 1)] public required int AccountID { get; init; } - [DataMember(Order = 2)] public required string ServerID { get; init; } - [DataMember(Order = 3)] public required long Key { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Responses/SessionGetOneResponse.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Responses/SessionGetOneResponse.cs deleted file mode 100644 index 0f66267f1..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Responses/SessionGetOneResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts.Responses; - -[DataContract] -public record SessionGetOneResponse -{ - [DataMember(Order = 1)] public required SessionResult Result { get; init; } - [DataMember(Order = 2)] public required SessionEntry? Session { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Responses/SessionResponse.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Responses/SessionResponse.cs deleted file mode 100644 index 93646f594..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/Responses/SessionResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts.Responses; - -[DataContract] -public record SessionResponse -{ - [DataMember(Order = 1)] public required SessionResult Result { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/SessionEntry.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/SessionEntry.cs deleted file mode 100644 index da8a00723..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/SessionEntry.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.Serialization; - -namespace Edelstein.Protocol.Services.Session.Contracts; - -[DataContract] -public record SessionEntry : ISessionEntry -{ - [DataMember] public required string ServerID { get; init; } = string.Empty; - - [DataMember] public required int ActiveAccount { get; init; } - [DataMember] public required int? ActiveCharacter { get; init; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/SessionResult.cs b/src/protocol/Edelstein.Protocol.Services.Session/Contracts/SessionResult.cs deleted file mode 100644 index 7bef84bfa..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Contracts/SessionResult.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Edelstein.Protocol.Services.Session.Contracts; - -public enum SessionResult -{ - Unknown = 0x0, - Success = 0x1, - FailedUnknown = 0x2, - FailedAlreadyStarted = 0x3, - FailedNotStarted = 0x4, - FailedNotFound = 0x5, - FailedInvalidKey = 0x6 -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/Edelstein.Protocol.Services.Session.csproj b/src/protocol/Edelstein.Protocol.Services.Session/Edelstein.Protocol.Services.Session.csproj deleted file mode 100644 index 656b60fb0..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/Edelstein.Protocol.Services.Session.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/protocol/Edelstein.Protocol.Services.Session/ISessionEntry.cs b/src/protocol/Edelstein.Protocol.Services.Session/ISessionEntry.cs deleted file mode 100644 index 2fa23d198..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/ISessionEntry.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Edelstein.Protocol.Services.Session; - -public interface ISessionEntry -{ - string ServerID { get; } - - int ActiveAccount { get; } - int? ActiveCharacter { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/ISessionService.cs b/src/protocol/Edelstein.Protocol.Services.Session/ISessionService.cs deleted file mode 100644 index adcd14f52..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/ISessionService.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ServiceModel; -using System.Threading.Tasks; -using Edelstein.Protocol.Services.Session.Contracts.Requests; -using Edelstein.Protocol.Services.Session.Contracts.Responses; -using ProtoBuf.Grpc; - -namespace Edelstein.Protocol.Services.Session; - -[ServiceContract] -public interface ISessionService -{ - [OperationContract] Task Start(SessionStartRequest request, CallContext context = default); - [OperationContract] Task End(SessionEndRequest request, CallContext context = default); - - [OperationContract] Task UpdateServer(SessionUpdateServerRequest request, CallContext context = default); - [OperationContract] Task UpdateCharacter(SessionUpdateCharacterRequest request, CallContext context = default); - - [OperationContract] Task GetByActiveAccount(SessionGetByActiveAccountRequest request, CallContext context = default); - [OperationContract] Task GetByActiveCharacter(SessionGetByActiveCharacterRequest request, CallContext context = default); -} diff --git a/src/protocol/Edelstein.Protocol.Services.Session/packages.lock.json b/src/protocol/Edelstein.Protocol.Services.Session/packages.lock.json deleted file mode 100644 index f0613d411..000000000 --- a/src/protocol/Edelstein.Protocol.Services.Session/packages.lock.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - }, - "protobuf-net.Grpc": { - "type": "Direct", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "uThFb/iUplzuXEa/cztJaNGpKLRQRb515STtQX99IS1MKh8Qsunw6MjjU+9rjo8s9UymR6lN9Ab6xT3adBlyDg==", - "dependencies": { - "Grpc.Core.Api": "2.51.0", - "protobuf-net": "2.4.8" - } - }, - "Grpc.Core.Api": { - "type": "Transitive", - "resolved": "2.51.0", - "contentHash": "WUYCnxZKfdBWCKNs08lWFRoTjESt3iyFDthsZu5KcWguZ4OnnXrTu/K5mIdO+R9dUhuw5Xm1ygUrI1e2q8d1YA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "ok+RPAtESz/9MUXeIEz6Lv5XAGQsaNmEYXMsgVALj4D7kqC8gveKWXWXbufLySR2fWrwZf8smyN5RmHu0e4BHA==" - }, - "protobuf-net": { - "type": "Transitive", - "resolved": "2.4.8", - "contentHash": "O+vbVVDxTWlFRBe5OsAmMKqqD7WQ7TPIH97Nr/Pk8gDxtNW77seiDmXfxnODuWIkm0fYW7kE5ILq8jHsgH79yg==", - "dependencies": { - "System.ServiceModel.Primitives": "4.5.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Private.ServiceModel": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "ancrQgJagx+yC4SZbuE+eShiEAUIF0E1d21TRSoy1C/rTwafAVcBr/fKibkq5TQzyy9uNil2tx2/iaUxsy0S9g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.1.0", - "System.Reflection.DispatchProxy": "4.5.0", - "System.Security.Principal.Windows": "4.5.0" - } - }, - "System.Reflection.DispatchProxy": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "+UW1hq11TNSeb+16rIk8hRQ02o339NFyzMc4ma/FqmxBzM30l1c2IherBB4ld1MNcenS48fz8tbt50OW4rVULA==" - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "2.0.0" - } - }, - "System.ServiceModel.Primitives": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "Wc9Hgg4Cmqi416zvEgq2sW1YYCGuhwWzspDclJWlFZqY6EGhFUPZU+kVpl5z9kAgrSOQP7/Uiik+PtSQtmq+5A==", - "dependencies": { - "System.Private.ServiceModel": "4.5.3" - } - } - } - } -} \ No newline at end of file diff --git a/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacket.cs b/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacket.cs deleted file mode 100644 index 33bd79abd..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacket.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Edelstein.Protocol.Utilities.Buffers; - -public interface IPacket : IDisposable -{ - int Length { get; } - byte[] Buffer { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacketReader.cs b/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacketReader.cs deleted file mode 100644 index 3554d1aa0..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacketReader.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace Edelstein.Protocol.Utilities.Buffers; - -public interface IPacketReader : IDisposable -{ - long Cursor { get; } - long Available { get; } - - byte ReadByte(); - bool ReadBool(); - - short ReadShort(); - ushort ReadUShort(); - - int ReadInt(); - uint ReadUInt(); - - long ReadLong(); - ulong ReadULong(); - - double ReadDouble(); - - string ReadString(short? length = null); - byte[] ReadBytes(short length); - - IPacketReader Skip(short length); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacketWriter.cs b/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacketWriter.cs deleted file mode 100644 index 29125867d..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Buffers/IPacketWriter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Edelstein.Protocol.Utilities.Buffers; - -public interface IPacketWriter : IDisposable -{ - long Length { get; } - - IPacketWriter WriteByte(byte value); - IPacketWriter WriteBool(bool value); - - IPacketWriter WriteShort(short value); - IPacketWriter WriteUShort(ushort value); - - IPacketWriter WriteInt(int value); - IPacketWriter WriteUInt(uint value); - - IPacketWriter WriteLong(long value); - IPacketWriter WriteULong(ulong value); - - IPacketWriter WriteDouble(double value); - - IPacketWriter WriteString(string value, short? length = null); - IPacketWriter WriteBytes(byte[] value); - - IPacket Build(); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Edelstein.Protocol.Utilities.csproj b/src/protocol/Edelstein.Protocol.Utilities/Edelstein.Protocol.Utilities.csproj deleted file mode 100644 index 3ee2a5794..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Edelstein.Protocol.Utilities.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipeline.cs b/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipeline.cs deleted file mode 100644 index ba800f749..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipeline.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Utilities.Pipelines; - -public interface IPipeline -{ - void Add(int priority, IPipelinePlug plug); - void Add(IPipelinePlug plug); - void Remove(IPipelinePlug plug); - - Task Process(TMessage message); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipelineContext.cs b/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipelineContext.cs deleted file mode 100644 index 88e45d10e..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipelineContext.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Edelstein.Protocol.Utilities.Pipelines; - -public interface IPipelineContext -{ - bool IsRequestedCancellation { get; } - - void Cancel(); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipelinePlug.cs b/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipelinePlug.cs deleted file mode 100644 index 8cf541d50..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Pipelines/IPipelinePlug.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Utilities.Pipelines; - -public interface IPipelinePlug -{ - Task Handle(IPipelineContext ctx, TMessage message); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Pipelines/PipelinePriority.cs b/src/protocol/Edelstein.Protocol.Utilities/Pipelines/PipelinePriority.cs deleted file mode 100644 index 58b14130b..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Pipelines/PipelinePriority.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Edelstein.Protocol.Utilities.Pipelines; - -public static class PipelinePriority -{ - public const int Highest = 0x10; - public const int High = 0x20; - public const int Normal = 0x30; - public const int Low = 0x40; - public const int Lowest = 0x50; - - public const int Reserved = 0x100; - - public const int PostHighest = 0x150; - public const int PostHigh = 0x160; - public const int PostNormal = 0x170; - public const int PostLow = 0x180; - public const int PostLowest = 0x190; -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/IQueriedRepository.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/IQueriedRepository.cs deleted file mode 100644 index cc0dd877d..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/IQueriedRepository.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Edelstein.Protocol.Utilities.Repositories.Methods; - -namespace Edelstein.Protocol.Utilities.Repositories; - -public interface IQueriedRepository : - IRepositoryMethodRetrieve, - IRepositoryMethodInsert, - IRepositoryMethodUpdate, - IRepositoryMethodDelete - where TKey : notnull - where TEntry : IRepositoryEntry; diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/IReadOnlyRepository.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/IReadOnlyRepository.cs deleted file mode 100644 index 0b6190171..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/IReadOnlyRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Edelstein.Protocol.Utilities.Repositories.Methods; - -namespace Edelstein.Protocol.Utilities.Repositories; - -public interface IReadOnlyRepository : - IRepositoryMethodRetrieve, - IRepositoryMethodRetrieveAll - where TKey : notnull - where TEntry : IRepositoryEntry; diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/IRepository.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/IRepository.cs deleted file mode 100644 index acc013c16..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/IRepository.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Edelstein.Protocol.Utilities.Repositories.Methods; - -namespace Edelstein.Protocol.Utilities.Repositories; - -public interface IRepository : - IReadOnlyRepository, - IRepositoryMethodInsert, - IRepositoryMethodUpdate, - IRepositoryMethodDelete - where TKey : notnull - where TEntry : IRepositoryEntry; diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/IRepositoryEntry.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/IRepositoryEntry.cs deleted file mode 100644 index 791ccc0e1..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/IRepositoryEntry.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Edelstein.Protocol.Utilities.Repositories; - -public interface IRepositoryEntry -{ - T ID { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodDelete.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodDelete.cs deleted file mode 100644 index dd2e93c27..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodDelete.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Utilities.Repositories.Methods; - -public interface IRepositoryMethodDelete - where TKey : notnull - where TEntry : IRepositoryEntry -{ - Task Delete(TKey key); - Task Delete(TEntry entry); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodInsert.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodInsert.cs deleted file mode 100644 index 7183e967a..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodInsert.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Utilities.Repositories.Methods; - -public interface IRepositoryMethodInsert - where TKey : notnull - where TEntry : IRepositoryEntry -{ - Task Insert(TEntry entry); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodRetrieve.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodRetrieve.cs deleted file mode 100644 index 298e117cb..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodRetrieve.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Utilities.Repositories.Methods; - -public interface IRepositoryMethodRetrieve - where TKey : notnull - where TEntry : IRepositoryEntry -{ - Task Retrieve(TKey key); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodRetrieveAll.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodRetrieveAll.cs deleted file mode 100644 index 84585971c..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodRetrieveAll.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Utilities.Repositories.Methods; - -public interface IRepositoryMethodRetrieveAll - where TKey : notnull - where TEntry : IRepositoryEntry -{ - Task> RetrieveAll(); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodUpdate.cs b/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodUpdate.cs deleted file mode 100644 index 55dbe7c33..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Repositories/Methods/IRepositoryMethodUpdate.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; - -namespace Edelstein.Protocol.Utilities.Repositories.Methods; - -public interface IRepositoryMethodUpdate - where TKey : notnull - where TEntry : IRepositoryEntry -{ - Task Update(TEntry entry); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplate.cs b/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplate.cs deleted file mode 100644 index c2bda69a2..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplate.cs +++ /dev/null @@ -1,5 +0,0 @@ -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Protocol.Utilities.Templates; - -public interface ITemplate : IRepositoryEntry; diff --git a/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateCollection.cs b/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateCollection.cs deleted file mode 100644 index df9674448..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateCollection.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Edelstein.Protocol.Utilities.Repositories.Methods; - -namespace Edelstein.Protocol.Utilities.Templates; - -public interface ITemplateCollection : - IRepositoryMethodRetrieve, - IRepositoryMethodRetrieveAll - where TTemplate : ITemplate -{ - int Count { get; } -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateCollectionProvider.cs b/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateCollectionProvider.cs deleted file mode 100644 index 32b094d41..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateCollectionProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Threading.Tasks; -using Edelstein.Protocol.Utilities.Repositories; - -namespace Edelstein.Protocol.Utilities.Templates; - -public interface ITemplateCollectionProvider : - IRepositoryEntry - where TTemplate : ITemplate -{ - Task Provide(); -} diff --git a/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateManager.cs b/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateManager.cs deleted file mode 100644 index 37876e036..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/Templates/ITemplateManager.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Edelstein.Protocol.Utilities.Repositories.Methods; - -namespace Edelstein.Protocol.Utilities.Templates; - -public interface ITemplateManager : - ITemplateCollection, - IRepositoryMethodInsert> - where TTemplate : ITemplate; diff --git a/src/protocol/Edelstein.Protocol.Utilities/packages.lock.json b/src/protocol/Edelstein.Protocol.Utilities/packages.lock.json deleted file mode 100644 index b21ae068c..000000000 --- a/src/protocol/Edelstein.Protocol.Utilities/packages.lock.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net9.0": { - "MinVer": { - "type": "Direct", - "requested": "[5.0.0, )", - "resolved": "5.0.0", - "contentHash": "ybkgpQMtt0Fo91l5rYtE3TZtD+Nmy5Ko091xvfXXOosQdMi30XO2EZ2+ShZt89gdu7RMmJqZaJ+e1q6d+6+KNw==" - } - } - } -} \ No newline at end of file