示例#1
0
        static bool  addHappyDataMap(HappyModeData hmd, int newId)
        {
            var    happMapCache = new PersonalCacheStruct <The3rdUserIDMap>();
            var    map          = happMapCache.FindKey("888");
            string type         = "YYS_CP360";
            uint   id           = utils.KeyInt2Uint(hmd.the3rdUserId);
            int    mapID        = newId;

            if (hmd.the3rdUserId > 0)
            {
                mapID = hmd.the3rdUserId;
            }
            string mapKey = Action1005.getMapKey(type, id.ToString());

            if (map.the3rdMap.ContainsKey(mapKey))
            {
                return(false);
            }
            map.ModifyLocked(() => {
                map.the3rdMap.Add(mapKey, mapID);
            });
            if (hmd.the3rdUserId > 0)
            {
                return(false);
            }
            return(true);
        }
示例#2
0
        bool ProcessHMD(string orderId, bool bSuccess, string jrRet)
        {
            // hmd
            var           hmdCache = new PersonalCacheStruct <HappyModeData>();
            int           keyid    = Action1005.getHappyIndex("YYS_BaiDu", app_uid);
            HappyModeData hmd      = hmdCache.FindKey(keyid.ToString());

            if (null == hmd)
            {
                // errorcode
                ConsoleLog.showErrorInfo(0, "PayLog ProcessHMD hmd is null");
                TraceLog.WriteError("PayLog ProcessHMD hmd is null");
                return(false);
            }
            else
            {
                if (false == hmd.PayInfoDic.ContainsKey(server_orderid))
                {
                    // errorcode
                    ConsoleLog.showErrorInfo(0, "PayLog ProcessHMD server_orderid not find :" + server_orderid + "/nbaidu orderID" + order_id);
                    TraceLog.WriteError("PayLog ProcessHMD server_orderid not find :" + server_orderid + "baidu orderID" + order_id);
                    return(false);
                }
                else
                {
                    hmd.PayInfoDic[server_orderid].userParms     = urlParams;
                    hmd.PayInfoDic[server_orderid].the3rdOrderId = order_id;
                }
            }

            PayOrderPersion payDataPersion  = hmd.PayInfoDic[server_orderid];
            bool            hasGetPayReward = false;

            if (false == payDataPersion.process)
            {
                if (bSuccess)
                {
                    hasGetPayReward = addProductOnServer(payDataPersion, hmd);
                }
                hmd.PayInfoDic.ModifyLocked(() =>
                {
                    payDataPersion.state           = bSuccess ? PayOrderPersion.PayStatus.paySuccess : PayOrderPersion.PayStatus.payFailed;
                    payDataPersion.process         = true;
                    payDataPersion.typeUser        = "******";
                    payDataPersion.jrRet           = jrRet;
                    payDataPersion.hasGetPayReward = hasGetPayReward;
                });
            }
            return(hasGetPayReward);
        }
示例#3
0
        void doAdd_RemoveMap(string parm)
        {
            string[] strs     = parm.Split(',');
            string   opt      = strs[0];
            string   type     = strs[1];
            string   the3rdID = strs[2];
            string   key      = Action1005.getMapKey(type, the3rdID);

            var cache = new PersonalCacheStruct <The3rdUserIDMap>();
            var Da    = cache.FindKey("888");

            if (opt == "del")
            {
                if (Da.the3rdMap.ContainsKey(key))
                {
                    Da.the3rdMap.Remove(key);
                    ConsoleLog.showErrorInfo(0, "del map key:" + key);
                }
                else
                {
                    ConsoleLog.showErrorInfo(0, "del not find map key:" + key);
                }
            }
            else if (opt == "add")
            {
                if (Da.the3rdMap.ContainsKey(key))
                {
                    ConsoleLog.showErrorInfo(0, "add map key had find:" + key);
                }
                else
                {
                    int happyID = int.Parse(strs[3]);
                    Da.the3rdMap.Add(key, happyID);
                    ConsoleLog.showErrorInfo(0, "add map key add :" + key);
                }
            }
            else if (opt == "addNew")
            {
                if (Da.the3rdMap.ContainsKey(key))
                {
                    ConsoleLog.showErrorInfo(0, "addNew map key had find:" + key);
                }
                else
                {
                    int happyID = Action1005.getHappyIndex(type, the3rdID);
                    Da.the3rdMap.Add(key, happyID);
                    ConsoleLog.showErrorInfo(0, "addNew map key add :" + key + ":" + the3rdID);
                }
            }
        }
示例#4
0
        void doAdd_reCreateHappy(string parm)
        {
            var cache = new PersonalCacheStruct <HappyModeData>();

            cache.LoadFrom(null);

            var mapCache = new PersonalCacheStruct <The3rdUserIDMap>();
            var mapData  = mapCache.FindKey("888");

            if (null == mapData)
            {
                mapData       = new The3rdUserIDMap();
                mapData.Index = 888;
                mapCache.Add(mapData);
            }
            string mapKey = "";

            cache.Foreach((string a, string b, HappyModeData hmd) => {
                mapKey = Action1005.getMapKey(parm, hmd.the3rdUserId.ToString());
                mapData.the3rdMap.Add(mapKey, hmd.the3rdUserId);
                return(true);
            });
        }
示例#5
0
        void doAdd_PayUserInfo(string parm)
        {
            string[]      parmSS   = parm.Split(',');
            uint          the3rdID = uint.Parse(parmSS[0]);
            var           cache    = new PersonalCacheStruct <PayUserInfoEx>();
            PayUserInfoEx pui      = cache.FindKey(the3rdID.ToString());

            if (null == pui)
            {
                pui               = new PayUserInfoEx();
                pui.the3rdUsrID   = the3rdID;
                pui.UserId        = int.Parse(parmSS[1]);
                pui.identify      = the3rdID.ToString();
                pui.the3rdUsrName = parmSS[2];
                pui.typeUser      = parmSS[3];
                Action1005.returnJson rj = new Action1005.returnJson();
                rj.id   = the3rdID.ToString();
                rj.name = pui.the3rdUsrName;
                int id = Action1005.getHappyIndex(pui.typeUser, the3rdID.ToString());
                pui.the3rdUsrID = (uint)id;
                pui.InfoExt     = JsonHelper.GetJson <Action1005.returnJson>(rj);
                cache.Add(pui);
            }
        }