package net.swordie.ms.handlers.header;

import net.swordie.ms.ServerConstants;
import net.swordie.ms.util.Util;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.*;

public enum InHeader {
    PONG(150),

    // Login ops
    CONNECT_CHAT(1),
    REDISPLAY_SERVER_LIST(7),
    GUILD_CHAT(19),
    FRIEND_CHAT(20),
    GUEST_LOGIN(22),
    TOS(29),
    VIEW_SERVER_LIST(33),
    VIEW_REGISTER_PIC(50),
    VIEW_SELECT_PIC(53),
    CLIENT_FAILED(57),
    PART_TIME_JOB(59),
    CHARACTER_CARD(60),
    ENABLE_LV50_CHAR(61),
    CREATE_LV50_CHAR(62),
    ENABLE_SPECIAL_CREATION(62),
    CREATE_SPECIAL_CHAR(65),

    DUMMY_CODE(100),
    BEGIN_SOCKET(101),
    SECURITY_PACKET(102),
    PERMISSION_REQUEST(103),
    LOGIN_BASIC_INFO(104),
    CHECK_LOGIN_AUTH_INFO(105),
    VIEW_CHANNEL_REQUEST(106),
    SELECT_WORLD(107), // ~
    CHECK_SPW_REQUEST(108),
    CHAR_SELECT(109),
    CHECK_SPW_EXIST_REQUEST(110),
    MIGRATE_IN(111),
    SELECT_CHARACTER(112),
    SELECT_GO_TO_STAR_PLANET(113),
    SELECT_ACCOUNT(114),
    WORLD_INFO_REQUEST(115),
    WORLD_INFO_FOR_SHINING_REQUEST(116),
    CHECK_DUPLICATE_ID(117),
    LOGOUT_WORLD(118),
    PERMISSION_REQUEST_FAKE(119),
    CHECK_LOGIN_AUTH_INFO_FAKE(120),
    CREATE_MAPLE_ACCOUNT_FAKE(121),
    SELECT_ACCOUNT_FAKE(122),
    SELECT_WORLD_FAKE(123),
    SELECT_CHARACTER_FAKE(124),
    CREATE_NEW_CHARACTER_FAKE(125),
    CREATE_NEW_CHARACTER(126),
    DELETE_CHARACTER(130),
    RESERVED_DELETE_CHARACTER_CONFIRM(131),
    RESERVED_DELETE_CHARACTER_CANCEL(132),
    RENAME_CHARACTER(133),
    //    ALIVE_ACK_FAKE(133), // one of these is removed 199
    EXCEPTION_LOG(134),
    PRIVATE_SERVER_PACKET(135),
    RESET_LOGIN_STATE_ON_CHECK_OTP(136),
    CHANGE_SPW_REQUEST(137),
    CHECK_SOW_REQUEST_FAKE(138),
    CHECK_OTP_REQUEST(139),
    CHECK_DELETE_CHARACTER_OTP(140),
    CHECK_OTP_FOR_WEB_LAUNCHING_REQUEST(141),
    CREATE_SECURITY_HANDLE(142),
    ALBA_REQUEST(143),
    UPDATE_CHARACTER_CARD_REQUEST(144),
    ALIVE_ACK(153), // *
    CLIENT_ERROR(155),
    APPLY_HOTFIX(158),
    SERVER_STATUS_REQUEST(159),
    WVS_SET_UP_STEP(160),
    WVS_CRASH_CALLBACK(161),
    WORLD_LIST_REQUEST(163),
    CHAR_POSITION_CHANGE(168),
    WORLD_STATUS_REQUEST(176),
    USE_AUTH_SERVER(183),
    AUTH_FAILURE(187),
    CHAR_SELECT_NO_PIC(189),
    CHANGE_PIC_REQUEST(190),
    UNK200_193(195),

    B_E_G_I_N__U_S_E_R(198), // *
    USER_TRANSFER_FIELD_REQUEST(199),
    USER_TRANSFER_CHANNEL_REQUEST(200),
    USER_TRANSFER_TO_HUB_REQUEST(201),
    WORLD_TRANSFER_REQUEST(202),
    WORLD_TRANSFER_SHINNING_STAR_REQUEST(203),
    USER_MIGRATE_TO_CASH_SHOP_REQUEST(205),
    USER_MIGRATE_AUCTION_REQUEST(206),
    USER_MIGRATE_TO_MONSTER_FARM(207),
    USER_MIGRATE_TO_MONSTER_FARM_BY_INVITE_ITEM(208),
    USER_TRANSFER_ASWAN_REQUEST(209),
    USER_TRANSFER_ASWAN_READY_REQUEST(210),
    ASWAN_RETIRE_REQUEST(211),
    USER_REQUEST_PV_P_STATUS(212),
    USER_MIGRATE_TO_PVE_REQUEST(212),
    USER_MOVE(213),
    USER_SIT_REQUEST(214),
    USER_PORTABLE_CHAIR_SIT_REQUEST(215),
    USER_EMOTICON_ITEM_USE_REQUEST(216),
    USER_DANCE_STOP_REQUEST(217),
    USER_MELEE_ATTACK(218),
    USER_SHOOT_ATTACK(219),
    USER_MAGIC_ATTACK(220),
    USER_BODY_ATTACK(221),
    USER_AREA_DOT_ATTACK(222),
    USER_AFFECTED_AREA_FOR_SCREEN_ATTACK(223),
    USER_HIT(225),
    USER_CHAT(226),
    USER_ITEM_LINKED_CHAT(227),
    USER_A_D_BOARD_CLOSE(228),
    USER_EMOTION(229),
    ANDROID_EMOTION(230),
    USER_ACTIVATE_EFFECT_ITEM(231),
    USER_MONKEY_EFFECT_ITEM(232),
    USER_ACTIVATE_NICK_ITEM(233),
    USER_ACTIVATE_DAMAGE_SKIN(-1), // disabled for now
    USER_ACTIVATE_DAMAGE_SKIN__PREMIUM(235),
    USER_DAMAGE_SKIN_SAVE_REQUEST(236),
    USER_DEFAULT_WING_ITEM(237),
    USER_KAISER_TRANSFORM_WING(238), // *
    USER_KAISER_TRANSFORM_TAIL(239), // *
    USER_UPGRADE_TOMB_EFFECT(240),
    //    USER_H_P(239),
//    PREMIUM(240),
    USER_BAN_MAP_BY_MOB(241),
    USER_MONSTER_BOOK_SET_COVER(242),
    USER_SELECT_NPC(243),
    USER_REMOTE_SHOP_OPEN_REQUEST(244),
    USER_SCRIPT_MESSAGE_ANSWER(245),
    USER_SHOP_REQUEST(246),
    USER_TRUNK_REQUEST(247),
    USER_ENTRUSTED_SHOP_REQUEST(248),
    USER_STORE_BANK_REQUEST(249),
    USER_PARCEL_REQUEST(250),
    USER_EFFECT_LOCAL(251),
    USER_SPECIAL_EFFECT_LOCAL(252),
    USER_FINAL_ATTACK_REQUEST(253),
    USER_CREATE_AREA_DOT_REQUEST(254),
    USER_CREATE_HOLIDOM_REQUEST(255),
    REQ_MAKING_SKILL_EFF(256),
    SHOP_SCANNER_REQUEST(257),
    SHOP_LINK_REQUEST(258),
    AUCTION_REQUEST(259),
    AUCTION_LEAVE_REQUEST(260),
    ADMIN_SHOP_REQUEST(261),
    USER_GATHER_ITEM_REQUEST(262),
    USER_SORT_ITEM_REQUEST(263),
    USER_CHANGE_SLOT_POSITION_REQUEST(264),
    USER_TEXT_EQUIP_INFO(265),
    USER_POP_OR_PUSH_BAG_ITEM_TO_INVEN(17),
    USER_BAG_TO_BAG_ITEM(267),
    USER_POUR_IN_BAG_TO_BAG(268),
    USER_STAT_CHANGE_ITEM_USE_REQUEST(269),
    USER_STAT_CHANGE_ITEM_CANCEL_REQUEST(270),
    USER_STAT_CHANGE_BY_PORTABLE_CHAIR_REQUEST(271),
    USER_MOB_SUMMON_ITEM_USE_REQUEST(272),
    USER_PET_FOOD_ITEM_USE_REQUEST(273),
    USER_TAMING_MOB_FOOD_ITEM_USE_REQUEST(274),
    USER_SCRIPT_ITEM_USE_REQUEST(275),
    USER_RECIPE_OPEN_ITEM_USE_REQUEST(276),
    USER_CONSUME_CASH_ITEM_USE_REQUEST(277),
    USER_ADDITIONAL_SLOT_EXTEND_ITEM_USE_REQUEST(278),
    USER_CASH_PET_PICK_UP_ON_OFF_REQUEST(279),
    USER_CASH_PET_SKILL_SETTING_REQUEST(280),
    USER_OPTION_CHANGE_REQUEST(281),
    USER_DESTROY_PET_ITEM_REQUEST(282),
    USER_BRIDLE_ITEM_USE_REQUEST(283),
    USER_SKILL_LEARN_ITEM_USE_REQUEST(284),
    USER_SKILL_RESET_ITEM_USE_REQUEST(285),
    USER_ABILITY_RESET_ITEM_USE_REQUEST(286),
    USER_ABILITY_CHANGE_ITEM_USE_REQUEST(287),
    USER_EXP_CONSUME_ITEM_USE_REQUEST(288),
    USER_MONSTER_LIFE_INVITE_ITEM_USE_REQUEST(289),
    USER_EXP_ITEM_GET_REQUEST(290),
    USER_CHAR_SLOT_INC_ITEM_USE_REQUEST(291),
    USER_CHAR_RENAME_ITEM_USE_REQUEST(292),
    USER_KAISER_COLOR_CHANGE_ITEM_USE_REQUEST(293),
    USER_SHOP_SCANNER_ITEM_USE_REQUEST(294),
    USER_MAP_TRANSFER_ITEM_USE_REQUEST(295),
    USER_PORTAL_SCROLL_USE_REQUEST(296),
    USER_FIELD_TRANSFER_REQUEST(297),
    USER_UPGRADE_ITEM_USE_REQUEST(298),
    USER_UPGRADE_ASSIST_ITEM_USE_REQUEST(299),
    USER_HYPER_UPGRADE_ITEM_USE_REQUEST(300),
    USER_EX_ITEM_UPGRADE_ITEM_USE_REQUEST(301),
    USER_KARMA_CONSUME_ITEM_USE_REQUEST(302),
    USER_EVENT_UPGRADE_ITEM_USE_REQUEST(303),
    USER_ITEM_OPTION_UPGRADE_ITEM_USE_REQUEST(306),
    USER_ADDITIONAL_OPT_UPGRADE_ITEM_USE_REQUEST(307),
    USER_ITEM_SLOT_EXTEND_ITEM_USE_REQUEST(308),
    USER_WEAPON_TEMP_ITEM_OPTION_REQUEST(309),
    USER_ITEM_SKILL_SOCKET_UPGRADE_ITEM_USE_REQUEST(310),
    USER_ITEM_SKILL_OPTION_UPGRADE_ITEM_USE_REQUEST(311),
    USER_FREE_MIRACLE_CUBE_ITEM_USE_REQUEST(312),

