NormLog() public static method

public static NormLog ( string module ) : void
module string
return void
示例#1
0
        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);
            }
        }
        internal void AccountLogin(string accountKey, int opcode, int channelId, string data, int login_server_id, string client_game_version, string client_login_ip, string unique_identifier, string system, string game_channel_id, string nodeName)
        {
            ServerBridgeThread bridgeThread = LobbyServer.Instance.ServerBridgeThread;

            if (bridgeThread.CurActionNum < 30000)
            {
                LogSys.Log(LOG_TYPE.INFO, "Account connected: {0}, Login type: AccountLogin", accountKey);
            }
            /// Normlog
            LogSys.NormLog("serverevent", LobbyConfig.AppKeyStr, LobbyConfig.LogNormVersionStr, system, game_channel_id,
                           unique_identifier, "null", (int)ServerEventCode.VerifyToken, client_game_version);
            //账号登录模式下,首先向Billing服务器验证账号,获取accountId
            //注意这里的回调执行线程是在ServerBridgeThread线程。
            VerifyAccount(accountKey, opcode, channelId, data, (BillingClient.VerifyAccountCB)((a, ret, accountId) =>
            {
                if (ret == true)
                {
                    if (m_KickedUsers.ContainsKey(accountId))
                    {
                        LogSys.Log(LOG_TYPE.WARN, ConsoleColor.Green, "Account verify success but user is a kicked user. account:{0}, id:{1}", accountKey, accountId);

                        JsonMessageAccountLoginResult replyMsg = new JsonMessageAccountLoginResult();
                        replyMsg.m_Account   = accountKey;
                        replyMsg.m_AccountId = "";
                        replyMsg.m_Result    = (int)AccountLoginResult.Error;
                        JsonMessageDispatcher.SendDcoreMessage(nodeName, replyMsg);
                    }
                    else
                    {
                        LogSys.Log(LOG_TYPE.INFO, ConsoleColor.Green, "Account verify success. account:{0}, id:{1}", accountKey, accountId);

                        DataProcessScheduler dataProcess = LobbyServer.Instance.DataProcessScheduler;
                        dataProcess.DispatchAction(dataProcess.DoAccountLogin, accountKey, accountId, login_server_id, client_game_version, client_login_ip, unique_identifier, system, game_channel_id, nodeName);
                    }
                }
                else
                {
                    LogSys.Log(LOG_TYPE.INFO, ConsoleColor.Yellow, "Account verify failed. account:{0}", accountKey);
                    JsonMessageAccountLoginResult replyMsg = new JsonMessageAccountLoginResult();
                    replyMsg.m_Account   = accountKey;
                    replyMsg.m_AccountId = "";
                    replyMsg.m_Result    = (int)AccountLoginResult.Error;
                    JsonMessageDispatcher.SendDcoreMessage(nodeName, replyMsg);
                }
                /// norm log
                LogSys.NormLog("serverevent", LobbyConfig.AppKeyStr, LobbyConfig.LogNormVersionStr, system, game_channel_id,
                               unique_identifier, accountId, (int)ServerEventCode.VerifyResult, client_game_version);
            }));
        }
示例#3
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);
                }
            }
        }
示例#4
0
        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");
                    }
                }
            }
        }