using System.Collections.Generic;

namespace Wizard;

public static class NetworkDefine
{
	public enum MAINTENANCE_TYPE
	{
		PROFILE_MAINTENANCE = 2001,
		MYPAGE_MAINTENANCE = 2002,
		GIFT_MAINTENANCE = 2003,
		SIGNUP_MAINTENANCE = 2004,
		PAYMENT_MAINTENANCE_iOS = 2005,
		PAYMENT_MAINTENANCE_ANDROID = 2006,
		PAYMENT_MAINTENANCE_DMM = 2025,
		PAYMENT_MAINTENANCE_STEAM = 2026,
		SHOP_CARDPACK_MAINTENANCE = 2007,
		SHOP_BUILDDECK_MAINTENANCE = 2032,
		SHOP_SLEEVE_MAINTENANCE = 2008,
		SHOP_SKIN_MAINTENANCE = 2024,
		SHOP_ITEM_MAINTENANCE = 2037,
		ACHIEVEMENT_MAINTENANCE = 2009,
		MISSION_MAINTENANCE = 2010,
		BP_POINT_MAINTENANCE = 2011,
		FREEBATTLE_MAINTENANCE = 2012,
		RANKBATTLE_MAINTENANCE = 2013,
		ROOM_BATTLE_MAINTENANCE = 2014,
		STORY_MAINTENANCE = 2015,
		PRACTICE_MAINTENANCE = 2016,
		ARENA_TWOPICK_MAINTENANCE = 2017,
		CARD_MAINTENANCE = 2018,
		DECK_MAINTENANCE = 2019,
		TUTORIAL_MAINTENANCE = 2020,
		ACCOUNT_MAINTENANCE = 2021,
		FRIEND_MAINTENANCE = 2022,
		ARENA_TWOPICK_BATTLE_MAINTENANCE = 2023,
		ROOM_TWOPICK_MAINTENANCE = 2029,
		ROOM_ALL_MAINTENANCE = 2030,
		ROOM_WATCHING_MAINTENANCE = 2031,
		ROOM_RULE_BO1 = 2038,
		ROOM_RULE_TWO_PICK = 2039,
		ROOM_RULE_TWO_PICK_BACKDRAFT = 2040,
		ROOM_RULE_BO3 = 2041,
		ROOM_RULE_BO5 = 2042,
		ROOM_RULE_BO3_BAN1 = 2071,
		ROOM_RULE_BO5_BAN1 = 2072,
		ARENA_CONVENTION = 2043,
		FREEBATTLE_UNLIMITED = 2044,
		FREEBATTLE_ROTATION = 2045,
		RANKBATTLE_UNLIMITED = 2046,
		RANKBATTLE_ROTATION = 2047,
		ROOM_UNLIMITED = 2048,
		ROOM_ROTATION = 2049,
		COLOSSEUM = 2050,
		COLOSSEUM_BATTLE = 2051,
		COLOSSEUM_RANK_MATCH_USER = 2052,
		ROOM_RULE_TWO_PICK_QUBE = 2053,
		GUILD_MAINTENANCE = 2054,
		ARENA_SEALED_MAINTENANCE = 2055,
		ARENA_SEALED_BATTLE_MAINTENANCE = 2056,
		ROOM_FORMAT_HOF = 2057,
		SEALED_DECK_CODE = 2059,
		SPOTCARD_EXCHANGE = 2060,
		ROOM_PRE_ROTATION = 2061,
		ROOM_RULE_TWO_PICK_BO3 = 2062,
		ROOM_RULE_TWO_PICK_BO5 = 2063,
		FREEBATTLE_PREROTATION = 2065,
		GATHERING_ALL = 2066,
		GATHERING_CREATE = 2067,
		BATTLE_PASS = 2070,
		ROOM_RULE_TWO_PICK_CHAOS = 2073,
		QUEST = 2077,
		ROOM_FORMAT_WINDFALL = 2078,
		DECK_QR_CODE = 2079,
		AUTO_DECK_CREATE = 2080,
		COMPETITION_ALL = 2081,
		COMPETITION_BATTLE = 2082,
		COMPETITION_RANK_MATCH_USER = 2083,
		FREEBATTLE_CROSSOVER = 2084,
		RANKBATTLE_CROSSOVER = 2085,
		ROOM_FORMAT_CROSSOVER = 2086,
		GATHERING_CROSSOVER = 2087,
		PRACTICE_PUZZLE = 2088,
		FREEBATTLE_MYROTATION = 2093,
		ROOM_FORMAT_MYROTATION = 2094,
		GATHERING_MYROTATION = 2095,
		BOSS_RUSH = 2096,
		SECRET_BOSS_BATTLE = 2100,
		REPLAY_ALL = 2034,
		NEWREPLAY_ALL = 2097,
		NEWREPLAY_EXCLUDE_ROTATION = 2098,
		NEWREPLAY_RECORD = 2099,
		CHAT_GUILD = 2101,
		CHAT_GATHERING = 2102,
		FREEBATTLE_AVATAR = 2103,
		ROOM_FORMAT_AVATAR = 2104,
		GATHERING_AVATAR = 2105,
		ROOM_RULE_TWO_PICK_CUBE_BACKDRAFT = 2106,
		ROOM_RULE_TWO_PICK_CUBE_BO3 = 2107,
		ROOM_RULE_TWO_PICK_CUBE_BO5 = 2108,
		ROOM_RULE_TWO_PICK_CHAOS_BACKDRAFT = 2109,
		ROOM_RULE_TWO_PICK_CHAOS_BO3 = 2110,
		ROOM_RULE_TWO_PICK_CHAOS_BO5 = 2111,
		INVALID_VALUE = 0
	}

