コード例 #1
0
        private void SendData(ScavengerServiceMessageType messageType, Guid scavengerId, Action <BinaryWriter> writeData = null)
        {
            var message = new MessageWrapper(ClientType.Scavenger, (int)messageType, scavengerId);

            _clientTerminal.SendMessage(message.WriteBuffer(writeData));
        }
コード例 #2
0
 public void AddScavengerHandler <T>(ScavengerServiceMessageType messageType, Func <BinaryReader, T> messageReader, Func <IScavengerService, MessageWrapper, T, Task> messageHandler) where T : class
 {
     _messageReaders[ClientType.Scavenger].Add((int)messageType, messageReader);
     _scavengerHandlers.Add((int)messageType, (service, message) => messageHandler(service, message, message.GetData <T>()));
 }