/// <summary> /// 添加副本 /// </summary> /// <param name="client"></param> /// <param name="copyMap"></param> /// <param name="sceneType"></param> public void AddCopyScenes(GameClient client, CopyMap copyMap, SceneUIClasses sceneType) { if (sceneType != SceneUIClasses.CoupleArena) { return; } int fuBenSeqId = copyMap.FuBenSeqID; int mapCode = copyMap.MapCode; lock (Mutex) { CoupleArenaCopyScene scene = null; if (!this.FuBenSeq2CopyScenes.TryGetValue(fuBenSeqId, out scene)) { scene = new CoupleArenaCopyScene(); scene.GameId = (int)Global.GetClientKuaFuServerLoginData(client).GameId; scene.FuBenSeq = fuBenSeqId; scene.MapCode = mapCode; scene.CopyMap = copyMap; FuBenSeq2CopyScenes[fuBenSeqId] = scene; } scene.EnterRoleSide[client.ClientData.RoleID] = client.ClientData.BattleWhichSide; copyMap.IsKuaFuCopy = true; copyMap.SetRemoveTicks(TimeUtil.NOW() + (WarCfg.WaitSec + WarCfg.FightSec + WarCfg.ClearSec + 120) * TimeUtil.SECOND); GlobalNew.UpdateKuaFuRoleDayLogData(client.ServerId, client.ClientData.RoleID, TimeUtil.NowDateTime(), client.ClientData.ZoneID, 0, 1, 0, 0, (int)GameTypes.CoupleArena); } }
public void Write(GenericStructure gs) { gs["ID"] = ID.ToString(); gs["Name"] = Name; gs["Specification"] = Specification; gs["EngineID"] = Engine.ToString(); gs["DontRedirectOutput"] = DontRedirectOutput.ToString(); gs["Path"] = Path; gs["Bsp"] = Bsp; gs["Csg"] = Csg; gs["Vis"] = Vis; gs["Rad"] = Rad; gs["IncludePathInEnvironment"] = IncludePathInEnvironment.ToString(); gs["WorkingDirectory"] = WorkingDirectory.ToString(); gs["AfterCopyBsp"] = AfterCopyBsp.ToString(); gs["AfterRunGame"] = AfterRunGame.ToString(); gs["AfterAskBeforeRun"] = AfterAskBeforeRun.ToString(); gs["CopyBsp"] = CopyBsp.ToString(); gs["CopyRes"] = CopyRes.ToString(); gs["CopyLin"] = CopyLin.ToString(); gs["CopyMap"] = CopyMap.ToString(); gs["CopyPts"] = CopyPts.ToString(); gs["CopyLog"] = CopyLog.ToString(); gs["CopyErr"] = CopyErr.ToString(); foreach (var bp in Profiles) { var prof = new GenericStructure("Profile"); bp.Write(prof); gs.Children.Add(prof); } }
public void AddCopyScene(GameClient client, CopyMap copyMap, SceneUIClasses sceneType) { if (copyMap.MapCode == this.MapCode) { int fuBenSeqId = copyMap.FuBenSeqID; int mapCode = copyMap.MapCode; lock (this.copyDict) { MoRiJudgeCopy copy = null; if (!this.copyDict.TryGetValue(fuBenSeqId, out copy)) { copy = new MoRiJudgeCopy(); copy.MyCopyMap = copyMap; copy.GameId = Global.GetClientKuaFuServerLoginData(client).GameId; copy.StateTimeData.GameType = 3; copy.StartTime = TimeUtil.NowDateTime(); copy.EndTime = copy.StartTime.AddMinutes((double)this.CopyMaxAliveMinutes); copy.LimitKillCount = 0; copy.RoleCount = 1; copy.Passed = false; this.copyDict[fuBenSeqId] = copy; } else { copy.RoleCount++; } } FuBenManager.AddFuBenSeqID(client.ClientData.RoleID, copyMap.FuBenSeqID, 0, copyMap.FubenMapID); copyMap.IsKuaFuCopy = true; copyMap.SetRemoveTicks(TimeUtil.NOW() + (long)((this.CopyMaxAliveMinutes + 3) * 60000)); GlobalNew.UpdateKuaFuRoleDayLogData(client.ServerId, client.ClientData.RoleID, TimeUtil.NowDateTime(), client.ClientData.ZoneID, 0, 1, 0, 0, 3); } }
public static void SaveAs(this Assembly assembly, Stream output) { ModuleBuilder modB = new ModuleBuilder(assembly.GetName()); AssemblyCopier copier = new AssemblyCopier(assembly, TargetFramework.SameAsSource); CopyMap map = copier.CopyTo(modB); new AssemblyBuilder(modB, map.EntryPoint).Save(output, new SaveOptions() { AssemblyAttributes = copier.CopyCustomAttributes(assembly.CustomAttributes) }); }
public static void SendMsgToClientForWanMoTaCopyMapAward(GameClient client, CopyMap copyMap, bool anyAlive) { if (copyMap != null) { int fuBenSeqID = FuBenManager.FindFuBenSeqIDByRoleID(client.ClientData.RoleID); FuBenTongGuanData fubenTongGuanData = null; bool bFirstPassWanMoTa = false; if (fuBenSeqID > 0) { FuBenInfoItem fuBenInfoItem = FuBenManager.FindFuBenInfoBySeqID(fuBenSeqID); if (null != fuBenInfoItem) { fuBenInfoItem.EndTicks = TimeUtil.NOW(); int addFuBenNum = 1; if (fuBenInfoItem.nDayOfYear != TimeUtil.NowDateTime().DayOfYear) { addFuBenNum = 0; } int fuBenID = FuBenManager.FindFuBenIDByMapCode(client.ClientData.MapCode); if (fuBenID > 0) { if (WanMotaCopySceneManager.IsWanMoTaMapCode(client.ClientData.MapCode)) { if (!Global.FuBenPassed(client, fuBenID)) { bFirstPassWanMoTa = true; } } int usedSecs = (int)((fuBenInfoItem.EndTicks - fuBenInfoItem.StartTicks) / 1000L); Global.UpdateFuBenDataForQuickPassTimer(client, fuBenID, usedSecs, addFuBenNum); FuBenMapItem fuBenMapItem = FuBenManager.FindMapCodeByFuBenID(fuBenID, client.ClientData.MapCode); fubenTongGuanData = WanMotaCopySceneManager.GiveCopyMapGiftNoScore(client, fuBenMapItem, true); GameManager.DBCmdMgr.AddDBCmd(10053, string.Format("{0}:{1}:{2}:{3}", new object[] { client.ClientData.RoleID, Global.FormatRoleName(client, client.ClientData.RoleName), fuBenID, usedSecs }), null, client.ServerId); } } } GameManager.ClientMgr.NotifyAllFuBenBeginInfo(copyMap, client.ClientData.RoleID, !anyAlive); if (fubenTongGuanData != null && bFirstPassWanMoTa) { TCPOutPacket tcpOutPacket = DataHelper.ObjectToTCPOutPacket <FuBenTongGuanData>(fubenTongGuanData, Global._TCPManager.TcpOutPacketPool, 521); if (!Global._TCPManager.MySocketListener.SendData(client.ClientSocket, tcpOutPacket, true)) { } } } }
/// <summary> /// 移除副本 /// </summary> /// <param name="copyMap"></param> /// <param name="sceneType"></param> public void RemoveCopyScene(CopyMap copyMap, SceneUIClasses sceneType) { if (copyMap == null || sceneType != SceneUIClasses.CoupleArena) { return; } lock (Mutex) { CoupleArenaCopyScene scene = null; if (FuBenSeq2CopyScenes.TryGetValue(copyMap.FuBenSeqID, out scene)) { FuBenSeq2CopyScenes.Remove(copyMap.FuBenSeqID); GameId2FuBenData.Remove(scene.GameId); } } }
// 添加一个末日审判副本 public void AddCopyScene(GameClient client, CopyMap copyMap, SceneUIClasses sceneType) { if (copyMap.MapCode == this.MapCode) { int fuBenSeqId = copyMap.FuBenSeqID; int mapCode = copyMap.MapCode; lock (copyDict) { MoRiJudgeCopy copy = null; if (!copyDict.TryGetValue(fuBenSeqId, out copy)) { copy = new MoRiJudgeCopy(); copy.MyCopyMap = copyMap; copy.GameId = Global.GetClientKuaFuServerLoginData(client).GameId; copy.StateTimeData.GameType = (int)GameTypes.MoRiJudge; // 副本的统计信息 copy.StartTime = TimeUtil.NowDateTime(); copy.EndTime = copy.StartTime.AddMinutes(this.CopyMaxAliveMinutes); copy.LimitKillCount = 0; copy.RoleCount = 1; copy.Passed = false; copyDict[fuBenSeqId] = copy; } else { copy.RoleCount++; } } FuBenManager.AddFuBenSeqID(client.ClientData.RoleID, copyMap.FuBenSeqID, 0, copyMap.FubenMapID); copyMap.IsKuaFuCopy = true; // 增加清除时间 copyMap.SetRemoveTicks(TimeUtil.NOW() + (this.CopyMaxAliveMinutes + 3) * TimeUtil.MINITE); //更新状态 // MoRiJudgeClient.getInstance().GameFuBenRoleChangeState(client.ClientData.RoleID, (int)KuaFuRoleStates.StartGame); // 开始游戏统计 GlobalNew.UpdateKuaFuRoleDayLogData(client.ServerId, client.ClientData.RoleID, TimeUtil.NowDateTime(), client.ClientData.ZoneID, 0, 1, 0, 0, (int)GameTypes.MoRiJudge); } }
public void DelCopyScene(CopyMap copyMap) { if (copyMap != null && copyMap.MapCode == this.MapCode) { MoRiJudgeCopy judgeCopy = null; lock (this.copyDict) { if (!this.copyDict.TryGetValue(copyMap.FuBenSeqID, out judgeCopy)) { return; } } lock (judgeCopy) { if (judgeCopy.m_eStatus < GameSceneStatuses.STATUS_END) { judgeCopy.m_eStatus = GameSceneStatuses.STATUS_END; } } } }
public static void SaveAs(this Assembly assembly, string assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine) { if (portableExecutableKind != PortableExecutableKinds.ILOnly) { throw new NotSupportedException(); } if (imageFileMachine != ImageFileMachine.I386) { throw new NotSupportedException(); } ModuleBuilder modB = new ModuleBuilder(assembly.GetName()); AssemblyCopier copier = new AssemblyCopier(assembly, TargetFramework.SameAsSource); CopyMap map = copier.CopyTo(modB); AssemblyBuilder asmBuilder = new AssemblyBuilder(modB, map.EntryPoint); using (FileStream output = File.Create(assemblyFileName)) asmBuilder.Save(output, new SaveOptions() { AssemblyAttributes = copier.CopyCustomAttributes(assembly.CustomAttributes) }); }
/// <summary> // 万魔塔副本层奖励 /// </summary> public static void SendMsgToClientForWanMoTaCopyMapAward(GameClient client, CopyMap copyMap, bool anyAlive) { CopyMap tmpCopyMap = copyMap; if (tmpCopyMap == null) { return; } int fuBenSeqID = FuBenManager.FindFuBenSeqIDByRoleID(client.ClientData.RoleID); FuBenTongGuanData fubenTongGuanData = null; bool bFirstPassWanMoTa = false; if (fuBenSeqID > 0) //如果副本不存在 { FuBenInfoItem fuBenInfoItem = FuBenManager.FindFuBenInfoBySeqID(fuBenSeqID); if (null != fuBenInfoItem) { fuBenInfoItem.EndTicks = DateTime.Now.Ticks / 10000; int addFuBenNum = 1; if (fuBenInfoItem.nDayOfYear != TimeUtil.NowDateTime().DayOfYear) { addFuBenNum = 0; } int fuBenID = FuBenManager.FindFuBenIDByMapCode(client.ClientData.MapCode); if (fuBenID > 0) { if (WanMotaCopySceneManager.IsWanMoTaMapCode(client.ClientData.MapCode)) { // 第一次通过万魔塔某层 if (!Global.FuBenPassed(client, fuBenID)) { bFirstPassWanMoTa = true; } } int usedSecs = (int)((fuBenInfoItem.EndTicks - fuBenInfoItem.StartTicks) / 1000); // 更新玩家通关时间信息 Global.UpdateFuBenDataForQuickPassTimer(client, fuBenID, usedSecs, addFuBenNum); // LogManager.WriteLog(LogTypes.Info, string.Format("万魔塔首次通关标记:{0}", bFirstPassWanMoTa)); // 给玩家物品 FuBenMapItem fuBenMapItem = FuBenManager.FindMapCodeByFuBenID(fuBenID, client.ClientData.MapCode); fubenTongGuanData = GiveCopyMapGiftNoScore(client, fuBenMapItem, true); GameManager.DBCmdMgr.AddDBCmd((int)TCPGameServerCmds.CMD_DB_ADDFUBENHISTDATA, string.Format("{0}:{1}:{2}:{3}", client.ClientData.RoleID, Global.FormatRoleName(client, client.ClientData.RoleName), fuBenID, usedSecs), null); // 万魔塔通关不计活跃 ChenXiaojun //int nLev = -1; //SystemXmlItem systemFuBenItem = null; //if (!GameManager.systemFuBenMgr.SystemXmlItemDict.TryGetValue(fuBenID, out systemFuBenItem)) //{ // nLev = systemFuBenItem.GetIntValue("FuBenLevel"); //} //GameManager.ClientMgr.UpdateRoleDailyData_FuBenNum(client, 1, nLev); //副本通关 //Global.BroadcastFuBenOk(client, usedSecs, fuBenID); } } } GameManager.ClientMgr.NotifyAllFuBenBeginInfo(client, !anyAlive); if (fubenTongGuanData != null && bFirstPassWanMoTa) { //发送奖励到客户端 TCPOutPacket tcpOutPacket = DataHelper.ObjectToTCPOutPacket <FuBenTongGuanData>(fubenTongGuanData, Global._TCPManager.TcpOutPacketPool, (int)TCPGameServerCmds.CMD_SPR_FUBENPASSNOTIFY); if (!Global._TCPManager.MySocketListener.SendData(client.ClientSocket, tcpOutPacket)) { ; } } }
public void Clear() { CopyMap.Clear(); referenceMap.Clear(); }