	public enum ServerBattleType
	{
		Practice = 1,
		Story = 2,
		Free = 3,
		Rank = 4,
		OpenRoom = 6,
		TwoPick = 11,
		RoomTwoPick = 13,
		Colosseum = 21,
		ColosseumTwoPick = 22,
		Quest = 37,
		Sealed = 32,
		Gathering = 34,
		Avatar = 39,
		OfflineEvent = 40,
		Competition = 42,
		BossRushQuest = 45,
		SecretBossQuest = 46,
		CompetitionTwoPick = 47
	}

	private static Dictionary<int, string> closeDialogErrorCode = new Dictionary<int, string>
	{
		{ 1401, "RC_CARD_NUMBER_DESTRUCT_ERROR" },
		{ 1402, "RC_CARD_NOT_DESTRUCT_ERROR" },
		{ 1403, "RC_CARD_NOT_CREATE_ERROR" },
		{ 1026, "RC_RED_ETHER_NOT_ENOUGH_ERROR" },
		{ 1551, "RC_FRINED_COUNT_OVER_ERROR" },
		{ 1552, "RC_PARTNER_FRIEND_COUNT_OVER_ERROR" },
		{ 1553, "RC_IS_FRIEND_ERROR" },
		{ 1554, "RC_REQUEST_MAX_ERROR" },
		{ 1555, "RC_IS_FRIEND_APPLY_ERROR" },
		{ 1556, "RC_GET_UNREAD_FRIEND_REQUEST" },
		{ 1557, "RC_SEARCH_USER_NOT_FOUND" },
		{ 1558, "RC_FRIEND_UNREAD_REQUEST_MAX_ERROR" },
		{ 1559, "RC_FRIEND_APPLY_NOT_FOUND_ERROR" },
		{ 1560, "RC_FRIEND_DENY_NOT_FOUND_ERROR" },
		{ 1561, "RC_FRIEND_CANSEL_NOT_FOUND_ERROR" },
		{ 1562, "RC_FRIEND_ACCEPT_NOT_FOUND_ERROR" },
		{ 1601, "RC_NG_PRESENT_INVALID_ACCESS" },
		{ 207, "RC_NG_WORD_ERROR" },
		{ 2001, "RC_PRESENT_RECEIVE_ERROR_NO_PRESRNT" },
		{ 2051, "RC_NOT_ENOUGH_ERROR" },
		{ 2102, "RC_STAMINA_MAX_ERROR" },
		{ 2103, "RC_USER_STATUS_ERROR" },
		{ 300, "RC_PAYMENT_HISTORY_ERROR" },
		{ 301, "RC_PAYMENT_ALREADY_ERROR" },
		{ 302, "RC_PRODUCT_DATA_CSV_ERROR" },
		{ 303, "RC_PAYMENT_RECEIPT_ERROR" },
		{ 304, "RC_PAYMENT_LIMIT_ERROR" },
		{ 305, "RC_PAYMENT_TIMEOUT_ERROR" },
		{ 306, "RC_PAYMENT_RESPONSE_ERROR" },
		{ 307, "RC_PAYMENT_AGE_GROUP_ERROR" },
		{ 308, "RC_PAYMENT_VALIDATION_ERROR" },
		{ 513, "RC_TRANSITION_CODE_NODATA_ERROR" },
		{ 514, "RC_TRANSITION_CODE_PUBLIC_ERROR" },
		{ 515, "RC_TRANSITION_CODE_EXPIRE_ERROR" },
		{ 530, "RC_EMAIL_VALIDATION_ERROR" },
		{ 531, "RC_EMAIL_SEND_ERROR" }
	};

	public static bool IsCloseOnlyDialogError(int ResultCode)
	{
		string value = "";
		closeDialogErrorCode.TryGetValue(ResultCode, out value);
		if (!string.IsNullOrEmpty(value))
		{
			return true;
		}
		return false;
	}
}
