/// <summary> /// 获得渠道玩家数据 /// </summary> /// <param name="openId"></param> /// <returns></returns> public A8csdkStartgameEntity GetStartgameEntity(string openId) { if (_a8CsdkStartgameEntities.ContainsKey(openId)) { return(_a8CsdkStartgameEntities[openId]); } return(A8csdkStartgameMgr.GetById(openId)); }
/// <summary> /// 储存渠道玩家数据 /// </summary> /// <param name="openId"></param> /// <param name="state"></param> /// <param name="serverId"></param> /// <param name="pf"></param> /// <param name="sessionId"></param> /// <param name="jsNeed"></param> /// <param name="nickName"></param> /// <returns></returns> public bool SetStartGameEntity(string openId, string state, string serverId, string pf, string sessionId, string jsNeed = "", string nickName = "", string common = "") { var info = A8csdkStartgameMgr.GetById(openId); bool isInsert = false; if (info == null) { isInsert = true; info = new A8csdkStartgameEntity(); info.OpenId = openId; } info.State = state; info.ServerId = serverId; info.Pf = pf; info.SessionId = sessionId; info.JsNeed = jsNeed; info.NickName = nickName; info.Common = common; if (_a8CsdkStartgameEntities.ContainsKey(openId)) { _a8CsdkStartgameEntities[openId] = info; } else { _a8CsdkStartgameEntities.Add(openId, info); } UserLoginCore.Instance.SetUserLogin(openId, pf, serverId); if (isInsert) { return(A8csdkStartgameMgr.Insert(info)); } else { return(A8csdkStartgameMgr.Update(info)); } }