/// <inheritdoc /> protected override IManagedNetworkClient <GamePacketPayload, GamePacketPayload> BuildOutgoingSessionManagedClient(NetworkClientBase clientBase, INetworkSerializationService serializeService) { SRP6SessionKeyStore keyStore = ServiceContainer.Resolve <SRP6SessionKeyStore>(); ICombinedSessionPacketCryptoService cryptoService = BuildOutgoingPacketCryptoService(keyStore); var wowClientReadServerWrite = new WoWClientWriteServerReadProxyPacketPayloadReaderWriterDecorator <NetworkClientBase, GamePacketPayload, GamePacketPayload, IGamePacketPayload>(clientBase, serializeService, cryptoService); return(new ManagedNetworkServerClient <WoWClientWriteServerReadProxyPacketPayloadReaderWriterDecorator <NetworkClientBase, GamePacketPayload, GamePacketPayload, IGamePacketPayload>, GamePacketPayload, GamePacketPayload>(wowClientReadServerWrite, Logger)); }
/// <inheritdoc /> protected override IManagedNetworkServerClient <GamePacketPayload, GamePacketPayload> BuildIncomingSessionManagedClient(NetworkClientBase clientBase, INetworkSerializationService serializeService) { //TODO: Are any details actually valuable here? if (Logger.IsInfoEnabled) { Logger.Info($"Client connected to proxy."); } SRP6SessionKeyStore keyStore = ServiceContainer.Resolve <SRP6SessionKeyStore>(); ICombinedSessionPacketCryptoService cryptoService = BuildIncomingPacketCryptoService(keyStore); var wowClientReadServerWrite = new WoWClientReadServerWriteProxyPacketPayloadReaderWriterDecorator <NetworkClientBase, GamePacketPayload, GamePacketPayload, IGamePacketPayload>(clientBase, serializeService, cryptoService, Logger); return(new ManagedNetworkServerClient <WoWClientReadServerWriteProxyPacketPayloadReaderWriterDecorator <NetworkClientBase, GamePacketPayload, GamePacketPayload, IGamePacketPayload>, GamePacketPayload, GamePacketPayload>(wowClientReadServerWrite, Logger)); }
public WoWClientWriteServerReadProxyPacketPayloadReaderWriterDecorator(TClientType decoratedClient, INetworkSerializationService serializer, ICombinedSessionPacketCryptoService cryptoService, int payloadBufferSize = 30000) { if (decoratedClient == null) { throw new ArgumentNullException(nameof(decoratedClient)); } if (serializer == null) { throw new ArgumentNullException(nameof(serializer)); } if (payloadBufferSize <= 0) { throw new ArgumentOutOfRangeException(nameof(payloadBufferSize)); } DecoratedClient = decoratedClient; Serializer = serializer; CryptoService = cryptoService; //One of the lobby packets is 14,000 bytes. We may even need bigger. PacketPayloadReadBuffer = new byte[payloadBufferSize]; //TODO: Do we need a larger buffer for any packets? }
/// <inheritdoc /> public VanillaWoWClientReadServerWriteProxyPacketPayloadReaderWriterDecorator(TClientType decoratedClient, INetworkSerializationService serializer, ICombinedSessionPacketCryptoService cryptoService, int payloadBufferSize = 30000) : base(decoratedClient, serializer, cryptoService, payloadBufferSize) { }