    USER_EQUIPMENT_ENCHANT_WITH_SINGLE_UI_REQUEST(314),
    USER_UI_OPEN_ITEM_USE_REQUEST(315),
    USER_BAG_ITEM_USE_REQUEST(316),
    USER_ARCANE_SYMBOL_MERGE_REQUEST(317),

    USER_ITEM_RELEASE_REQUEST(320),
    USER_MEMORIAL_CUBE_OPTION_REQUEST(321),
    USER_USE_NAVI_FLYING_SKILL_REQUEST(322),
    USER_TOADS_HAMMER_REQUEST(324),
    USER_TOADS_HAMMER_HELP_REQUEST(325),
    USER_CHANGE_SOUL_COLLECTION_REQUEST(326),
    USER_SELECT_SOUL_SKILL_UP_REQUEST(327),
    USER_ABILITY_UP_REQUEST(329),
    USER_ABILITY_MASS_UP_REQUEST(330),
    USER_DOT_HEAL(331),
    USER_CHANGE_STAT_REQUEST(332),
    USER_CHANGE_STAT_REQUEST_BY_ITEM_OPTION(333),
    SET_SON_OF_LINKED_SKILL_REQUEST(334),
    UNLINK_SKILL_REQUEST(335),
    LINK_SKILL_REQUEST(336),
    USER_SKILL_UP_REQUEST(337),
    USER_SKILL_USE_REQUEST(338),
    USER_SKILL_CANCEL_REQUEST(339),
    USER_SKILL_PREPARE_STOP(340),
    USER_SKILL_PREPARE_START(341),

    USER_SKILL_KEYDOWN_CHARGE_REQUEST(343),
    USER_DROP_MONEY_REQUEST(344),
    USER_GIVE_POPULARITY_REQUEST(345),
    USER_PARTY_REQUEST(346),
    USER_CHARACTER_INFO_REQUEST(347),
    USER_ACTIVATE_PET_REQUEST(348),
    USER_REGISTER_PET_AUTO_BUFF_REQUEST(349),
    USER_TEMPORARY_STAT_UPDATE_REQUEST(350),
    USER_PORTAL_SCRIPT_REQUEST(351),
    USER_PORTAL_TELEPORT_REQUEST(352),
    USER_CALLING_TELEPORT_REQUEST(354),
    USER_MAP_TRANSFER_REQUEST(355),
    USER_ANTI_MACRO_ITEM_USE_REQUEST(356),
    USER_ANTI_MACRO_SKILL_USE_REQUEST(357),
    USER_ANTI_MACRO_REFRESH_REQUEST(358),
    USER_CLAIM_REQUEST(359),
    USER_QUEST_REQUEST(360),
    USER_MEDAL_REISSUE_REQUEST(361),
    USER_CALC_DAMAGE_STAT_SET_REQUEST(362),
    USER_B2_BODY_REQUEST(363),
    USER_THROW_GRENADE(364),
    USER_DESTROY_GRENADE(365),
    USER_CREATE_AURA_BY_GRENADE(366),
    USER_SET_MOVE_GRENADE(367),
    USER_MACRO_SYS_DATA_MODIFIED(368),
    USER_SELECT_NPC_ITEM_USE_REQUEST(369),
    USER_LOTTERY_ITEM_USE_REQUEST(370),
    USER_ROULETTE_START_REQUEST(371),
    USER_ROULETTE_RESULT_REQUEST(372),
    USER_ITEM_MAKE_REQUEST(373),
    USER_REPAIR_DURABILITY_ALL(374),
    USER_REPAIR_DURABILITY(375),
    USER_QUEST_RECORD_SET_STATE(376),
    USER_CLIENT_TIMER_END_REQUEST(377),
    USER_CLIENT_RESOLUTION_RESULT(-1),
    USER_FOLLOW_CHARACTER_REQUEST(-1),
    USER_FOLLOW_CHARACTER_WITHDRAW(380),
    USER_SELECT_PQ_REWARD(381),
    USER_REQUEST_PQ_REWARD(-1),
    SET_PASSENGER_RESULT(382),
    USER_REQUEST_INSTANCE_TABLE(383),
    USER_REQUEST_CREATE_ITEM_POT(384),
    USER_REQUEST_REMOVE_ITEM_POT(385),
    USER_REQUEST_INC_ITEM_POT_LIFE_SATIETY(386),
    USER_REQUEST_CURE_ITEM_POT_LIFE_SICK(387),
    USER_REQUEST_COMPLATE_TO_ITEM_POT(388),
    USER_REQUEST_RESPAWN(389),
    USER_CONSUME_HAIR_ITEM_USE_REQUEST(390),
    USER_FORCE_ATOM_COLLISION(393),
    USER_DEBUFF_OBJ_COLLISION(394),
    USER_UPDATE_LAPIDIFICATION(395),
    USER_UPDATE_PARTY_BUFF_AREA(396),

