private void RecordChallengeAction(ArenaInfo challenger, ArenaInfo target, bool IsSuccess) { DataProcessScheduler dataProcess = LobbyServer.Instance.DataProcessScheduler; if (null == challenger && null == target) { return; } UserInfo user1 = dataProcess.GetUserInfo(challenger.GetId()); UserInfo user2 = dataProcess.GetUserInfo(target.GetId()); if (null == user1 || null == user2) { return; } AccountInfo challenger_acc = dataProcess.FindAccountInfoById(user1.AccountId); if (null != challenger_acc) { int c_ct = challenger.FightPartners.Count; int c_partner_frt = 0 < c_ct ? challenger.FightPartners[0].Id : 0; int c_partner_scd = 1 < c_ct ? challenger.FightPartners[1].Id : 0; int c_partner_thd = 2 < c_ct ? challenger.FightPartners[2].Id : 0; int t_ct = target.FightPartners.Count; int t_partner_frt = 0 < t_ct ? target.FightPartners[0].Id : 0; int t_partner_scd = 1 < t_ct ? target.FightPartners[1].Id : 0; int t_partner_thd = 2 < t_ct ? target.FightPartners[2].Id : 0; /// norm log LogSys.NormLog("arena", LobbyConfig.AppKeyStr, challenger_acc.ClientGameVersion, Module.arena, LobbyConfig.LogNormVersionStr, "C0500", challenger_acc.LogicServerId, user1.AccountId, user1.Guid, user1.Level, user1.HeroId, user1.FightingScore, c_partner_frt, c_partner_scd, c_partner_thd, user2.AccountId, user2.Guid, user2.Level, user2.HeroId, user2.FightingScore, t_partner_frt, t_partner_scd, t_partner_thd, challenger.GetRank(), IsSuccess ? 1 : 0); } }
private void RecordPvpAction(UserInfo win, UserInfo lost) { DataProcessScheduler dataProcess = LobbyServer.Instance.DataProcessScheduler; if (null != win && null != lost) { AccountInfo win_acc = dataProcess.FindAccountInfoById(win.AccountId); AccountInfo lost_acc = dataProcess.FindAccountInfoById(lost.AccountId); if (null != win_acc && null != lost_acc) { /// norm log LogSys.NormLog("pvp", LobbyConfig.AppKeyStr, win_acc.ClientGameVersion, Module.pvp, LobbyConfig.LogNormVersionStr, "C0400", win_acc.LogicServerId, win.AccountId, win.Guid, win.Level, win.HeroId, win.FightingScore, lost.AccountId, lost.Guid, lost.Level, lost.HeroId, lost.FightingScore, 1); } } }
internal void RequestSinglePVE(ulong guid, int sceneId) { Data_SceneConfig cfg = SceneConfigProvider.Instance.GetSceneConfigById(sceneId); if (null == cfg || cfg.m_Type == (int)SceneTypeEnum.TYPE_PVE) { //单人pve不建立房间,直接开始游戏(todo:奖励记到人身上[多人的奖励也是这样]) DataProcessScheduler dataProcess = LobbyServer.Instance.DataProcessScheduler; UserInfo user = dataProcess.GetUserInfo(guid); if (user != null) { user.CurrentBattleInfo.init(sceneId, user.HeroId); SyncCombatData(user); JsonMessageWithGuid startGameResultMsg = new JsonMessageWithGuid(JsonMessageID.StartGameResult); startGameResultMsg.m_Guid = user.Guid; ArkCrossEngineMessage.Msg_LC_StartGameResult protoData = new ArkCrossEngineMessage.Msg_LC_StartGameResult(); GeneralOperationResult result = GeneralOperationResult.LC_Succeed; if (user.CurStamina >= cfg.m_CostStamina) { if (!GlobalVariables.Instance.IsDebug) { int preSceneId = SceneConfigProvider.Instance.GetPreSceneId(sceneId); if (-1 != preSceneId) { if (!user.SceneData.ContainsKey(preSceneId)) { LogSystem.Error("player {0} try to enter an Illegal scene {1}", user.Guid, sceneId); return; } } if (cfg.m_SubType == (int)SceneSubTypeEnum.TYPE_ELITE && user.GetCompletedSceneCount(sceneId) >= user.MaxEliteSceneCompletedCount) { LogSystem.Error("player {0} enter an Elite scene {1} too many times {2}", user.Guid, sceneId, user.GetCompletedSceneCount(sceneId)); return; } } protoData.server_ip = "127.0.0.1"; protoData.server_port = 9001; protoData.key = user.Key; protoData.hero_id = user.HeroId; protoData.camp_id = (int)CampIdEnum.Blue; protoData.scene_type = sceneId; protoData.match_key = user.CurrentBattleInfo.MatchKey; result = GeneralOperationResult.LC_Succeed; user.CurrentState = UserState.Pve; } else { result = GeneralOperationResult.LC_Failure_CostError; } protoData.result = (int)result; startGameResultMsg.m_ProtoData = protoData; JsonMessageDispatcher.SendDcoreMessage(user.NodeName, startGameResultMsg); LogSys.Log(LOG_TYPE.INFO, "Single Player Room will run on Lobby without room and roomserver, user {0} scene {1}", guid, sceneId); /// norm log AccountInfo accountInfo = dataProcess.FindAccountInfoById(user.AccountId); if (null != accountInfo) { /// pvefight LogSys.NormLog("PVEfight", LobbyConfig.AppKeyStr, accountInfo.ClientGameVersion, Module.pvefight, LobbyConfig.LogNormVersionStr, "B4110", accountInfo.LogicServerId, accountInfo.AccountId, user.Guid, user.Level, sceneId, (int)FightingType.General, "null", (int)PvefightResult.Failure, "null", "null"); } } } }