Exemple #1
0
        private async Task OnRecv_Custom(NList msg)
        {
            int   custom_msg = msg.Get <int>(0);
            NList args       = msg.GetRange(1, msg.Count - 1);

            await NModule.CallbackCustom(_RoleNode, _RoleId, custom_msg, args);
        }
Exemple #2
0
        public async Task Custom(Nuid id, int custom, NList msg)
        {
            Entity entity = EntityManager.Get(id);

            if (entity != null)
            {
                await NModule.CallbackCustom(this, id, custom, msg);

                await SyncManager.Callback(SyncType.Custom, this, id, NList.New().Add(custom).Append(msg));
            }
            else
            {
                if (id.Origin == Identity)
                {
                    return;
                }

                INode node = GrainFactory.GetGrain <INode>(id.Origin);

                if (await node.IsActive())
                {
                    await node.Custom(id, custom, msg);
                }
            }
        }