    USER_REQUEST_CHARACTER_POTENTIAL_SKILL_RAND_SET(400),
    USER_REQUEST_CHARACTER_POTENTIAL_SKILL_RAND_SET_UI(401),
    USER_REQUEST_OCCUMPATION_DATA(-1),
    USER_REQUEST_ASWAN_TIME_TABLE_CLIENT_INIT(-1),
    USER_PROTECT_BUFF_DIE_ITEM_REQUEST(404),
    USER_PROTECT_BUFF_DIE_MAPLE_POINT_REQUEST(-1),
    USER_PROTECT_EXP_DIE_MAPLE_POINT_REQUEST(-1),
    USER_KEY_DOWN_AREA_MOVING(-1),
    USER_CHECK_WEDDING_EX_REQUEST(-1),
    USER_CATCH_DEBUFF_COLLISION(408), // *
    USER_AFFECTED_AREA_CREATED(409),
    USER_AFFECTED_AREA_REMOVED(410),
    USER_DAZZLE_HIT(411),
    USER_MESO_EXCHANGE_REQUEST(412),
    ZERO_TAG(417),
    ZERO_SHARE_CASH_EQUIP_PART(418),
    ZERO_LAST_ASSIST_STATE(419),
    USER_SHOOT_ATTACK_IN_FPS(420),
    USER_LUCKY_ITEM_USE_REQUEST(421),
    USER_MOB_MOVE_ABILITY_CHANGE(422),
    USER_DRAGON_ACTION(423),
    USER_DRAGON_BREATH_EARTH_EFFECT(424),

    USER_RENAME_REQUEST(425),
    USER_RENAME_SPW_CHECK(426),

    GROUP_MESSAGE(428),
    ITEM_LINKED_GROUP_MESSAGE(429),
    FIELD_UNIVERSE_MESSAGE(430),
    WHISPER(431),
    MESSENGER(432),
    MINI_ROOM(434),
    PARTY_REQUEST(436),
    PARTY_RESULT(437),
    PARTY_INVITABLE_SET(438),
    EXPEDITION_REQUEST(439),
    PARTY_ADVER_REQUEST(440),
    URSUS_PARTY_REQUEST(441),
    GUILD_REQUEST(442),
    GUILD_RESULT(443),
    GUILD_JOIN_REQUEST(444),
    GUILD_JOIN_CANCEL_REQUEST(445),
    GUILD_JOIN_ACCEPT(446),
    GUILD_JOIN_REJECT(447),
    GUILD_CONTENT_RANK_REQUEST(448),
    TOWER_RANK_REQUEST(449),
    ADMIN(450),
    LOG(451),
    FRIEND_REQUEST(452),
    //    STAR_FRIEND_REQUEST(450),
    STAR_PLANET_POINT_REQUEST(453),
    LOAD_ACCOUNT_ID_OF_CHARACTER_FRIEND_REQUEST(454),
    MEMO_REQUEST(455),
    MEMO_FLAG_REQUEST(456),
    ENTER_TOWN_PORTAL_REQUEST(458),
    ENTER_RANDOM_PORTAL_REQUEST(459),
    ENTER_OPEN_GATE_REQUEST(460),
    SLIDE_REQUEST(461),
    FUNC_KEY_MAPPED_MODIFIED(462),
    R_P_S_GAME(463),
    G_S_R_P_S_GAME(464),
    STAR_PLANET__G_S_R_P_S_GAME(465),
    G_S_R_P_S_FORCE_SELECT(466),
    MARRIAGE_REQUEST(467),
    WEDDING_WISH_LIST_REQUEST(468),
    GUEST_BLESS(469),
    BOOBY_TRAP_ALERT(470),
    STALK_BEGIN(471),
    ALLIANCE_REQUEST(472),
    ALLIANCE_RESULT(473),
    TALK_TO_TUTOR(474),
    TALK_TO_PARTNER(475),
    USER_SWITCH_R_P(476),
    REQUEST_INC_COMBO(477), // *
    REQUEST_DEC_COMBO(478), // *
    REQUEST_SET_BLESS_OF_DARKNESS(479), // *

    DEMON_BLOOD_SPILL_REQUEST(481), // *
    XENON_CORE_OVERLOAD(482), // *
    REQUEST_SET_HP_BASE_DAMAGE(483),
    MOB_CRC_KEY_CHANGED_REPLY(484),
    MOB_CRC_DATA_RESULT(485),
    MAKING_SKILL_REQUEST(486),
    BROADCAST_EFFECT_TO_SPLIT(487),
    BROADCAST_ONE_TIME_ACTION_TO_SPLIT(488),
    BROADCAST_AFFECTED_EFFECT_TO_SPLIT(489),
    DEBUG_ONLY_COMMAND(490),
    MICRO_BUFF_END_TIME(491), // *
    REQUEST_SESSION_VALUE(492),
    USER_TRANSFER_FREE_MARKET_REQUEST(493),
    USER_REQUEST_SET_STEAL_SKILL_SLOT(494),
    USER_REQUEST_STEAL_SKILL_MEMORY(495),
    USER_REQUEST_STEAL_SKILL_LIST(496),
    USER_REQUEST_STEAL_SKILL(497),
    RECALL_SUMMON(498), // *

    REWARD_MOB_LIST_REQUEST(501),
    USER_LV_UP_GUIDE_NOTICE(502),
    RESET_CROSS_HUNTER_ALERT(503),
    CROSS_HUNTER_COMPLETE_REQUEST(504),
    CROSS_HUNTER_SHOP_REQUEST(505),
    USER_EQUIP_SLOT_LEVEL_MINUS_ITEM_USE_REQUEST(506),
    BOARD_GAME_REQUEST(507),
    USER_REQUEST_FLYING_SWORD_START(508),
    BINGO_REQUEST(512),
    BINGO_CASSANDRA_REQUEST(513),
    ACTION_BAR_REQUEST(514),
    //    USER_REQUEST_SET_OFF_TRINITY(513),
//    MESO_RANGER_REQUEST(514),
//    USER_REQUEST_SET_SMASH_COUNT(515),
    USER_HYPER_SKILL_UP_REQUEST(515),
    USER_HYPER_SKILL_RESET_REQUEST(516),
    USER_HYPER_STAT_SKILL_UP_REQUEST(517),
    USER_HYPER_STAT_SKILL_RESET_REQUEST(518),
    USER_SET_DRESS_CHANGED_REQUEST(519),
    ENTRY_RECORD_REQUEST(520),
    SET_MAX_GAUGE(521),
    USER_RETURN_EFFECT_RESPONSE(522),
    GET_SERVER_TIME(523),
    GET_CHARACTER_POSITION(524),
    USER_REQUEST_CHANGE_MOB_ZONE_STATE(525),
    EVOLVING_REQUEST(526),
    USER_MIXER_REQUEST(527),
    SUMMON_EVENT_REWARD(528),
    MYSTIC_FIELD_MOVE(529),
    YUT_GAME_REQUEST(530),
    USER_JEWEL_CRAFT_REQUEST(531),
    VALUE_PACK_REQUEST(532),
    REQUEST_RELOGIN_COOKIE(533),
    WAIT_QUEUE_REQUEST(534),
    CHECK_TRICK_OR_TREAT_REQUEST(535),
    MONSTER_FARM_MIGRATE_OUT_REQUEST(536),
    HALLOWEEN_CANDY_RANKING_REQUEST(537),
    GET_REWARD_REQUEST(538),
    MAPLE_STYLE_BONUS_REQUEST(539),
    MAPLE_STYLE_ADVICE_REQUEST(540),
    MAPLE_STYLE_SET_SCORE_REQUEST(541),
    MENTORING(541),
    GET_LOTTERY_RESULT(542),
    ROOT_ABYSS_ENTER_REQUEST(543),
    USER_SET_ITEM_ACTION(544),
    USER_SET_BITS_CASE(545),
    USER_SET_BITS_SLOT(546),
    USER_ANTI_MACRO_QUESTION_RESULT(547),
    USER_PINKBEAN_ROLLING(548),
    //    USER_PINKBEAN_YO_YO_STACK(538), // 4 ops got removed, idk which ones though
    USER_QUICK_MOVE_SCRIPT(547),
    TIME_GATE_REQUEST(546),
    USER_SELECT_ANDROID(547),
    USER_COMPLETE_NPC_SPEECH(548),
    USER_COMPLETE_ANOTHER_USER_CHECK(549),
    USER_COMPLETE_COMBO_KILL_COUNT_CHECK(550),
    USER_COMPLETE_MULTI_KILL_COUNT_CHECK(551),
    USER_COMPLETE_MULTI_KILL_CHECK(552),
    USER_DAMAGE_FALLING_CHECK(553),
    USER_COMPLETE_PERSONAL_SHOP_BUY_CHECK(554),
    USER_DAILY_COMMITMENT_CHECK(555),
    USER_MOB_DROP_MESO_PICKUP(555),
    USER_BREAK_TIME_FIELD_ENTER(556),
    USER_RUN_ACT_QUEST(567),
    JOURNAL_AVATAR_REQUEST(568),
    REQUEST_EVENT_LIST(569),
    USER_SIGN_REQUEST(570),
    ADD_ATTACK_RESET(571),
    SET_EVENT_NAME_TAG(572),
    USER_AFFECTED_AREA_REMOVE_BY_TIME(573),
    REQUEST_FREE_CHANGE_JOB(574),
    LIBRARY_START_SCRIPT(575),
    CHANNEL_USER_COUNT_REQUEST(576),
    UN_URSUS_SELECTED_SKILL_LIST(577),
    SOUL_DUNGEON_SYS(578),
    USER_COORDINATION_CONTEST_REQUEST(579),
    USER_SOUL_EFFECT_REQUEST(580),
    USER_SPIN_OFF_NEW_MODIFY_REQUEST(581),
    BLACK_LIST(582),
    SKILL_HELPER_POPUP(583),
    BLOCKBUSTER(584),
    M_TALK_OFFLINE_ACCOUNT_FRIENDS_NAME_REQUEST(585),
    CHARACTER_BURNING(586),
    UPDATE_CHARACTER_SELECT_LIST(586),
    DIRECT_GO_TO_FIELD(586),
    TRY_REGISTER_TELEPORT(586),
    USER_TOWER_CHAIR_SETTING(587),
    UNION_REQUEST(592),
    //    USER_LAST_COLLECT_MONSTER_RESET(563),
    END_OVER_HEAT(587),
    //TRADE_KING_SHOP_REQ(586), // overlap
    BULLET_BARRAGE_DURATION_EXTENSION_REQUEST(588), // *
    TRADE_KING_SHOP_INFO_REQ(589),
    KEY_DOWN_SKILL_COST(603), // *
    MATRIX_UPDATE_REQUEST(607),
    MOD_SPECTRA_ENERGY(610),
    USER_REVIVE_REQUEST(611),

