internal bool SyncMembersCore(Guid managerId, EnumArenaType arenaType, DTOBuffMemberView buffData, string siteId = "") { try { if (null == buffData) { return(false); } if (string.IsNullOrEmpty(siteId)) { int managerHash = ShareUtil.GetTableMod(managerId); //var idles = GetIdleMembers(managerId, buffData); string mSkills = FrameConvert.SkillListToText(buffData.ManagerSkills); int errorCode = 0; byte[] rowVer = BitConverter.GetBytes(buffData.UseSyncVersion); NbManagerbuffmemberMgr.SyncBatch(managerId, buffData.Kpi, string.Empty, mSkills, rowVer, ref rowVer, ref errorCode); if (errorCode != 0) { return(false); } buffData.UseSyncVersion = BitConverter.ToUInt64(rowVer, 0); } buffData.SyncIdleFlag = false; s_memBuffMember.Set(arenaType.ToString() + managerId.ToString(), buffData); return(true); } catch (Exception ex) { SystemlogMgr.Error(string.Format("BuffDataCore:Sync Manager[{0}]", managerId), ex); return(false); } }
/// <summary> /// 请求同步球员Buff /// </summary> /// <param name="managerId">经理Id</param> public void SetMembers(Guid managerId, EnumArenaType arenaType, bool memFlag) { if (memFlag) { s_memBuffMember.Delete(arenaType.ToString() + managerId.ToString()); } else { s_buffSync.SetBuffMembers(managerId, arenaType); } }
public static int DeleteTeammemberAndSolutionCache(Guid managerId, EnumArenaType arenaType, bool isUpdateKpi = true) { try { MemcachedFactory.ArenaTeammembersClient.Delete(arenaType.ToString() + managerId.ToString()); MemcachedFactory.ArenaSolutionClient.Delete(arenaType.ToString() + managerId.ToString()); if (isUpdateKpi) { return(KpiHandler.Instance.RebuildKpi(managerId, (int)arenaType)); } return(-1); } catch (Exception ex) { return(-1); } }
internal bool SetMembersCore(Guid managerId, EnumArenaType arenaType) { try { int errorCode = 0; NbManagerbuffmemberMgr.SyncSend(managerId, null, ref errorCode); if (errorCode != 0) { throw new Exception(string.Format("Manager[{0}] FailCode[{1}]", managerId, errorCode)); } return(true); } catch (Exception ex) { s_memBuffMember.Delete(arenaType.ToString() + managerId.ToString()); SystemlogMgr.Error("BuffDataCore:SyncSend", ex); return(false); } }
/// <summary> /// 创建对象 /// </summary> /// <param name="managerId"></param> /// <param name="arenaType"></param> /// <param name="zoneName"></param> public ArenaTeammemberFrame(Guid managerId, EnumArenaType arenaType, string zoneName = "") { var teammpmberInfo = ArenaTeammemberMgr.GetByManagerId(managerId, (int)arenaType, zoneName); _zoneId = zoneName; if (teammpmberInfo == null) { teammpmberInfo = new ArenaTeammemberEntity(); teammpmberInfo.ManagerId = managerId; teammpmberInfo.ArenaType = (int)arenaType; teammpmberInfo.SkillString = ",,,,,,"; teammpmberInfo.TeammemberString = new byte[0]; teammpmberInfo.RowTime = DateTime.Now; isInsert = true; } _arenaTeammemberEntity = teammpmberInfo; Analyse(); ArenaType = arenaType; ManagerId = managerId; ZoneName = zoneName; }
public void SyncBuffMembers(Guid managerId, EnumArenaType arenaType, DTOBuffMemberView buffData, string siteId = "") { s_tpBuffMember.Add(() => ArenaBuffDataCore.Instance().SyncMembersCore(managerId, arenaType, buffData, siteId)); }
public void SetBuffMembers(Guid managerId, EnumArenaType arenaType) { s_tpBuffMember.Add(() => ArenaBuffDataCore.Instance().SetMembersCore(managerId, arenaType)); }