Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
 protected virtual Task OnCommandAsync(byte[] bytes, GangAudit audit)
 {
     return(Task.CompletedTask);
 }
Esempio n. 3
0
 protected virtual Task OnMemberDisconnectAsync(GangAudit audit)
 {
     return(Task.CompletedTask);
 }