|
@@ -810,13 +810,22 @@ namespace CommonAI.Zone.Instance
|
|
|
/// <param name="add">输出事件</param>
|
|
|
/// <param name="summoner">召唤者</param>
|
|
|
/// <returns></returns>
|
|
|
+ ///
|
|
|
+
|
|
|
+ private long mAddUnitPrintTime = 0;
|
|
|
+
|
|
|
public InstanceUnit AddUnit(UnitInfo info, string name, int force, int level, float x, float y, float direction,
|
|
|
out AddUnitEvent add, InstanceUnit summoner = null, String clientShowName = "", int gsFlag = 0, int alliesForce = 0, bool pointLv = false)
|
|
|
{
|
|
|
add = null;
|
|
|
if (mObjects.UnitsCount >= mMaxUnitCount)
|
|
|
{
|
|
|
- log.Warn(string.Format("--Zone AddUnit to max: {0}, UUID: {1}, ID: {2} 单位数量:{3}", this.GetSceneID(), this.UUID, info.TemplateID, mObjects.UnitsCount));
|
|
|
+ if(mAddUnitPrintTime < CommonLang.CUtils.localTimeMS)
|
|
|
+ {
|
|
|
+ mAddUnitPrintTime = CommonLang.CUtils.localTimeMS + 3000;
|
|
|
+ log.Warn(string.Format("--Zone AddUnit to max: {0}, UUID: {1}, ID: {2} 单位数量:{3}", this.GetSceneID(), this.UUID, info.TemplateID, GetZoneUnitInfo()));
|
|
|
+ }
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -884,6 +893,30 @@ namespace CommonAI.Zone.Instance
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /** 获取场景单位异常信息 */
|
|
|
+ private string GetZoneUnitInfo(int nMinNums = 50)
|
|
|
+ {
|
|
|
+ HashMap<int, int> mInfo = new HashMap<int, int>();
|
|
|
+ foreach (InstanceUnit obj in mObjects.Units)
|
|
|
+ {
|
|
|
+ mInfo.Put(obj.Info.ID, mInfo.Get(obj.Info.ID) + 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ string finalStr = "";
|
|
|
+ foreach(int unitID in mInfo.Keys)
|
|
|
+ {
|
|
|
+ int count = mInfo.Get(unitID);
|
|
|
+ if (count < nMinNums)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ finalStr = finalStr + (unitID) + "-" + count + ", ";
|
|
|
+ }
|
|
|
+
|
|
|
+ return finalStr;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public InstanceItem AddItem(ItemTemplate template, string name, float x, float y, float direction, int force, string disPlayName,
|
|
|
out AddItemEvent add, InstanceUnit creater,int from)
|
|
|
{
|