    GREATER_DARK_SERVANT_SWAP_REQUEST(612), // *

    INHUMAN_SPEED_FORCE_ATOM_REQUEST(614), // *

    CRYSTAL_SKILL_REQUEST(616),
    UNK202(618),

    B_E_G_I_N__P_E_T(628),
    PET_MOVE(629),
    PET_ACTION(630),
    PET_INTERACTION_REQUEST(631),
    PET_DROP_PICK_UP_REQUEST(632),
    PET_STAT_CHANGE_ITEM_USE_REQUEST(633),
    PET_UPDATE_EXCEPTION_LIST_REQUEST(634),
    PET_FOOD_ITEM_USE_REQUEST(635),
    PET_OPEN_SHOP(636),
    E_N_D__P_E_T(637),

    B_E_G_I_N__S_K_I_L_L_P_E_T(638),
    SKILL_PET_MOVE(639),
    SKILL_PET_ACTION(640),
    SKILL_PET_STATE(641),
    SKILL_PET_DROP_PICK_UP_REQUEST(642),
    SKILL_PET_UPDATE_EXCEPTION_LIST_REQUEST(643),
    E_N_D__S_K_I_L_L_P_E_T(644),

    B_E_G_I_N__S_U_M_M_O_N_E_D(645),
    SUMMONED_MOVE(646),
    SUMMONED_ATTACK(647),
    SUMMONED_HIT(648),
    SUMMONED_SKILL(649),
    SUMMONED_REMOVE(650),
    SUMMONED_ATTACK_PV_P(651),
    SUMMONED_ACTION(652),

    SUMMONED_ASSIST_ATTACK_DONE(655),

    SUMMONED_SKILL_ATTACK(659),
    E_N_D__S_U_M_M_O_N_E_D(661),

    B_E_G_I_N__D_R_A_G_O_N(662),
    DRAGON_MOVE(663),
    DRAGON_GLIDE(664),
    E_N_D__D_R_A_G_O_N(665),

    B_E_G_I_N__A_N_D_R_O_I_D(666),
    ANDROID_MOVE(667),
    ANDROID_ACTISET(668),
    E_N_D__A_N_D_R_O_I_D(669),

    B_E_G_I_N__F_O_X_M_A_N(670),
    FOX_MAN_MOVE(671),
    FOX_MAN_ACTION_SET_USE_REQUEST(672),
    E_N_D__F_O_X_M_A_N(673),

    QUICKSLOT_KEY_MAPPED_MODIFIED(673),
    PASSIVE_SKILL_INFO_UPDATE(674),
    UPDATE_CLIENT_ENVIRONMENT(675),
    DIRECTION_NODE_COLLISION(679),
    USER_LASER_INFO_FOR_REMOTE(680),
    RETURN_TELEPORT_DEBUFF(681),
    CHECK_PROCESS(682),
    MEMO_IN_GAME_REQUEST(682),
    EGO_EQUIP_GAUGE_COMPLETE_RETURN(683),
    EGO_EQUIP_CREATE_UPGRADE_ITEM(684),
    EGO_EQUIP_CREATE_UPGRADE_ITEM_COST_REQUEST(685),
    EGO_EQUIP_TALK_REQUEST(686),
    EGO_EQUIP_CHECK_UPDATE_ITEM_REQUEST(687),
    INHERITANCE_INFO_REQUEST(688),
    INHERITANCE_UPGRADE_REQUEST(689),
    MIRROR_READING_SELECT_BOOK_REQUEST(690),
    LIKE_POINT(691),
    USER10TH_STREAMING_URL_REQUEST(692),
    USER_UPDATE_MAPLE_TV_SHOW_TIME(693),
    REDUCE_DOT_DAMAGE_BASE_BUFF_REQUEST(694),
    MIRROR_STUDY_COMPLETE(695),
    REQUEST_ARROW_PLATTER_OBJ(697),
    USER_TIME_EVENT_UI_OPEN_REQUEST(698),
    USER_TIME_EVENT_RESULT_REQUEST(699),
    USER_TIME_EVENT_COMPLETE_REQUEST(700),
    USER_TIME_EVENT_PASSED_TIME_SET(701),
    INVASION_SETTING_REQUEST(702),
    USER_FIELD_ATTACK_OBJ_REQUEST_BOARDING(703),
    USER_FIELD_ATTACK_OBJ_REQUEST_GET_OFF(704),
    MONSTER_BATTLE(705),
    UI_SCRIPT_REQUEST(727),
    BOSS_ARENA_MATCH_REQUEST(728),
    BOSS_ARENA_MIGRATE_REQUEST(706),
    MOB_USER_CONTROL_SKILL_Q_PUSH(707),
    MOB_USER_CONTROL_SKILL_Q_POP(708),
    MOB_USER_CONTROL_SKILL_FORCED_Q_POP(709),
    PARTY_QUEST_RANKING_REQUEST(710),
    ATTENDANCE_EVENT(711),
    ATTENDANCE_EVENT_REWARD_REQ(712),
    UI_ATTENDANCE_GHOST_CHANGE_REQ(713),
    EVENT_UI_REQ(714),
    ATTENDANCE_EVENT_SELECT_REWARD(715),
    USER_SET_CUSTOMIZE_EFFECT(717),
    USER_CUSTOMIZE_EFFECT_ITEM_MODIFY(718),
    USER_GROWTH_HELPER_REQUEST(719),
    USER_CONTENTS_MAP_REQUEST(720),
    USER_TIMER_REQ(723),
    USER_MANNEQUIN(724),
    USER_BUFFER_FLY_REQ(725),
    USER_NON_TARGET_FORCE_ATOM_ATTACK(726),
    USER_RUN_SCRIPT(727),
    CHECK_BOSS_PARTY_BY_SCRIPT(728),
    SET_GO_TO_SHINE_CITY_WAIT_FIELD(729),
    SET_STAR_PLANET_MINI_GAME_CUSTOMIZING_OPTION(730),
    STAR_PLANET_TREND_SHOP_SET_AVATAR(731),
    STAR_PLANET_TREND_SHOP_RESTORE_AVATAR(732),
    STAR_PLANET_REQUEST(733),
    STAR_PLANET_MATCHING_REENTRANCE(734),
    STAR_PLANET_RESULT_UI_EXIT_SCRIPT(735),
    MOVE_TO_BOSS_MATCHING_FIELD(737), // v206
    MONSTER_COLLECTION_COMPLETE_REWARD_REQ(738),
    MONSTER_COLLECTION_EXPLORE_REQ(739),
    UNION_RAID_RETREAT(740),
    PLAT_FORMAR_ENTER_REQUEST(741),
    STIGMA_DELIVERY_REQUEST(742),

