Beispiel #1
0
        protected async ETVoid RunAsync(Session session, DBSaveBatchRequest message, Action <DBSaveBatchResponse> reply)
        {
            DBSaveBatchResponse response = new DBSaveBatchResponse();

            try
            {
                DBComponent dbComponent = Game.Scene.GetComponent <DBComponent>();

                if (string.IsNullOrEmpty(message.CollectionName))
                {
                    // myDebugInfo(session, message);//[MyAppend]
                    if (message.Components != null) //[MyAppend]
                    {                               //[MyAppend]
                        message.CollectionName = message.Components[0].GetType().Name;
                    }//[MyAppend]
                }

                await dbComponent.AddBatch(message.Components, message.CollectionName);

                reply(response);
            }
            catch (Exception e)
            {
                ReplyError(response, e, reply);
            }
        }
Beispiel #2
0
        protected override async ETTask Run(Session session, DBSaveBatchRequest request, DBSaveBatchResponse response, Action reply)
        {
            DBComponent dbComponent = Game.Scene.GetComponent <DBComponent>();

            if (string.IsNullOrEmpty(request.CollectionName))
            {
                request.CollectionName = request.Components[0].GetType().Name;
            }
            await dbComponent.AddBatch(request.Components, request.CollectionName);

            reply();
        }