async Task IGangMember.HandleAsync( GangMessageTypes type, byte[] data, GangAudit audit) { switch (type) { case GangMessageTypes.Connect: await OnMemberConnectAsync(audit); break; case GangMessageTypes.Disconnect: await OnMemberDisconnectAsync(audit); break; case GangMessageTypes.Command: await OnCommandAsync(data, audit); await Controller.SendAsync( GangMessageTypes.Receipt, BitConverter.GetBytes(audit.Version.Value), new[] { audit.MemberId } ); break; } }
protected virtual Task OnCommandAsync(byte[] bytes, GangAudit audit) { return(Task.CompletedTask); }
protected virtual Task OnMemberDisconnectAsync(GangAudit audit) { return(Task.CompletedTask); }