    B_E_G_I_N__E_V_E_N_T__G_R_O_U_P(-1),
    INVITATION_ACCEPT_USER(743),
    INVITATION_CANCEL_USER(744),
    EVENT_GROUP_LEAVE(745),
    B_E_G_I_N__E_V_E_N_T__G_R_O_U_P__P_A_C_K_E_T(746),
    E_N_D__E_V_E_N_T__G_R_O_U_P__P_A_C_K_E_T(747),
    E_N_D__E_V_E_N_T__G_R_O_U_P(748),

    B_E_G_I_N__E_V_E_N_T__R_A_N_K_I_N_G(749),
    EVENT_RANKING_OPEN(750),
    EVENT_RANKING_HELP(751),
    E_N_D__E_V_E_N_T__R_A_N_K_I_N_G(752),

    B_E_G_I_N__A_F_R_E_E_C_A_T_V(753),
    AFREECA_TV_BROAD_START(754),
    AFREECA_TV_BROAD_STOP(755),
    E_N_D__A_F_R_E_E_C_A_T_V(756),
    /*
        B_E_G_I_N__S_T_A_R_P_L_A_N_E_T__M_A_T_C_H_I_N_G(759),
        STAR_PLANET_MATCHING__REGISTER_REQ(760),
        STAR_PLANET_MATCHING__UN_REGISTER_REQ(761),
        STAR_PLANET_MATCHING__REGISTER_PARTY_REQ(762),
        STAR_PLANET_MATCHING__JOIN_PARTY_PLAY_REQ(763),
        STAR_PLANET_MATCHING__TRANSFER_ASSENT(764),
        STAR_PLANET_MATCHING__HELP_SCRIPT(765),
        E_N_D__S_T_A_R_P_L_A_N_E_T__M_A_T_C_H_I_N_G(766),

        B_E_G_I_N__S_T_A_R_P_L_A_N_E_T__Q_U_E_U_E(767),
        STAR_PLANET_QUEUE__REGISTER_REQ(768),
        STAR_PLANET_QUEUE__UN_REGISTER_REQ(769),
        E_N_D__S_T_A_R_P_L_A_N_E_T__Q_U_E_U_E(770),

        B_E_G_I_N__S_T_A_R_P_L_A_N_E_T__I_N_V_I_T_A_T_I_O_N(771),
        STAR_PLANET_INVITATION_ACCEPT(772),
        STAR_PLANET_INVITATION_CANCEL(773),
        E_N_D__S_T_A_R_P_L_A_N_E_T__I_N_V_I_T_A_T_I_O_N(774),
    */
    // changed OPheaders from here (-6)
    USER_SURVEY_REQUEST(773),
    NPS_INFO(774),
    USER_FLAME_ORB_REQUEST(775),
    USER__SAD_RESULT_UI__CLOSE(776),
    FREE_LOOK_CHANGE_REQUEST(777),
    FREE_LOOK_CHANGE_UI_OPEN_FAILED(778),
    USER_SMART_PHONE_CALL_REQUEST(779),
    USER_JAGUAR_CHANGE_REQUEST(780),
    FPS_LOG(781),
    PACKET_MODIFY_LOG(782),
    BATTLE_USER_AVATAR_SELECT(783),
    BATTLE_USER_ATTACK(784),
    BATTLE_USER_ATTACK_EXPIRE(785),
    BATTLE_USER_ATTACK_POSITION(786),
    BATTLE_USER_HIT(787),
    BATTLE_USER_HIT_BY_MOB(788),
    BATTLE_STAT_CORE_REQUEST(789),
    BATTLE_USER_ALIVE(790),
    USER_CONTENTS_BOOK_REQUEST(791),
    PERFORMANCE_CLIENT_LOGIN(792),
    PERFORMANCE_CLIENT_IN_FIELD(793),
    PING_CHECK_REQUEST__CLIENT_TO_GAME(794),
    PING__CLIENT_TO_GAME(795),
    PLANT_POT_CLICK(796),
    RANDOM_MISSION_REQUEST(797),
    ITEM_COLLECTION_SET_FLAG(798),
    ITEM_COLLECTION_CHECK_COMPLETE(799),
    SELF_STAT_CHANGE_REQUEST(800),
    CASH_BUFF_EVENT_CANCEL(801),

    CREATE_PSYCHIC_LOCK(808), // *
    RESET_PATH_PSYCHIC_LOCK(809),
    RELEASE_PSYCHIC_LOCK(810),
    RESERVE_DAMAGE_PSYCHIC_LOCK(811),
    CREATE_KINESIS_PSYCHIC_AREA(812),
    DO_ACTIVE_PSYCHIC_AREA(813),
    DEBUFF_PSYCHIC_AREA(814),
    RELEASE_PSYCHIC_AREA(815),
    PSYCHIC_OVER_REQUEST(816),
    DEC_PSYCHIC_POINT_REQUEST(817),
    TOUCH_ME_END_REQUEST(818),
    BITE_ATTACK_RESPONSE(819),
    SAVE_URSUS_SKILL(820),
    GET_SAVED_URSUS_SKILL(821),
    URSUS_SHOP_REQUEST(822),
    URSUS_PARTY_MEMBER_LIST(822),
    USER_KEY_DOWN_STEP_REQUEST(823),
    DAILY_GIFT_REQUEST(824),
    SKILL_COMMAND_LOCK_ARAN(825),
    SKILL_COMMAND_LOCK_ARK(826),
    BEAST_FORM_WING_OFF(827),
    RESET_AIR_HIT_COUNT_REQUEST(828),
    RW_ACTION_CANCEL(833),
    RELEASE_RW_GRAB(834),
    DIMENSIONAL_MIRROR_WARP_REQUEST(835),
    RW_CLEAR_CURRENT_ATTACK_REQUEST(836),
    RW_MULTI_CHARGE_CANCEL_REQUEST(837),
    FUNCTION_FOOTHOLD_MAN(838),
    // to here

    SHOOT_OBJECT_CREATE_REQUEST(840),

    SHOOT_OBJECT_EXPLODE_REQUEST(843),

    LOADED_DICE_SELECTION_RESULT(847),
    SERPENT_VORTEX_INCREMENT_REQUEST(848),

    UNION_ASSIGN_REQUEST(852),
    SPOTLIGHT_STACK_REQUEST(851), // *

    UNION_PRESET_CHANGE(855), // (856 v207)
    UNION_PRESET_INFO_REQUEST(856), // v206 (857 v207)


    ACHIEVEMENT_REQUEST(865), // *

    USER_TELEPORT_ROCK_ALLOWED_SETTING_REQUEST(871),

    INCREASE_SKILL_STACK_REQUEST(882),

    DIVINE_ECHO_EXPIRE_REQUEST(883),

    DIMENSIONAL_SWORD_CHANGE(884), // *
    INFERNO_SPHERE_FEATHER_COUNT(885), // *

    MONSTER_BOOK_MOB_INFO(917),
    GACHAPON_REQUEST(919),

    NEBULITE_INSERT_REQUEST(914), // *
    SOCKET_CREATE_REQUEST(915),

    FAMILIAR_ADD_REQUEST(924),
    FAMILIAR_SPAWN_REQUEST(925),
    FAMILIAR_RENAME_REQUEST(926),

    PREMIUM_BOX_REQUEST(928),
    PLAYER_MORPH_REQUEST(944),

    // Beast Tamer
    BEAST_TAMER_REGROUP_REQUEST(895),

    GUILD_BBS(937),
    
    SURPRISE_BOX(945),

    SALON_QUERY(970),


    FAMILIAR_MOVE(985),
    FAMILIAR_ACTION(986),
    FAMILIAR_ATTACK(987),
    FAMILIAR_SKILL(988),

