Exemplo n.º 1
0
        public void SendELKLog4Destroy()
        {
            if (mELKLog4Destroy == null)
            {
                mELKLog4Destroy = new ELKLog4Destroy();
            }

            MakeELKLog4Destroy(mELKLog4Destroy);
            string json = JsonMapper.ToJson(mELKLog4Destroy);

            //将已获得的武器、技能信息装填日志中
            Dictionary <string, int> weaponLvMap = Global.gApp.gSystemMgr.GetWeaponMgr().GetWeaponLvMap();
            string weaponJson = JsonMapper.ToJson(weaponLvMap);

            Dictionary <string, int> skillLvMap = Global.gApp.gSystemMgr.GetSkillMgr().GetSkillLvMap();
            string skillJson = JsonMapper.ToJson(skillLvMap);

            json       = json.Remove(json.Length - 1);
            weaponJson = weaponJson.Remove(0, 1);
            weaponJson = weaponJson.Remove(weaponJson.Length - 1);
            skillJson  = skillJson.Remove(0, 1);

            json = json + "," + weaponJson + "," + skillJson;
            Post(json);

            //Thread athread = new Thread(new ParameterizedThreadStart(ThreadMain));
            //athread.IsBackground = true;//防止后台现成。相反需要后台线程就设为false
            //athread.Start(json);
        }
Exemplo n.º 2
0
        public void MakeELKLog4Destroy(ELKLog4Destroy log)
        {
            log.reportTime   = getTimeNow();
            log.behaviorTime = getTimeNow();

            log.hardId     = deviceTag;
            log.roleLevel  = Global.gApp.gSystemMgr.GetBaseAttrMgr().GetLevel();
            log.gold       = Global.gApp.gSystemMgr.GetBaseAttrMgr().GetGold();
            log.diamond    = Global.gApp.gSystemMgr.GetBaseAttrMgr().GetDiamond();
            log.exp        = Global.gApp.gSystemMgr.GetBaseAttrMgr().GetExp();
            log.energy     = Global.gApp.gSystemMgr.GetBaseAttrMgr().GetEnergy();
            log.mdt        = Global.gApp.gSystemMgr.GetBaseAttrMgr().GetMDT();
            log.passId     = Global.gApp.gSystemMgr.GetPassMgr().GetCurPassId();
            log.weaponId   = Global.gApp.gSystemMgr.GetWeaponMgr().GetCurMainWeaponId();
            log.weaponLv   = Global.gApp.gSystemMgr.GetWeaponMgr().GetWeaponLevel(Global.gApp.gSystemMgr.GetWeaponMgr().GetCurMainWeapon());
            log.online     = log.reportTime - Global.gApp.gSystemMgr.GetMiscMgr().GetLastLoginTime();
            log.retainDays = Global.gApp.gSystemMgr.GetMiscMgr().GetRetainDays();
        }