MailType = {
  MAIL_SYSTEM = 2,
  MAIL_SYSTEM_EXTRA = 3,
  MAIL_SCOUT_RESULT = 8,
  MAIL_SCOUT_ALERT = 9,
  MAIL_WOUNDED = 11,
  MAIL_GM = 13,
  MAIL_UPDATE = 16,
  MAIL_ALLIANCE_ALL = 20,
  MAIL_SELF_SEND = 21,
  MAIL_USER = 22,
  GIFT_BUY_EXCHANGE = 34,
  MAIL_BOSS_REWARD = 36,
  MAIL_PRESIDENT_SEND = 45,
  NEW_FIGHT = 72,
  NEW_COLLECT_MAIL = 73,
  MAIL_FIRST_JOIN_ALLIANCE = 74,
  MAIL_JOIN_ALLIANCE = 75,
  MAIL_ALCOMPETE_REWARD = 77,
  MAIL_ALCOMPETE_WEEK_REPORT = 78,
  ALLIANCE_CITY_OCCUPIED_REWARD = 79,
  MAIL_ALLIANCE_MARK_ADD = 80,
  MAIL_PICK_GARBAGE = 81,
  MAIL_EXPLORE = 82,
  RESOURCE_HELP_FROM = 83,
  RESOURCE_HELP_TO = 84,
  RESOURCE_HELP_FAIL = 85,
  MAIL_AL_LEADER_ELECT = 86,
  MAIL_AL_LEADER_VOTE = 87,
  MAIL_AL_AL_COMMON = 88,
  MAIL_AL_LEADER_CHANGE = 89,
  MONSTER_COLLECT_REWARD = 90,
  MARCH_DESTROY_MAIL = 91,
  ENERGY_REFUND = 92,
  ELITE_FIGHT_MAIL = 93,
  ALLIANCE_CITY_RANK = 94,
  MAIL_AL_ELECT_RESULT_R4 = 95,
  MAIL_AL_ELECT_RESULT_LEADER = 96,
  MAIL_GOLLOES_TRADE_REWARDS = 97,
  MAIL_ALLIANCE_INVITE = 98,
  COLLECT_ADDITION_REWARD = 100,
  CHALLENGE_BOSS_REWARD = 101,
  COLLECT_OVER_FLOW_MAIL = 102,
  FIGHT_MONSTER = 103,
  LW_INACTIVITY_MEMBER_MAIL = 104,
  BE_KING = 105,
  POSITION_APPOINT = 106,
  TRUCK = 107,
  DESERT_BATTLE_PARTICIPANTS = 108,
  DESERT_BATTLE_RESULT = 109,
  DESERT_BATTLE_MATCH_RESULT = 110,
  DESERT_BATTLE_BEGIN = 111,
  CANT_CLAIM_ALL = 112,
  LW_AL_DONATE_REWARD = 113,
  LW_ALLIANCE_GROUP_MAIL = 114,
  LW_ALLIANCE_BOSS_ALLIANCE_MAIL = 115,
  BUILDING_UPGARDE_MAIL = 116,
  ARENA_BATTLE_REPORT = 117,
  TRUCK_BATTLE_REPORT = 118,
  HOSPITAL_FULL = 119,
  ZONE_WAR_MAIL = 120,
  LW_FOOD_PARTY_ALLIANCE_RANK = 121,
  LW_FOOD_PARTY_USER_RANK = 122,
  LW_FOOD_PARTY_USER_RANK_NO_REWARD = 123,
  LW_FOOD_PARTY_ALLIANCE_RANK_NO_REWARD = 124,
  LW_FOOD_PARTY_USER_NO_RANK = 125,
  LW_FOOD_PARTY_ALLIANCE_NO_RANK = 126,
  TRAIN_SYSTEM = 127,
  TRAIN_ARRIVE = 128,
  TRAIN_REWARD = 129,
  TRAIN_DEPARTURE = 130,
  TRAIN_3V3 = 131,
  PERSON_ARMS_DAILY_RANK = 132,
  BRIC_Recharge = 133,
  TranslationRating = 134,
  Automatic_TranslationRating = 135,
  REFUND_COST_GOLD = 136,
  REFUND_RETURN_GOLD = 137,
  RUNNING_BOSS_ATTACK_CITY = 138,
  LW_SEASON_DESERT_BATTLE_MAIL = 139,
  LW_SEASON_PLAYER_BATTLE_MAIL = 140,
  LW_SEASON_AL_CENTER_BATTLE_MAIL = 141,
  LW_SEASON_SCOUT_MAIL = 142,
  LW_SEASON_REWARD_MAIL = 143,
  LW_BACKSTAGE_MAIL = 144,
  LW_SEASON_END_COMPENSATE = 145,
  LW_SURVEY_MONKEY_MAIL = 146,
  ALL_OUT = 147,
  LW_ZOMBIE_RUSH_PERSONAL_MAIL = 148,
  LW_ZOMBIE_RUSH_ALLIANCE_MAIL = 149,
  LW_ZOMBIE_RUSH_BOSS_ATTACK_CITY = 150,
  LW_NEW_GOLDBRICK = 151,
  LW_REBIRTH_HOSPITAL_DEAD = 152,
  LW_Notice_Vote = 153,
  LW_TORCH_RELAY_REWARD = 154,
  LANDMINE = 155,
  LW_SEASON_BREAK_ICE_MAIL = 156,
  MONSTER_INVASION_ATTACK_PLAYER = 157,
  LW_SEASON_ALLIANCE_REWARD_MAIL = 158,
  LW_SEASON_WEATHER_MAIL = 159,
  TRAIN_KOF = 160,
  THANKS_LETTER = 161,
  NEW_ARENA_KOF_BATTLE = 162,
  LW_MIGRATION_MARKET = 163,
  RUNNING_MUMMY_ATTACK_CITY = 164,
  ATTACK_RUIN_BUILDING = 165,
  DISGUISE_ATTACK = 166,
  LW_METEORITE_RANK = 167,
  LW_METEORITE_KNOCKOUT_BIG = 168,
  LW_METEORITE_KNOCKOUT_SMALL = 169,
  LW_METEORITE_COLLECT = 170,
  REVIVAL_ACTIVITY = 171,
  ALLIANCE_WEEKLY_STAR_MAIL = 172,
  ALLIANCE_BOSS_SAND_ATTACK_CITY = 173,
  ALLIANCE_MONSTER_CHALLENGE_NEW_REWARD = 174,
  ALLIANCE_MONSTER_CHALLENGE_NEW_PUBLICITY = 175,
  ALLIANCE_MONSTER_CHALLENGE_ATTACK = 176,
  REFUND_COMPLETE = 177,
  HUNTER_ACTIVITY_LIFE_REWARD = 178,
  HUNTER_ACTIVITY_RANK_REWARD = 179,
  REFUND_RESULT = 180,
  EPIDEMIC_BATTLE_RESULT = 181,
  CITY_BATTLE_S1_REST_START = 182,
  BLOOD_QUEEN_MONSTER_ATTACK_CITY = 183,
  BLOOD_QUEEN_ALL_BATTLE_END_NOTIFY = 184,
  WINTER_BATTLE_FIGHT = 185,
  DESERT_BATTLE_FIGHT = 186,
  WINTER_BATTLE_SCOUT = 187,
  DESERT_BATTLE_SCOUT = 188,
  WINTER_BATTLE_BE_SCOUT = 189,
  DESERT_BATTLE_BE_SCOUT = 190,
  SURFING_BATTLE_REWARD = 191,
  DSB_DUEL_BATTLE_RESULT = 192,
  ZONE_TRAIN_BATTLE_RESULT = 193,
  ZONE_TRAIN_TRADE_SETTLE = 194,
  DSB_DUEL_ALLIANCE_CONDITION = 196,
  DSB_DUEL_ALLIANCE_CONDITION_FAIL = 198,
  DSB_DUEL_ALLIANCE_CONDITION_SUCCESS = 199,
  SEASON_BANK = 195,
  ROB_BANK_MAIL = 197,
  SANDWORM_KNOCK_OFF = 999
}
MailIdMap = {
  Alliance_Office_Taking = 11019,
  Alliance_Office_Removal = 11020,
  Alliance_R5_Change = 10018,
  Alliance_R5_Change_Force = 20028
}
MailIdToDetailType = {
  [MailIdMap.Alliance_Office_Taking] = MailType.MAIL_AL_AL_COMMON,
  [MailIdMap.Alliance_Office_Removal] = MailType.MAIL_AL_AL_COMMON,
  [MailIdMap.Alliance_R5_Change] = MailType.MAIL_AL_AL_COMMON
}
MailInternalGroup = {
  MAIL_IN_hide = 1,
  MAIL_IN_report = 2,
  MAIL_IN_alliance = 3,
  MAIL_IN_activity = 4,
  MAIL_IN_system = 5,
  MAIL_IN_daily = 6,
  MAIL_IN_charge = 7,
  MAIL_IN_favor = 8,
  MAIL_IN_season = 9,
  MAIL_IN_MAX = 9
}
MailShowGroup = {
  MailInternalGroup.MAIL_IN_report,
  MailInternalGroup.MAIL_IN_alliance,
  MailInternalGroup.MAIL_IN_activity,
  MailInternalGroup.MAIL_IN_season,
  MailInternalGroup.MAIL_IN_system,
  MailInternalGroup.MAIL_IN_daily,
  MailInternalGroup.MAIL_IN_charge,
  MailInternalGroup.MAIL_IN_favor
}
MailShowNameGroup = {
  [MailInternalGroup.MAIL_IN_season] = {
    title_txt = "100356",
    icon_path = "Assets/Main/Sprites/UI/UILWMail/lt_youjian_tubiao09.png"
  },
  [MailInternalGroup.MAIL_IN_report] = {
    title_txt = "310101",
    icon_path = "Assets/Main/Sprites/UI/UILWMail/lt_youjian_tubiao01.png"
  },
  [MailInternalGroup.MAIL_IN_alliance] = {
    title_txt = GameDialogDefine.ALLIANCE,
    icon_path = "Assets/Main/Sprites/UI/UILWMail/lt_youjian_tubiao02.png"
  },
  [MailInternalGroup.MAIL_IN_activity] = {
    title_txt = "801314",
    icon_path = "Assets/Main/Sprites/UI/UILWMail/zyf_youjian_huodong_icon.png"
  },
  [MailInternalGroup.MAIL_IN_system] = {
    title_txt = "310002",
    icon_path = "Assets/Main/Sprites/UI/UILWMail/lt_youjian_tubiao03.png"
  },
  [MailInternalGroup.MAIL_IN_daily] = {
    title_txt = "801500",
    icon_path = "Assets/Main/Sprites/UI/UILWMail/zyf_youjian_richang_icon.png"
  },
  [MailInternalGroup.MAIL_IN_charge] = {
    title_txt = "801310",
    icon_path = "Assets/Main/Sprites/UI/UILWMail/zyf_youjian_zuanshi.png"
  },
  [MailInternalGroup.MAIL_IN_favor] = {
    title_txt = "310102",
    icon_path = "Assets/Main/Sprites/UI/UILWMail/lt_youjian_tubiao04.png"
  }
}
MailButtonType = {
  ALL_DELETE = 1,
  ALL_READ = 2,
  DELETE = 3,
  RECEIVE = 4,
  COLLECT = 5,
  SHARE = 6,
  TRANSLATE = 7,
  RELAY = 8
}
MailButtonTitle = {
  [MailButtonType.ALL_DELETE] = "310103",
  [MailButtonType.ALL_READ] = "310104",
  [MailButtonType.DELETE] = "100190",
  [MailButtonType.RECEIVE] = "170004",
  [MailButtonType.COLLECT] = "310102",
  [MailButtonType.SHARE] = "110073",
  [MailButtonType.TRANSLATE] = "290042",
  [MailButtonType.RELAY] = "372265"
}
BattleReportMailType = {
  [MailType.NEW_FIGHT] = 1,
  [MailType.FIGHT_MONSTER] = 2,
  [MailType.ARENA_BATTLE_REPORT] = 3,
  [MailType.CHALLENGE_BOSS_REWARD] = 4,
  [MailType.TRAIN_3V3] = 5,
  [MailType.RUNNING_BOSS_ATTACK_CITY] = 6,
  [MailType.LW_SEASON_DESERT_BATTLE_MAIL] = 7,
  [MailType.LW_SEASON_PLAYER_BATTLE_MAIL] = 9,
  [MailType.LW_SEASON_AL_CENTER_BATTLE_MAIL] = 10,
  [MailType.TRUCK_BATTLE_REPORT] = 11,
  [MailType.LW_ZOMBIE_RUSH_BOSS_ATTACK_CITY] = 12,
  [MailType.TRAIN_KOF] = 13,
  [MailType.NEW_ARENA_KOF_BATTLE] = 14,
  [MailType.RUNNING_MUMMY_ATTACK_CITY] = 15,
  [MailType.ALLIANCE_BOSS_SAND_ATTACK_CITY] = 16,
  [MailType.BLOOD_QUEEN_MONSTER_ATTACK_CITY] = 17,
  [MailType.WINTER_BATTLE_FIGHT] = 18,
  [MailType.DESERT_BATTLE_FIGHT] = 19,
  [MailType.ROB_BANK_MAIL] = 20,
  [MailType.ZONE_TRAIN_BATTLE_RESULT] = 21
}
ShareMailType = {
  [MailType.NEW_FIGHT] = 1,
  [MailType.FIGHT_MONSTER] = 2,
  [MailType.MAIL_SCOUT_RESULT] = 3,
  [MailType.ARENA_BATTLE_REPORT] = 4,
  [MailType.TRUCK_BATTLE_REPORT] = 5,
  [MailType.TRAIN_3V3] = 6,
  [MailType.LW_SEASON_DESERT_BATTLE_MAIL] = 7,
  [MailType.LW_SEASON_PLAYER_BATTLE_MAIL] = 8,
  [MailType.LW_SEASON_AL_CENTER_BATTLE_MAIL] = 9,
  [MailType.LW_SEASON_SCOUT_MAIL] = 10,
  [MailType.LANDMINE] = 11,
  [MailType.TRAIN_KOF] = 12,
  [MailType.NEW_ARENA_KOF_BATTLE] = 13,
  [MailType.DISGUISE_ATTACK] = 14,
  [MailType.WINTER_BATTLE_FIGHT] = 15,
  [MailType.DESERT_BATTLE_FIGHT] = 16,
  [MailType.WINTER_BATTLE_SCOUT] = 17,
  [MailType.DESERT_BATTLE_SCOUT] = 18,
  [MailType.SEASON_BANK] = 19,
  [MailType.ZONE_TRAIN_BATTLE_RESULT] = 20
}
MailCantClaimAllType = {
  [MailType.CANT_CLAIM_ALL] = 1,
  [MailType.TranslationRating] = 2,
  [MailType.Automatic_TranslationRating] = 3
}
MailTypeToInternalGroup = {
  [MailType.LW_SEASON_SCOUT_MAIL] = MailInternalGroup.MAIL_IN_season,
  [MailType.LW_SEASON_DESERT_BATTLE_MAIL] = MailInternalGroup.MAIL_IN_season,
  [MailType.LW_SEASON_PLAYER_BATTLE_MAIL] = MailInternalGroup.MAIL_IN_season,
  [MailType.LW_SEASON_AL_CENTER_BATTLE_MAIL] = MailInternalGroup.MAIL_IN_season,
  [MailType.LW_SEASON_REWARD_MAIL] = MailInternalGroup.MAIL_IN_season,
  [MailType.LW_SEASON_BREAK_ICE_MAIL] = MailInternalGroup.MAIL_IN_season,
  [MailType.LW_SEASON_WEATHER_MAIL] = MailInternalGroup.MAIL_IN_season,
  [MailType.HUNTER_ACTIVITY_LIFE_REWARD] = MailInternalGroup.MAIL_IN_season,
  [MailType.HUNTER_ACTIVITY_RANK_REWARD] = MailInternalGroup.MAIL_IN_season,
  [MailType.SEASON_BANK] = MailInternalGroup.MAIL_IN_season,
  [MailType.ROB_BANK_MAIL] = MailInternalGroup.MAIL_IN_season,
  [MailType.MAIL_SCOUT_ALERT] = MailInternalGroup.MAIL_IN_report,
  [MailType.MAIL_SCOUT_RESULT] = MailInternalGroup.MAIL_IN_report,
  [MailType.MARCH_DESTROY_MAIL] = MailInternalGroup.MAIL_IN_report,
  [MailType.NEW_FIGHT] = MailInternalGroup.MAIL_IN_report,
  [MailType.CHALLENGE_BOSS_REWARD] = MailInternalGroup.MAIL_IN_report,
  [MailType.HOSPITAL_FULL] = MailInternalGroup.MAIL_IN_report,
  [MailType.RUNNING_BOSS_ATTACK_CITY] = MailInternalGroup.MAIL_IN_report,
  [MailType.RUNNING_MUMMY_ATTACK_CITY] = MailInternalGroup.MAIL_IN_report,
  [MailType.LW_ZOMBIE_RUSH_BOSS_ATTACK_CITY] = MailInternalGroup.MAIL_IN_report,
  [MailType.LW_REBIRTH_HOSPITAL_DEAD] = MailInternalGroup.MAIL_IN_report,
  [MailType.LANDMINE] = MailInternalGroup.MAIL_IN_report,
  [MailType.DISGUISE_ATTACK] = MailInternalGroup.MAIL_IN_report,
  [MailType.ATTACK_RUIN_BUILDING] = MailInternalGroup.MAIL_IN_report,
  [MailType.LW_METEORITE_KNOCKOUT_SMALL] = MailInternalGroup.MAIL_IN_report,
  [MailType.WINTER_BATTLE_FIGHT] = MailInternalGroup.MAIL_IN_report,
  [MailType.WINTER_BATTLE_SCOUT] = MailInternalGroup.MAIL_IN_report,
  [MailType.WINTER_BATTLE_BE_SCOUT] = MailInternalGroup.MAIL_IN_report,
  [MailType.DESERT_BATTLE_FIGHT] = MailInternalGroup.MAIL_IN_report,
  [MailType.DESERT_BATTLE_SCOUT] = MailInternalGroup.MAIL_IN_report,
  [MailType.DESERT_BATTLE_BE_SCOUT] = MailInternalGroup.MAIL_IN_report,
  [MailType.BLOOD_QUEEN_MONSTER_ATTACK_CITY] = MailInternalGroup.MAIL_IN_report,
  [MailType.ARENA_BATTLE_REPORT] = MailInternalGroup.MAIL_IN_hide,
  [MailType.TRUCK_BATTLE_REPORT] = MailInternalGroup.MAIL_IN_hide,
  [MailType.ZONE_TRAIN_BATTLE_RESULT] = MailInternalGroup.MAIL_IN_hide,
  [MailType.ELITE_FIGHT_MAIL] = MailInternalGroup.MAIL_IN_hide,
  [MailType.TRAIN_3V3] = MailInternalGroup.MAIL_IN_hide,
  [MailType.TRAIN_KOF] = MailInternalGroup.MAIL_IN_hide,
  [MailType.NEW_ARENA_KOF_BATTLE] = MailInternalGroup.MAIL_IN_hide,
  [MailType.MAIL_SYSTEM_EXTRA] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_ALLIANCE_ALL] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.LW_INACTIVITY_MEMBER_MAIL] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_JOIN_ALLIANCE] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_AL_ELECT_RESULT_R4] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_ALLIANCE_MARK_ADD] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_AL_LEADER_ELECT] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.LW_AL_DONATE_REWARD] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_AL_LEADER_CHANGE] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.LW_ALLIANCE_GROUP_MAIL] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_FIRST_JOIN_ALLIANCE] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_AL_AL_COMMON] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_AL_LEADER_VOTE] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.ALLIANCE_CITY_OCCUPIED_REWARD] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_ALLIANCE_INVITE] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_AL_ELECT_RESULT_LEADER] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.RESOURCE_HELP_FAIL] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.ALLIANCE_CITY_RANK] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.RESOURCE_HELP_FROM] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.RESOURCE_HELP_TO] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.LW_ALLIANCE_BOSS_ALLIANCE_MAIL] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.LW_ZOMBIE_RUSH_PERSONAL_MAIL] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.LW_ZOMBIE_RUSH_ALLIANCE_MAIL] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.LW_Notice_Vote] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.ALLIANCE_WEEKLY_STAR_MAIL] = MailInternalGroup.MAIL_IN_alliance,
  [MailType.MAIL_SYSTEM] = MailInternalGroup.MAIL_IN_activity,
  [MailType.DESERT_BATTLE_RESULT] = MailInternalGroup.MAIL_IN_activity,
  [MailType.DESERT_BATTLE_BEGIN] = MailInternalGroup.MAIL_IN_activity,
  [MailType.DESERT_BATTLE_PARTICIPANTS] = MailInternalGroup.MAIL_IN_activity,
  [MailType.DESERT_BATTLE_MATCH_RESULT] = MailInternalGroup.MAIL_IN_activity,
  [MailType.COLLECT_ADDITION_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.MAIL_GOLLOES_TRADE_REWARDS] = MailInternalGroup.MAIL_IN_activity,
  [MailType.TRUCK] = MailInternalGroup.MAIL_IN_activity,
  [MailType.ZONE_TRAIN_TRADE_SETTLE] = MailInternalGroup.MAIL_IN_activity,
  [MailType.TRAIN_SYSTEM] = MailInternalGroup.MAIL_IN_activity,
  [MailType.TRAIN_ARRIVE] = MailInternalGroup.MAIL_IN_activity,
  [MailType.TRAIN_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.TRAIN_DEPARTURE] = MailInternalGroup.MAIL_IN_activity,
  [MailType.MAIL_ALCOMPETE_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.MAIL_ALCOMPETE_WEEK_REPORT] = MailInternalGroup.MAIL_IN_activity,
  [MailType.MAIL_BOSS_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.POSITION_APPOINT] = MailInternalGroup.MAIL_IN_activity,
  [MailType.ZONE_WAR_MAIL] = MailInternalGroup.MAIL_IN_activity,
  [MailType.PERSON_ARMS_DAILY_RANK] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_FOOD_PARTY_ALLIANCE_RANK] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_FOOD_PARTY_USER_RANK] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_FOOD_PARTY_USER_RANK_NO_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_FOOD_PARTY_ALLIANCE_RANK_NO_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_FOOD_PARTY_USER_NO_RANK] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_FOOD_PARTY_ALLIANCE_NO_RANK] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_TORCH_RELAY_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.ENERGY_REFUND] = MailInternalGroup.MAIL_IN_activity,
  [MailType.ALL_OUT] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_SEASON_END_COMPENSATE] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_SEASON_ALLIANCE_REWARD_MAIL] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_METEORITE_RANK] = MailInternalGroup.MAIL_IN_activity,
  [MailType.LW_METEORITE_KNOCKOUT_BIG] = MailInternalGroup.MAIL_IN_activity,
  [MailType.REVIVAL_ACTIVITY] = MailInternalGroup.MAIL_IN_activity,
  [MailType.ALLIANCE_MONSTER_CHALLENGE_NEW_PUBLICITY] = MailInternalGroup.MAIL_IN_activity,
  [MailType.ALLIANCE_MONSTER_CHALLENGE_NEW_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.EPIDEMIC_BATTLE_RESULT] = MailInternalGroup.MAIL_IN_activity,
  [MailType.CITY_BATTLE_S1_REST_START] = MailInternalGroup.MAIL_IN_activity,
  [MailType.BLOOD_QUEEN_ALL_BATTLE_END_NOTIFY] = MailInternalGroup.MAIL_IN_activity,
  [MailType.SURFING_BATTLE_REWARD] = MailInternalGroup.MAIL_IN_activity,
  [MailType.DSB_DUEL_BATTLE_RESULT] = MailInternalGroup.MAIL_IN_activity,
  [MailType.DSB_DUEL_ALLIANCE_CONDITION] = MailInternalGroup.MAIL_IN_activity,
  [MailType.DSB_DUEL_ALLIANCE_CONDITION_FAIL] = MailInternalGroup.MAIL_IN_activity,
  [MailType.DSB_DUEL_ALLIANCE_CONDITION_SUCCESS] = MailInternalGroup.MAIL_IN_activity,
  [MailType.CANT_CLAIM_ALL] = MailInternalGroup.MAIL_IN_system,
  [MailType.BE_KING] = MailInternalGroup.MAIL_IN_system,
  [MailType.MAIL_PRESIDENT_SEND] = MailInternalGroup.MAIL_IN_system,
  [MailType.MAIL_GM] = MailInternalGroup.MAIL_IN_system,
  [MailType.BUILDING_UPGARDE_MAIL] = MailInternalGroup.MAIL_IN_system,
  [MailType.BRIC_Recharge] = MailInternalGroup.MAIL_IN_system,
  [MailType.TranslationRating] = MailInternalGroup.MAIL_IN_system,
  [MailType.Automatic_TranslationRating] = MailInternalGroup.MAIL_IN_system,
  [MailType.REFUND_COST_GOLD] = MailInternalGroup.MAIL_IN_system,
  [MailType.REFUND_RETURN_GOLD] = MailInternalGroup.MAIL_IN_system,
  [MailType.LW_BACKSTAGE_MAIL] = MailInternalGroup.MAIL_IN_system,
  [MailType.LW_SURVEY_MONKEY_MAIL] = MailInternalGroup.MAIL_IN_system,
  [MailType.THANKS_LETTER] = MailInternalGroup.MAIL_IN_system,
  [MailType.LW_MIGRATION_MARKET] = MailInternalGroup.MAIL_IN_system,
  [MailType.REFUND_COMPLETE] = MailInternalGroup.MAIL_IN_system,
  [MailType.REFUND_RESULT] = MailInternalGroup.MAIL_IN_system,
  [MailType.MONSTER_COLLECT_REWARD] = MailInternalGroup.MAIL_IN_daily,
  [MailType.MAIL_PICK_GARBAGE] = MailInternalGroup.MAIL_IN_daily,
  [MailType.MAIL_EXPLORE] = MailInternalGroup.MAIL_IN_daily,
  [MailType.NEW_COLLECT_MAIL] = MailInternalGroup.MAIL_IN_daily,
  [MailType.SANDWORM_KNOCK_OFF] = MailInternalGroup.MAIL_IN_daily,
  [MailType.FIGHT_MONSTER] = MailInternalGroup.MAIL_IN_daily,
  [MailType.MONSTER_INVASION_ATTACK_PLAYER] = MailInternalGroup.MAIL_IN_daily,
  [MailType.LW_METEORITE_COLLECT] = MailInternalGroup.MAIL_IN_daily,
  [MailType.ALLIANCE_MONSTER_CHALLENGE_ATTACK] = MailInternalGroup.MAIL_IN_daily,
  [MailType.GIFT_BUY_EXCHANGE] = MailInternalGroup.MAIL_IN_charge,
  [MailType.LW_NEW_GOLDBRICK] = MailInternalGroup.MAIL_IN_charge
}
FightResult = {
  DEFAULT = -1,
  SELF_WIN = 0,
  OTHER_WIN = 1,
  DRAW = 2
}
MailBattleReportType = {
  Default = -1,
  City = 0,
  Jungle = 1,
  AllianceCity = 2,
  ActBoss = 3,
  DETECT_EVENT = 4,
  PVE_STAGE = 5,
  THRONE = 6,
  TRAIN_PVP = 7,
  TRAIN_PERSON_PVP = 8,
  CROSS_PVP_BATTLE = 9,
  CROSS_ALLIANCE_CITY_BATTLE = 10,
  CROSS_ARENA = 11,
  ALLIANCE_BOSS = 12,
  THRONE_DEFENSE = 13,
  ALLIANCE_TRAIN_BATTLE = 14,
  RUNNING_BOSS_ATTACK_CITY = 15,
  TRIAL_TOWER = 16,
  SEASON_DESERT_BATTLE = 17,
  SEASON_PLAYER_BUILDING_BATTLE = 18,
  SEASON_AL_BUILDING_BATTLE = 19,
  WINTER_STORM_BUILDING = 20,
  CITY_STRONGHOLD = 21,
  ZOMBIE_RUSH_BOSS_ATTACK_CITY = 22,
  DARK_KNIGHT_MONSTER_ATTACK_ALLIANCE_CITY = 23,
  CHAMPION_DUEL = 24,
  ACT_BERSERK_BOSS = 25,
  ALLIANCE_BUILDING_FURNACE = 26,
  DARK_KNIGHT_MONSTER_ATTACK_ALLIANCE_BUILDING = 27,
  BEHEMOTH_BOSS_ATTACK_ALLIANCE_CITY = 30,
  BEHEMOTH_BOSS_ATTACK_BOSS = 31,
  MONSTER_INVASION_BOSS = 32,
  SANDWORM = 34,
  MUSE_MUMMY = 35,
  MUMMY_PATROL = 36,
  SANDWORM_SMALL = 37,
  MUMMY_MONSTER_ATTACK_AL_BUILDING = 38,
  DARKNESS_MONSTER_ATTACK_CITY = 39,
  DARKNESS_MONSTER_ATTACK_AL_BUILDING = 40,
  ALLIANCE_MONSTER_CHALLENGE_KIROV = 42,
  BLOOD_QUEEN_MONSTER_ATTACK_CITY = 46,
  CITY_BATTLE_S1_REST_ATTACK_MONSTER = 48,
  ROB_STRONGHOLD_BANK = 51,
  CITY_OUTPOST = 52
}
MailCombatUnitType = {
  ArmyCombatUnit = 1,
  CombineCombatUnit = 2,
  SimpleCombatUnit = 3,
  Unknow = 4
}
eMailDetailActionType = {
  DEFAULT = 0,
  ATTACK = 1,
  COUNTER_ATTACK = 2,
  SHIELD_ATTACK = 3,
  SHIELD = 4,
  RECOVER_DAMAGE = 5,
  ADD_EFFECT = 6,
  USE_SKILL = 7,
  ADD_ANGER = 8
}
eMailSoldierAttr = {
  Total = "total",
  Lost = "lost",
  Wounded = "wounded",
  Injured = "injured",
  Dead = "dead",
  Cure = "cure"
}
eMailDetailItemType = {
  Title_Summary = 0,
  Title_Self = 1,
  Title_Other = 2,
  Content = 3,
  Title_Result = 4
}
eMailDetailTxtColor = {
  Green_Start = "<color=#228B22>",
  Red_Start = "<color=#CD2626>",
  End = "</color>"
}
eMailDetailTroopSide = {Self = 0, Other = 1}
SpecialUnitType = {
  NONE = 0,
  ALLIANCE_CITY_NPC = 1,
  BUILDING_STATION = 2,
  CITY_STATION = 3,
  TEAM_LEADER = 4,
  TEAM_MEMBER = 5,
  PVE_MARCH = 6,
  PVE_MONSTER = 7,
  ACT_BOSS = 8,
  ARENA_NPC = 9,
  PUZZLE_BOSS = 10,
  CHALLENGE_BOSS = 11,
  DESERT_NPC = 12
}
GameEffectReason = {
  Science = 0,
  Building = 1,
  Hero = 2,
  VIP = 3,
  MONTH_CARD = 4,
  PLAYER_LEVEL = 5,
  Hero_Station = 6,
  Science_Activity = 7,
  Alliance_Science = 8,
  World_Alliance_City = 9,
  Status = 10,
  Tank = 11,
  Career = 12,
  Alliance_Career = 13,
  Land = 14,
  SERVER_EFFECT = 15,
  BASE_TALENT = 16,
  HERO_OFFICIAL = 17,
  ARTIFACT = 18,
  FormationBuff = 100,
  FormationRestraintValue = 101
}
AtkDefReason = {
  HERO = 0,
  SOLDIER_TOTAL = 1,
  SCIENCE = 3,
  BUILDING = 4,
  FORMATION_STATUS = 6,
  TOWER_DMG = 7,
  TOWER_RANGE = 8
}
BattleReportShowType = {
  Total = 0,
  Atk = 1,
  Def = 2,
  Soldier = 3,
  SoldierLevel = 4,
  HeroAtk = 5,
  HeroDef = 6,
  Health = 7,
  CampValue = 8
}
BattleSubTitleShowType = {
  HeroAttack = 1,
  HeroDefence = 2,
  AttackAdd = 3,
  DefenceAdd = 4,
  HealthAdd = 5,
  MarchLimitAdd = 6,
  SkillHurtAdd = 7,
  NormalHurtAdd = 8,
  BackHurtAdd = 9,
  SkillHurtDec = 10,
  NormalHurtDec = 11,
  BackHurtDec = 12,
  Curve = 13
}
MailTargetType = {
  Player = 0,
  AllianceCity = 1,
  Monster = 2,
  Army = 3,
  DragonBuild = 4,
  SeasonDesert = 5,
  SeasonBuilding = 6,
  SeasonCenter = 7,
  WinterStormBuilding = 8,
  CityStronghold = 9,
  TradeStation = 10,
  EpidemicBuild = 11,
  SeasonBank = 12,
  SeasonOutpost = 13
}
MailPVEType = {
  WalkMonsterBoss = 1,
  GeneralTrialNormal = 2,
  GeneralTrialAllyBoss = 3,
  MonsterInvasion = 4,
  MonsterBoss = 5,
  NormalMonster = 6,
  SeasonLand = 7,
  CityMonster = 8
}
NEED_REQUEST_REPORT_VERSION = 4
NEW_CARD_EFFECT_VERSION = 7

