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); }
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); } } }
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); } }