    SLASH_COMMAND(1023),

    E_N_D__U_S_E_R(1014),

    B_E_G_I_N__F_I_E_L_D(1014),
    B_E_G_I_N__L_I_F_E_P_O_O_L(1007),


    B_E_G_I_N__M_O_B(1022),
    MOB_MOVE(1023),
    MOB_APPLY_CTRL(1024),
    MOB_DROP_PICK_UP_REQUEST(1025),
    MOB_HIT_BY_OBSTACLE(1026),
    MOB_HIT_BY_OBSTACLE_ATOM(1027),
    MOB_HIT_BY_MOB(1028),
    MOB_SELF_DESTRUCT(1029),
    MOB_SELF_DESTRUCT_COLLISION_GROUP(1030),
    MOB_ATTACK_MOB(1032),
    MOB_SKILL_DELAY_END(1033),
    MOB_TIME_BOMB_END(1034),
    MOB_ESCORT_COLLISION(1035),
    MOB_REQUEST_ESCORT_INFO(1036),
    MOB_ESCORT_STOP_END_REQUEST(1037),
    MOB_AREA_ATTACK_DISEASE(1038),
    MOB_EXPLOSION_START(1039),
    MOB_LIFTING_END(1040),
    MOB_UPDATE_FIXED_MOVE_DIR(1041),
    MOB_CREATE_FIRE_WALK(1042),
    MOB_AFTER_DEAD_REQUEST(1043),
    MOB_DAMAGE_SHARE_INFO(1044),
    MOB_CREATE_AFFECTED_AREA(1045),
    MOB_DOWN_RESPONSE(1046),
    E_N_D__M_O_B(1047),

    B_E_G_I_N__N_P_C(1058),
    NPC_MOVE(1059),
    NPC_SPECIAL_ACTION(1060),
    E_N_D__N_P_C(1061),
    E_N_D__L_I_F_E_P_O_O_L(1062),

    B_E_G_I_N__D_R_O_P_P_O_O_L(1063),
    DROP_PICK_UP_REQUEST(1064),
    E_N_D__D_R_O_P_P_O_O_L(1065),

    B_E_G_I_N__R_E_A_C_T_O_R_P_O_O_L(1065),
    REACTOR_HIT(1066),
    REACTOR_CLICK(1067),
    REACTOR_RECT_IN_MOB(1068),
    REACTOR_UNK203_1047(1069),
    REACTOR_KEY(1070),
    E_N_D__R_E_A_C_T_O_R_P_O_O_L(1071),

    B_E_G_I_N__F_I_S_H_I_N_G_Z_O_N_E_P_O_O_L(1072),
    FISHING_INFO(1073),
    FISHING_END(1074),
    E_N_D__F_I_S_H_I_N_G_Z_O_N_E_P_O_O_L(1075),

    B_E_G_I_N__P_E_R_S_O_N_A_L__O_B_J_E_C_T(1076),
    DECOMPOSER_REQUEST(1077),
    E_N_D__P_E_R_S_O_N_A_L__O_B_J_E_C_T(1078),

    B_E_G_I_N__E_V_E_N_T__F_I_E_L_D(1079),
    EVENT_START(1080),
    SNOW_BALL_HIT(1081),
    SNOW_BALL_TOUCH(1082),
    COCONUT_HIT(1083),
    TOURNAMENT_MATCH_TABLE(1084),
    PULLEY_HIT(1085),
    E_N_D__E_V_E_N_T__F_I_E_L_D(1086),

    B_E_G_I_N__M_O_N_S_T_E_R__C_A_R_N_I_V_A_L__F_I_E_L_D(1087),
    M_CARNIVAL_REQUEST(1088),
    E_N_D__M_O_N_S_T_E_R__C_A_R_N_I_V_A_L__F_I_E_L_D(1089),

    B_E_G_I_N__D_E_F_E_N_S_E__F_I_E_L_D(1090),
    DEFENSE_GAME_REQUEST(1091),
    E_N_D__D_E_F_E_N_S_E__F_I_E_L_D(1092),

    C_O_N_T_I_S_T_A_T_E(1105),
    B_E_G_I_N__P_A_R_T_Y__M_A_T_C_H(1106),
    INVITE_PARTY_MATCH(1110),
    CANCEL_INVITE_PARTY_MATCH(1111),
    PARTY_MEMBER_CANDIDATE_REQUEST(1112),
    URSUS_PARTY_MEMBER_CANDIDATE_REQUEST(1113),
    PARTY_CANDIDATE_REQUEST(1114),
    INTRUSION_FRIEND_CANDIDATE_REQUEST(1115),
    INTRUSION_LOBBY_CANDIDATE_REQUEST(1116),
    END_PARTY_MATCH(1117),
    REQUEST_FOOT_HOLD_MOVE(1118),
    //  GATHER_REQUEST(1089),
    GATHER_END_NOTICE(1120),
    ACT_CHANGE_REACTOR_USE_REQUST(1121),
    USER_ANTI_MACRO_BOMB_REQUEST(1122),
    MAKE_ENTER_FIELD_PACKET_FOR_QUICK_MOVE(1123),
    RUNE_STONE_USE_REQ(1124),
    RUNE_STONE_SKILL_REQ(1119),

    OBSTACLE_ATOM_COLLISION(1127), // *
    TIMER_GAUGE_TIMEOUT(1128),
    FALLING_CATCHER_HACK_CHECK(1129), // *
    COOK_GAME_REQUEST(1130),
    FPS_MODE_EXIT_REQUEST(1131),
    MAKE_ENTER_FIELD_PACKET_FOR_MIRROR_DUNGEON(1132),
    LEAVE_MIRROR_DUNGEON(1133),
    PEACEMAKER_TRAVEL_CONTACT_COUNT(1134), // *
    PEACEMAKER_EXPLOSION_CONTACT_COUNT(1135), // *

    ILLIUM_RESONANCE_LINK(1139),


    B_E_G_I_N__R_H_Y_T_H_M_G_A_M_E(1131),
    RHYTHM_GAME_HIT_NOTE(1132),
    RHYTHM_GAME_START_REGION(1133),
    //RHYTHM_GAME_END_REGION(1134),
    //RHYTHM_GAME_END_SPECIAL_ATTACK(1135),

    //RHYTHM_GAME_SELECT_MODE(1104),
    //RHYTHM_GAME_ATTACK_REQUEST(1105),
    RHYTHM_GAME_NPC_ACTION_REQUEST(1138),
    //RHYTHM_GAME_EXIT_GAME(1119),
    E_N_D__R_H_Y_T_H_M_G_A_M_E(1140),

    B_E_G_I_N__M_O_U_N_T_A_I_N_R_I_D_I_N_G(1141),
    MOUNTAIN_RIDING_HP_INFO(1142),
    MOUNTAIN_RIDING_MOB_INFO(1143),
    E_N_D__M_O_U_N_T_A_I_N_R_I_D_I_N_G(1144),

    B_E_G_I_N__P_I_R_A_N_H_A(1145),
    PIRANHA_INFO(1146),
    PIRANHA_DIE(1147),
    PIRANHA_DAMAGE(1148),
    PIRANHA_PREPARE(1149),
    E_N_D__P_I_R_A_N_H_A(1150),

    B_E_G_I_N__R_O_B_B_I_N_S(1151),
    ROBBINS__INC_BOMB(1152),
    ROBBINS__DEC_BOMB(1153),
    ROBBINS__TOSS_BOMB(1154),
    E_N_D__R_O_B_B_I_N_S(1155),

    B_E_G_I_N__F_A_L_L_I_N_G_S_T_O_N_E(1156),
    FALLING_STONE_INFO(1157),
    FALLING_STONE_HP_INFO(1158),
    FALLING_STONE_PREPARE(1159),
    E_N_D__F_A_L_L_I_N_G_S_T_O_N_E(1160),

    B_E_G_I_N__B_A_T_T_L_E_F_I_E_L_D(1161),
    BATTLE_FIELD_DAMAGE(1162),
    BATTLE_FIELD_SHEEP_REVIVAL_REQ(1163),
    BATTLE_FIELD_SHEEP_REVIVE(1164),
    E_N_D__B_A_T_T_L_E_F_I_E_L_D(1165),

