Esempio n. 1
0
        protected async ETVoid RunAsync(Session session, DBSaveRequest message, Action <DBSaveResponse> reply)
        {
            DBSaveResponse response = new DBSaveResponse();

            try
            {
                DBComponent dbComponent = Game.Scene.GetComponent <DBComponent>();
                if (string.IsNullOrEmpty(message.CollectionName))
                {
                    // myDebugInfo(session, message);//[MyAppend]
                    if (message.Component != null) //[MyAppend]
                    {                              //[MyAppend]
                        message.CollectionName = message.Component.GetType().Name;
                    }//[MyAppend]
                }

                await dbComponent.Add(message.Component, message.CollectionName);

                reply(response);
            }
            catch (Exception e)
            {
                ReplyError(response, e, reply);
            }
        }
        protected override async ETTask Run(Session session, DBSaveRequest request, DBSaveResponse response, Action reply)
        {
            DBComponent dbComponent = Game.Scene.GetComponent <DBComponent>();

            if (string.IsNullOrEmpty(request.CollectionName))
            {
                request.CollectionName = request.Component.GetType().Name;
            }

            await dbComponent.Add(request.Component, request.CollectionName);

            reply();
        }