function MailPrint(fmt, ...)
end

local MAIL_TIME

function MailCountTime(tip)
  if not MAIL_TIME then
    MAIL_TIME = os.time()
  end
  local now = os.time()
  Logger.LogError(string.format(tip .. "\239\188\154%s", os.difftime(now, MAIL_TIME)))
  MAIL_TIME = now
end

MailContentType = {
  ChannelList = 1,
  MailList = 2,
  MailDetail = 3,
  SubBattleReport = 4,
  SharedMail = 5
}
MailFilterType = {
  None = 0,
  MailName = 1,
  MailType = 2
}

function IsMailNewFightType(mailType)
  return mailType == MailType.NEW_FIGHT or mailType == MailType.DESERT_BATTLE_FIGHT or mailType == MailType.WINTER_BATTLE_FIGHT
end

function IsMailScoutType(mailType)
  return mailType == MailType.MAIL_SCOUT_RESULT or mailType == MailType.DESERT_BATTLE_SCOUT or mailType == MailType.WINTER_BATTLE_SCOUT
end

function IsMailBeScoutType(mailType)
  return mailType == MailType.MAIL_SCOUT_ALERT or mailType == MailType.DESERT_BATTLE_BE_SCOUT or mailType == MailType.WINTER_BATTLE_BE_SCOUT
end