    B_E_G_I_N__B_O_S_S_A_R_E_N_A(1166),
    BOSS_ARENA_SELECT_BOSS(1167),
    BOSS_ARENA_SELECT_SKILL(1168),
    BOSS_ARENA_SELECT_DIFFICULTY(1169),
    BOSS_ARENA_SELECT_CONFIRM(1170),
    E_N_D__B_O_S_S_A_R_E_N_A(1171),

    B_E_G_I_N__C_A_T_A_P_U_L_T(1172),
    CATAPULT__UPGRADE_SKILL(1173),
    E_N_D__C_A_T_A_P_U_L_T(1174),

    FIELD_ATTACK_OBJ_PUSH_ACT(1175),
    FIELD_RESPAWN(1176),
    B_E_G_I_N__S_O_U_L__D_U_N_G_E_O_N(1177),
    SOUL_ITEM_USE(1178),
    SOUL_ITEM_USE_VOTE(1179),
    SOUL_DUNGEON_SUMM_SOUL_BOSS(1180),
    E_N_D__S_O_U_L__D_U_N_G_E_O_N(1181),

    B_E_G_I_N__S_P_A_C_E_M_O_O_N_R_A_B_B_I_T(1182),
    SPACE_MOON_RABBIT_HIT_EFF(1183),
    SPACE_MOON_RABBIT_DAMAGE(1184),
    E_N_D__S_P_A_C_E_M_O_O_N_R_A_B_B_I_T(1185),

    B_E_G_I_N__H_U_N_D_R_E_D_B_I_N_G_O(1186),
    H_BINGO_CHECK_NUMBER(1187),
    H_BINGO_CHECK_BINGO(1188),
    E_N_D__H_U_N_D_R_E_D_B_I_N_G_O(1189),

    B_E_G_I_N__T_Y_P_I_N_G_G_A_M_E(1190),
    TYPING_GAME_CHECK_MSG(1191),
    TYPING_GAME_WORD_MOB_ATTACK(1192),
    TYPING_GAME_LEVEL_SELECT(1193),
    TYPING_GAME_SKILL_ATTACK(1194),
    TYPING_GAME_FIELD_OUT(1195),
    E_N_D__T_Y_P_I_N_G_G_A_M_E(1196),

    B_E_G_I_N__H_U_N_D_R_E_D_O_X_Q_UI_Z(1197),
    H_OX_QUIZ_SELECTED(1198),
    E_N_D__H_U_N_D_R_E_D_O_X_Q_UI_Z(1199),

    B_E_G_I_N__S_T_A_R_P_L_A_N_E_T_R_P_S(1200),
    S_P_RPS_GAME_USER_SELECT(1201),
    S_P_RPS_GAME_ANSWER(1202),
    S_P_RPS_GAME_LEAVE(1203),
    E_N_D__S_T_A_R_P_L_A_N_E_T_R_P_S(1204),

    B_E_G_I_N__S_I_D_E_S_C_R_O_L_L_F_L_Y_S_H_O_O_T_I_N_G(1205),
    SSFS_HIT_USER(1206),
    SSFS_LETHAL_ATTACK(1207),
    SSFS_EXIT(1208),
    E_N_D__S_I_D_E_S_C_R_O_L_L_F_L_Y_S_H_O_O_T_I_N_G(1209),

    B_E_G_I_N__F_I_E_L_D_S_T_A_T_E(1210),
    STAR_PLANET__H_BINGO_CHECK_NUMBER(1211),
    STAR_PLANET__H_BINGO_CHECK_BINGO(1212),
    STAR_PLANET__H_BINGO_SEND_NUMBER(1213),
    STAR_PLANET__H_RPS_SELECTED(1214),
    STAR_PLANET__GROUP_DANCE_SELECTED(1215),
    STAR_PLANET__GROUP_DANCE_CANCEL(1216),
    E_N_D__F_I_E_L_D_S_T_A_T_E(1217),

    B_E_G_I_N__M_O_M_E_N_T_S_W_I_M_A_R_E_A(1218),
    MOMENT_SWIM_AREA__WATER_LEVEL(1219),
    E_N_D__M_O_M_E_N_T_S_W_I_M_A_R_E_A(1220),

    B_E_G_I_N__G_H_O_S_T_P_A_R_K(1221),
    GHOST_PARK_USE_RUNE_REQ(1222),
    GHOST_PARK_RUNE_HEAL_REQ(1223),
    GHOST_PARK_HIT_BULLET(1224),
    E_N_D__G_H_O_S_T_P_A_R_K(1225),

    B_E_G_I_N__F_I_E_L_D__U_R_U_S(1226),
    URSUS_SAVE_DEADLY_USER(1227),
    E_N_D__F_I_E_L_D__U_R_U_S(1228),

    FIELD_SKILL_USE_REQUEST(1229),
    FIELD_WEATHER__MSG(1230),
    FIELD_STAT_Q_R_EX_DAY(1231),

    B_E_G_I_N__P_O_L_O_F_R_I_T_O_B_O_U_N_T_Y_H_U_N_T_I_N_G(1232),
    POLO_FRITO_BOUNTY_HUNTING_REQUEST(1233),
    E_N_D__P_O_L_O_F_R_I_T_O_B_O_U_N_T_Y_H_U_N_T_I_N_G(1234),

    B_E_G_I_N__P_O_L_O_F_R_I_T_O_T_O_W_N_D_E_F_E_N_S_E(1235),
    POLO_FRITO_TOWN_DEFENSE_REQUEST(1236),
    E_N_D__P_O_L_O_F_R_I_T_O_T_O_W_N_D_E_F_E_N_S_E(1237),

    B_E_G_I_N__P_O_L_O_F_R_I_T_O_C_O_U_R_T_S_H_I_P_D_A_N_C_E(1238),
    POLO_FRITO_COURTSHIP_DANCE_RESULT(1239),
    E_N_D__P_O_L_O_F_R_I_T_O_C_O_U_R_T_S_H_I_P_D_A_N_C_E(1240),

    B_E_G_I_N__B_O_S_S__D_E_M_I_A_N__F_L_Y_I_N_G_S_W_O_R_D(1241),
    DEMIAN_OBJECT_MAKE_ENTER_ACK(1245),
    DEMIAN_OBJECT_NODE_END(1246),
    DEMIAN_OBJECT_ERR__RECREATE(1247),
    E_N_D__B_O_S_S__D_E_M_I_A_N__F_L_Y_I_N_G_S_W_O_R_D(1248),
    E_N_D__F_I_E_L_D(1249),

    CHECK_S_P_W_CREATE_NEW_CHARACTER(1261),
    SET_S_P_W(1262),

    B_E_G_I_N__B_L_A_C_K__M_A_G_E(1329),
    BLACK_MAGE_ORB_HIT(1329),
    E_N_D__B_L_A_C_K__M_A_G_E(1330),

    GOLLUX_MINI_MAP_LEAVE_REQUEST(1334),

    B_E_G_I_N__C_A_S_H_S_H_O_P(1379), // *
    CASH_SHOP_CHARGE_PARAM_REQUEST(1380),
    CASH_SHOP_QUERY_CASH_REQUEST(1381),
    CASH_SHOP_CASH_ITEM_REQUEST(1382),
    CASH_SHOP_CHECK_COUPON_REQUEST(1383),
    CASH_SHOP_MEMBER_SHOP_REQUEST(1385),
    CASH_SHOP_GIFT_MATE_INFO_REQUEST(1386),
    CASH_SHOP_SEARCH_LOG(1387),
    CASH_SHOP_COODINATION_REQUEST(1388),
    CASH_SHOP_CHECK_MILEAGE_REQUEST(1389),
    CASH_SHOP_NAVER_USAGE_INFO_REQUEST(1390),
    M_V_P__DAILY_PACK__REQUEST(1391),
    M_V_P__SPECIAL_PACK__REQUEST(1392),
    CASH_SHOP_ACTION(1395),
    CASH_SHOP_BUTTON_PRESS(1396),
    E_N_D__C_A_S_H_S_H_O_P(1397),


    B_E_G_I_N__R_A_I_S_E(1398),
    RAISE_REFRESH(1399),
    RAISE_UI_STATE(1400),
    RAISE_INC_EXP(1401),
    RAISE_ADD_PIECE(1402),
    E_N_D__R_A_I_S_E(1403),

