示例#1
0
        public override bool TakeAction()
        {
            var cache = new ShareCacheStruct <testUpdate>();
            var tu    = new testUpdate();

            tu.index  = (int)cache.GetNextNo();
            tu.itemID = 0;

            tu.ModifyLocked(() => {
                tu.itemID = 1;
            });

            tu = cache.FindKey(tu.index);

            tu        = new testUpdate();
            tu.index  = (int)cache.GetNextNo();
            tu.itemID = 100;
            cache.Add(tu);
            tu = cache.FindKey(tu.index);
            //   try
            //   {
            //       var UA = new UserAnalysis();
            //       foreach (logData d in requestPack.items)
            //       {
            //           UA.DeviceId = d.DeviceID;
            //           UA.Channel = d.Channel;
            //           UA.SimType = d.SimType;
            //           UA.ActionType = (UserAnalysis.E_ActionType)d.ActionType;
            //           UA.ProductionId = d.ProductionId;
            //           UA.ActionTime = System.DateTime.Now;
            //           //DataSyncQueueManager.SendToDb(UA);
            //           Console.WriteLine("{0}GameSession:{1}", DateTime.Now.ToString("HH:mm:ss"), GameSession.Count);
            //       }
            //       responsePack = new ResponsePack();
            //       responsePack.ActionId = 80000;
            //       responsePack.ErrorCode = 101;
            //       responsePack.ErrorInfo = "Success";
            //       return true;
            //   }
            //   catch (Exception ex)
            //   {
            //       TraceLog.WriteError("TakeAction:{0} error:{1}", actionId, ex);
            //       return false;
            //   }
            return(true);
        }
示例#2
0
        public override bool TakeAction()
        {
            var cache = new ShareCacheStruct<testUpdate>();
            var tu = new testUpdate();
            tu.index = (int)cache.GetNextNo();
            tu.itemID = 0;

            tu.ModifyLocked(() => {
                tu.itemID = 1;
            });

            tu = cache.FindKey(tu.index);

            tu = new testUpdate();
            tu.index = (int)cache.GetNextNo();
            tu.itemID = 100;
            cache.Add(tu);
            tu = cache.FindKey(tu.index);
            //   try
            //   {
            //       var UA = new UserAnalysis();
            //       foreach (logData d in requestPack.items)
            //       {
            //           UA.DeviceId = d.DeviceID;
            //           UA.Channel = d.Channel;
            //           UA.SimType = d.SimType;
            //           UA.ActionType = (UserAnalysis.E_ActionType)d.ActionType;
            //           UA.ProductionId = d.ProductionId;
            //           UA.ActionTime = System.DateTime.Now;
            //           //DataSyncQueueManager.SendToDb(UA);
            //           Console.WriteLine("{0}GameSession:{1}", DateTime.Now.ToString("HH:mm:ss"), GameSession.Count);
            //       }
            //       responsePack = new ResponsePack();
            //       responsePack.ActionId = 80000;
            //       responsePack.ErrorCode = 101;
            //       responsePack.ErrorInfo = "Success";
            //       return true;
            //   }
            //   catch (Exception ex)
            //   {
            //       TraceLog.WriteError("TakeAction:{0} error:{1}", actionId, ex);
            //       return false;
            //   }
            return true;
        }