    SEND_MATE_MAIL(1404),
    REQUEST_GUILD_BOARD_AUTH_KEY(1405),
    REQUEST_CONSULT_AUTH_KEY(1406),
    REQUEST_CLASS_COMPETITION_AUTH_KEY(1407),
    REQUEST_WEB_BOARD_AUTH_KEY(1408),
    IRBOX_EVENT(1409),

    B_E_G_I_N__I_T_E_M_U_P_G_R_A_D_E(1413), // *
    GOLD_HAMMER_REQUEST(1414),
    GOLD_HAMMER_COMPLETE(1415),
    E_N_D__I_T_E_M_U_P_G_R_A_D_E(1416),

    B_E_G_I_N__B_A_T_T_L_E_R_E_C_O_R_D(1418),
    BATTLE_RECORD_ON_OFF_REQUEST(1419),
    BATTLE_RECORD_SKILL_DAMAGE_LOG(1420),
    E_N_D__B_A_T_T_L_E_R_E_C_O_R_D(1421),

    B_E_G_I_N__F_A_R_M(1421),
    INSERT_FARM_OBJECT(1422),
    DELETE_FARM_OBJECT(1423),
    INSERT_FARM_TILE(1424),
    DELETE_FARM_TILE(1425),
    TRANSFER_FARM_FIELD(1426),
    BUY_FARM_OBJECT(1427),
    SEL_FARM_OBJECT(1428),
    MY_HOUSE_UPGRADE(1428),
    FARM_ADMIN_COMMAND(1429),
    REQUEST_QUEST_COMPLETE(1430),
    CHECK_FARM_NAME(1431),
    REQUEST_INTERACT_OBJECT(1432),
    REQUEST_CONSUME_OBJECT(1433),
    REQUEST_CLICK_NPC(1434),
    REQUEST_RANDOM_FARM(1435),
    REQUEST_FARM_VISIT(1436),
    REQUEST_ADD_FARM_FRIEND(1437),
    FARM_IN_GAME_FRIEND_REQUEST(1438),
    REQUEST_DELETE_FARM_FRIEND(1439),
    REQUEST_ADD_BLACK_LIST(1440),
    REQUEST_DELETE_BLACK_LIST(1441),
    REQUEST_FARM_INFO_UI(1442),
    CHECK_FARM_NAME_BY_CONSUME(1443),
    REQUEST_AUTO_HARVEST(1444),
    REQUEST_SOUL_RECHARGE(1445),
    REQUEST_TRANSFER_FARM_BY_NAME(1446),
    MY_FARM_MONSTER_REQUEST(1447),
    FARM_MONSTER_COMBINE(1448),
    FARM_MONSTER_SET_NAME_REQUEST(1449),
    FARM_MONSTER_CARE(1450),
    FARM_MONSTER_PLAY(1451),
    FARM_MONSTER_RELEASE(1452),
    FARM_MONSTER_SEARCH_REQUEST(1453),
    FARM_MONSTER_POS_RECODE(1454),
    FARM_MONSTER_LOCKER_REQUEST(1455),
    FARM_MONSTER_LIFE_EXTEND(1456),
    PHOTO_UPDATE(1457),
    PHOTO_GET_REQUEST(1458),
    MY_HOME_SEND_NOTICE_REQUEST(1459),
    MY_HOME_LOAD_MAIN_LOG_REQUEST(1460),
    MY_HOME_DELETE_LOG_REQUEST(1461),
    FARM_WHISPER(1462),
    FARM_GROUP_MESSAGE(1463),
    REQUEST_FARM_FRIEND_RECOMMEND(1464),
    FARM_REQUEST_IN_GAME_INFO_SET(1465),
    FARM_REQUEST_IN_GAME_INFO_MOD(1466),
    REQUEST_FARM_FRIEND_INFO(1467),
    REQUEST_FARM_TODAY(1468),
    REQUEST_FIRST_ENTER_REWARD(1469),
    CHECK_ADMIN_ACCOUNT_LOG(1470),
    E_N_D__F_A_R_M(1471),

    CHARACTER_LIST_REQUEST(1472),
    COPY_CHARACTER_TO_TEST_REQUEST(1473),

    REWARD_REQUEST(1482),

    VORAGE_REQUEST(1483),

    NO(1484), // ish
    ;

    /**
     * Created on 2/18/2017.
     */
    private short value;
    private final static Map<Short, InHeader> opToHeaderMap = new HashMap<>();

    static {
        for (InHeader ih : values()) {
            opToHeaderMap.put(ih.getValue(), ih);
        }
    }

    InHeader(int op) {
        this.value = (short) op;
    }

    public short getValue() {
        return value;
    }

    public static InHeader getInHeaderByOp(int op) {
        return opToHeaderMap.getOrDefault((short) op, null);
    }

    public static boolean isSpamHeader(InHeader inHeaderByOp) {
        List<InHeader> spam = Arrays.asList(
            //    UPDATE_CLIENT_ENVIRONMENT,
                PONG,
                WVS_SET_UP_STEP,
                SECURITY_PACKET,
                PRIVATE_SERVER_PACKET,
                MOB_MOVE,
                USER_MOVE,
                USER_HIT,
                USER_EMOTION,
                PASSIVE_SKILL_INFO_UPDATE,
                USER_CHANGE_STAT_REQUEST,
                SUMMONED_MOVE,
                USER_TEMPORARY_STAT_UPDATE_REQUEST,
                USER_CALC_DAMAGE_STAT_SET_REQUEST,
                MOB_APPLY_CTRL,
                USER_REQUEST_INSTANCE_TABLE,
                USER_QUEST_REQUEST,
                CHECK_LOGIN_AUTH_INFO,
                NPC_MOVE,
                SKILL_PET_MOVE,
                FAMILIAR_MOVE,
                PET_MOVE,
                ALIVE_ACK,
                OBSTACLE_ATOM_COLLISION,
                USER_COMPLETE_COMBO_KILL_COUNT_CHECK,
                USER_COMPLETE_MULTI_KILL_COUNT_CHECK,
                USER_COMPLETE_MULTI_KILL_CHECK,
                USER_CHAT,
                XENON_CORE_OVERLOAD,
//                MOB_SKILL_DELAY_END,
                ANDROID_MOVE,
                DRAGON_MOVE,
                SERPENT_VORTEX_INCREMENT_REQUEST,
                MOD_SPECTRA_ENERGY,
                UPDATE_CLIENT_ENVIRONMENT
        );
        return spam.contains(inHeaderByOp);
    }

    public static void main(String[] args) {
//        int change = 39;
//        for (OutHeader header : values()) {
//            int val = header.getValue();
//            if (val >= SET_FIELD.getValue()) {
//                val += change;
//            }
//            System.out.printf("%s(%d),%n", header, val);
//        }
        File file = new File(ServerConstants.DIR + "\\src\\main\\java\\net\\swordie\\ms\\handlers\\header\\InHeader.java");
        int change = 1;
        InHeader checkOp = null;
        try (Scanner s = new Scanner(file)) {
            while (s.hasNextLine()) {
                String line = s.nextLine();
                if (line.contains(",") && line.contains("(")) {
                    String[] split = line.split("[()]");
                    String name = split[0];
                    if (!Util.isNumber(split[1])) {
                        System.out.println(line);
                        continue;
                    }
                    int val = Integer.parseInt(split[1]);
                    InHeader ih = Arrays.stream(InHeader.values()).filter(o -> o.toString().equals(name.trim())).findFirst().orElse(null);
                    if (ih != null) {
                        InHeader start = B_E_G_I_N__C_A_S_H_S_H_O_P;
                        if (ih.ordinal() >= start.ordinal() && ih.ordinal() < B_E_G_I_N__I_T_E_M_U_P_G_R_A_D_E.ordinal()) {
                            if (line.contains("*")) {
                                checkOp = ih;
                            }
                            val += change;
                            System.out.println(String.format("%s(%d), %s", name, val, start == ih ? "// *" : ""));
                        } else {
                            System.out.println(line);
                        }
                    } else {
                        System.out.println(line);
                    }
                } else {
                    System.out.println(line);
                }
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        if (checkOp != null) {
            System.err.println(String.format("Current op (%s) contains a * (= updated). Be sure to check for overlap.", checkOp));
        }
    }
}
