diff --git a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.deps.json b/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.deps.json deleted file mode 100644 index 1a28e5f5ea..0000000000 --- a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.deps.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "runtimeTarget": { - "name": ".NETStandard,Version=v2.1/", - "signature": "" - }, - "compilationOptions": {}, - "targets": { - ".NETStandard,Version=v2.1": {}, - ".NETStandard,Version=v2.1/": { - "CSNetwork/1.0.0": { - "dependencies": { - "System.Reflection.Metadata": "9.0.8" - }, - "runtime": { - "CSNetwork.dll": {} - } - }, - "System.Buffers/4.5.1": { - "runtime": { - "lib/netstandard2.0/System.Buffers.dll": { - "assemblyVersion": "4.0.3.0", - "fileVersion": "4.6.28619.1" - } - } - }, - "System.Collections.Immutable/9.0.8": { - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Collections.Immutable.dll": { - "assemblyVersion": "9.0.0.0", - "fileVersion": "9.0.825.36511" - } - } - }, - "System.Memory/4.5.5": { - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Memory.dll": { - "assemblyVersion": "4.0.1.2", - "fileVersion": "4.6.31308.1" - } - } - }, - "System.Numerics.Vectors/4.4.0": { - "runtime": { - "lib/netstandard2.0/System.Numerics.Vectors.dll": { - "assemblyVersion": "4.1.3.0", - "fileVersion": "4.6.25519.3" - } - } - }, - "System.Reflection.Metadata/9.0.8": { - "dependencies": { - "System.Collections.Immutable": "9.0.8", - "System.Memory": "4.5.5" - }, - "runtime": { - "lib/netstandard2.0/System.Reflection.Metadata.dll": { - "assemblyVersion": "9.0.0.0", - "fileVersion": "9.0.825.36511" - } - } - }, - "System.Runtime.CompilerServices.Unsafe/6.0.0": { - "runtime": { - "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { - "assemblyVersion": "6.0.0.0", - "fileVersion": "6.0.21.52210" - } - } - } - } - }, - "libraries": { - "CSNetwork/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - }, - "System.Buffers/4.5.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", - "path": "system.buffers/4.5.1", - "hashPath": "system.buffers.4.5.1.nupkg.sha512" - }, - "System.Collections.Immutable/9.0.8": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Eje6exD7AGKPg5SIkmjyWTBq0KK6SpfTBfdFUmpGG07mNbYimFJ+jyVnILcs0ikFOXoYTBpBOxKYgAk2hhjYOw==", - "path": "system.collections.immutable/9.0.8", - "hashPath": "system.collections.immutable.9.0.8.nupkg.sha512" - }, - "System.Memory/4.5.5": { - "type": "package", - "serviceable": true, - "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", - "path": "system.memory/4.5.5", - "hashPath": "system.memory.4.5.5.nupkg.sha512" - }, - "System.Numerics.Vectors/4.4.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==", - "path": "system.numerics.vectors/4.4.0", - "hashPath": "system.numerics.vectors.4.4.0.nupkg.sha512" - }, - "System.Reflection.Metadata/9.0.8": { - "type": "package", - "serviceable": true, - "sha512": "sha512-oJQezcASFomKvSp+06pzvSFRTnzdUJtiO19peAdZ9RwiqZinBV56u7zW5fEGf2/VrQFL3qZSV7UapgG31XRWQA==", - "path": "system.reflection.metadata/9.0.8", - "hashPath": "system.reflection.metadata.9.0.8.nupkg.sha512" - }, - "System.Runtime.CompilerServices.Unsafe/6.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==", - "path": "system.runtime.compilerservices.unsafe/6.0.0", - "hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512" - } - } -} \ No newline at end of file diff --git a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll b/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll deleted file mode 100644 index c82e94aa15..0000000000 Binary files a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll and /dev/null differ diff --git a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll.meta b/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll.meta deleted file mode 100644 index fb396d45e8..0000000000 --- a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 3b9d74e7123c6e144ae35ceb982d00de \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork.meta new file mode 100644 index 0000000000..57b4c2f6e1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cff6fdd017698448b94714631dec98e1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/AUICommon.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/AUICommon.cs new file mode 100644 index 0000000000..9bb345d99f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/AUICommon.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CSNetwork +{ + public static class AUICommon + { + public static void AUI_ConvertChatString(string pszChat, char[] pszConv, bool bName) + { + if (string.IsNullOrEmpty(pszChat) || pszConv == null) + return; + + int nLen = 0; + + for (int i = 0; i < pszChat.Length; i++) + { + char c = pszChat[i]; + if (c == '^') + { + if (nLen + 1 < pszConv.Length) + { + pszConv[nLen] = '^'; + pszConv[nLen + 1] = '^'; + nLen += 2; + } + } + else if (c == '&') + { + if (nLen + 1 < pszConv.Length) + { + pszConv[nLen] = '^'; + pszConv[nLen + 1] = '&'; + nLen += 2; + } + } + else + { + if (nLen < pszConv.Length) + { + pszConv[nLen] = c; + nLen++; + } + } + } + + // kết thúc chuỗi bằng ký tự null + if (nLen < pszConv.Length) + pszConv[nLen] = '\0'; + } + + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/AUICommon.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/AUICommon.cs.meta new file mode 100644 index 0000000000..048c3c3f20 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/AUICommon.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ff3c9f9901a244e7282e005d885f27a1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand.meta new file mode 100644 index 0000000000..25f7b038e0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93762d244ce204f89bcdff922008fe27 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs new file mode 100644 index 0000000000..623cac9385 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs @@ -0,0 +1,1328 @@ +using CSNetwork.GPDataType; +using System; +using System.Numerics; + +namespace CSNetwork.C2SCommand +{ + + // Command IDs + public enum CommandID : ushort + { + PLAYER_MOVE = 0, + LOGOUT, + SELECT_TARGET, + NORMAL_ATTACK, + REVIVE_VILLAGE, // Revive in near village + + REVIVE_ITEM = 5, // Revive by using item + PICKUP, + STOP_MOVE, + UNSELECT, + GET_ITEM_INFO, + + GET_IVTR = 10, // Get inventory information + GET_IVTR_DETAIL, // Get inventory detail information + EXG_IVTR_ITEM, + MOVE_IVTR_ITEM, + DROP_IVTR_ITEM, + + DROP_EQUIP_ITEM = 15, + EXG_EQUIP_ITEM, + EQUIP_ITEM, + MOVE_ITEM_TO_EQUIP, + GOTO, + + THROW_MONEY = 20, + GET_EXT_PROP, + SET_STATUS_POINT, // Set state points + GET_EXT_PROP_BASE, + GET_EXT_PROP_MOVE, + + GET_EXT_PROP_ATK = 25, + GET_EXT_PROP_DEF, + TEAM_INVITE, + TEAM_AGREE_INVITE, + TEAM_REJECT_INVITE, + + TEAM_LEAVE_PARTY = 30, + TEAM_KICK_MEMBER, + TEAM_MEMBER_POS, // Get team member's position + GET_OTHER_EQUIP, + TEAM_SET_PICKUP, // Change team pickup flag + + SEVNPC_HELLO = 35, // say hello to service NPC + SEVNPC_GET_CONTENT, + SEVNPC_SERVE, + GET_OWN_WEALTH, + GET_ALL_DATA, // Get all data when entering game, returns all packages, money and skills + + USE_ITEM = 40, // Use an item + CAST_SKILL, + CANCEL_ACTION, + CHARGE_E_FLYSWORD, // Charge flysword which is on equipment bar + CHARGE_FLYSWORD, + + USE_ITEM_T = 45, // use item with target + SIT_DOWN, + STAND_UP, + EMOTE_ACTION, + TASK_NOTIFY, + + ASSIST_SELECT = 50, + CONTINUE_ACTION, + STOP_FALL, // Stop falling + GET_ITEM_INFO_LIST, + GATHER_MATERIAL, + + GET_TRASHBOX_INFO = 55, + EXG_TRASHBOX_ITEM, + MOVE_TRASHBOX_ITEM, + EXG_TRASHBOX_IVTR, + TRASHBOX_ITEM_TO_IVTR, + + IVTR_ITEM_TO_TRASHBOX = 60, + EXG_TRASHBOX_MONEY, + TRICK_ACTION, + SET_ADV_DATA, + CLR_ADV_DATA, + + TEAM_ASK_TO_JOIN = 65, + TEAM_REPLY_JOIN_ASK, + QUERY_PLAYER_INFO_1, + QUERY_NPC_INFO_1, + SESSION_EMOTE, + + CON_EMOTE_REQUEST = 70, + CON_EMOTE_REPLY, + CHANGE_TEAM_LEADER, + DEAD_MOVE, + DEAD_STOP_MOVE, + + ENTER_SANCTUARY = 75, + OPEN_BOOTH, + CLOSE_BOOTH, + QUERY_BOOTH_NAME, + COMPLETE_TRAVEL, + + CAST_INSTANT_SKILL = 80, + DESTROY_ITEM, + ENABLE_PVP_STATE, + DISABLE_PVP_STATE, + OPEN_BOOTH_TEST, + + SWITCH_FASHION_MODE = 85, + ENTER_INSTANCE, + REVIVAL_AGREE, + NOTIFY_POS_IN_TEAM, + CAST_POS_SKILL, + + ACTIVE_RUSH_FLY = 90, + QUERY_DOUBLE_EXP, + DUEL_REQUEST, + DUEL_REPLY, + BIND_PLAYER_REQUEST, + + BIND_PLAYER_INVITE = 95, + BIND_PLAYER_REQUEST_REPLY, + BIND_PLAYER_INVITE_REPLY, + CANCEL_BIND_PLAYER, + GET_OTHER_EQUIP_DETAIL, + + SUMMON_PET = 100, + RECALL_PET, + BANISH_PET, + PET_CTRL, + DEBUG_DELIVER_CMD, + + DEBUG_GS_CMD = 105, + MALL_SHOPPING, + GET_WALLOW_INFO, + TEAM_DISMISS_PARTY, + USE_ITEM_WITH_ARG, + + QUERY_CASH_INFO = 110, + ELF_ADD_ATTRIBUTE, + ELF_ADD_GENIUS, + ELF_PLAYER_INSERT_EXP, + ELF_EQUIP_ITEM, + + ELF_CHANGE_SECURE_STATUS = 115, + CAST_ELF_SKILL, + RECHARGE_EQUIPPED_ELF, + GET_MALL_ITEM_PRICE, + EQUIP_FASHION_ITEM, + + CHECK_SECURITY_PASSWD = 120, + NOTIFY_FORCE_ATTACK, + DIVIDEND_MALL_SHOPPING, + GET_DIVIDEND_MALL_ITEM_PRICE, + CHOOSE_MULTI_EXP, + + TOGGLE_MULTI_EXP = 125, + MULTI_EXCHANGE_ITEM, + SYSAUCTION_OP, + CALC_NETWORK_DELAY, + GET_FACTION_FORTRESS_INFO, + + CONGREGATE_REPLY = 130, + GET_FORCE_GLOBAL_DATA, + PRODUCE4_CHOOSE, + RECHARGE_ONLINE_AWARD, + TOGGLE_ONLINE_AWARD, + + QUERY_PROFIT_TIME = 135, + ENTER_PK_PROTECTED, + COUNTRYBATTLE_GET_PERSONAL_SCORE, + GET_SERVER_TIMESTAMP, + COUNTRYBATTLE_LEAVE, + + GET_CASH_MONEY_EXCHG_RATE = 140, + EVOLUTION_PET, + ADD_PET_EXP, + REBUILD_PET_NATURE, + REBUILD_PET_INHERIT_RATIO, + + PET_REBUILD_INHERIT_CHOOSE = 145, + PET_REBUILD_NATURE_CHOOSE, + EXCHANGE_WANMEI_YINPIAO, + PLAYER_GIVE_PRESENT, + PLAYER_ASK_FOR_PRESENT, + + MERIDIANS_IMPACT = 150, + COUNTRYBATTLE_GET_STRONGHOLD_STATE, + QUERY_TOUCH_POINT, + SPEND_TOUCH_POINT, + QUERY_TITLE, + + CHANGE_CURR_TITLE = 155, + DAILY_SIGNIN, + LATE_SIGNIN, + APPLY_SIGNINAWARD, + REFRESH_SIGNIN, + + SWITCH_IN_PARALLEL_WORLD = 160, + QUERY_PARALLEL_WORLD, + GET_REINCARNATION_TOME, + REWRITE_REINCARNATION_TOME, + ACTIVATE_REINCARNATION_TOME, + + QUERY_UNIQUE_DATA = 165, + AUTO_TEAM_SET_GOAL, + AUTO_TEAM_JUMP_TO_GOAL, + TRICKBATTLE_LEAVE, + TRICKBATTLE_UPGRADE_CHARIOT, + + SWALLOW_GENERALCARD = 170, + EQUIP_TRASHBOX_ITEM, + QUERY_TRICKBATTLE_CHARIOTS, + COUNTRYBATTLE_LIVE_SHOW, + SEND_MASS_MAIL, + + RANDOM_MALL_SHOPPING = 175, + QUERY_MAFIA_PVP_INFO, + QUERY_CAN_INHERIT_ADDONS, + ACTIVATE_REGION_WAYPOINTS, + INSTANCE_REENTER_REQUEST, + + NUM_C2SCMD, + + // GM Commands + GM_CMD_START = 200, + GM_MOVETO_PLAYER, + GM_CALLIN_PLAYER, + GM_KICK_PLAYER, // Requires target selection, no parameters + GM_INVISIBLE, // Toggle self invisibility, no parameters + + GM_INVINCIBLE = 205, // Toggle self invincibility, no parameters + GM_GENERATE, + GM_ACTIVE_SPAWNER, + GM_GENERATE_MOB, + + GM_QUERY_SPEC_ITEM = 218, // query player's trashbox detail + GM_REMOVE_SPEC_ITEM, // remove items in trashbox + GM_OPEN_ACTIVITY, // GM open activity + GM_CHANGE_DS, // GM cross-server + } + + // Basic command header structure + public struct CMD_Header + { + public CommandID cmd; + } + + // Player movement command + public struct CMD_PlayerMove + { + public Vector3 vCurPos; // Current position + public Vector3 vNextPos; // Next position + public ushort useTime; // Time to use + public short speed; // Move speed 8.8 fix-point + public byte moveMode; // Walk run swim fly .... walk_back run_back + public ushort stamp; // Move command stamp + } + struct cmd_object_move + { + public int id; + public Vector3 dest; + public float use_time; + public short sSpeed; // Move speed 8.8 fix-point + public byte move_mode; + }; + + // Stop movement command + public struct CMD_StopMove + { + public Vector3 vCurPos; // Current position + public short speed; // Moving speed in 8.8 fix-point + public byte dir; // Object direction + public byte moveMode; // Walk run swim fly .... walk_back run_back + public ushort stamp; // Move command stamp + public ushort useTime; // Time to use + } + + // Player logout command + public struct CMD_PlayerLogout + { + public int outType; + } + + // Select target command + public struct CMD_SelectTarget + { + public int id; + } + + // Normal attack command + public struct CMD_NormalAttack + { + public byte pvpMask; + } + + public struct cmd_error_msg + { + public int iMessage; + } + + // Pickup item command + public struct CMD_Pickup + { + public int idItem; + public int tid; // Template ID + } + + // Get item info command + public struct CMD_GetItemInfo + { + public byte byPackage; + public byte bySlot; + } + // Get inventory + public struct CMD_GetInventory + { + public byte byPackage; + } + // Get inventory detail + public struct CMD_GetInventoryDetail + { + public byte byPackage; + } + // NPC trade item structure + public struct CMD_NPCTradeItem + { + public int tid; + public int index; + public int count; + } + + // NPC sell item structure + public struct CMD_NPCSellItem + { + public int tid; + public int index; + public int count; + public int price; + } + + // NPC booth item structure + public struct CMD_NPCBoothItem + { + public int tid; + public ushort index; + public ushort invIndex; + public uint count; + } + + // Exchange inventory item command + public struct CMD_ExchangeInventoryItem + { + public byte index1; + public byte index2; + } + + // Move inventory item command + public struct CMD_MoveInventoryItem + { + public byte src; + public byte dest; + public uint count; + } + + // Exchange equipment item command + public struct CMD_ExchangeEquipItem + { + public byte index1; + public byte index2; + } + + public struct CMD_CheckSecurityPassWd + { + public uint passwd_size; + } + + // Equip item command + public struct CMD_EquipItem + { + public byte idx_inv; + public byte idx_eq; + } + + public struct CMD_DropIvtrItem + { + public byte index; + public int amount; + } + + public struct CMD_DropEquipItem + { + public byte index; + } + // Move equipment item command + public struct CMD_MoveEquipItem + { + public byte indexInv; + public byte indexEquip; + public uint amount; + } + + // Add status point command + public struct CMD_AddStatusPoint + { + public int vitality; + public int energy; + public int strength; + public int agility; + public int remain; + } + + // Team leader invite command + public struct CMD_TeamLeaderInvite + { + public int idLeader; + public int seq; + public ushort pickFlag; + } + + // Team member position command + public struct CMD_TeamMemberPos + { + public ushort memberCount; + public int[] memberIDs; // Variable length array + } + + // Get other equipment command + public struct CMD_GetOtherEquip + { + public ushort size; + public int[] idList; // Variable length array + } + + // Team set pickup command + public struct CMD_TeamSetPickup + { + public short pickupFlag; + } + + // Get all data command + public struct CMD_GetAllData + { + public byte byPack; + public byte byEquip; + public byte byTask; + } + + // Use item command + public struct CMD_UseItem + { + public byte where; + public byte byCount; + public ushort index; + public int itemId; + } + + // Cast skill command + public struct CMD_CastSkill + { + public int skillId; + public byte pvpMask; + public byte targetCount; + public int[] targets; // Variable length array + } + + // Dead move command + public struct CMD_DeadMove + { + public float y; + public ushort useTime; + public ushort speed; + public byte moveMode; + } + + // Dead stop move command + public struct CMD_DeadStopMove + { + public float y; + public ushort speed; + public byte dir; + public byte moveMode; + } + + // Enter sanctuary command + public struct CMD_EnterSanctuary + { + public int id; + } + + // Open booth command + public struct CMD_OpenBooth + { + public ushort count; + public string name; // Max 62 bytes + + public struct Entry + { + public int type; + public int index; + public int count; + public int price; + } + public Entry[] list; // Variable length array + } + + // Query booth name command + public struct CMD_QueryBoothName + { + public ushort count; + public int[] list; // Variable length array + } + + // Evolution pet command + public struct CMD_EvolutionPet + { + public int petIndex; + public int formulaIndex; + } + + // Add pet exp command + public struct CMD_AddPetExp + { + public int petIndex; + public int itemNum; + } + + // Rebuild pet nature command + public struct CMD_RebuildPetNature + { + public int petIndex; + public int formulaIndex; + } + + // Rebuild pet inherit ratio command + public struct CMD_RebuildPetInheritRatio + { + public int petIndex; + public int formulaIndex; + } + + // Pet rebuild inherit choose command + public struct CMD_PetRebuildInheritChoose + { + public byte isAccept; + } + + // Pet rebuild nature choose command + public struct CMD_PetRebuildNatureChoose + { + public byte isAccept; + } + + // Try refine meridian command + public struct CMD_TryRefineMeridian + { + public int index; // Gate index + } + + // Player give present command + public struct CMD_PlayerGivePresent + { + public int roleId; + public int mailId; + public int goodsId; + public int goodsIndex; + public int goodsSlot; + } + + // Player ask for present command + public struct CMD_PlayerAskForPresent + { + public int roleId; + public int goodsId; + public int goodsIndex; + public int goodsSlot; + } + + // Spend touch point command + public struct CMD_SpendTouchPoint + { + public uint index; + public uint lots; + public int id; + public uint num; + public uint price; + public int expireTime; + } + + // Query unique data command + public struct CMD_QueryUniqueData + { + public int count; + public int[] key; // Variable length array + } + + // Revive command + public struct CMD_Revive + { + public int param; // For chariot battlefield this is chariotId, meaningless for other scenes + } + + // Trickbattle upgrade chariot command + public struct CMD_TrickbattleUpgradeChariot + { + public int chariot; + } + + // Swallow general card command + public struct CMD_SwallowGeneralCard + { + public byte equipIndex; + public byte isInv; + public byte swallowedEquipIndex; + public uint count; + } + + // Equip trashbox item command + public struct CMD_EquipTrashboxItem + { + public byte trashBoxIndex; + public byte itemIndexInBox; + public byte equipIndex; + } + + // Send mass mail command + public struct CMD_SendMassMail + { + public int serviceId; + public byte[] data; // Variable length array + } + + // Random mall shopping command + public struct CMD_RandomMallShopping + { + public int configId; + public int op; + } + + // Query faction PVP info command + public struct CMD_QueryFactionPvpInfo + { + public int factionId; + } + + // Query can inherit addons command + public struct CMD_QueryCanInheritAddons + { + public int equipId; + public byte invIdx; + } + + // Activate region waypoints command + public struct CMD_ActivateRegionWaypoints + { + public byte num; + public int[] waypoints; // Variable length array + } + + // Instance reenter request command + public struct CMD_InstanceReenterRequest + { + public bool agree; + } +} + +namespace CSNetwork.S2CCommand +{ + public enum eCommandID// Command ID + { + PROTOCOL_COMMAND = -1, // Reserved for protocol + + PLAYER_INFO_1 = 0, + PLAYER_INFO_2, + PLAYER_INFO_3, + PLAYER_INFO_4, + PLAYER_INFO_1_LIST, + + PLAYER_INFO_2_LIST, // 5 + PLAYER_INFO_3_LIST, + PLAYER_INFO_23_LIST, + SELF_INFO_1, + NPC_INFO_LIST, + + MATTER_INFO_LIST, // 10 + NPC_ENTER_SLICE, + PLAYER_ENTER_SLICE, + OBJECT_LEAVE_SLICE, + NOTIFY_HOSTPOS, + + OBJECT_MOVE, // 15 + NPC_ENTER_WORLD, + PLAYER_ENTER_WORLD, + MATTER_ENTER_WORLD, + PLAYER_LEAVE_WORLD, + + NPC_DIED, // 20 + OBJECT_DISAPPEAR, + OBJECT_STARTATTACK, // ������ + HOST_STOPATTACK, + HOST_ATTACKRESULT, + + ERROR_MESSAGE, // 25 + HOST_ATTACKED, + PLAYER_DIED, + HOST_DIED, + PLAYER_REVIVE, + + PICKUP_MONEY, // 30 + PICKUP_ITEM, + PLAYER_INFO_00, + NPC_INFO_00, + OUT_OF_SIGHT_LIST, + + OBJECT_STOP_MOVE, // 35 + RECEIVE_EXP, + LEVEL_UP, + SELF_INFO_00, + UNSELECT, + + OWN_ITEM_INFO, // 40, Own item information + EMPTY_ITEM_SLOT, // Empty item slot notify + OWN_IVTR_DATA, // Own inventory data + OWN_IVTR_DETAIL_DATA, + EXG_IVTR_ITEM, + + MOVE_IVTR_ITEM, // 45 + PLAYER_DROP_ITEM, + EXG_EQUIP_ITEM, + EQUIP_ITEM, + MOVE_EQUIP_ITEM, + + OWN_EXT_PROP, // 50 + ADD_STATUS_POINT, + SELECT_TARGET, + PLAYER_EXT_PROP_BASE, + PLAYER_EXT_PROP_MOVE, + + PLAYER_EXT_PROP_ATK, // 55 + PLAYER_EXT_PROP_DEF, + TEAM_LEADER_INVITE, + TEAM_REJECT_INVITE, + TEAM_JOIN_TEAM, + + TEAM_MEMBER_LEAVE, // 60 + TEAM_LEAVE_PARTY, + TEAM_NEW_MEMBER, + TEAM_LEADER_CACEL_PARTY, + TEAM_MEMBER_DATA, + + TEAM_MEMBER_POS, // 65 + EQUIP_DATA, // �û���װ�����ݣ�Ӱ����� + EQUIP_DATA_CHANGED, + EQUIP_DAMAGED, // װ���� + TEAM_MEMBER_PICKUP, // ���Ѽ���װ�� + + NPC_GREETING, // 70 + NPC_SERVICE_CONTENT, + PURCHASE_ITEM, + ITEM_TO_MONEY, + REPAIR_ALL, + + REPAIR, // 75 + RENEW, + SPEND_MONEY, + GAIN_MONEY_IN_TRADE, + GAIN_ITEM_IN_TRADE, + + GAIN_MONEY_AFTER_TRADE, // 80 + GAIN_ITEM_AFTER_TRADE, + GET_OWN_MONEY, + ATTACK_ONCE, + HOST_START_ATTACK, + + OBJECT_CAST_SKILL, // 85 + SKILL_INTERRUPTED, + SELF_SKILL_INTERRUPTED, + SKILL_PERFORM, + OBJECT_BE_ATTACKED, // ������ + + SKILL_DATA, // 90 + HOST_USE_ITEM, + EMBED_ITEM, + CLEAR_TESSERA, + COST_SKILL_POINT, + + LEARN_SKILL, // 95 + OBJECT_TAKEOFF, + OBJECT_LANDING, + FLYSWORD_TIME, + HOST_OBTAIN_ITEM, + + PRODUCE_START, // 100 + PRODUCE_ONCE, + PRODUCE_END, + DECOMPOSE_START, + DECOMPOSE_END, + + TASK_DATA, // 105 + TASK_VAR_DATA, + OBJECT_START_USE, + OBJECT_CANCEL_USE, + OBJECT_USE_ITEM, + + OBJECT_START_USE_T, // 110 + OBJECT_SIT_DOWN, + OBJECT_STAND_UP, + OBJECT_DO_EMOTE, + SERVER_TIME, + + OBJECT_ROOT, // 115 + HOST_DISPEL_ROOT, + INVADER_RISE, + PARIAH_RISE, + INVADER_FADE, + + OBJECT_ATTACK_RESULT, // 120 + BE_HURT, + HURT_RESULT, + HOST_STOP_SKILL, + UPDATE_EXT_STATE, + + ICON_STATE_NOTIFY, // 125 + PLAYER_GATHER_START, + PLAYER_GATHER_STOP, + TRASHBOX_PWD_CHANGED, + TRASHBOX_PWD_STATE, + + TRASHBOX_OPEN, // 130 + TRASHBOX_CLOSE, + TRASHBOX_WEALTH, + EXG_TRASHBOX_ITEM, + MOVE_TRASHBOX_ITEM, + + EXG_TRASHBOX_IVTR, // 135 + IVTR_ITEM_TO_TRASH, + TRASH_ITEM_TO_IVTR, + EXG_TRASH_MONEY, + ENCHANT_RESULT, + + HOST_NOTIFY_ROOT, // 140 + OBJECT_DO_ACTION, + HOST_SKILL_ATTACK_RESULT, + OBJECT_SKILL_ATTACK_RESULT, + HOST_SKILL_ATTACKED, + + PLAYER_SET_ADV_DATA, // 145 + PLAYER_CLR_ADV_DATA, + PLAYER_IN_TEAM, + TEAM_ASK_TO_JOIN, + OBJECT_EMOTE_RESTORE, + + CON_EMOTE_REQUEST, // 150, concurrent emote request + DO_CONCURRENT_EMOTE, + MATTER_PICKUP, + MAFIA_INFO_NOTIFY, + MAFIA_TRADE_START, + + MAFIA_TRADE_END, // 155 + TASK_DELIVER_ITEM, + TASK_DELIVER_REP, + TASK_DELIVER_EXP, + TASK_DELIVER_MONEY, + + TASK_DELIVER_LEVEL2, // 160 + HOST_REPUTATION, + ITEM_IDENTIFY, + PLAYER_CHGSHAPE, + ENTER_SANCTUARY, + + LEAVE_SANCTUARY, // 165 + PLAYER_OPEN_BOOTH, + SELF_OPEN_BOOTH, + PLAYER_CLOSE_BOOTH, + PLAYER_BOOTH_INFO, + + BOOTH_TRADE_SUCCESS, // 170 + BOOTH_NAME, + PLAYER_START_TRAVEL, + HOST_START_TRAVEL, + PLAYER_END_TRAVEL, + + GM_INVINCIBLE, // 175 + GM_INVISIBLE, + HOST_CORRECT_POS, + OBJECT_CAST_INSTANT_SKILL, + ACTIVATE_WAYPOINT, + + WAYPOINT_LIST, // 180 + UNFREEZE_IVTR_SLOT, // Unfreeze inventory item + TEAM_INVITE_TIMEOUT, + PLAYER_ENABLE_PVP, + PLAYER_DISABLE_PVP, + + HOST_PVP_COOLDOWN, // 185 + COOLTIME_DATA, + SKILL_ABILITY, + OPEN_BOOTH_TEST, + BREATH_DATA, + + HOST_STOP_DIVE, // 190 + BOOTH_SELL_ITEM, + PLAYER_ENABLE_FASHION, + HOST_ENABLE_FREEPVP, + INVALID_OBJECT, + + PLAYER_ENABLE_EFFECT, // 195 + PLAYER_DISABLE_EFFECT, + REVIVAL_INQUIRE, + SET_COOLDOWN, + CHANGE_TEAM_LEADER, + + EXIT_INSTANCE, // 200 + CHANGE_FACE_START, + CHANGE_FACE_END, + PLAYER_CHG_FACE, // Player change face completed + OBJECT_CAST_POS_SKILL, + + SET_MOVE_STAMP, // 205 + INST_DATA_CHECKOUT, + HOST_RUSH_FLY, + TRASHBOX_SIZE, + NPC_DIED2, + + PRODUCE_NULL, // 210 + PVP_COMBAT, + DOUBLE_EXP_TIME, + AVAILABLE_DOUBLE_EXP_TIME, + DUEL_RECV_REQUEST, + + DUEL_REJECT_REQUEST, // 215 + DUEL_PREPARE, + DUEL_CANCEL, + HOST_DUEL_START, + DUEL_STOP, + + DUEL_RESULT, // 220 + PLAYER_BIND_REQUEST, + PLAYER_BIND_INVITE, + PLAYER_BIND_REQUEST_REPLY, + PLAYER_BIND_INVITE_REPLY, + + PLAYER_BIND_START, // 225 + PLAYER_BIND_STOP, + PLAYER_MOUNTING, + PLAYER_EQUIP_DETAIL, + PLAYER_DUEL_START, + + PARIAH_TIME, // 230 + GAIN_PET, + FREE_PET, + SUMMON_PET, + RECALL_PET, + + PLAYER_START_PET_OP, // 235 + PLAYER_STOP_PET_OP, + PET_RECEIVE_EXP, + PET_LEVELUP, + PET_ROOM, + + PET_ROOM_CAPACITY, // 240 + PET_HONOR_POINT, + PET_HUNGER_GAUGE, + HOST_ENTER_BATTLE, + TANK_LEADER_NOTIFY, + + BATTLE_RESULT, // 245 + BATTLE_SCORE, + PET_DEAD, + PET_REVIVE, + PET_HP_NOTIFY, + + PET_AI_STATE, // 250 + REFINE_RESULT, + PET_SET_COOLDOWN, + PLAYER_CASH, + PLAYER_BIND_SUCCESS, + + CHANGE_IVTR_SIZE, // 255 + PVP_MODE, + PLAYER_WALLOW_INFO, + PLAYER_USE_ITEM_WITH_ARG, + OBJECT_USE_ITEM_WITH_ARG, + + PLAYER_CHANGE_SPOUSE, // 260 + NOTIFY_SAFE_LOCK, + ELF_VIGOR, + ELF_ENHANCE, + ELF_STAMINA, + + ELF_CMD_RESULT, // 265 + COMMON_DATA_NOTIFY, + COMMON_DATA_LIST, + ELF_REFINE_ACTIVATE, + CAST_ELF_SKILL, + + MALL_ITEM_PRICE, // 270 + MALL_ITEM_BUY_FAILED, + GOBLIN_LEVEL_UP, + PLAYER_PROPERTY, + PLAYER_CAST_RUNE_SKILL, + + PLAYER_CAST_RUNE_INSTANT_SKILL, //275 + PLAYER_EQUIP_TRASHBOX_ITEM, + SECURITY_PASSWD_CHECKED, + OBJECT_INVISIBLE, + PLAYER_HP_STEAL, + + PLAYER_DIVIDEND, // 280 + DIVIDEND_MALL_ITEM_PRICE, + DIVIDEND_MALL_ITEM_BUY_FAILED, + ELF_EXP, + PUBLIC_QUEST_INFO, + + PUBLIC_QUEST_RANKS, // 285 + MULTI_EXP_INFO, + CHANGE_MULTI_EXP_STATE, + WORLD_LIFE_TIME, + WEDDING_BOOK_LIST, + + WEDDING_BOOK_SUCCESS, // 290 + CALC_NETWORK_DELAY_RE, + PLAYER_KNOCKBACK, + SUMMON_PLANT_PET, + PLANT_PET_DISAPPEAR, + + PLANT_PET_HP_NOTIFY, // 295 + PET_PROPERTY, + FACTION_CONTRIB_NOTIFY, + FACTION_FORTRESS_INFO, + ENTER_FACTIONFORTRESS, + + FACTION_RELATION_NOTIFY, // 300 + PLAYER_EQUIP_DISABLED, + PLAYER_SPEC_ITEM_LIST, // return value of GM_QUERY_SPEC_ITEM + OBJECT_START_PLAY_ACTION, + OBJECT_STOP_PLAY_ACTION, + + CONGREGATE_REQUEST, // 305 + REJECT_CONGREGATE, + CONGREGATE_START, + CANCEL_CONGREGATE, + ENGRAVE_START, + + ENGRAVE_END, // 310 + ENGRAVE_RESULT, + DPS_DPH_RANK, + ADDONREGEN_START, + ADDONREGEN_END, + + ADDONREGEN_RESULT, // 315 + INVISIBLE_OBJ_LIST, + SET_PLAYER_LIMIT, + PLAYER_TELEPORT, + OBJECT_FORBID_BE_SELECTED, + + PLAYER_INVENTORY_DETAIL, // 320 + PLAYER_FORCE_DATA, + PLAYER_FORCE_CHANGED, + PLAYER_FORCE_DATA_UPDATE, + FORCE_GLOBAL_DATA, + + ADD_MULTIOBJECT_EFFECT, // 325 + REMOVE_MULTIOBJECT_EFFECT, + ENTER_WEDDING_SCENE, + PRODUCE4_ITEM_INFO, + ONLINE_AWARD_DATA, //���߽��� + + TOGGLE_ONLINE_AWARD, // 330 ����л������߽����Ŀ���״̬ + PLAYER_PROFIT_TIME, // �������ʱ�� + ENTER_NONPENALTY_PVP_STATE, // PK�޳ͷ� + SELF_COUNTRY_NOTIFY, + PLAYER_COUNTRY_CHANGED, + + ENTER_COUNTRYBATTLE, // 335 + COUNTRYBATTLE_RESULT, + COUNTRYBATTLE_SCORE, + COUNTRYBATTLE_RESURRECT_REST_TIMES, + COUNTRYBATTLE_FLAG_CARRIER_NOTIFY, + + COUNTRYBATTLE_BECAME_FLAG_CARRIER, // 340 + COUNTRYBATTLE_PERSONAL_SCORE, + COUNTRYBATTLE_FLAG_MSG_NOTIFY, + DEFENSE_RUNE_ENABLED, + COUNTRYBATTLE_INFO, + + SET_PROFIT_TIME, //345 + CASH_MONEY_EXCHG_RATE, + PET_REBUILD_INHERIT_START, + PET_REBUILD_INHERIT_INFO, + PET_REBUILD_INHERIT_END, + + PET_EVOLUTION_DONE, //350 + PET_REBUILD_NATURE_START, + PET_REBUILD_NATURE_INFO, + PET_REBUILD_NATURE_END, + EQUIP_ADDON_UPDATE_NOTIFY, //354 ֪ͨװ����ʯ��� + + SELF_KING_NOTIFY, // 355 + PLAYER_KING_CHANGED, + MERIDIANS_NOTIFY, // ������Ϣ��� + MERIDIANS_RESULT, // ������Ѩ��� + COUNTRYBATTLE_STRONGHOND_STATE_NOTIFY, + + QUERY_TOUCH_POINT, // 360 + SPEND_TOUCH_POINT, + TOTAL_RECHARGE, + QUERY_TITLE_RE, + CHANGE_CURR_TITLE_RE, + + MODIFY_TITLE_NOFIFY, // 365 + REFRESH_SIGNIN, // ǩ��״̬ + PARALLEL_WORLD_INFO, + PLAYER_REINCARNATION, // ���ת�� + REINCARNATION_TOME_INFO, // ת��������Ϣ + + ACTIVATE_REINCARNATION_TOME, // 370 ת�������Ƿ񼤻� + UNIQUE_DATA_NOTIFY, // ��ʷ�ƽ� ��ȫ������ + USE_GIFTCARD_RESULT, + REALM_EXP, // ���羭�� + REALM_LEVEL, // ����ȼ� + + ENTER_TRICKBATTLE, // 375 ����ս�� ���庬��ͬ��ս����ս�� + TRICKBATTLE_PERSONAL_SCORE, // ս���Լ��÷� + TRICKBATTLE_CHARIOT_INFO, // ս����Ϣ + PLAYER_LEADERSHIP, // ���ͳ���� + GENERALCARD_COLLECTION_DATA, // �佫��ͼ������ + + ADD_GENERALCARD_COLLECTION, // 380 �ղؿ��� + REFRESH_MONSTERSPIRIT_LEVEL, // ���� + MINE_GATHERED, // ����ɹ��ɼ��㲥 + PLAYER_IN_OUT_BATTLE, // ������ҽ���/����ս��״̬ + PLAYER_QUERY_CHARIOTS, // ս��������ѯ + + COUNTRYBATTLE_LIVE_SHOW_RESULT, // 385 ��սս��rank���������� + RANDOM_MALL_SHOPPING_RES, // ����̳Dz�ѯ���� + FACTION_PVP_MASK_MODIFY, // ����PVP״̬�ı� + PLAYER_WORLD_CONTRIBUTION, // ���繱�׶� + RANDOM_MAP_ORDER, // �����ͼ + + SCENE_SERVICE_NPC_LIST, // 390��ǰ������ѧϰ���ܵ�NPC�б� + NPC_VISIBLE_TID_NOTIFY, // �㲥֪ͨ��Ұ��npc�任����ģ�� + CLIENT_SCREEN_EFFECT, // ��Ļ��Ч + EQUIP_CAN_INHERIT_ADDONS, // ��������5�ɼ̳еĸ������� + COMBO_SKILL_PREPARE, + + INSTANCE_REENTER_NOTIFY, // 395 ��������֪ͨ + PRAY_DISTANCE_CHANGE, // ����������� + }; + + public struct CMD_GetAllData + { + byte byPack; // Get detail info. flag + byte byEquip; + byte byTask; + }; + public struct CMD_OwnInventoryInfo + { + public byte byPackage; + public byte ivtr_size; + public uint content_length; + public byte[] content; + }; + public struct CMD_OwnInventoryDetailInfo + { + public byte byPackage; + public byte ivtr_size; + public uint content_length; + public byte[] content; + }; + // Drop inventory item command + public struct CMD_PlayerDropItem + { + public byte byPackage; + public byte bySlot; + public uint count; + public int tid; + public byte reason; + }; + public struct CMD_OwnItemInfo + { + public byte byPackage; + public byte bySlot; + public int type; + public int expire_date; + public int state; + public uint count; + public ushort crc; + public ushort content_length; + public byte[] content; + }; + // Equip item command + public struct CMD_EquipItem + { + public byte index_inv; + public byte index_equip; + public uint count_inv; + public uint count_equip; + } + public struct CMD_InfoPlayer1 + { + public int cid; + public Vector3 pos; + public ushort crc_e; + public ushort crc_c; + public byte dir; //256�Ķ�������ʾ���� + public byte level2; + public int state; + public int state2; + + // public bool CheckValid(int buf_size, int sz) + // { + // if (buf_size< sizeof(this)) + // return false; + + // sz = sizeof(*this); + + // if (state & eStatePlayerAndNPC.GP_STATE_ADV_MODE) + // sz += sizeof(DWORD)* 2; + + // if (state & GP_STATE_SHAPE) + // sz += sizeof(char); + + // if (state & GP_STATE_EMOTE) + // sz += sizeof(char); + + // if (state & GP_STATE_EXTEND_PROPERTY) + // sz += sizeof(DWORD)* OBJECT_EXT_STATE_COUNT; + + // if (state & GP_STATE_FACTION) + // sz += sizeof(int) + sizeof(char); + + // if (state & GP_STATE_BOOTH) + // sz += sizeof(char); + + // if (state & GP_STATE_EFFECT) + // { + // const BYTE* pData = reinterpret_cast (this) + sz; + // sz += sizeof(BYTE); + + // if (buf_size(this) + sz; + // sz += sizeof(int); + + // if (buf_size < sz) + // return false; + + // sz += *(int *)pData * (sizeof(int) + sizeof(char)); + // } + + // if (state & GP_STATE_COUNTRY) + // sz += sizeof(int); + // if (state2 & GP_STATE2_TITLE) + // sz += sizeof(unsigned short); + // if (state2 & GP_STATE2_REINCARNATION) + // sz += sizeof(unsigned char); + // if (state2 & GP_STATE2_REALM) + // sz += sizeof(unsigned char); + // if (state2 & GP_STATE2_FACTION_PVP_MASK) + // sz += sizeof(unsigned char); + + // return buf_size >= sz; + // } + //unsigned char GetGender()const{ + // return (state2 & GP_STATE2_GENDER) ? GENDER_FEMALE : GENDER_MALE; + // } + } + + public struct CMD_TaskData + { + public uint active_list_size; + public byte[] active_list; + + public uint finished_list_size; + public byte[] finished_list; + + public uint finished_time_list_size; + public byte[] finished_time_list; + + public uint finished_count_size; + public byte[] finished_count; + + public uint storage_task_size; + public byte[] storage_task; + }; + public struct CMD_TaskVarData + { + public uint size; + public byte[] data; + }; + + //public struct CMD_InfoPlayer2 //name ,customize data �����ı� + //{ + // public byte size; + // public char data[1]; + //}; +} + +// Player and NPC state \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs.meta new file mode 100644 index 0000000000..11cf9753b1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e1241d6c086734d9ebada34113290082 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommandFactory.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommandFactory.cs new file mode 100644 index 0000000000..9d2c624942 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommandFactory.cs @@ -0,0 +1,407 @@ +using CSNetwork.GPDataType; +using CSNetwork.S2CCommand; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Threading.Tasks; + +namespace CSNetwork.C2SCommand +{ + public static class C2SCommandFactory + { + private static readonly IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(GameSession)); // Get class-specific logger + // Special types that need custom serialization + private static bool NeedsCustomSerialization(Type type) + { + return type == typeof(string) + || type == typeof(Vector3) + || type.IsArray + || !type.IsValueType; + } + + // Generic command serialization + public static Octets SerializeCommand(CommandID cmdId, T command) + where T : struct + { + var octets = new Octets(); + + // Write command header - write enum value directly + WriteBasicValue(octets, (ushort)cmdId); + + // Write command body + WriteStruct(octets, command); + + return octets; + } + public static Octets SerializeCommand(eCommandID cmdId, T command) + where T : struct + { + var octets = new Octets(); + + // Write command header - write enum value directly + WriteBasicValue(octets, (ushort)cmdId); + + // Write command body + WriteStruct(octets, command); + + return octets; + } + + // Serialize a nake command (commands that have id but havn't data) + public static Octets SerializeCommand(CommandID cmdId) + { + var octets = new Octets(); + WriteBasicValue(octets, (ushort)cmdId); + return octets; + } + + private static void WriteStruct(Octets octets, T value) + where T : struct + { + // Get fields of the struct + var fields = typeof(T).GetFields(); + + foreach (var field in fields) + { + var fieldValue = field.GetValue(value); + var fieldType = field.FieldType; + + if (NeedsCustomSerialization(fieldType)) + { + // Handle special types + if (fieldType == typeof(Vector3)) + { + var vec = (Vector3)fieldValue; + WriteBasicValue(octets, vec.X); + WriteBasicValue(octets, vec.Y); + WriteBasicValue(octets, vec.Z); + } + else if (fieldType == typeof(string)) + { + WriteString(octets, (string)fieldValue); + } + else if (fieldType.IsArray) + { + WriteArray(octets, (Array)fieldValue); + } + } + else if (fieldType.IsEnum) + { + // Handle enum by getting underlying value + var underlyingType = Enum.GetUnderlyingType(fieldType); + var enumValue = Convert.ChangeType(fieldValue, underlyingType); + WriteBasicValue(octets, enumValue); + } + else + { + // For basic value types, use non-generic overload + WriteBasicValue(octets, fieldValue, fieldType); + } + } + } + + // Generic version for known types + private static void WriteBasicValue(Octets octets, T value) + { + if (value == null) + return; + + WriteBasicValue(octets, value, typeof(T)); + } + + // Non-generic version for handling object values with known type + private static void WriteBasicValue(Octets octets, object value, Type type) + { + if (value == null) + return; + + // Handle enums + if (type.IsEnum) + { + type = Enum.GetUnderlyingType(type); + value = Convert.ChangeType(value, type); + } + + byte[] bytes; + if (type == typeof(byte)) + bytes = new[] { (byte)value }; + else if (type == typeof(sbyte)) + bytes = new[] { (byte)(sbyte)value }; + else if (type == typeof(short)) + bytes = BitConverter.GetBytes((short)value); + else if (type == typeof(ushort)) + bytes = BitConverter.GetBytes((ushort)value); + else if (type == typeof(int)) + bytes = BitConverter.GetBytes((int)value); + else if (type == typeof(uint)) + bytes = BitConverter.GetBytes((uint)value); + else if (type == typeof(long)) + bytes = BitConverter.GetBytes((long)value); + else if (type == typeof(ulong)) + bytes = BitConverter.GetBytes((ulong)value); + else if (type == typeof(float)) + bytes = BitConverter.GetBytes((float)value); + else if (type == typeof(double)) + bytes = BitConverter.GetBytes((double)value); + else if (type == typeof(bool)) + bytes = BitConverter.GetBytes((bool)value); + else + throw new ArgumentException( + $"Unsupported type for basic value serialization: {type.Name}" + ); + + octets.Insert(octets.Size, bytes); + } + + private static void WriteString(Octets octets, string str, int maxLength = 62) + { + if (octets == null) + return; + + if (string.IsNullOrEmpty(str)) + { + WriteBasicValue(octets, (byte)0); + return; + } + + byte[] strBytes = System.Text.Encoding.UTF8.GetBytes(str); + byte length = (byte)Math.Min(strBytes.Length, maxLength); + WriteBasicValue(octets, length); + octets.Insert(octets.Size, strBytes.AsSpan(0, length).ToArray()); + } + + private static void WriteArray(Octets octets, Array array) + { + if (octets == null) + return; + if (array == null) + { + WriteBasicValue(octets, 0); + return; + } + + WriteBasicValue(octets, array.Length); + + var elementType = array.GetType().GetElementType(); + if (NeedsCustomSerialization(elementType)) + { + // Handle arrays of special types + for (int i = 0; i < array.Length; i++) + { + var element = array.GetValue(i); + if (elementType == typeof(Vector3)) + { + var vec = (Vector3)element; + WriteBasicValue(octets, vec.X); + WriteBasicValue(octets, vec.Y); + WriteBasicValue(octets, vec.Z); + } + else if (elementType.IsValueType) + { + WriteBasicValue(octets, element, elementType); + } + } + } + else + { + // For basic type arrays, handle each element individually + for (int i = 0; i < array.Length; i++) + { + WriteBasicValue(octets, array.GetValue(i), elementType); + } + } + } + + // Example usage methods + public static Octets CreatePlayerMove( + Vector3 curPos, + Vector3 nextPos, + ushort useTime, + float speed, + byte moveMode, + ushort stamp + ) + { + var cmd = new CMD_PlayerMove + { + vCurPos = curPos, + vNextPos = nextPos, + useTime = useTime, + speed = FloatToFix8(speed), + moveMode = moveMode, + stamp = stamp + }; + return SerializeCommand(CommandID.PLAYER_MOVE, cmd); + } + public static Octets CreatePlayerStop( + in Vector3 vDest, float fSpeed, byte iMoveMode, + byte byDir, ushort wStamp, ushort iTime + ) + { + _logger.Log(LogType.Warning, $"HoangDev : vDest : {vDest}\n speed {FloatToFix8(FloatToFix8(fSpeed))} \n useTime : {iTime}\n moveMode: {iMoveMode} \n stamp: {wStamp}"); + var cmd = new CMD_StopMove + { + vCurPos = vDest, + speed = FloatToFix8(fSpeed), + dir = byDir, + moveMode = iMoveMode, + stamp = wStamp, + useTime = iTime + }; + return SerializeCommand(CommandID.STOP_MOVE, cmd); + } + public static short FloatToFix8(float x) + { + return (short)(x * 256.0f + 0.5f); + } + public static Octets CreateSelectTarget(int targetId) + { + var cmd = new CMD_SelectTarget { id = targetId }; + return SerializeCommand(CommandID.SELECT_TARGET, cmd); + } + + public static Octets CreateDropIvtrItem(byte index, int amount) + { + var cmd = new CMD_DropIvtrItem + { + index = index, + amount = amount + }; + return SerializeCommand(CommandID.DROP_IVTR_ITEM, cmd); + } + public static Octets CreateDropEquipItem(byte index) + { + var cmd = new CMD_DropEquipItem + { + index = index + }; + return SerializeCommand(CommandID.DROP_EQUIP_ITEM, cmd); + } + + public static Octets CreatePickupItem(int idItem, int tid) + { + var cmd = new CMD_Pickup + { + idItem = idItem, + tid = tid + }; + return SerializeCommand(CommandID.PICKUP, cmd); + } + public static Octets CreateCheckSecurityPassWd(string password) + { + // Calculate password length (similar to C++ strlen) + uint passwdSize = 0; + if (!string.IsNullOrEmpty(password)) + { + passwdSize = (uint)password.Length; + } + + // Create the command structure + var cmd = new CMD_CheckSecurityPassWd { passwd_size = passwdSize }; + + // Serialize the command structure first + var octets = SerializeCommand(CommandID.CHECK_SECURITY_PASSWD, cmd); + + // Append the actual password data if present + if (passwdSize > 0) + { + var passwordBytes = System.Text.Encoding.UTF8.GetBytes(password); + octets.Insert(octets.Size, passwordBytes); + } + + return octets; + } + + public static Octets CreateEquipItem(byte iIvtrIdx, byte iEquipIdx) + { + var cmd = new CMD_EquipItem + { + idx_inv = iIvtrIdx, + idx_eq = iEquipIdx + }; + return SerializeCommand(CommandID.EQUIP_ITEM, cmd); + } + + public static Octets CreateGetInventoryDetail(byte byPackage) + { + var cmd = new CMD_GetInventoryDetail + { + byPackage = byPackage + }; + return SerializeCommand(CommandID.GET_IVTR_DETAIL, cmd); + } + public static Octets CreateOwnItemInfo + ( + byte byPackage, + byte bySlot, + int type, + int expire_date, + int state, + uint count, + ushort crc, + ushort content_length, + byte[] content + ) + { + var cmd = new CMD_OwnItemInfo + { + byPackage = byPackage, + bySlot = bySlot, + type = type, + expire_date = expire_date, + state = state, + count = count, + crc = crc, + content_length = content_length, + content = content + }; + return SerializeCommand(eCommandID.OWN_ITEM_INFO, cmd); + } + public static Octets CreateTaskDataCommand(uint active_list_size, byte[] active_list, uint finished_list_size, byte[] finished_list, uint finished_time_list_size, byte[] finished_time_list, uint finished_count_size, byte[] finished_count, uint storage_task_size, byte[] storage_task) + { + // Create the CMD_TaskData object and populate it with the provided parameters + var cmd = new CMD_TaskData + { + active_list_size = active_list_size, + active_list = active_list, + finished_list_size = finished_list_size, + finished_list = finished_list, + finished_time_list_size = finished_time_list_size, + finished_time_list = finished_time_list, + finished_count_size = finished_count_size, + finished_count = finished_count, + storage_task_size = storage_task_size, + storage_task = storage_task + }; + + // Serialize the command and return the serialized data + return SerializeCommand(eCommandID.TASK_DATA, cmd); + } + public static Octets CreateTaskVarDataCommand(uint size, byte[] data) + { + // Create the CMD_TaskVarData object and populate it with the provided parameters + var cmd = new CMD_TaskVarData + { + size = size, + data = data + }; + + // Serialize the command and return the serialized data + return SerializeCommand(eCommandID.TASK_VAR_DATA, cmd); + } + + public static Octets CreateGetAllDataCommand(bool byPack, bool byEquip, bool byTask) + { + var cmd = new CMD_GetAllData + { + byPack = Convert.ToByte(byPack), + byEquip = Convert.ToByte(byEquip), + byTask = Convert.ToByte(byTask) + }; + + // Serialize the command and return the serialized data + return SerializeCommand(CommandID.GET_ALL_DATA, cmd); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommandFactory.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommandFactory.cs.meta new file mode 100644 index 0000000000..87511fad5d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommandFactory.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 028c8545e700b497296ae6d17c61beac \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/CSNetwork.csproj.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/CSNetwork.csproj.meta new file mode 100644 index 0000000000..333a9b1482 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/CSNetwork.csproj.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d0c06c588e2a6442488a3542551fb243 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common.meta new file mode 100644 index 0000000000..1a3c52952c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7009390df0e724fafa550ca88301cb61 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common/ExpTypes.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common/ExpTypes.cs new file mode 100644 index 0000000000..aa6b652bb7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common/ExpTypes.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace CSNetwork.Common +{ + internal class ExpTypes + { + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)] + public struct MONSTER_ESSENCE + { + public uint id; + public uint id_type; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + public string name; // wchar_t[32] + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string prop; // wchar_t[16] + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string desc; // wchar_t[16] + + public uint faction; + public uint monster_faction; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string file_model; // wchar_t[128] + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string file_gfx_short; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public string file_gfx_short_hit; + + public float size; + public float damage_delay; + + public uint id_strategy; + public uint role_in_war; + public uint character_combo_id; + public uint element_combo_id; + public uint exp; + public uint spirit; + public uint money; + public uint drop_probability; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public DropInfo[] drop_objects; + + public uint hp; + public uint mp; + public uint attack; + public uint defence; + public uint attack_speed; + public uint run_speed; + public uint range; + public uint view_range; + + public uint level; + public uint resist_metal; + public uint resist_wood; + public uint resist_water; + public uint resist_fire; + public uint resist_earth; + + public uint stunt; + public uint stunt_probability; + public uint stunt_delay; + + public uint combined_switch; + + public int hp_adjust_common_value; + public int defence_adjust_common_value; + public int attack_adjust_common_value; + + public float max_move_range; + public uint drop_for_no_profit_time; + + public int drop_mine_condition_flag; + public float drop_mine_probability; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public DropMine[] drop_mines; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] + public string label; // wchar_t[16] + + public uint domain_related; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] + public int[] local_var; + + // ---- Sub-structs ---- + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct DropInfo + { + public uint id; + public float probability; + public int num; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct DropMine + { + public uint id; + public float probability; + public int life; + } + } + + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common/ExpTypes.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common/ExpTypes.cs.meta new file mode 100644 index 0000000000..a5916c1b95 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Common/ExpTypes.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5d306357d71734b56aa0f851a31d456b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_ManMessage.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_ManMessage.cs new file mode 100644 index 0000000000..a7de0199cd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_ManMessage.cs @@ -0,0 +1,78 @@ +using System.Collections.Generic; + +namespace CSNetwork +{ + public class EC_ManMessage + { + // singleton + private static readonly IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(GameSession)); + private static EC_ManMessage _instance; + private static EC_ManMessage Instance + { + get + { + if (_instance == null) + { + _instance = new EC_ManMessage(); + } + return _instance; + } + } + + private Dictionary m_MsgHandlerList = new Dictionary(); + public Queue m_MsgList = new Queue(); + private IMsgHandler m_tempHandler; // so we don't have to allocate a new one every time + + private EC_ManMessage() {} + + /// Post a message to the message queue + public static void PostMessage(long dwMsg, int iManager, int iSubID, object p1=null, object p2=null, object p3=null, object p4=null, MsgDataBase[] pData=null) + { + ECMSG msg = new ECMSG + { + dwMsg = dwMsg, + iManager = iManager, + iSubID = iSubID, + dwParam1 = p1, + dwParam2 = p2, + dwParam3 = p3, + dwParam4 = p4, + pMsgData = pData + }; + AddMessage(msg); + } + + /// Add a message to the message queue + public static void AddMessage(ECMSG msg) + { + Instance.m_MsgList.Enqueue(msg); + } + + /// Register a message handler, it should be called before the game starts + public static void RegisterHandler(IMsgHandler handler) + { + Instance.m_MsgHandlerList.Add(handler.HandlerId, handler); + } + + /// Must use a Update function to call this function. It should be called in the Unity main thread + public static void Tick() + { + int i, count = Instance.m_MsgList.Count; + _logger.Info($"HoangDev : "+ Instance.m_MsgList.Count); + for (i = 0; i < count; i++) + { + ECMSG msg = Instance.m_MsgList.Dequeue(); + Instance.m_tempHandler = Instance.m_MsgHandlerList[msg.iManager]; + if (Instance.m_tempHandler != null) + { + Instance.m_tempHandler.ProcessMessage(msg); + } + } + } + + public static void Dispose() + { + _instance = null; + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_ManMessage.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_ManMessage.cs.meta new file mode 100644 index 0000000000..28cac02051 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_ManMessage.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b85016761c95c4e5b80bb57093a98d27 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_Manager.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_Manager.cs new file mode 100644 index 0000000000..70d66122ae --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_Manager.cs @@ -0,0 +1,13 @@ +namespace CSNetwork +{ + public sealed class MANAGER_INDEX + { + public static int MAN_PLAYER = 0; // Player manager + public static int MAN_NPC = 1; // NPC manager + public static int MAN_MATTER = 2; // Matter manager + public static int MAN_ORNAMENT = 3; // Ornament manager + public static int MAN_SKILLGFX = 4; // Skill Gfx Manager + public static int MAN_ATTACKS = 5; // Attack Manager + public static int MAN_DECAL = 6; // Decal manager + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_Manager.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_Manager.cs.meta new file mode 100644 index 0000000000..8a1183565e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_Manager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 87633064405114fb784b88dc38ecf2b9 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_MsgDef.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_MsgDef.cs new file mode 100644 index 0000000000..7260c565ca --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_MsgDef.cs @@ -0,0 +1,380 @@ +using System; + +namespace CSNetwork +{ + public sealed class EC_MsgDef + { + // Messages to gamerun + public static int MSG_EXITGAME = 100; // Exit game. p1 - exit code, + public static int MSG_CLOSEALLDIALOG = 101; // Close all dialogs + public static int MSG_SERVERTIME = 102; // Server time + public static int MSG_INSTCHECKOUT = 103; // Instance data checkout + public static int MSG_DOUBLETIME = 104; // Double time + public static int MSG_COMMONDATA = 105; // Common data + public static int MSG_MALLITEMINFO = 106; // Mall item info + public static int MSG_DIVIDENDMALLITEMINFO = 107; // Dividend mall item info + public static int MSG_PUBLICQUESTINFO = 108; // Public Quest task info + public static int MSG_WORLDLIFETIME = 109; // World life time info + public static int MSG_ENTERAUTOHOME = 110; // Enter autohome + public static int MSG_LEAVEAUTOHOME = 111; // Leave authhome + public static int MSG_CALCNETWORKDELAY = 112; // Network delay + public static int MSG_PLAYERSPECITEMLIST = 113; // Player spec items + public static int MSG_PARALLEL_WORLD_INFO = 114; // Sharding and load information + public static int MSG_UNIQUE_DATA = 115; // Historical progression data + public static int MSG_RANDOM_MAP_ORDER = 116; + + // Messages to host player + public static int MSG_GST_MOVE = 200; // Ghost move. p1 - move dir (0 - 7) + public static int MSG_GST_PITCH = 201; // Ghost pitch, p1 - degree + public static int MSG_GST_YAW = 202; // Ghost yaw, p1 - degree + public static int MSG_GST_MOVEABSUP = 203; // Ghost move absolute up, p1 - 1: up, 0: down + + public static int MSG_HST_CAMERAMODE = 220; // Host camera mode. p1 - camera mode + public static int MSG_HST_PUSHMOVE = 221; // Host player is pushed to move, p1 - move dir (0 - 7) + public static int MSG_HST_PITCH = 222; // Host camera pitch, p1 - degree; p2 - turn player flag + public static int MSG_HST_YAW = 223; // Host camera yaw, p1 - degree; p2 - turn player flag + public static int MSG_HST_LBTNCLICK = 224; // Left button click, p1 - x; p2 - y; p3 - SHIFT, ALT, CTRL key states; p4 - double click flag + public static int MSG_HST_TURNCAM = 225; // Begin or end turning host's camera, p1 - 1: begin, 0: end. p2 - 1: left button, 0: right button + public static int MSG_HST_WHEELCAM = 226; // Move camera using mouse's wheel button + public static int MSG_HST_CAMDEFAULT = 227; // Retrieve system default camera state + public static int MSG_HST_CAMPRESET = 228; // Retrieve system pre-defined camera state + public static int MSG_HST_CAMUSERGET = 229; // Retrieve user defined camera state, p1 - channel + public static int MSG_HST_CAMUSERSET = 230; // Store user defined camera state, p1 - channel + public static int MSG_HST_QUICKVIEW = 231; // Call camera monitor state quickly + public static int MSG_HST_ATKRESULT = 232; // Host attack result + public static int MSG_HST_ATTACKED = 233; // Host was attacked, p1 - data address + public static int MSG_HST_DIED = 234; // Host died + public static int MSG_HST_ASKREVIVE = 235; // Ask revive + public static int MSG_HST_PICKUPMONEY = 236; // Host pickup money + public static int MSG_HST_PICKUPITEM = 237; // Host pickup item + public static int MSG_HST_FOLLOW = 238; // Host follow some else + public static int MSG_HST_RECEIVEEXP = 239; // Received experience, p1 - data address + public static int MSG_HST_INFO00 = 240; // Host information 00, p1 - data address + public static int MSG_HST_GOTO = 241; // Host go to a position, p1 - data address + public static int MSG_HST_OWNITEMINFO = 242; // Host item information, p1 - data address + public static int MSG_HST_GAINITEM = 243; // Gain item in or after trade + public static int MSG_HST_SELTARGET = 244; // Select / unselect target, p1 - data address; p2 - command ID + public static int MSG_HST_FIXCAMERA = 245; // Fix camera + public static int MSG_HST_OWNEXTPROP = 246; // Host extend properties + public static int MSG_HST_ADDSTATUSPT = 247; // Add status point + public static int MSG_HST_RBTNCLICK = 248; // Left button click, p1 - x; p2 - y; p2 - y; p3 - SHIFT, ALT, CTRL key states + public static int MSG_HST_JOINTEAM = 249; // Host join team + public static int MSG_HST_LEAVETEAM = 250; // Host leave team + public static int MSG_HST_NEWTEAMMEM = 251; // New team member joined + public static int MSG_HST_ITEMOPERATION = 252; // Inventory and equipment item operations + public static int MSG_HST_TEAMINVITE = 253; // Host is invited by a team + public static int MSG_HST_TEAMREJECT = 254; // Host's join requirment is rejected by a team + public static int MSG_HST_TEAMMEMPOS = 255; // Notify host team member position + public static int MSG_HST_TEAMMEMPICKUP = 256; // Host team member pickup item + public static int MSG_HST_EQUIPDAMAGED = 257; // Host equipment damaged + public static int MSG_HST_NPCGREETING = 258; // NPC say greeting to host + public static int MSG_HST_TRADESTART = 259; // Trade with player start + public static int MSG_HST_TRADEREQUEST = 260; // Other player's trade request + public static int MSG_HST_TRADEMOVEITEM = 261; // Move item when trading with other player + public static int MSG_HST_TRADECANCEL = 262; // Host cancel trading with other player + public static int MSG_HST_TRADESUBMIT = 263; // Host submit trading + public static int MSG_HST_TARDECONFIRM = 264; // Host confirm trading + public static int MSG_HST_TRADEEND = 265; // Trade end + public static int MSG_HST_TRADEADDGOODS = 266; // Add goods to trade bar + public static int MSG_HST_TRADEREMGOODS = 267; // Remove goods from trade bar + public static int MSG_HST_IVTRINFO = 268; // Host inventory information + public static int MSG_HST_STARTATTACK = 269; // Host start attack + public static int MSG_HST_PURCHASEITEMS = 270; // Host buy items form NPC or player + public static int MSG_HST_SPENDMONEY = 271; // Host spend money + public static int MSG_HST_ITEMTOMONEY = 272; // Host sell items to NPC + public static int MSG_HST_REPAIR = 273; // Repair items + public static int MSG_HST_USEITEM = 274; // Host use item + public static int MSG_HST_SKILLDATA = 275; // Host skill data + public static int MSG_HST_EMBEDITEM = 276; // Embed item + public static int MSG_HST_CLEARTESSERA = 277; // Clear tessera + public static int MSG_HST_COSTSKILLPT = 278; // Cost skill point + public static int MSG_HST_LEARNSKILL = 279; // Learn skill + public static int MSG_HST_FLYSWORDTIME = 280; // Notify fly sword time + public static int MSG_HST_PRODUCEITEM = 281; // Host produce item + public static int MSG_HST_BREAKITEM = 282; // Host break item + public static int MSG_HST_TASKDATA = 283; // Task data + public static int MSG_HST_TARGETISFAR = 284; // Attack target is too far + public static int MSG_HST_PRESSCANCEL = 285; // User press cancel button + public static int MSG_HST_CANCELACTION = 286; // Cancel host current action + public static int MSG_HST_ROOTNOTIFY = 287; // Dispel root + public static int MSG_HST_STOPATTACK = 288; // Host stop attack + public static int MSG_HST_JUMP = 289; // Test code. jump + public static int MSG_HST_HURTRESULT = 290; // Hurt result + public static int MSG_HST_ATTACKONCE = 291; // Attack once notify + public static int MSG_HST_TRASHBOXOP = 292; // Trash box operation + public static int MSG_HST_PLAYTRICK = 293; // Play trick action + public static int MSG_HST_SKILLRESULT = 294; // Host skill attack result + public static int MSG_HST_SKILLATTACKED = 295; // Host skill attacked + public static int MSG_HST_ASKTOJOINTEAM = 296; // Some ask to join team + public static int MSG_HST_FACTION = 297; // Faction messages + public static int MSG_HST_TASKDELIVER = 298; // Task deliver + public static int MSG_HST_REPUTATION = 299; // Reputation update + public static int MSG_HST_ITEMIDENTIFY = 300; // Item identify + public static int MSG_HST_SANCTUARY = 301; // Sanctuary + public static int MSG_HST_CORRECTPOS = 302; // Correct host position + public static int MSG_HST_FRIENDOPT = 303; // Friend operation + public static int MSG_HST_TEAMINVITETO = 304; // Team invite timeout + public static int MSG_HST_WAYPOINT = 305; // Way point + public static int MSG_HST_BREATHDATA = 306; // Breath data + public static int MSG_HST_SKILLABILITY = 307; // Skill ability + public static int MSG_HST_COOLTIMEDATA = 308; // Cool time data + public static int MSG_HST_REVIVALINQUIRE = 309; // Revival inquire + public static int MSG_HST_SETCOOLTIME = 310; // Set cool time + public static int MSG_HST_CHGTEAMLEADER = 311; // Change team leader + public static int MSG_HST_EXITINSTANCE = 312; // Exit instance notify + public static int MSG_HST_CHANGEFACE = 313; // Host change face + public static int MSG_HST_TEAMMEMBERDATA = 314; // Team member data + public static int MSG_HST_SETMOVESTAMP = 315; // Set move stamp + public static int MSG_HST_CHATROOMOPT = 316; // Chatroom messages + public static int MSG_HST_MAILOPT = 317; // Mail messages + public static int MSG_HST_VENDUEOPT = 318; // Vendue messages + public static int MSG_HST_VIEWOTHEREQUIP = 319; // Get player's equipments + public static int MSG_HST_PARIAHTIME = 320; // Update pariah time + public static int MSG_HST_PETOPT = 321; // Pet operation + public static int MSG_HST_BATTLEOPT = 322; // Battle operation + public static int MSG_HST_ACCOUNTPOINT = 323; // Account point operation + public static int MSG_HST_GMOPT = 324; // GM operation + public static int MSG_HST_REFINEOPT = 325; // Refine operation + public static int MSG_HST_ITEMBOUND = 326; // Item bound result + public static int MSG_HST_USEITEMWITHDATA = 327; // Host use item with data + public static int MSG_HST_SAFELOCK = 328; // Safe lock operation + public static int MSG_HST_GOBLININFO = 329; // Goblin information + public static int MSG_HST_AUTOMOVE = 330; // Player auto move + public static int MSG_HST_BUY_SELL_FAIL = 331; // Player buy or sell failed + public static int MSG_HST_PLAYERPROPERTY = 332; // Player property + public static int MSG_HST_PASSWDCHECKED = 333; // Player's password has checked + public static int MSG_HST_HPSTEAL = 334; // Player steal hp + public static int MSG_HST_MULTI_EXP_INFO = 335; // Player multi exp info + public static int MSG_HST_MULTI_EXP_STATE = 336; // Player change multi exp state + public static int MSG_HST_WEBTRADELIST = 337; // Web trade list re + public static int MSG_HST_WEBTRADEATTENDLIST = 338; // Web trade attend list re + public static int MSG_HST_WEBTRADEGETITEM = 339; // Web trade get item re + public static int MSG_HST_WEBTRADEGETDETAIL = 340; // Web trade get item detail re + public static int MSG_HST_WEBTRADEPREPOST = 341; // Web trade pre-post re + public static int MSG_HST_WEBTRADEPRECANCELPOST = 342; // Web trade cancel post re + public static int MSG_HST_WEBTRADEUPDATE = 343; // Web trade update re + public static int MSG_HST_SYSAUCTIONACCOUNT = 344; // Sys Auction Account re + public static int MSG_HST_SYSAUCTIONBID = 345; // Sys Auction Bid re + public static int MSG_HST_SYSAUCTIONCASHTRANSFER = 346; // Sys Auction Cash Transfer re + public static int MSG_HST_SYSAUCTIONGETITEM = 347; // Sys Auction Get Item re + public static int MSG_HST_SYSAUCTIONLIST = 348; // Sys Auction List re + public static int MSG_HST_ONLINEAWARD = 349; // Online award + // Continue later; do not add more here + + // Messages to player manager + public static int MSG_PM_PLAYERINFO = 350; // Player information, p1 - data address; p2 - command ID + public static int MSG_PM_PLAYERMOVE = 351; // Player move, p1 - data address + public static int MSG_PM_PLAYERRUNOUT = 352; // Player run out of view area, p1 - data address + public static int MSG_PM_PLAYEREXIT = 353; // Player exit game, p1 - data address + public static int MSG_PM_CHANGENAMECOLOR = 354; // Change player's name color + public static int MSG_PM_PLAYERROOT = 355; // Player is root + public static int MSG_PM_PLAYERDIED = 356; // Player was killed, p1 - data address + public static int MSG_PM_PLAYERREVIVE = 357; // Player revive, p1 - data address + public static int MSG_PM_PLAYEROUTOFVIEW = 358; // Player is out of view, p1 - player's ID + public static int MSG_PM_PLAYERDISAPPEAR = 359; // Player disappear, p1 - data address + public static int MSG_PM_PLAYERSTOPMOVE = 360; // Player stop move, p1 - data address + public static int MSG_PM_PLAYERLEVELUP = 361; // Player level up + public static int MSG_PM_PLAYEREXTPROP = 362; // Player extend properties + // #define MSG_PM_TEAMMEMBERDATA 363 // Team member data + public static int MSG_PM_LEAVETEAM = 364; // Player leave team + public static int MSG_PM_PLAYEREQUIPDATA = 365; // Player equipment data + public static int MSG_PM_CASTSKILL = 366; // Player cast skill + public static int MSG_PM_PLAYERBASEINFO = 367; // Player custom data + public static int MSG_PM_PLAYERFLY = 368; // Player take off or land on + public static int MSG_PM_PLAYERSITDOWN = 369; // Player sit down / stand up + public static int MSG_PM_PLAYERATKRESULT = 370; // Player attack result + public static int MSG_PM_PLAYEREXTSTATE = 371; // Player extend states changed + public static int MSG_PM_PLAYERDOEMOTE = 372; // Player do emotion + public static int MSG_PM_PLAYERUSEITEM = 373; // Player use item + public static int MSG_PM_PLAYERCUSTOM = 374; // Player custom data + public static int MSG_PM_ENCHANTRESULT = 375; // Enchant result + public static int MSG_PM_PLAYERDOACTION = 376; // Player do action + public static int MSG_PM_PLAYERSKILLRESULT = 377; // Player skill attack result + public static int MSG_PM_PLAYERADVDATA = 378; // Player advertisement data + public static int MSG_PM_PLAYERINTEAM = 379; // Player in team notify + public static int MSG_PM_PICKUPMATTER = 380; // Player pickup a matter + public static int MSG_PM_PLAYERGATHER = 381; // Player gather mine + public static int MSG_PM_DOCONEMOTE = 382; // Player do concurrent emotion + public static int MSG_PM_PLAYERCHGSHAPE = 383; // Player change shape + public static int MSG_PM_BOOTHOPT = 384; // Booth operation + public static int MSG_PM_PLAYERTRAVEL = 385; // Player travel service + public static int MSG_PM_PLAYERPVP = 386; // Player PVP messages + public static int MSG_PM_FASHIONENABLE = 387; // Player enable/disable fashion + public static int MSG_PM_INVALIDOBJECT = 388; // Object is invalid + public static int MSG_PM_PLAYEREFFECT = 389; // Player effect association + public static int MSG_PM_CHANGEFACE = 390; // Player change face + public static int MSG_PM_DUELOPT = 391; // Duel operation + public static int MSG_PM_PLAYERBINDOPT = 392; // Player bind operation + public static int MSG_PM_PLAYERBINDSTART = 393; // Player bind start + public static int MSG_PM_PLAYERMOUNT = 394; // Player mount state + public static int MSG_PM_PLAYERDUELOPT = 395; // Player duel operation + public static int MSG_PM_PLAYERDUELRLT = 396; // Player duel result + public static int MSG_PM_PLAYERLEVEL2 = 397; // Player level2 notify + public static int MSG_PM_TANKLEADER = 398; // Tank leader notify + public static int MSG_PM_USEITEMWITHDATA = 399; + public static int MSG_PM_PLAYERCHANGESPOUSE = 400; // Player change the spouse + public static int MSG_PM_GOBLINOPT = 401; // Goblin operation: Cast skill, change refine active... + public static int MSG_PM_GOBLINLEVELUP = 402; // Goblin level up + public static int MSG_PM_PLAYERINVISIBLE = 403; // Player invisible + public static int MSG_PM_PLAYERKNOCKBACK = 404; // Player knock back + public static int MSG_PM_PLAYEREQUIPDISABLED = 405; // Player equipment disabled + public static int MSG_PM_CONGREGATE = 406; // Congregate related + public static int MSG_PM_TELEPORT = 407; // teleport + public static int MSG_PM_FORBIDBESELECTED = 408; // forbid to be selected + public static int MSG_PM_FORCE_CHANGED = 409; // a player changed his force + public static int MSG_PM_MULTIOBJ_EFFECT = 410; // player's multi object effect + public static int MSG_PM_COUNTRY_CHANGED = 411; + public static int MSG_PM_KINGCHANGED = 412; + public static int MSG_PM_TITLE = 413; // player's titles + public static int MSG_PM_REINCARNATION = 414; + public static int MSG_PM_REALMLEVEL = 415; + public static int MSG_PM_PLAYER_IN_OUT_BATTLE = 416; + public static int MSG_PM_FACTION_PVP_MASK_MODIFY = 417; + + // Messages to NPC manager + public static int MSG_NM_NPCINFO = 400; // NPC information, p1 - protocol object address + public static int MSG_NM_NPCMOVE = 401; // NPC move, p1 - data address + public static int MSG_NM_NPCRUNOUT = 402; // NPC run out of view area, p1 - data address + public static int MSG_NM_NPCDIED = 403; // NPC died, p1 - data address + public static int MSG_NM_NPCDISAPPEAR = 404; // NPC disappear, p1 - data address + public static int MSG_NM_NPCCASTSKILL = 405; // NPC cast skill + public static int MSG_NM_NPCROOT = 406; // NPC is root + public static int MSG_NM_NPCOUTOFVIEW = 407; // NPC is out of view, p1 - NPC's ID + public static int MSG_NM_NPCSTOPMOVE = 408; // NPC stop moving, p1 - data address + public static int MSG_NM_NPCATKRESULT = 409; // NPC attack result + public static int MSG_NM_NPCEXTSTATE = 410; // NPC extend states changed + public static int MSG_NM_ENCHANTRESULT = 411; // Enchant result + public static int MSG_NM_NPCSKILLRESULT = 412; // NPC skill attack result + public static int MSG_NM_INVALIDOBJECT = 413; // Object is invalid + public static int MSG_NM_NPCLEVELUP = 414; // NPC level up + public static int MSG_NM_NPCINVISIBLE = 415; // NPC invisible + public static int MSG_NM_NPCSTARTPLAYACTION = 416; // NPC play policy action + public static int MSG_NM_NPCSTOPPLAYACTION = 417; // NPC stop play policy action + public static int MSG_NM_FORBIDBESELECTED = 418; // forbid to be selected + public static int MSG_NM_MULTIOBJECT_EFFECT = 419; // NPC's multi object effect + + // Messages to matter manager + public static int MSG_MM_MATTERINFO = 500; // Matter information, p1 - data address + public static int MSG_MM_MATTERDISAPPEAR = 501; // Matter disappear, p1 - data address + public static int MSG_MM_MATTERENTWORLD = 502; // Matter enter world, p1 - data address + public static int MSG_MM_MATTEROUTOFVIEW = 503; // Matter is out of view, p1 - data address + public static int MSG_MM_INVALIDOBJECT = 504; // Object is invalid + + // Messages to host player cont. + public static int MSG_HST_WEDDINGBOOKLIST = 600; // wedding book list + public static int MSG_HST_WEDDINGBOOKSUCCESS = 601; // wedding book success notify + public static int MSG_HST_FACTIONCONTRIB = 602; // faction contrib + public static int MSG_HST_FACTIONFORTRESSINFO = 603; // faction fortress info + public static int MSG_HST_ENTERFACTIONFORTRESS = 604; // enter faction fortress + public static int MSG_HST_ENGRAVEITEM = 605; // engrave item + public static int MSG_HST_DPS_DPH_RANK = 606; // current dps dph rank + public static int MSG_HST_ADDONREGEN = 607; // regenerate item addon + public static int MSG_HST_INVISIBLEOBJLIST = 608; // invisible object list notify + public static int MSG_HST_SETPLAYERLIMIT = 609; // set player limit + public static int MSG_HST_FORCE_DATA = 610; // Player force data (get or changed) + public static int MSG_HST_INVENTORY_DETAIL = 611; // Get other player's inventory detail info + public static int MSG_HST_ADD_MULTIOBJECT_EFFECT = 612; // Add multi object effect + public static int MSG_HST_WEDDINGSCENE_INFO = 613; // whose wedding scene the player is entering + public static int MSG_HST_PROFITTIME = 614; // change the player's profit level + public static int MSG_HST_PVPNOPENALTY = 615; // PVP no penalty + public static int MSG_HST_COUNTRY_NOTIFY = 616; + public static int MSG_HST_ENTER_COUNTRYBATTLE = 617; + public static int MSG_HST_COUNTRYBATTLE_RESULT = 618; + public static int MSG_HST_COUNTRYBATTLE_SCORE = 619; + public static int MSG_HST_COUNTRYBATTLE_REVIVE_TIMES = 620; + public static int MSG_HST_COUNTRYBATTLE_CARRIER_NOTIFY = 621; + public static int MSG_HST_COUNTRYBATTLE_BECOME_CARRIER = 622; + public static int MSG_HST_COUNTRYBATTLE_PERSONAL_SCORE = 623; + public static int MSG_HST_COUNTRYBATTLE_FLAG_MSG_NOTIFY = 624; + public static int MSG_HST_DEFENSE_RUNE_ENABLE = 625; + public static int MSG_HST_COUNTRYBATTLE_INFO = 626; + public static int MSG_HST_CASHMONEYRATE = 627; + public static int MSG_HST_STONECHANGEEND = 628; + public static int MSG_HST_KINGNOTIFY = 629; + public static int MSG_HST_MERIDIANS_NOTIFY = 630; + public static int MSG_HST_MERIDIANS_RESULT = 631; + public static int MSG_HST_COUNTRYBATTLE_STRONGHOLD_STATE = 632; + public static int MSG_HST_TOUCHPOINT = 633; // Touch related + public static int MSG_HST_TITLE = 644; // Title related + public static int MSG_HST_SIGNIN = 645; + public static int MSG_HST_REINCARNATION_TOME_INFO = 646; + public static int MSG_HST_REINCARNATION_TOME_ACTIVATE = 647; + public static int MSG_HST_USE_GIFTCARD = 648; // Use gift card + public static int MSG_HST_REALM_EXP = 649; + public static int MSG_HST_TRICKBATTLE = 650; + public static int MSG_HST_CONTINUECOMBOSKILL = 651; + public static int MSG_HST_GENERALCARD = 652; + public static int MSG_HST_MONSTERSPIRIT_LEVEL = 653; + public static int MSG_HST_COUNTRYBATTLE_LIVESHOW = 654; + public static int MSG_HST_RAND_MALL_SHOPPING_RES = 655; + public static int MSG_HST_WORLD_CONTRIBUTION = 656; + public static int MSG_HST_CANINHERIT_ADDONS = 657; + public static int MSG_HST_CLIENT_SCREENEFFECT = 658; + public static int MSG_HST_COMBO_SKILL_PREPARE = 659; + public static int MSG_HST_INSTANCE_REENTER_NOTIFY = 660; + public static int MSG_HST_PRAY_DISTANCE_CHANGE = 661; + + } + + public struct ECMSG + { + public long dwMsg; // Message code + public int iManager; // Receiver manager's ID + public int iSubID; // Sub ID + public object dwParam1; // Parameter 1 + public object dwParam2; // Parameter 2 + public object dwParam3; // Parameter 3 + public object dwParam4; // Parameter 4 + public MsgDataBase[] pMsgData; + + } + + public enum DataType + { + MSG_DATABASE = 0, + MSG_TARGETPOS, + MSG_TARGETNPC, + } + + public class MsgDataBase + { + public int m_imsgType; + + public MsgDataBase() {} + public MsgDataBase(int type) + { + m_imsgType = type; + } + } + + public class MsgDataAutoMove : MsgDataBase + { + public int m_iNPCId; + public int m_iTaskId; + + public MsgDataAutoMove(int type, int id, int taskid) : base(type) + { + m_iNPCId = id; + m_iTaskId = taskid; + } + + // TODO: might need to implement this + // virtual MsgDataBase* Clone() { return new MsgDataAutoMove(*this); } + + public int GetTargetID() + { + return m_iNPCId; + } + + public int GetTaskID() + { + return m_iTaskId; + } + } + + public interface IMsgHandler + { + int HandlerId { get; } + bool ProcessMessage(ECMSG Msg); + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_MsgDef.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_MsgDef.cs.meta new file mode 100644 index 0000000000..1bf4d7178f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EC_MsgDef.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fbc9be35124064cef8fde9e5f637a9bf \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/EventBus.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EventBus.cs new file mode 100644 index 0000000000..31180090b6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EventBus.cs @@ -0,0 +1,326 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Timers; + +public static class EventBus +{ + // Cho phép null ở value để có thể "clear" slot + private static readonly Dictionary globalListeners = + new Dictionary(); + + private static readonly Dictionary globalClassListeners = + new Dictionary(); + + private static readonly Dictionary> channelListeners = + new Dictionary>(); + + private static readonly Dictionary> channelClassListeners = + new Dictionary>(); + + // Cho phép null khi chưa bật auto-cleanup + private static Timer? cleanupTimer; + + public static bool DebugEnabled = false; + + private static void DebugLog(string message) + { + if (DebugEnabled) + Console.WriteLine($"[EventBus] {message}"); + } + + // ===== GLOBAL STRUCT EVENTS ===== + public static void Subscribe(Action listener) where T : struct + { + var type = typeof(T); + if (!globalListeners.ContainsKey(type)) + globalListeners[type] = null; + + var current = globalListeners[type] as Action; + current += listener; + globalListeners[type] = current; + } + + public static void Unsubscribe(Action listener) where T : struct + { + var type = typeof(T); + if (!globalListeners.ContainsKey(type)) + return; + + var current = globalListeners[type] as Action; + current -= listener; + if (current == null) + globalListeners.Remove(type); + else + globalListeners[type] = current; + } + + public static void Publish(T eventData) where T : struct + { + var type = typeof(T); + if (globalListeners.TryGetValue(type, out var del)) + { + var action = del as Action; + if (action != null) + { + DebugLog($"Publish Global Struct Event: {type.Name}"); + action(eventData); + } + } + } + + // ===== GLOBAL CLASS EVENTS ===== + public static void SubscribeClass(Action listener) where T : class + { + var type = typeof(T); + if (!globalClassListeners.ContainsKey(type)) + globalClassListeners[type] = null; + + var current = globalClassListeners[type] as Action; + current += listener; + globalClassListeners[type] = current; + } + + public static void UnsubscribeClass(Action listener) where T : class + { + var type = typeof(T); + if (!globalClassListeners.ContainsKey(type)) + return; + + var current = globalClassListeners[type] as Action; + current -= listener; + if (current == null) + globalClassListeners.Remove(type); + else + globalClassListeners[type] = current; + } + + public static void PublishClass(T eventData) where T : class + { + var type = typeof(T); + if (globalClassListeners.TryGetValue(type, out var del)) + { + var action = del as Action; + if (action != null) + { + DebugLog($"Publish Global Class Event: {type.Name}"); + action(eventData); + } + } + } + + // ===== CHANNEL STRUCT EVENTS ===== + public static void SubscribeChannel(int channelId, Action listener) where T : struct + { + var type = typeof(T); + + if (!channelListeners.ContainsKey(channelId)) + channelListeners[channelId] = new Dictionary(); + + if (!channelListeners[channelId].ContainsKey(type)) + channelListeners[channelId][type] = null; + + var current = channelListeners[channelId][type] as Action; + current += listener; + channelListeners[channelId][type] = current; + } + + public static void UnsubscribeChannel(int channelId, Action listener) where T : struct + { + var type = typeof(T); + if (!channelListeners.ContainsKey(channelId) || + !channelListeners[channelId].ContainsKey(type)) + return; + + var current = channelListeners[channelId][type] as Action; + current -= listener; + + if (current == null) + { + channelListeners[channelId].Remove(type); + if (channelListeners[channelId].Count == 0) + channelListeners.Remove(channelId); + } + else + { + channelListeners[channelId][type] = current; + } + } + + public static void PublishChannel(int channelId, T eventData) where T : struct + { + var type = typeof(T); + if (channelListeners.TryGetValue(channelId, out var dict)) + { + Delegate? del; + if (dict.TryGetValue(type, out del)) + { + var action = del as Action; + if (action != null) + { + DebugLog($"Publish Channel Struct Event: {type.Name} to channel '{channelId}'"); + action(eventData); + } + } + } + } + + // ===== CHANNEL CLASS EVENTS ===== + public static void SubscribeChannelClass(int channelId, Action listener) where T : class + { + var type = typeof(T); + + if (!channelClassListeners.ContainsKey(channelId)) + channelClassListeners[channelId] = new Dictionary(); + + if (!channelClassListeners[channelId].ContainsKey(type)) + channelClassListeners[channelId][type] = null; + + var current = channelClassListeners[channelId][type] as Action; + current += listener; + channelClassListeners[channelId][type] = current; + } + + public static void UnsubscribeChannelClass(int channelId, Action listener) where T : class + { + var type = typeof(T); + if (!channelClassListeners.ContainsKey(channelId) || + !channelClassListeners[channelId].ContainsKey(type)) + return; + + var current = channelClassListeners[channelId][type] as Action; + current -= listener; + + if (current == null) + { + channelClassListeners[channelId].Remove(type); + if (channelClassListeners[channelId].Count == 0) + channelClassListeners.Remove(channelId); + } + else + { + channelClassListeners[channelId][type] = current; + } + } + + public static void PublishChannelClass(int channelId, T eventData) where T : class + { + var type = typeof(T); + if (channelClassListeners.TryGetValue(channelId, out var dict)) + { + Delegate? del; + if (dict.TryGetValue(type, out del)) + { + var action = del as Action; + if (action != null) + { + DebugLog($"Publish Channel Class Event: {type.Name} to channel '{channelId}'"); + action(eventData); + } + } + } + } + + // ===== ONE-TIME SUBSCRIBE ===== + public static void SubscribeOnce(Action listener) where T : struct + { + Action? wrapper = null; + wrapper = data => + { + listener(data); + Unsubscribe(wrapper); + }; + Subscribe(wrapper); + } + + public static void SubscribeOnceClass(Action listener) where T : class + { + Action? wrapper = null; + wrapper = data => + { + listener(data); + UnsubscribeClass(wrapper); + }; + SubscribeClass(wrapper); + } + + public static void SubscribeOnceChannel(int channelId, Action listener) where T : struct + { + Action? wrapper = null; + wrapper = data => + { + listener(data); + UnsubscribeChannel(channelId, wrapper); + }; + SubscribeChannel(channelId, wrapper); + } + + public static void SubscribeOnceChannelClass(int channelId, Action listener) where T : class + { + Action? wrapper = null; + wrapper = data => + { + listener(data); + UnsubscribeChannelClass(channelId, wrapper); + }; + SubscribeChannelClass(channelId, wrapper); + } + + // ===== CHANNEL UTILITIES ===== + public static bool ChannelExists(int channelId) + { + return channelListeners.ContainsKey(channelId) || channelClassListeners.ContainsKey(channelId); + } + + public static void EnableAutoCleanup(float delaySeconds = 5f) + { + cleanupTimer = new Timer(delaySeconds * 1000); + cleanupTimer.Elapsed += (sender, e) => + { + var emptyStructChannels = channelListeners + .Where(pair => pair.Value.Values.All(d => d == null)) + .Select(pair => pair.Key) + .ToList(); + foreach (var id in emptyStructChannels) + { + channelListeners.Remove(id); + DebugLog($"Removed empty struct channel: {id}"); + } + + var emptyClassChannels = channelClassListeners + .Where(pair => pair.Value.Values.All(d => d == null)) + .Select(pair => pair.Key) + .ToList(); + foreach (var id in emptyClassChannels) + { + channelClassListeners.Remove(id); + DebugLog($"Removed empty class channel: {id}"); + } + }; + cleanupTimer.AutoReset = true; + cleanupTimer.Start(); + } + public static void UnsubscribeAllChannels() + { + channelListeners.Clear(); + channelClassListeners.Clear(); + DebugLog("Unsubscribed all events from all channels"); + } + public static void UnsubscribeAllInChannel(int channelId) + { + if (channelListeners.ContainsKey(channelId)) + { + channelListeners[channelId].Clear(); + channelListeners.Remove(channelId); + DebugLog($"Unsubscribed all struct events in channel {channelId}"); + } + + if (channelClassListeners.ContainsKey(channelId)) + { + channelClassListeners[channelId].Clear(); + channelClassListeners.Remove(channelId); + DebugLog($"Unsubscribed all class events in channel {channelId}"); + } + } + +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/EventBus.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EventBus.cs.meta new file mode 100644 index 0000000000..6985f7755e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/EventBus.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 51ef736cb143545fc868769bb41d309e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs new file mode 100644 index 0000000000..2d8f7303d7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs @@ -0,0 +1,1220 @@ +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; + +namespace CSNetwork.GPDataType +{ + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_header + { + public ushort cmd; + }; + + [Flags] + public enum GPMoveMode + { + GP_MOVE_WALK = 0, + GP_MOVE_RUN = 1, + GP_MOVE_STAND = 2, + GP_MOVE_FALL = 3, + GP_MOVE_SLIDE = 4, + GP_MOVE_PUSH = 5, // only sent to NPC + GP_MOVE_FLYFALL = 6, + GP_MOVE_RETURN = 7, + GP_MOVE_JUMP = 8, + GP_MOVE_PULL = 9, // only sent to NPC + GP_MOVE_BLINK = 10, // only sent to NPC£¨Ë²ÒÆ£© + GP_MOVE_MASK = 0x0f, + + GP_MOVE_TURN = 0x10, // Turnaround + GP_MOVE_DEAD = 0x20, + + GP_MOVE_AIR = 0x40, + GP_MOVE_WATER = 0x80, + GP_MOVE_ENVMASK = 0xc0, + }; + + public static class CommandID // Command ID + { + public const int PROTOCOL_COMMAND = -1; // Reserved for protocol + + public const int PLAYER_INFO_1 = 0; + public const int PLAYER_INFO_2 = 1; + public const int PLAYER_INFO_3 = 2; + public const int PLAYER_INFO_4 = 3; + public const int PLAYER_INFO_1_LIST = 4; + + public const int PLAYER_INFO_2_LIST = 5; + public const int PLAYER_INFO_3_LIST = 6; + public const int PLAYER_INFO_23_LIST = 7; + public const int SELF_INFO_1 = 8; + public const int NPC_INFO_LIST = 9; + + public const int MATTER_INFO_LIST = 10; + public const int NPC_ENTER_SLICE = 11; + public const int PLAYER_ENTER_SLICE = 12; + public const int OBJECT_LEAVE_SLICE = 13; + public const int NOTIFY_HOSTPOS = 14; + + public const int OBJECT_MOVE = 15; + public const int NPC_ENTER_WORLD = 16; + public const int PLAYER_ENTER_WORLD = 17; + public const int MATTER_ENTER_WORLD = 18; + public const int PLAYER_LEAVE_WORLD = 19; + + public const int NPC_DIED = 20; + public const int OBJECT_DISAPPEAR = 21; + public const int OBJECT_STARTATTACK = 22; + public const int HOST_STOPATTACK = 23; + public const int HOST_ATTACKRESULT = 24; + + public const int ERROR_MESSAGE = 25; + public const int HOST_ATTACKED = 26; + public const int PLAYER_DIED = 27; + public const int HOST_DIED = 28; + public const int PLAYER_REVIVE = 29; + + public const int PICKUP_MONEY = 30; + public const int PICKUP_ITEM = 31; + public const int PLAYER_INFO_00 = 32; + public const int NPC_INFO_00 = 33; + public const int OUT_OF_SIGHT_LIST = 34; + + public const int OBJECT_STOP_MOVE = 35; + public const int RECEIVE_EXP = 36; + public const int LEVEL_UP = 37; + public const int SELF_INFO_00 = 38; + public const int UNSELECT = 39; + + public const int OWN_ITEM_INFO = 40; + public const int EMPTY_ITEM_SLOT = 41; + public const int OWN_IVTR_DATA = 42; + public const int OWN_IVTR_DETAIL_DATA = 43; + public const int EXG_IVTR_ITEM = 44; + + public const int MOVE_IVTR_ITEM = 45; + public const int PLAYER_DROP_ITEM = 46; + public const int EXG_EQUIP_ITEM = 47; + public const int EQUIP_ITEM = 48; + public const int MOVE_EQUIP_ITEM = 49; + + public const int OWN_EXT_PROP = 50; + public const int ADD_STATUS_POINT = 51; + public const int SELECT_TARGET = 52; + public const int PLAYER_EXT_PROP_BASE = 53; + public const int PLAYER_EXT_PROP_MOVE = 54; + + public const int PLAYER_EXT_PROP_ATK = 55; + public const int PLAYER_EXT_PROP_DEF = 56; + public const int TEAM_LEADER_INVITE = 57; + public const int TEAM_REJECT_INVITE = 58; + public const int TEAM_JOIN_TEAM = 59; + + public const int TEAM_MEMBER_LEAVE = 60; + public const int TEAM_LEAVE_PARTY = 61; + public const int TEAM_NEW_MEMBER = 62; + public const int TEAM_LEADER_CACEL_PARTY = 63; + public const int TEAM_MEMBER_DATA = 64; + + public const int TEAM_MEMBER_POS = 65; + public const int EQUIP_DATA = 66; + public const int EQUIP_DATA_CHANGED = 67; + public const int EQUIP_DAMAGED = 68; + public const int TEAM_MEMBER_PICKUP = 69; + + public const int NPC_GREETING = 70; + public const int NPC_SERVICE_CONTENT = 71; + public const int PURCHASE_ITEM = 72; + public const int ITEM_TO_MONEY = 73; + public const int REPAIR_ALL = 74; + + public const int REPAIR = 75; + public const int RENEW = 76; + public const int SPEND_MONEY = 77; + public const int GAIN_MONEY_IN_TRADE = 78; + public const int GAIN_ITEM_IN_TRADE = 79; + + public const int GAIN_MONEY_AFTER_TRADE = 80; + public const int GAIN_ITEM_AFTER_TRADE = 81; + public const int GET_OWN_MONEY = 82; + public const int ATTACK_ONCE = 83; + public const int HOST_START_ATTACK = 84; + + public const int OBJECT_CAST_SKILL = 85; + public const int SKILL_INTERRUPTED = 86; + public const int SELF_SKILL_INTERRUPTED = 87; + public const int SKILL_PERFORM = 88; + public const int OBJECT_BE_ATTACKED = 89; + + public const int SKILL_DATA = 90; + public const int HOST_USE_ITEM = 91; + public const int EMBED_ITEM = 92; + public const int CLEAR_TESSERA = 93; + public const int COST_SKILL_POINT = 94; + + public const int LEARN_SKILL = 95; + public const int OBJECT_TAKEOFF = 96; + public const int OBJECT_LANDING = 97; + public const int FLYSWORD_TIME = 98; + public const int HOST_OBTAIN_ITEM = 99; + + public const int PRODUCE_START = 100; + public const int PRODUCE_ONCE = 101; + public const int PRODUCE_END = 102; + public const int DECOMPOSE_START = 103; + public const int DECOMPOSE_END = 104; + + public const int TASK_DATA = 105; + public const int TASK_VAR_DATA = 106; + public const int OBJECT_START_USE = 107; + public const int OBJECT_CANCEL_USE = 108; + public const int OBJECT_USE_ITEM = 109; + + public const int OBJECT_START_USE_T = 110; + public const int OBJECT_SIT_DOWN = 111; + public const int OBJECT_STAND_UP = 112; + public const int OBJECT_DO_EMOTE = 113; + public const int SERVER_TIME = 114; + + public const int OBJECT_ROOT = 115; + public const int HOST_DISPEL_ROOT = 116; + public const int INVADER_RISE = 117; + public const int PARIAH_RISE = 118; + public const int INVADER_FADE = 119; + + public const int OBJECT_ATTACK_RESULT = 120; + public const int BE_HURT = 121; + public const int HURT_RESULT = 122; + public const int HOST_STOP_SKILL = 123; + public const int UPDATE_EXT_STATE = 124; + + public const int ICON_STATE_NOTIFY = 125; + public const int PLAYER_GATHER_START = 126; + public const int PLAYER_GATHER_STOP = 127; + public const int TRASHBOX_PWD_CHANGED = 128; + public const int TRASHBOX_PWD_STATE = 129; + + public const int TRASHBOX_OPEN = 130; + public const int TRASHBOX_CLOSE = 131; + public const int TRASHBOX_WEALTH = 132; + public const int EXG_TRASHBOX_ITEM = 133; + public const int MOVE_TRASHBOX_ITEM = 134; + + public const int EXG_TRASHBOX_IVTR = 135; + public const int IVTR_ITEM_TO_TRASH = 136; + public const int TRASH_ITEM_TO_IVTR = 137; + public const int EXG_TRASH_MONEY = 138; + public const int ENCHANT_RESULT = 139; + public const int HOST_NOTIFY_ROOT = 140; + public const int OBJECT_DO_ACTION = 141; + public const int HOST_SKILL_ATTACK_RESULT = 142; + public const int OBJECT_SKILL_ATTACK_RESULT = 143; + public const int HOST_SKILL_ATTACKED = 144; + + public const int PLAYER_SET_ADV_DATA = 145; + public const int PLAYER_CLR_ADV_DATA = 146; + public const int PLAYER_IN_TEAM = 147; + public const int TEAM_ASK_TO_JOIN = 148; + public const int OBJECT_EMOTE_RESTORE = 149; + + public const int CON_EMOTE_REQUEST = 150; // concurrent emote request + public const int DO_CONCURRENT_EMOTE = 151; + public const int MATTER_PICKUP = 152; + public const int MAFIA_INFO_NOTIFY = 153; + public const int MAFIA_TRADE_START = 154; + + public const int MAFIA_TRADE_END = 155; + public const int TASK_DELIVER_ITEM = 156; + public const int TASK_DELIVER_REP = 157; + public const int TASK_DELIVER_EXP = 158; + public const int TASK_DELIVER_MONEY = 159; + + public const int TASK_DELIVER_LEVEL2 = 160; + public const int HOST_REPUTATION = 161; + public const int ITEM_IDENTIFY = 162; + public const int PLAYER_CHGSHAPE = 163; + public const int ENTER_SANCTUARY = 164; + + public const int LEAVE_SANCTUARY = 165; + public const int PLAYER_OPEN_BOOTH = 166; + public const int SELF_OPEN_BOOTH = 167; + public const int PLAYER_CLOSE_BOOTH = 168; + public const int PLAYER_BOOTH_INFO = 169; + + public const int BOOTH_TRADE_SUCCESS = 170; + public const int BOOTH_NAME = 171; + public const int PLAYER_START_TRAVEL = 172; + public const int HOST_START_TRAVEL = 173; + public const int PLAYER_END_TRAVEL = 174; + + public const int GM_INVINCIBLE = 175; + public const int GM_INVISIBLE = 176; + public const int HOST_CORRECT_POS = 177; + public const int OBJECT_CAST_INSTANT_SKILL = 178; + public const int ACTIVATE_WAYPOINT = 179; + + public const int WAYPOINT_LIST = 180; + public const int UNFREEZE_IVTR_SLOT = 181; // Unfreeze inventory item + public const int TEAM_INVITE_TIMEOUT = 182; + public const int PLAYER_ENABLE_PVP = 183; + public const int PLAYER_DISABLE_PVP = 184; + + public const int HOST_PVP_COOLDOWN = 185; + public const int COOLTIME_DATA = 186; + public const int SKILL_ABILITY = 187; + public const int OPEN_BOOTH_TEST = 188; + public const int BREATH_DATA = 189; + + public const int HOST_STOP_DIVE = 190; + public const int BOOTH_SELL_ITEM = 191; + public const int PLAYER_ENABLE_FASHION = 192; + public const int HOST_ENABLE_FREEPVP = 193; + public const int INVALID_OBJECT = 194; + + public const int PLAYER_ENABLE_EFFECT = 195; + public const int PLAYER_DISABLE_EFFECT = 196; + public const int REVIVAL_INQUIRE = 197; + public const int SET_COOLDOWN = 198; + public const int CHANGE_TEAM_LEADER = 199; + + public const int EXIT_INSTANCE = 200; + public const int CHANGE_FACE_START = 201; + public const int CHANGE_FACE_END = 202; + public const int PLAYER_CHG_FACE = 203; // Player change face completed + public const int OBJECT_CAST_POS_SKILL = 204; + + public const int SET_MOVE_STAMP = 205; + public const int INST_DATA_CHECKOUT = 206; + public const int HOST_RUSH_FLY = 207; + public const int TRASHBOX_SIZE = 208; + public const int NPC_DIED2 = 209; + + public const int PRODUCE_NULL = 210; + public const int PVP_COMBAT = 211; + public const int DOUBLE_EXP_TIME = 212; + public const int AVAILABLE_DOUBLE_EXP_TIME = 213; + public const int DUEL_RECV_REQUEST = 214; + + public const int DUEL_REJECT_REQUEST = 215; + public const int DUEL_PREPARE = 216; + public const int DUEL_CANCEL = 217; + public const int HOST_DUEL_START = 218; + public const int DUEL_STOP = 219; + + public const int DUEL_RESULT = 220; + public const int PLAYER_BIND_REQUEST = 221; + public const int PLAYER_BIND_INVITE = 222; + public const int PLAYER_BIND_REQUEST_REPLY = 223; + public const int PLAYER_BIND_INVITE_REPLY = 224; + + public const int PLAYER_BIND_START = 225; + public const int PLAYER_BIND_STOP = 226; + public const int PLAYER_MOUNTING = 227; + public const int PLAYER_EQUIP_DETAIL = 228; + public const int PLAYER_DUEL_START = 229; + + public const int PARIAH_TIME = 230; + public const int GAIN_PET = 231; + public const int FREE_PET = 232; + public const int SUMMON_PET = 233; + public const int RECALL_PET = 234; + + public const int PLAYER_START_PET_OP = 235; + public const int PLAYER_STOP_PET_OP = 236; + public const int PET_RECEIVE_EXP = 237; + public const int PET_LEVELUP = 238; + public const int PET_ROOM = 239; + + public const int PET_ROOM_CAPACITY = 240; + public const int PET_HONOR_POINT = 241; + public const int PET_HUNGER_GAUGE = 242; + public const int HOST_ENTER_BATTLE = 243; + public const int TANK_LEADER_NOTIFY = 244; + + public const int BATTLE_RESULT = 245; + public const int BATTLE_SCORE = 246; + public const int PET_DEAD = 247; + public const int PET_REVIVE = 248; + public const int PET_HP_NOTIFY = 249; + + public const int PET_AI_STATE = 250; + public const int REFINE_RESULT = 251; + public const int PET_SET_COOLDOWN = 252; + public const int PLAYER_CASH = 253; + public const int PLAYER_BIND_SUCCESS = 254; + + public const int CHANGE_IVTR_SIZE = 255; + public const int PVP_MODE = 256; + public const int PLAYER_WALLOW_INFO = 257; + public const int PLAYER_USE_ITEM_WITH_ARG = 258; + public const int OBJECT_USE_ITEM_WITH_ARG = 259; + + public const int PLAYER_CHANGE_SPOUSE = 260; + public const int NOTIFY_SAFE_LOCK = 261; + public const int ELF_VIGOR = 262; + public const int ELF_ENHANCE = 263; + public const int ELF_STAMINA = 264; + + public const int ELF_CMD_RESULT = 265; + public const int COMMON_DATA_NOTIFY = 266; + public const int COMMON_DATA_LIST = 267; + public const int ELF_REFINE_ACTIVATE = 268; + public const int CAST_ELF_SKILL = 269; + + public const int MALL_ITEM_PRICE = 270; + public const int MALL_ITEM_BUY_FAILED = 271; + public const int GOBLIN_LEVEL_UP = 272; + public const int PLAYER_PROPERTY = 273; + public const int PLAYER_CAST_RUNE_SKILL = 274; + + public const int PLAYER_CAST_RUNE_INSTANT_SKILL = 275; + public const int PLAYER_EQUIP_TRASHBOX_ITEM = 276; + public const int SECURITY_PASSWD_CHECKED = 277; + public const int OBJECT_INVISIBLE = 278; + public const int PLAYER_HP_STEAL = 279; + + public const int PLAYER_DIVIDEND = 280; + public const int DIVIDEND_MALL_ITEM_PRICE = 281; + public const int DIVIDEND_MALL_ITEM_BUY_FAILED = 282; + public const int ELF_EXP = 283; + public const int PUBLIC_QUEST_INFO = 284; + + public const int PUBLIC_QUEST_RANKS = 285; + public const int MULTI_EXP_INFO = 286; + public const int CHANGE_MULTI_EXP_STATE = 287; + public const int WORLD_LIFE_TIME = 288; + public const int WEDDING_BOOK_LIST = 289; + + public const int WEDDING_BOOK_SUCCESS = 290; + public const int CALC_NETWORK_DELAY_RE = 291; + public const int PLAYER_KNOCKBACK = 292; + public const int SUMMON_PLANT_PET = 293; + public const int PLANT_PET_DISAPPEAR = 294; + + public const int PLANT_PET_HP_NOTIFY = 295; + public const int PET_PROPERTY = 296; + public const int FACTION_CONTRIB_NOTIFY = 297; + public const int FACTION_FORTRESS_INFO = 298; + public const int ENTER_FACTIONFORTRESS = 299; + + public const int FACTION_RELATION_NOTIFY = 300; + public const int PLAYER_EQUIP_DISABLED = 301; + public const int PLAYER_SPEC_ITEM_LIST = 302; // return value of GM_QUERY_SPEC_ITEM + public const int OBJECT_START_PLAY_ACTION = 303; + public const int OBJECT_STOP_PLAY_ACTION = 304; + + public const int CONGREGATE_REQUEST = 305; + public const int REJECT_CONGREGATE = 306; + public const int CONGREGATE_START = 307; + public const int CANCEL_CONGREGATE = 308; + public const int ENGRAVE_START = 309; + + public const int ENGRAVE_END = 310; + public const int ENGRAVE_RESULT = 311; + public const int DPS_DPH_RANK = 312; + public const int ADDONREGEN_START = 313; + public const int ADDONREGEN_END = 314; + + public const int ADDONREGEN_RESULT = 315; + public const int INVISIBLE_OBJ_LIST = 316; + public const int SET_PLAYER_LIMIT = 317; + public const int PLAYER_TELEPORT = 318; + public const int OBJECT_FORBID_BE_SELECTED = 319; + + public const int PLAYER_INVENTORY_DETAIL = 320; + public const int PLAYER_FORCE_DATA = 321; + public const int PLAYER_FORCE_CHANGED = 322; + public const int PLAYER_FORCE_DATA_UPDATE = 323; + public const int FORCE_GLOBAL_DATA = 324; + + public const int ADD_MULTIOBJECT_EFFECT = 325; + public const int REMOVE_MULTIOBJECT_EFFECT = 326; + public const int ENTER_WEDDING_SCENE = 327; + public const int PRODUCE4_ITEM_INFO = 328; + public const int ONLINE_AWARD_DATA = 329; + + public const int TOGGLE_ONLINE_AWARD = 330; + public const int PLAYER_PROFIT_TIME = 331; + public const int ENTER_NONPENALTY_PVP_STATE = 332; + public const int SELF_COUNTRY_NOTIFY = 333; + public const int PLAYER_COUNTRY_CHANGED = 334; + + public const int ENTER_COUNTRYBATTLE = 335; + public const int COUNTRYBATTLE_RESULT = 336; + public const int COUNTRYBATTLE_SCORE = 337; + public const int COUNTRYBATTLE_RESURRECT_REST_TIMES = 338; + public const int COUNTRYBATTLE_FLAG_CARRIER_NOTIFY = 339; + + public const int COUNTRYBATTLE_BECAME_FLAG_CARRIER = 340; + public const int COUNTRYBATTLE_PERSONAL_SCORE = 341; + public const int COUNTRYBATTLE_FLAG_MSG_NOTIFY = 342; + public const int DEFENSE_RUNE_ENABLED = 343; + public const int COUNTRYBATTLE_INFO = 344; + + public const int SET_PROFIT_TIME = 345; + public const int CASH_MONEY_EXCHG_RATE = 346; + public const int PET_REBUILD_INHERIT_START = 347; + public const int PET_REBUILD_INHERIT_INFO = 348; + public const int PET_REBUILD_INHERIT_END = 349; + + public const int PET_EVOLUTION_DONE = 350; + public const int PET_REBUILD_NATURE_START = 351; + public const int PET_REBUILD_NATURE_INFO = 352; + public const int PET_REBUILD_NATURE_END = 353; + public const int EQUIP_ADDON_UPDATE_NOTIFY = 354; + + public const int SELF_KING_NOTIFY = 355; + public const int PLAYER_KING_CHANGED = 356; + public const int MERIDIANS_NOTIFY = 357; + public const int MERIDIANS_RESULT = 358; + public const int COUNTRYBATTLE_STRONGHOND_STATE_NOTIFY = 359; + + public const int QUERY_TOUCH_POINT = 360; + public const int SPEND_TOUCH_POINT = 361; + public const int TOTAL_RECHARGE = 362; + public const int QUERY_TITLE_RE = 363; + public const int CHANGE_CURR_TITLE_RE = 364; + + public const int MODIFY_TITLE_NOFIFY = 365; + public const int REFRESH_SIGNIN = 366; + public const int PARALLEL_WORLD_INFO = 367; + public const int PLAYER_REINCARNATION = 368; + public const int REINCARNATION_TOME_INFO = 369; + + public const int ACTIVATE_REINCARNATION_TOME = 370; + public const int UNIQUE_DATA_NOTIFY = 371; + public const int USE_GIFTCARD_RESULT = 372; + public const int REALM_EXP = 373; + public const int REALM_LEVEL = 374; + + public const int ENTER_TRICKBATTLE = 375; + public const int TRICKBATTLE_PERSONAL_SCORE = 376; + public const int TRICKBATTLE_CHARIOT_INFO = 377; + public const int PLAYER_LEADERSHIP = 378; + public const int GENERALCARD_COLLECTION_DATA = 379; + + public const int ADD_GENERALCARD_COLLECTION = 380; // Êղؿ¨ÅÆ + public const int REFRESH_MONSTERSPIRIT_LEVEL = 381; // ÃüÂÖ + public const int MINE_GATHERED = 382; // ¿óÎï³É¹¦²É¼¯¹ã²¥ + public const int PLAYER_IN_OUT_BATTLE = 383; // ÆäËûÍæ¼Ò½øÈë/ÍÑÀëÕ½¶·×´Ì¬ + public const int PLAYER_QUERY_CHARIOTS = 384; // Õ½³µÊýÁ¿²éѯ + + public const int COUNTRYBATTLE_LIVE_SHOW_RESULT = 385; // ¹úÕ½Õ½³¡rankºÍËÀÍöÊý¾Ý + public const int RANDOM_MALL_SHOPPING_RES = 386; // Ëæ»úÉ̳Dzéѯ·µ»Ø + public const int FACTION_PVP_MASK_MODIFY = 387; // °ïÅÉPVP״̬¸Ä±ä + public const int PLAYER_WORLD_CONTRIBUTION = 388; // ÊÀ½ç¹±Ï×¶È + public const int RANDOM_MAP_ORDER = 389; // Ëæ»úµØÍ¼ + + public const int SCENE_SERVICE_NPC_LIST = 390; // µ±Ç°³¡¾°ÖÐѧϰ¼¼ÄܵÄNPCÁбí + public const int NPC_VISIBLE_TID_NOTIFY = 391; // ¹ã²¥Í¨ÖªÊÓÒ°ÄÚnpc±ä»»¿ÉÊÓÄ£ÐÍ + public const int CLIENT_SCREEN_EFFECT = 392; // ÆÁÄ»ÌØÐ§ + public const int EQUIP_CAN_INHERIT_ADDONS = 393; // Éú²úÀàÐÍ5¿É¼Ì³ÐµÄ¸½¼ÓÊôÐÔ + public const int COMBO_SKILL_PREPARE = 394; + + public const int INSTANCE_REENTER_NOTIFY = 395; // ¸±±¾ÖØÈë֪ͨ + public const int PRAY_DISTANCE_CHANGE = 396; // Ò÷³ª¾àÀë²ÎÊý + } + + // Constants used in moving control + public struct MOVECONST + { + public float fStepHei; // Maximum step height + public float fMinAirHei; // Minimum distance to terrain (or water) when fly + public float fMinWaterHei; // Minimum distance to terrain when swim + public float fShoreDepth; // Shore depth + public float fWaterSurf; // Water surface depth + + public MOVECONST(float fStepHei, float fMinAirHei, float fMinWaterHei, float fShoreDepth, float fWaterSurf) + { + this.fStepHei = fStepHei; + this.fMinAirHei = fMinAirHei; + this.fMinWaterHei = fMinWaterHei; + this.fShoreDepth = fShoreDepth; + this.fWaterSurf = fWaterSurf; + } + }; + + // Gender + public static class GENDER + { + public const int GENDER_MALE = 0; + public const int GENDER_FEMALE = 1; + public const int NUM_GENDER = 2; + } + + // Profession + public static class PROFESSION + { + public const int PROF_WARRIOR = 0; // 0:ÎäÏÀ + public const int PROF_MAGE = 1; // 1:·¨Ê¦ + public const int PROF_MONK = 2; // 2:Î×ʦ + public const int PROF_HAG = 3; // 3:Ñý¾« + public const int PROF_ORC = 4; // 4:ÑýÊÞ + public const int PROF_GHOST = 5; // 5:´Ì¿Í + public const int PROF_ARCHOR = 6; // 6:Óðâ + public const int PROF_ANGEL = 7; // 7:ÓðÁé + public const int PROF_JIANLING = 8; // 8:½£Áé + public const int PROF_MEILING = 9; // 9:÷ÈÁé + public const int PROF_YEYING = 10; // 10:Ò¹Ó° + public const int PROF_YUEXIAN = 11; // 11:ÔÂÏÉ + public const int NUM_PROFESSION = 12; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_object_move + { + public int id; + public A3DVECTOR3 dest; + public ushort use_time; + public short sSpeed; // Move speed 8.8 fixed-point + public byte move_mode; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_object_stop_move + { + public int id; + public A3DVECTOR3 dest; + public short sSpeed; // Move speed 8.8 fix-point + public byte dir; + public byte move_mode; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct A3DVECTOR3 + { + public float x; + public float y; + public float z; + + // Constructors + public A3DVECTOR3(float m) + { + x = m; y = m; z = m; + } + + public A3DVECTOR3(float x, float y, float z) + { + this.x = x; this.y = y; this.z = z; + } + + public A3DVECTOR3(A3DVECTOR3 v) + { + x = v.x; y = v.y; z = v.z; + } + + // Operators + public static A3DVECTOR3 operator +(A3DVECTOR3 v1, A3DVECTOR3 v2) + => new A3DVECTOR3(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); + + public static A3DVECTOR3 operator -(A3DVECTOR3 v1, A3DVECTOR3 v2) + => new A3DVECTOR3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); + + public static A3DVECTOR3 operator *(A3DVECTOR3 v, float f) + => new A3DVECTOR3(v.x * f, v.y * f, v.z * f); + + public static A3DVECTOR3 operator *(float f, A3DVECTOR3 v) + => v * f; + + public static A3DVECTOR3 operator /(A3DVECTOR3 v, float f) + { + float inv = 1.0f / f; + return new A3DVECTOR3(v.x * inv, v.y * inv, v.z * inv); + } + + public static A3DVECTOR3 operator /(A3DVECTOR3 v1, A3DVECTOR3 v2) + => new A3DVECTOR3(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z); + + public static bool operator ==(A3DVECTOR3 v1, A3DVECTOR3 v2) + => v1.x == v2.x && v1.y == v2.y && v1.z == v2.z; + + public static bool operator !=(A3DVECTOR3 v1, A3DVECTOR3 v2) + => !(v1 == v2); + + public static A3DVECTOR3 operator -(A3DVECTOR3 v) + => new A3DVECTOR3(-v.x, -v.y, -v.z); + + // Dot product + public static float DotProduct(A3DVECTOR3 v1, A3DVECTOR3 v2) + => v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; + + // Cross product + public static A3DVECTOR3 CrossProduct(A3DVECTOR3 v1, A3DVECTOR3 v2) + { + return new A3DVECTOR3( + v1.y * v2.z - v1.z * v2.y, + v1.z * v2.x - v1.x * v2.z, + v1.x * v2.y - v1.y * v2.x + ); + } + + // Magnitudes + public float Magnitude() => (float)Math.Sqrt(x * x + y * y + z * z); + public float MagnitudeH() => (float)Math.Sqrt(x * x + z * z); + public float SquaredMagnitude() => x * x + y * y + z * z; + + // Normalize (in-place) + public float Normalize() + { + float mag = Magnitude(); + if (Math.Abs(mag) < 1e-6f) + { + Clear(); + return 0f; + } + float inv = 1f / mag; + x *= inv; y *= inv; z *= inv; + return mag; + } + + // Get normalized (static) + public static float Normalize(A3DVECTOR3 vIn, out A3DVECTOR3 vOut) + { + float mag = vIn.Magnitude(); + if (Math.Abs(mag) < 1e-6f) + { + vOut = new A3DVECTOR3(0f, 0f, 0f); + return 0f; + } + float inv = 1f / mag; + vOut = vIn * inv; + return mag; + } + + // Lerp + public static A3DVECTOR3 Lerp(A3DVECTOR3 v1, A3DVECTOR3 v2, float t) + => v1 * (1f - t) + v2 * t; + + // Utils + public void Set(float _x, float _y, float _z) { x = _x; y = _y; z = _z; } + public void Clear() { x = y = z = 0f; } + public bool IsZero() => x == 0f && y == 0f && z == 0f; + + public float MinMember() => Math.Min(x, Math.Min(y, z)); + public float MaxMember() => Math.Max(x, Math.Max(y, z)); + + public void Snap() + { + if (x > 1f - 1e-5f) { Clear(); x = 1f; return; } + if (x < -1f + 1e-5f) { Clear(); x = -1f; return; } + if (y > 1f - 1e-5f) { Clear(); y = 1f; return; } + if (y < -1f + 1e-5f) { Clear(); y = -1f; return; } + if (z > 1f - 1e-5f) { Clear(); z = 1f; return; } + if (z < -1f + 1e-5f) { Clear(); z = -1f; return; } + } + + // Override Equals & GetHashCode + public override bool Equals(object obj) + { + if (!(obj is A3DVECTOR3)) return false; + var v = (A3DVECTOR3)obj; + return this == v; + } + + public override int GetHashCode() => (x, y, z).GetHashCode(); + + public override string ToString() => $"({x}, {y}, {z})"; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_self_info_1 + { + public int iExp; + public int iSP; + public int cid; + public A3DVECTOR3 pos; + public ushort crc_e; + public ushort crc_c; + public byte dir; // unsigned char → byte + public byte level2; // unsigned char → byte + public int state; + public int state2; + + //TO DO: Check Valid + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct info_player_1 + { + public int cid; + public A3DVECTOR3 pos; + public ushort crc_e; + public ushort crc_c; + public byte dir; + public byte level2; + public int state; + public int state2; + + //TO DO: Convert to c# + // Hàm CheckValid bên C# sẽ viết lại thủ công (không auto marshal được) + //public bool CheckValid(int bufSize, ref int sz, byte[] buffer, int offset = 0) + //{ + // sz = Marshal.SizeOf(); + + // if (bufSize < sz) + // return false; + + // if ((state & GP_STATE_ADV_MODE) != 0) + // sz += sizeof(int) * 2; + + // if ((state & GP_STATE_SHAPE) != 0) + // sz += sizeof(byte); + + // if ((state & GP_STATE_EMOTE) != 0) + // sz += sizeof(byte); + + // if ((state & GP_STATE_EXTEND_PROPERTY) != 0) + // sz += sizeof(int) * OBJECT_EXT_STATE_COUNT; + + // if ((state & GP_STATE_FACTION) != 0) + // sz += sizeof(int) + sizeof(byte); + + // if ((state & GP_STATE_BOOTH) != 0) + // sz += sizeof(byte); + + // if ((state & GP_STATE_EFFECT) != 0) + // { + // if (bufSize < sz + 1) + // return false; + + // byte count = buffer[offset + sz]; + // sz += sizeof(byte); + // sz += count * sizeof(short); + // } + + // if ((state & GP_STATE_PARIAH) != 0) + // sz += sizeof(byte); + + // if ((state & GP_STATE_IN_MOUNT) != 0) + // sz += sizeof(ushort) + sizeof(int); + + // if ((state & GP_STATE_IN_BIND) != 0) + // sz += sizeof(byte) + sizeof(int); + + // if ((state & GP_STATE_SPOUSE) != 0) + // sz += sizeof(int); + + // if ((state & GP_STATE_EQUIPDISABLED) != 0) + // sz += sizeof(long); + + // if ((state & GP_STATE_PLAYERFORCE) != 0) + // sz += sizeof(int); + + // if ((state & GP_STATE_MULTIOBJ_EFFECT) != 0) + // { + // if (bufSize < sz + sizeof(int)) + // return false; + + // int count = BitConverter.ToInt32(buffer, offset + sz); + // sz += sizeof(int); + // sz += count * (sizeof(int) + sizeof(byte)); + // } + + // if ((state & GP_STATE_COUNTRY) != 0) + // sz += sizeof(int); + + // if ((state2 & GP_STATE2_TITLE) != 0) + // sz += sizeof(ushort); + + // if ((state2 & GP_STATE2_REINCARNATION) != 0) + // sz += sizeof(byte); + + // if ((state2 & GP_STATE2_REALM) != 0) + // sz += sizeof(byte); + + // if ((state2 & GP_STATE2_FACTION_PVP_MASK) != 0) + // sz += sizeof(byte); + + // return bufSize >= sz; + //} + + //public byte GetGender() + //{ + // return (state2 & GP_STATE2_GENDER) != 0 ? GENDER_FEMALE : GENDER_MALE; + //} + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_own_ivtr_info + { + public byte byPackage; + public byte ivtr_size; + public uint content_length; + public byte[] content; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_own_ivtr_detail_info + { + public byte byPackage; + public byte ivtr_size; + public uint content_length; + public byte[] content; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_own_item_info + { + public byte byPackage; + public byte bySlot; + public int type; + public int expire_date; + public int state; + public uint count; + public ushort crc; + public ushort content_length; + public byte[] content; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_unfreeze_ivtr_slot + { + public byte where; + public ushort index; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_equip_item + { + public byte index_inv; + public byte index_equip; + public uint count_inv; + public uint count_equip; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct cmd_move_equip_item + { + public byte index_inv; + public byte index_equip; + public uint amount; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct cmd_player_drop_item + { + public byte byPackage; + public byte bySlot; + public int count; + public int tid; + public byte reason; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_matter_info_list + { + public int count; + public info_matter Info; + } + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_matter_enter_world + { + public info_matter Info; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + struct cmd_pickup_item + { + public int tid; + public int expire_date; + public uint iAmount; + public uint iSlotAmount; + public byte byPackage; + public byte bySlot; + } + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct info_matter + { + public int mid; + public int tid; + public A3DVECTOR3 pos; + public byte dir0; + public byte dir1; + public byte rad; + public byte state; + public byte value; + } + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_player_info_1_list + { + public ushort count; + public byte placeholder; // info_player_1 list + } + public enum ChatChannel + { + //Õâ¸öö¾Ù¶¨ÒåÈç¹û¸Ä¶¯µÄ»°£¬ÒªÍ¨ÖªËùÓÐÈË£¬°üÀ¨·þÎñÆ÷³ÌÐòÔ± + //Èç·Ç±ØÒª£¬¾¡¿ÉÄÜÔÚºóÃæÌí¼Ó£¬±ÜÃâɾ³ýºÍ¸ü¸ÄÇ°ÃæchannelµÄ˳Ðò + GP_CHAT_LOCAL = 0, + GP_CHAT_FARCRY, + GP_CHAT_TEAM, + GP_CHAT_FACTION, + GP_CHAT_WHISPER, + GP_CHAT_DAMAGE, + GP_CHAT_FIGHT, + GP_CHAT_TRADE, + GP_CHAT_SYSTEM, + GP_CHAT_BROADCAST, + GP_CHAT_MISC, + GP_CHAT_INSTANCE, + GP_CHAT_SUPERFARCRY, + GP_CHAT_BATTLE, + GP_CHAT_COUNTRY, + GP_CHAT_MAX, + }; + // Player and NPC state + public static class PlayerNPCState + { + public const int GP_STATE_SHAPE = 0x00000001, + GP_STATE_EMOTE = 0x00000002, + GP_STATE_INVADER = 0x00000004, + GP_STATE_SITDOWN = 0x00000020, + GP_STATE_EXTEND_PROPERTY = 0x00000040, + GP_STATE_CORPSE = 0x00000080, + + // Used only by player + GP_STATE_PARIAH = 0x00000008, + GP_STATE_FLY = 0x00000010, + GP_STATE_TEAM = 0x00000100, + GP_STATE_TEAMLEADER = 0x00000200, + GP_STATE_ADV_MODE = 0x00000400, + GP_STATE_FACTION = 0x00000800, + GP_STATE_BOOTH = 0x00001000, + GP_STATE_FASHION = 0x00002000, + GP_STATE_GMFLAG = 0x00004000, + GP_STATE_PVPFLAG = 0x00008000, + GP_STATE_EFFECT = 0x00010000, + GP_STATE_INPVPCOMBAT = 0x00020000, + GP_STATE_IN_DUEL = 0x00040000, // ÊÇ·ñÕýÔÚ¾ö¶·ÖÐ + GP_STATE_IN_MOUNT = 0x00080000, // ÕýÔÚÆï³ËÖÐ + GP_STATE_IN_BIND = 0x00100000, // ºÍ±ðÈ˰óÔÚÒ»Æð + GP_STATE_BC_INVADER = 0x00200000, // Battle camp: invader + GP_STATE_BC_DEFENDER = 0x00400000, // Battle camp: defender + GP_STATE_SPOUSE = 0x00800000, // Åäżid + GP_STATE_GOBLINREFINE = 0x01000000, // С¾«ÁéÊÇ·ñÒѾ­¼¤»î + GP_STATE_SHIELDUSER = 0x02000000, // ÊÇ·ñÍêÃÀÉñ¶ÜÓû§ + GP_STATE_INVISIBLE = 0x04000000, // ÒþÉí + GP_STATE_EQUIPDISABLED = 0x08000000, // Equipment disabled + GP_STATE_FORBIDBESELECTED = 0x10000000, // ½ûÖ¹±»Ñ¡ÖÐ (NPCÒ²ÓÐЧ) + GP_STATE_PLAYERFORCE = 0x20000000, // ÒѼÓÈëÊÆÁ¦ + GP_STATE_MULTIOBJ_EFFECT = 0x40000000; // ÓëÆäËû¶ÔÏó´æÔÚÌØÊâЧ¹û + public const uint GP_STATE_COUNTRY = 0x80000000; //ÒѼÓÈë¹ú¼Ò + + // Used only by NPC + public const int GP_STATE_NPC_DELAYDEAD = 0x00000008, + GP_STATE_NPC_ADDON1 = 0x00000100, + GP_STATE_NPC_ADDON2 = 0x00000200, + GP_STATE_NPC_ADDON3 = 0x00000400, + GP_STATE_NPC_ADDON4 = 0x00000800, + GP_STATE_NPC_ALLADDON = 0x00000F00, + GP_STATE_NPC_PET = 0x00001000, // Pet flag + GP_STATE_NPC_NAME = 0x00002000, + GP_STATE_NPC_FIXDIR = 0x00004000, // ·½Ïò¹Ì¶¨ + GP_STATE_NPC_MAFIA = 0x00008000, // ËùÊô°ïÅÉ£¨ÓÃÓÚ°ïÅÉPVPÖп󳵵ȣ© + GP_STATE_NPC_FLY = 0x00010000, + GP_STATE_NPC_SWIM = 0x00020000; + }; + + // Player and NPC state2 + public static class PlayerNPCState2 + { + public const int GP_STATE2_ISKING = 0x00000001, // Íæ¼ÒÊÇ·ñ¹úÍõ + GP_STATE2_TITLE = 0x00000002, // ³ÆºÅ + GP_STATE2_REINCARNATION = 0x00000004, // תÉú + GP_STATE2_REALM = 0x00000008, // ¾³½ç + GP_STATE2_IN_BATTLE = 0x00000010, // Õ½¶·×´Ì¬ + GP_STATE2_FACTION_PVP_MASK = 0X00000020, // °ïÅÉ PVP Mask + GP_STATE2_GENDER = 0x00000040; // ÐÔ±ð + } + + [Flags] + // Move mode + public enum MoveMode + + { + MOVE_STAND = 0, + MOVE_MOVE, // Normal move, walk, run, swim or fly + MOVE_JUMP, + MOVE_FREEFALL, + MOVE_SLIDE, + }; + + [Flags] + // Move environment + public enum MoveEnvironment + + { + MOVEENV_GROUND = 0, // Move on ground + MOVEENV_WATER, + MOVEENV_AIR, + }; + + public static class NumberDWORDsPlayerNPC + { + public const int OBJECT_EXT_STATE_COUNT = 6; // Íæ¼Ò/NPC ÉíÉÏ״̬¹âЧ DWORD ¸öÊý = Number of DWORDs for player/NPC status effects + }; + + public static class GPDataTypeHelper + { + public static T FromBytes(byte[] data, int startIndex = 0) where T : struct + { + int size = Marshal.SizeOf(); + if (data.Length - startIndex < size) + throw new ArgumentException("Buffer không đủ dữ liệu"); + + IntPtr ptr = Marshal.AllocHGlobal(size); + try + { + Marshal.Copy(data, startIndex, ptr, size); + return Marshal.PtrToStructure(ptr); + } + finally + { + Marshal.FreeHGlobal(ptr); + } + } + } + +[StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_npc_info_list + { + public ushort count; + public byte placeholder; // chỉ để giữ layout, dữ liệu thực nằm trong buffer + + public static bool CheckValid(ReadOnlySpan buffer, out int sz) + { + sz = 0; + + // cần ít nhất 2 byte cho count + if (buffer.Length < sizeof(ushort)) + return false; + + int sz_org = buffer.Length; + + // đọc count (little-endian) + ushort count = BinaryPrimitives.ReadUInt16LittleEndian(buffer); + + // bỏ qua sizeof(count) = 2 + int offset = sizeof(ushort); + int buf_size = buffer.Length - offset; + + for (int i = 0; i < count; i++) + { + // gọi CheckValid của info_npc trên buffer con + if (!info_npc.CheckValid(buffer.Slice(offset, buf_size), out int npcSize)) + return false; + + offset += npcSize; + buf_size -= npcSize; + } + + sz = sz_org - buf_size; + return true; + } + } + public struct cmd_npc_visible_tid_notify + { + public int nid; + public int vis_tid; + }; + public struct cmd_npc_info_00 + { + public int idNPC; + public int iHP; + public int iMaxHP; + public int iTargetID; + }; + [StructLayout(LayoutKind.Sequential, Pack = 1)] // sizeof = 36 với padding 1 byte sau dir + public struct info_npc + { + public int nid; + public int tid; // template id + public int vis_tid; // + public A3DVECTOR3 pos; + public ushort seed; // seed of customize data + public byte dir; + // (1 byte padding ở đây để int tiếp theo align 4) + public int state; + public int state2; + + // ====== Cờ & hằng số protocol (điền giá trị đúng theo dự án của bạn) ====== + + // Offset và kích thước header theo layout ở trên (Pack=4) + public static readonly int HEADER_SIZE = Marshal.SizeOf(); // sizeof(info_npc) với padding MSVC + public static readonly int STATE_OFFSET = Marshal.OffsetOf(nameof(state)).ToInt32(); // offset của 'state' trong header + + /// + /// Bản chuyển C# tương đương CheckValid: kiểm tra buffer và tính kích thước tổng (sz). + /// buffer phải trỏ đúng từ đầu struct (tức vị trí của 'this' trong C++). + /// + public static bool CheckValid(ReadOnlySpan buffer, out int sz) + { + sz = 0; + + // Cần đủ bytes cho header cố định + if (buffer.Length < HEADER_SIZE) + return false; + + // Đọc state (little-endian) + int state = BinaryPrimitives.ReadInt32LittleEndian(buffer.Slice(STATE_OFFSET, sizeof(int))); + + sz = HEADER_SIZE; + + // If (state & GP_STATE_EXTEND_PROPERTY), OBJECT_EXT_STATE_COUNT DWORD inserted here + if ((state & PlayerNPCState.GP_STATE_EXTEND_PROPERTY) != 0) + { + sz += sizeof(uint) * (int)OBJECT_EXT_STATE.OBJECT_EXT_STATE_COUNT; // DWORD = 4 bytes + } + + // If (state & GP_STATE_NPC_PET), 1 int inserted here + if ((state & PlayerNPCState.GP_STATE_NPC_PET) != 0) + { + sz += sizeof(int); + } + + // If (state & GP_STATE_NPC_NAME), 1 BYTE + name string here + if ((state & PlayerNPCState.GP_STATE_NPC_NAME) != 0) + { + // cần ít nhất 1 byte để đọc độ dài + if (buffer.Length < sz + sizeof(byte)) + return false; + + byte len = buffer[sz]; // độ dài tên + sz += sizeof(byte) + len; // 1 byte length + len bytes nội dung + } + + // If (state & GP_STATE_MULTIOBJ_EFFECT) + if ((state & PlayerNPCState.GP_STATE_MULTIOBJ_EFFECT) != 0) + { + // cần 4 byte để đọc số lượng + if (buffer.Length < sz + sizeof(int)) + return false; + + int count = BinaryPrimitives.ReadInt32LittleEndian(buffer.Slice(sz, sizeof(int))); + sz += sizeof(int); + + if (count < 0) // tránh tràn + return false; + + // mỗi effect: 1 int + 1 "char" 1 byte (trong C++ sizeof(char) = 1) + sz += count * (sizeof(int) + 1); + } + + // If (state & GP_STATE_NPC_MAFIA), 1 int inserted here + if ((state & PlayerNPCState.GP_STATE_NPC_MAFIA) != 0) + { + sz += sizeof(int); + } + + // cuối cùng: buffer có đủ không? + return buffer.Length >= sz; + } + } + public enum OBJECT_EXT_STATE + { + OBJECT_EXT_STATE_COUNT = 6, // Íæ¼Ò/NPC ÉíÉÏ״̬¹âЧ DWORD ¸öÊý + }; +} + diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs.meta new file mode 100644 index 0000000000..e8701c0b25 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 04ef696be8b0447a8b5528a2e5ea8bce \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs new file mode 100644 index 0000000000..ed9c2a4e25 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs @@ -0,0 +1,731 @@ +using System.Text; +using System; +using CSNetwork.Protocols; +using CSNetwork.Protocols.RPCData; +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using CommandID = CSNetwork.GPDataType.CommandID; +using System.IO; +using System.Diagnostics; +using System.Numerics; +using CSNetwork.C2SCommand; +using CSNetwork.GPDataType; + +namespace CSNetwork +{ + public class GameSession : IDisposable + { + private static IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(GameSession)); // Get class-specific logger + + private NetworkManager _networkManager; + private string _host; + private int _port; + private string _username; + private string _password; + private int _currentUserId = -1; // To store the UserID after successful login + private int m_iCharID; + + // State management for async operations and callbacks + private Action _loginCallback; + private Action> _roleListCallback; + private List _accumulatedRoles; + private Action _selectRoleCallback; + private RoleInfo _selectedRole; + public bool IsConnected => _networkManager?.IsConnected ?? false; + + public GameSession() + { + _networkManager = new NetworkManager(); + _networkManager.ProtocolReceived += OnProtocolReceived; + _networkManager.ErrorOccurred += OnErrorOccurred; + _networkManager.Disconnected += OnDisconnected; + } + + public void SetLogPath(string path) + { + LoggerFactory.SetFileLoggerImplementation(new FileLogger()); + _logger = LoggerFactory.GetCustomLogger(path, nameof(GameSession) + GetHashCode(), LoggerType.File); + _networkManager.SetLogPath(path); + } + /// + /// Connects to the game server asynchronously. + /// + /// Server hostname or IP address. + /// Server port. + /// Task representing the asynchronous connect operation. Check IsConnected property or handle Disconnected event for status. + public async Task ConnectAsync(string host, int port) + { + if (IsConnected) + { + _logger.Log(LogType.Warning, "ConnectAsync called but already connected."); + return; + } + _host = host; + _port = port; + _logger.Log(LogType.Info, $"Attempting to connect to {_host}:{_port}..."); + try + { + await _networkManager.ConnectAsync(_host, _port); + if (IsConnected) + { + _logger.Log(LogType.Info, "Connection established."); + } + else + { + _logger.Log(LogType.Warning, "Connection failed after ConnectAsync completed (check NetworkManager logs/events)."); + } + } + catch (Exception ex) + { + _logger.Log(LogType.Error, $"Connection exception: {ex.Message}"); + _logger.LogException(ex); + OnDisconnected(); + } + } + + + public void Disconnect() + { + _networkManager.Disconnect(); + } + + /// + /// Initiates the login process asynchronously. + /// + /// Account username. + /// Account password. + /// Action invoked with true on successful login (OnlineAnnounce received), false otherwise. + public void LoginAsync(string username, string password, Action callback) + { + if (!IsConnected) + { + _logger.Log(LogType.Warning, "LoginAsync called but not connected."); + callback?.Invoke(false); + return; + } + if (_loginCallback != null) + { + _logger.Log(LogType.Warning, "LoginAsync called while another login is already in progress."); + callback?.Invoke(false); + return; + } + + _username = username; + _password = password; + _loginCallback = callback; + _currentUserId = -1; // Reset user ID + + _logger.Log(LogType.Info, $"Initiating login for user '{_username}'..."); + } + + /// + /// Initiates fetching the role list asynchronously. Requires successful login. + /// + /// Action invoked with the complete list of roles, or null/empty list on failure. + public void GetRoleListAsync(Action> callback) + { + if (!IsConnected) + { + _logger.Log(LogType.Warning, "GetRoleListAsync called but not connected."); + callback?.Invoke(null); + return; + } + if (_currentUserId == -1) + { + _logger.Log(LogType.Warning, "GetRoleListAsync called but not logged in."); + callback?.Invoke(null); + return; + } + if (_roleListCallback != null) + { + _logger.Log(LogType.Warning, "GetRoleListAsync called while another role list retrieval is already in progress."); + callback?.Invoke(null); + return; + } + + _roleListCallback = callback; + _accumulatedRoles = new List(); + _logger.Log(LogType.Info, "Requesting role list..."); + RequestRoleListInternal(); + } + + public void SelectRoleAsync(RoleInfo role, Action callback) + { + _selectedRole = role; + _selectRoleCallback = callback; + SetCharacterID(role.roleid); + SendProtocol(new selectrole() + { + Roleid = role.roleid, + Flag = 0 + }); + + } + public void EnterWorldAsync(RoleInfo role, Action callback) + { + SendProtocol(new enterworld() + { + Roleid = _selectedRole.roleid, + Provider_link_id = 0, + }, callback); + } + public void RequestDropIvtrItem(byte index, int amount) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.CreateDropIvtrItem(index, amount); + SendProtocol(gamedatasendRequest); + } + public void RequestDropEquipItem(byte index) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.CreateDropEquipItem(index); + SendProtocol(gamedatasendRequest); + } + + public void RequestPickupItem(int idItem, int tid) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.CreatePickupItem(idItem, tid); + SendProtocol(gamedatasendRequest); + } + public void RequestInventoryAsync(byte byPackage, Action callback) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = CSNetwork.C2SCommand.C2SCommandFactory.CreateGetInventoryDetail(byPackage); + SendProtocol(gamedatasendRequest, callback); + } + + public void RequestCheckSecurityPassWd(string password) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.CreateCheckSecurityPassWd(password); + SendProtocol(gamedatasendRequest); + } + + public void RequestEquipItem(byte iIvtrIdx, byte iEquipIdx, Action callback) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = CSNetwork.C2SCommand.C2SCommandFactory.CreateEquipItem(iIvtrIdx, iEquipIdx); + SendProtocol(gamedatasendRequest, callback); + } + public void RequestOwnItemInfoAsync( + byte byPackage, + byte bySlot, + int type, + int expire_date, + int state, + uint count, + ushort crc, + ushort content_length, + byte[] content, + Action callback) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.CreateOwnItemInfo(byPackage, bySlot, type, expire_date, state, count, crc, content_length, content); + SendProtocol(gamedatasendRequest, callback); + } + + // --- Protocol Sending --- + public void SendProtocol(Protocol protocol, Action complete = null) + { + if (IsConnected) + { + _logger.Log(LogType.Debug, $"Sending protocol: {protocol.GetType().Name} (Detail: {protocol.ToString})"); + _networkManager.Send(protocol); + complete?.Invoke(); + } + else + { + _logger.Log(LogType.Warning, $"Cannot send protocol ({protocol.GetType().Name}), not connected."); + } + } + + // --- Event Handlers (from NetworkManager) --- + + private void OnProtocolReceived(Protocol protocol) + { + + _logger.Log(LogType.Debug, $"Received protocol: {protocol.GetType().Name} (Type: {protocol.Type})"); + if (protocol is null) + return; + + + + // Route protocol to appropriate handler + switch (protocol.GetPType()) + { + case ProtocolType.PROTOCOL_CHALLENGE: + HandleChallenge((challenge)protocol); + break; + case ProtocolType.PROTOCOL_KEYEXCHANGE: + HandleKeyExchange((KeyExchange)protocol); + break; + case ProtocolType.PROTOCOL_ONLINEANNOUNCE: + HandleOnlineAnnounce((onlineannounce)protocol); + break; + case ProtocolType.PROTOCOL_ROLELIST_RE: + HandleRoleListResponse((RoleListResponse)protocol); + break; + // Add cases for other protocols GameSession might need to handle + case ProtocolType.PROTOCOL_SELECTROLE_RE: + HandleSelectRoleResponse((SelectRole_Re)protocol); + //_networkManager.IgnoreBytes = 2; + break; + case ProtocolType.PROTOCOL_S2CGAMEDATASEND: + case ProtocolType.PROTOCOL_GAMEDATASEND: + HandleServerDataSend((gamedatasend)protocol); + break; + case ProtocolType.PROTOCOL_CHATMESSAGE: + _logger.Log(LogType.Warning, $"HoangDev :ProtocolType.PROTOCOL_CHATMESSAGE {protocol.GetPType()}"); + OnPrtcChatMessage(protocol, false); + break; + default: + _logger.Log(LogType.Warning, $"Received unhandled protocol type: {protocol.GetPType()}"); + break; + } + } + + private void HandleServerDataSend(gamedatasend protocol) + { + _logger.Info($"### GameDataSend: {protocol.Data.ByteArray[0]}"); + int lenghtHeader = Marshal.SizeOf(); + var pDataBuf = new byte[protocol.Data.ByteArray.Length - lenghtHeader]; + var byteArrHeader = new byte[lenghtHeader]; + long dwDataSize = protocol.Data.Size; + + if (dwDataSize < Marshal.SizeOf()) + { + _logger.Error($"### GameDataSend: size invalid {dwDataSize}"); + return; + } + + dwDataSize -= Marshal.SizeOf(); // subtract the header size (ushort) + for (int i = 0; i < protocol.Data.ByteArray.Length; i++) + { + if (i < lenghtHeader) + { + byteArrHeader[i] = protocol.Data.ByteArray[i]; + } + else + { + pDataBuf[i - lenghtHeader] = protocol.Data.ByteArray[i]; + } + } + var pCmdHeader = BitConverter.ToUInt16(byteArrHeader); + + _logger.Info($"### GameDataSend: CMDID {pCmdHeader}"); + int iHostID = _selectedRole.roleid; + switch (pCmdHeader) + { + case CommandID.PLAYER_INFO_2: + case CommandID.PLAYER_INFO_3: + case CommandID.PLAYER_INFO_4: + case CommandID.PLAYER_INFO_2_LIST: + case CommandID.PLAYER_INFO_3_LIST: + case CommandID.PLAYER_INFO_23_LIST: + + break; + + case CommandID.PLAYER_INFO_1: + case CommandID.PLAYER_ENTER_WORLD: + case CommandID.PLAYER_ENTER_SLICE: + case CommandID.PLAYER_INFO_1_LIST: + case CommandID.PLAYER_INFO_00: + case CommandID.SELF_INFO_1: + // OnMsgPlayerInfo(-1, pDataBuf, pCmdHeader); + _logger.Info($"HoangDev : EC_MsgDef.MSG_PM_PLAYERINFO"); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERINFO, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader, iHostID, _selectedRole); + break; + case CommandID.OBJECT_MOVE: + int lenghtDataType = Marshal.SizeOf(); + byte[] arrByteData = GetBytes(pDataBuf, lenghtDataType, 0); + int idObjMove = BitConverter.ToInt32(arrByteData); + if (IsPlayerId(idObjMove)) + { + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERMOVE, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader, iHostID); + } + else if (ISNPCID(idObjMove)) + { + _logger.Info("HoangDev : NPC OBJECT_MOVE"); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCMOVE, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); + } + break; + case CommandID.OBJECT_STOP_MOVE: + { + int id = GPDataTypeHelper.FromBytes(pDataBuf); + if (IsPlayerId(id)) + { + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERSTOPMOVE, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + } + else if (ISNPCID(id)) + { + _logger.Info("HoangDev : NPC OBJECT_MOVE"); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCSTOPMOVE, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); + } + break; + } + case CommandID.OWN_IVTR_DATA: + case CommandID.OWN_IVTR_DETAIL_DATA: + case CommandID.GET_OWN_MONEY: + case CommandID.CHANGE_IVTR_SIZE: + _logger.Info($"HUNG INVENTORY2"); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_IVTRINFO, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, iHostID); + break; + case CommandID.EXG_IVTR_ITEM: + case CommandID.MOVE_IVTR_ITEM: + case CommandID.PLAYER_DROP_ITEM: + case CommandID.EXG_EQUIP_ITEM: + case CommandID.EQUIP_ITEM: + case CommandID.MOVE_EQUIP_ITEM: + case CommandID.UNFREEZE_IVTR_SLOT: + case CommandID.PLAYER_EQUIP_TRASHBOX_ITEM: + _logger.Info($"HUNG EQUIP ITEM: " + pCmdHeader); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ITEMOPERATION, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.MATTER_INFO_LIST: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_MM_MATTERINFO, (int)MANAGER_INDEX.MAN_MATTER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.MATTER_ENTER_WORLD: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_MM_MATTERENTWORLD, (int)MANAGER_INDEX.MAN_MATTER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.PICKUP_ITEM: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_PICKUPITEM, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.HOST_CORRECT_POS: + _logger.Info($"HoangDev HOST_CORRECT_POSHOST_CORRECT_POSHOST_CORRECT_POS"); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_CORRECTPOS, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, iHostID); + break; + case CommandID.OWN_ITEM_INFO: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_OWNITEMINFO, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, iHostID); + break; + case CommandID.NPC_ENTER_SLICE: + case CommandID.NPC_INFO_LIST: + case CommandID.NPC_INFO_00: + case CommandID.NPC_ENTER_WORLD: + case CommandID.NPC_VISIBLE_TID_NOTIFY: + _logger.Info($"HoangDev :NPC_VISIBLE_TID_NOTIFY"); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCINFO, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader, dwDataSize); + break; + case CommandID.TASK_DATA: + case CommandID.TASK_VAR_DATA: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_TASKDATA, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); + break; + case CommandID.ERROR_MESSAGE: + _logger.Info($"### GameDataSend: ERROR_MESSAGE: {BitConverter.ToInt32(pDataBuf, 0)}"); + break; + } + } + + public void OnMsgPlayerInfo(int iSubID, byte[] data, ushort pCmdHeader) + { + if (iSubID == 0) + { + + } + else if (iSubID < 0) + { + int iHostID = _selectedRole.roleid; + int lenghtByte = Marshal.SizeOf(); + byte[] byteArray = new byte[lenghtByte]; + for (int i = 0; i < lenghtByte; i++) + { + byteArray[i] = data[i]; + } + int cid = BitConverter.ToInt32(byteArray); + switch (pCmdHeader) + { + case CommandID.PLAYER_INFO_1: + case CommandID.PLAYER_ENTER_WORLD: + case CommandID.PLAYER_ENTER_SLICE: + { + if (cid != iHostID) + { + _logger.Info("### OnMsgPlayerInfo: ElsePlayer join"); + } + break; + } + } + } + else + { + + } + } + + private void HandleSelectRoleResponse(SelectRole_Re protocol) + { + _logger.Info($"Select role response {protocol.result}"); + _selectRoleCallback?.Invoke(_selectedRole); + } + + private void OnErrorOccurred(string errorMessage) + { + _logger.Log(LogType.Error, $"Network Error: {errorMessage}"); + FailLoginInProgress(errorMessage); + FailRoleListInProgress(errorMessage); + } + + private void OnDisconnected() + { + _logger.Log(LogType.Info, "Disconnected from server."); + _currentUserId = -1; + FailLoginInProgress("Disconnected"); + FailRoleListInProgress("Disconnected"); + } + + // --- Protocol Handling Logic --- + + private void HandleChallenge(challenge challenge) + { + if (_loginCallback == null || string.IsNullOrEmpty(_username)) + { + _logger.Log(LogType.Warning, "Received Challenge but not expecting it or username not set."); + return; + } + + _logger.Log(LogType.Info, "Handling Challenge..."); + + response response = new response(); + byte[] usernameBytes = Encoding.ASCII.GetBytes(_username); + byte[] passwordBytes = Encoding.ASCII.GetBytes(_password); + response.identity.Replace(usernameBytes); + response.Setup(new Octets(usernameBytes), new Octets(passwordBytes), challenge.nonce); + + uint clientId = 0xffffffff; + byte[] clientIdBytes = BitConverter.GetBytes(clientId); + response.cli_fingerprint.Replace(clientIdBytes); + response.use_token = 0; + + _networkManager.SetNonce(response.response_data); + SendProtocol(response); + _logger.Log(LogType.Info, "Sent Response."); + } + + private void HandleKeyExchange(KeyExchange keyExchange) + { + if (_loginCallback == null || string.IsNullOrEmpty(_username)) + { + _logger.Log(LogType.Warning, "Received KeyExchange but not expecting it."); + return; + } + + _logger.Log(LogType.Info, "Handling KeyExchange..."); + keyExchange.Setup(_networkManager, _username); + keyExchange.Blkickuser = 1; + SendProtocol(keyExchange); + _logger.Log(LogType.Info, "Sent KeyExchange acknowledgment/response."); + } + + private void HandleOnlineAnnounce(onlineannounce announce) + { + if (_loginCallback == null) + { + _logger.Log(LogType.Warning, "Received OnlineAnnounce but not expecting it."); + return; + } + + _logger.Log(LogType.Info, $"Login successful! UserID: {announce.Userid}, LocalSID: {announce.Localsid}"); + _currentUserId = announce.Userid; + + var callback = _loginCallback; + _loginCallback = null; + callback?.Invoke(true); + } + + private void RequestRoleListInternal(int lastHandle = -1) + { + rolelist rolelistRequest = new rolelist(); + rolelistRequest.Userid = _currentUserId; + rolelistRequest.Localsid = 0; + rolelistRequest.Handle = lastHandle; + + SendProtocol(rolelistRequest); + + + //gamedatasend gamedatasendRequest = new gamedatasend(); + //gamedatasendRequest.Data = C2SCommandFactory.CreatePlayerMove(); + + //SendProtocol(gamedatasendRequest); + } + + private void HandleRoleListResponse(RoleListResponse response) + { + if (_roleListCallback == null || _accumulatedRoles == null) + { + _logger.Log(LogType.Warning, "Received RoleListResponse but not expecting it."); + return; + } + + _logger.Log(LogType.Debug, $"Received RoleListResponse. Handle: {response.handle}, Result: {response.result}, Count: {response.rolelist.Count}"); + + if (response.result == 0) + { + _accumulatedRoles.AddRange(response.rolelist); + + foreach (var role in response.rolelist) + { + try + { + string roleName = Encoding.UTF8.GetString(role.name.ByteArray, 0, role.name.Length); + _logger.Log(LogType.Info, $" - Role ID: {role.roleid}, Name: {roleName}, Level: {role.level}"); + } + catch (Exception ex) + { + _logger.Log(LogType.Error, $" - Error decoding role name: {ex.Message}"); + _logger.LogException(ex); + } + } + + if (response.handle != -1) + { + _logger.Log(LogType.Debug, $"Requesting next batch of roles (handle: {response.handle})..."); + RequestRoleListInternal(response.handle); + } + else + { + _logger.Log(LogType.Info, $"Finished fetching roles. Total count: {_accumulatedRoles.Count}"); + var callback = _roleListCallback; + var result = _accumulatedRoles; + _roleListCallback = null; + _accumulatedRoles = null; + callback?.Invoke(result); + } + } + else + { + _logger.Log(LogType.Error, $"Role list retrieval failed. Result code: {response.result}"); + FailRoleListInProgress($"Role list retrieval failed (Result: {response.result})"); + } + } + + // --- Helper methods for failure handling --- + private void FailLoginInProgress(string reason) + { + if (_loginCallback != null) + { + _logger.Log(LogType.Error, $"Login failed: {reason}"); + var callback = _loginCallback; + _loginCallback = null; + callback?.Invoke(false); + } + } + + private void FailRoleListInProgress(string reason) + { + if (_roleListCallback != null) + { + _logger.Log(LogType.Error, $"Role list retrieval failed: {reason}"); + var callback = _roleListCallback; + _roleListCallback = null; + _accumulatedRoles = null; + callback?.Invoke(null); + } + } + + // --- IDisposable Implementation --- + private bool disposedValue = false; + + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + if (_networkManager != null) + { + _logger.Log(LogType.Info, "[DUCK] Disposing GameSession and disconnecting..."); + _networkManager.ProtocolReceived -= OnProtocolReceived; + _networkManager.ErrorOccurred -= OnErrorOccurred; + _networkManager.Disconnected -= OnDisconnected; + _networkManager.Disconnect(); + _networkManager.Dispose(); + _networkManager = null; + } + _loginCallback = null; + _roleListCallback = null; + _accumulatedRoles = null; + } + disposedValue = true; + } + } + + public void Dispose() + { + Dispose(true); + // GC.SuppressFinalize(this); + } + + public bool IsPlayerId(int id) + { + return id != 0 && (id & 0x80000000) == 0; + } + public bool ISNPCID(int id) => ((id & unchecked((int)0x80000000)) != 0) + && ((id & 0x40000000) == 0); + private byte[] GetBytes(byte[] bytes, int length, int index) + { + byte[] arrByteData = new byte[length]; + for (int i = 0; i < length; i++) + { + arrByteData[i] = bytes[i + index]; + } + return arrByteData; + } + public void c2s_CmdPlayerMove(in Vector3 vCurPos, in Vector3 vDest, + int iTime, float fSpeed, int iMoveMode, ushort wStamp) + { + gamedatasend gamedatasend = new gamedatasend(); + + gamedatasend.Data = C2SCommandFactory.CreatePlayerMove(vCurPos, vDest, (ushort)iTime, fSpeed, (byte)iMoveMode, wStamp); + SendProtocol(gamedatasend); + } + public void c2s_SendCmdStopMove(in Vector3 vDest, float fSpeed, int iMoveMode, + byte byDir, ushort wStamp, int iTime) + { + + gamedatasend gamedatasend = new gamedatasend(); + + gamedatasend.Data = C2SCommandFactory.CreatePlayerStop(vDest, fSpeed, (byte)iMoveMode, byDir, wStamp, (ushort)iTime); + SendProtocol(gamedatasend); + } + public void SendChatData(byte cChannel, in string szMsg, int iPack, int iSlot) + { + publicchat publicChat = new publicchat(); + publicChat.Channel = cChannel; + publicChat.Roleid = m_iCharID; + + byte[] unicodeBytes = Encoding.Unicode.GetBytes(szMsg); + publicChat.Msg.Replace(unicodeBytes); + _logger.Log(LogType.Warning, $"HoangDev : publicChat {publicChat}"); + SendProtocol(publicChat); + } + private void SetCharacterID(int iCharID) { m_iCharID = iCharID; } + private void OnPrtcChatMessage(Protocol pProtocol, bool bCalledagain) + { + chatmessage p = (chatmessage)pProtocol; + + string strTemp = System.Text.Encoding.Unicode.GetString(p.Msg.ToArray(), 0, p.Msg.Length); + + _logger.Log(LogType.Warning, $"HoangDev : OnPrtcChatMessage :{strTemp}"); + EventBus.Publish(new ChatMessageEvent(strTemp)); + } + + public struct ChatMessageEvent + { + public string context; + public ChatMessageEvent(string context) { this.context = context; } + } + + public void c2s_SendCmdGetAllData(bool byPack, bool byEquip, bool byTask) + { + gamedatasend gamedatasend = new gamedatasend(); + + gamedatasend.Data = C2SCommandFactory.CreateGetAllDataCommand(byPack, byEquip, byTask); + _logger.Log(LogType.Warning, $"[Dat]- SendCmdGetAllData {byPack},{byEquip},{byTask}"); + SendProtocol(gamedatasend); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs.meta new file mode 100644 index 0000000000..b2fe59db95 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6d80345ab31fd4c76ba29e624f33e6ef \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Helper.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Helper.cs new file mode 100644 index 0000000000..35f697c948 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Helper.cs @@ -0,0 +1,36 @@ +using System; + +namespace CSNetwork +{ + public static class Helper + { + public static byte[] HexStringToByteArray(string hex) + { + if (hex.Length % 2 == 1) + throw new ArgumentException("Hex string must have an even number of digits."); + + int numberChars = hex.Length; + byte[] bytes = new byte[numberChars / 2]; + for (int i = 0; i < numberChars; i += 2) + { + try + { + bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); + } + catch (FormatException ex) + { + throw new ArgumentException( + $"Invalid hex character found at position {i}: '{hex.Substring(i, 2)}'", + ex + ); + } + } + return bytes; + } + + public static string ByteToHexString(byte[] bytes) + { + return BitConverter.ToString(bytes).Replace("-", ""); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Helper.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Helper.cs.meta new file mode 100644 index 0000000000..d8585ae77d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Helper.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fe3c985875ea4448d95225eb0b8273d2 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger.meta new file mode 100644 index 0000000000..0db48dd8fd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9e33a53771af04f8aa7e6cb86760300b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ConsoleLogger.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ConsoleLogger.cs new file mode 100644 index 0000000000..7524c1c5d2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ConsoleLogger.cs @@ -0,0 +1,27 @@ +using System; + +namespace CSNetwork +{ + public class ConsoleLogger : ILogger + { + public void Log(LogType logType, string prefix, string message) + { + // Check if the message's log level is sufficient + // if (logType >= Manager.MinLogLevel) <-- REMOVED: Filtering done by LoggerFactory/PrefixedLogger + // { + // Format: [LogType] [Prefix] Message + Console.WriteLine($"[{logType}] [{prefix}] {message}"); + // } + } + + public void LogException(string prefix, Exception exception) + { + // Exceptions are logged if Exception level is enabled + // if (LogType.Exception >= Manager.MinLogLevel) <-- REMOVED: Filtering done by LoggerFactory/PrefixedLogger + // { + // Format: [Exception] [Prefix] Exception Details + Console.WriteLine($"[Exception] [{prefix}] {exception}"); // Includes message and stack trace + // } + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ConsoleLogger.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ConsoleLogger.cs.meta new file mode 100644 index 0000000000..ed5fa29e44 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ConsoleLogger.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 10ea71599c91f4898b0222a59215d56c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/FileLogger.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/FileLogger.cs new file mode 100644 index 0000000000..f5cf1717d2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/FileLogger.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace CSNetwork +{ + public class FileLogger : ILogger + { + private string _filePath; + private readonly object _lockObject = new object(); + + public void SetFilePath(string filePath) + { + // Prevent changing the file path if it's already set + if (!string.IsNullOrEmpty(_filePath)) return; + + _filePath = filePath; + // Ensure directory exists + Directory.CreateDirectory(Path.GetDirectoryName(filePath)); + // Create or clear the file + File.WriteAllText(filePath, string.Empty); + } + + public void Log(LogType logType, string prefix, string message) + { + var logMessage = $"[{logType}] [{prefix}] {message}{Environment.NewLine}"; + lock (_lockObject) + { + File.AppendAllText(_filePath, logMessage); + } + } + + public void LogException(string prefix, Exception exception) + { + var logMessage = $"[Exception] [{prefix}] {exception}{Environment.NewLine}"; + lock (_lockObject) + { + File.AppendAllText(_filePath, logMessage); + } + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/FileLogger.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/FileLogger.cs.meta new file mode 100644 index 0000000000..5df0b983fa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/FileLogger.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1d5039dcc202e4a4eb8646cf667a1c38 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ILogger.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ILogger.cs new file mode 100644 index 0000000000..a3803dd9fe --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ILogger.cs @@ -0,0 +1,19 @@ +using System; + +namespace CSNetwork +{ + public enum LogType + { + Debug, + Info, + Warning, + Error, + Exception + } + + public interface ILogger + { + void Log(LogType logType, string prefix, string message); + void LogException(string prefix, Exception exception); + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ILogger.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ILogger.cs.meta new file mode 100644 index 0000000000..0dd799fdb0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/ILogger.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f2d723cc0854d43db98999c0b7009a86 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/IPrefixedLogger.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/IPrefixedLogger.cs new file mode 100644 index 0000000000..44e5c5045c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/IPrefixedLogger.cs @@ -0,0 +1,23 @@ +using System; + +namespace CSNetwork +{ + /// + /// Interface for a logger instance that has a pre-defined prefix. + /// + public interface IPrefixedLogger + { + /// + /// Logs a message with the specified log level. + /// + /// The severity level of the message. + /// The message to log. + void Log(LogType logType, string message); + + /// + /// Logs an exception. + /// + /// The exception to log. + void LogException(Exception exception); + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/IPrefixedLogger.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/IPrefixedLogger.cs.meta new file mode 100644 index 0000000000..3c829a6c39 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/IPrefixedLogger.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f4f4ff53571f144918c70a7b6001d91b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerExtensions.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerExtensions.cs new file mode 100644 index 0000000000..2f8a25ad94 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerExtensions.cs @@ -0,0 +1,66 @@ +using System; + +namespace CSNetwork +{ + /// + /// Provides extension methods for the IPrefixedLogger interface. + /// + public static class LoggerExtensions + { + /// + /// Logs a message with the Debug level. + /// + public static void Debug(this IPrefixedLogger logger, string message) + { + logger.Log(LogType.Debug, message); + } + + /// + /// Logs a message with the Info level. + /// + public static void Info(this IPrefixedLogger logger, string message) + { + logger.Log(LogType.Info, message); + } + + /// + /// Logs a message with the Warning level. + /// + public static void Warning(this IPrefixedLogger logger, string message) + { + logger.Log(LogType.Warning, message); + } + + /// + /// Logs a message with the Error level. + /// + public static void Error(this IPrefixedLogger logger, string message) + { + logger.Log(LogType.Error, message); + } + + /// + /// Logs an exception with the Exception level. + /// + public static void Exception(this IPrefixedLogger logger, Exception exception, string message = null) + { + if (!string.IsNullOrEmpty(message)) + { + logger.Log(LogType.Exception, $"{message}\n{exception}"); // Log message first, then exception + } + else + { + logger.LogException(exception); + } + } + + /// + /// Logs only an exception message with the Exception level. + /// Use this if you only want the message and not the full stack trace from LogException. + /// + public static void ExceptionMsg(this IPrefixedLogger logger, string message) + { + logger.Log(LogType.Exception, message); + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerExtensions.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerExtensions.cs.meta new file mode 100644 index 0000000000..a94d30aaa1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerExtensions.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2bbc23303790c431c96db75dd92567d9 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerFactory.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerFactory.cs new file mode 100644 index 0000000000..8282f71340 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerFactory.cs @@ -0,0 +1,118 @@ +using System; + +namespace CSNetwork +{ + public enum LoggerType + { + Console, + File + } + /// + /// Provides instances of loggers and manages the global logging configuration. + /// + public static class LoggerFactory + { + private static ILogger _actualLogger = new ConsoleLogger(); // Default implementation + private static ILogger _fileLogger = new FileLogger(); // Default file logger + private static LogType _minLogLevel = LogType.Debug; // Default level + + /// + /// Sets the underlying logger implementation used by the factory. + /// + /// The logger implementation to use. + public static void SetLoggerImplementation(ILogger loggerImplementation) + { + _actualLogger = loggerImplementation ?? throw new ArgumentNullException(nameof(loggerImplementation)); + } + + public static void SetFileLoggerImplementation(ILogger loggerImplementation) + { + _fileLogger = loggerImplementation ?? throw new ArgumentNullException(nameof(loggerImplementation)); + } + + /// + /// Sets the minimum log level. Messages below this level will be ignored. + /// + /// The minimum log level. + public static void SetMinLogLevel(LogType level) + { + _minLogLevel = level; + } + + /// + /// Gets a logger instance associated with the specified prefix (typically a class name). + /// + /// The prefix for the logger instance. + /// An IPrefixedLogger instance. + public static IPrefixedLogger GetLogger(string prefix) + { + return new PrefixedLogger(prefix ?? string.Empty); + } + + /// + /// Get a custom logger instance based on configuration and type.
+ /// If it's a File logger, the config is the file path (absolute). + ///
+ public static IPrefixedLogger GetCustomLogger(string config, string prefix, LoggerType loggerType = LoggerType.File) + { + switch (loggerType) + { + case LoggerType.File: + if (!string.IsNullOrEmpty(config)) + { + return new CustomFileLogger(config, prefix); + } + return null; + default: + return null; + } + } + + // Internal implementation of IPrefixedLogger + private class PrefixedLogger : IPrefixedLogger + { + private readonly string _prefix; + + internal PrefixedLogger(string prefix) + { + _prefix = prefix; + } + + public void Log(LogType logType, string message) + { + if (logType >= _minLogLevel) // Check level before calling underlying logger + { + _actualLogger.Log(logType, _prefix, message); + } + } + + public void LogException(Exception exception) + { + if (LogType.Exception >= _minLogLevel) // Exception level check + { + _actualLogger.LogException(_prefix, exception); + } + } + } + + private class CustomFileLogger : IPrefixedLogger + { + private readonly string _prefix; + public CustomFileLogger(string filePath, string prefix) + { + (_fileLogger as FileLogger)?.SetFilePath(filePath); + _prefix = prefix; + } + + public void Log(LogType logType, string message) + { + if (logType >= _minLogLevel) _fileLogger.Log(logType, _prefix, message); + } + + public void LogException(Exception exception) + { + if (LogType.Exception >= _minLogLevel) _fileLogger.LogException(_prefix, exception); + } + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerFactory.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerFactory.cs.meta new file mode 100644 index 0000000000..e5f00d4c05 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Logger/LoggerFactory.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bb54781bdcaec4df8b30ab87b7b2acbd \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Manager.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Manager.cs new file mode 100644 index 0000000000..0bd02f1a5d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Manager.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +using CSNetwork.Protocols; + +namespace CSNetwork +{ + public abstract class Manager + { + public abstract void OnAddSession(uint sid); + public abstract void OnDelSession(uint sid); + + public virtual void OnAbortSession(uint sid) { } + + public virtual void OnRecvProtocol(uint sid, Protocol protocol) { } + + public abstract bool Close(uint sid); + public abstract string GetLastError(); + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Manager.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Manager.cs.meta new file mode 100644 index 0000000000..607507feb5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Manager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b3e193f7e08334f13a657a45993aa508 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/NetworkManager.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/NetworkManager.cs new file mode 100644 index 0000000000..459516adf6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/NetworkManager.cs @@ -0,0 +1,540 @@ +using System.Collections.Concurrent; +using System.Net.Sockets; +using CSNetwork.Security; // Use the Security namespace +using CSNetwork.Protocols; +using System.Threading; +using System.Threading.Tasks; +using System; +using System.IO; + +namespace CSNetwork +{ + public class NetworkManager + { + private TcpClient? _client; + private NetworkStream? _stream; + private readonly Octets _receiveOctets; // Underlying buffer for receiving + private readonly OctetsStream _receiveBufferStream; // Stream wrapper (less used now) + private BaseSecurity? _inputSecurity = null; // Use abstract Security class + private BaseSecurity? _outputSecurity = null; // Use abstract Security class + private readonly object _securityLock = new object(); // Lock for setting security + private CancellationTokenSource? _cts; + private Task? _receiveTask; + private Task? _sendTask; + private readonly ConcurrentQueue _sendQueue = new ConcurrentQueue(); + private readonly object _streamLock = new object(); // Lock for stream access + + public Octets Nonce; + public int SessionId = 1; + + // Events + public event Action? ProtocolReceived; + public event Action? ErrorOccurred; + public event Action? Disconnected; + public event Action? Connected; + + public bool IsConnected => _client?.Connected ?? false; + private static IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(NetworkManager)); + + public int IgnoreBytes = 0; + + public NetworkManager() + { + // Removed TcpClient initialization here, do it in ConnectAsync + _receiveOctets = new Octets(8192); // Initial buffer size + _receiveBufferStream = new OctetsStream(_receiveOctets); // Keep for reference maybe? + // Initialize security using the factory + _inputSecurity = BaseSecurity.Create(SecurityType.NULLSECURITY); + _outputSecurity = BaseSecurity.Create(SecurityType.NULLSECURITY); + } + + public void SetLogPath(string path) + { + _logger = LoggerFactory.GetCustomLogger(path, nameof(NetworkManager) + GetHashCode(), LoggerType.File); + } + + public async Task ConnectAsync(string host, int port) + { + if (IsConnected) + { + _logger.Log(LogType.Info, "Already connected."); + return; + } + + _client = new TcpClient { NoDelay = true }; + _cts = new CancellationTokenSource(); + try + { + _logger.Log(LogType.Info, $"Connecting to {host}:{port}..."); + await _client.ConnectAsync(host, port); + _stream = _client.GetStream(); + + // Reset security layers on new connection + lock (_securityLock) + { + _inputSecurity = BaseSecurity.Create(SecurityType.NULLSECURITY); + _outputSecurity = BaseSecurity.Create(SecurityType.NULLSECURITY); + } + _logger.Log(LogType.Info, "Connected."); + OnConnected(); + + _receiveTask = Task.Run(() => ProcessReceivedData(_cts.Token), _cts.Token); + _sendTask = Task.Run(() => ProcessSendQueue(_cts.Token), _cts.Token); + } + catch (Exception ex) + { + _logger.Log(LogType.Error, $"Connection failed: {ex.Message}"); + OnErrorOccurred($"Connection failed: {ex.Message}"); + _client?.Dispose(); + _client = null; + _cts?.Dispose(); + _cts = null; + } + } + + public void Disconnect() + { + _logger.Log(LogType.Info, "Try To Disconnecting..."); + if (!IsConnected && _client == null) + { + _logger.Log(LogType.Info, "Already disconnected."); + return; + } + _logger.Log(LogType.Info, "Disconnecting..."); + + _cts?.Cancel(); // Signal tasks to stop + + // Wait briefly for tasks to acknowledge cancellation + // Task.WhenAll(_receiveTask ?? Task.CompletedTask, _sendTask ?? Task.CompletedTask).Wait(500); + + lock (_streamLock) + { + _stream?.Close(); + _stream = null; + } + _client?.Close(); + _client = null; + + // Clean up CTS after tasks are signaled/stopped + _cts?.Dispose(); + _cts = null; + + // Clear the send queue + while (_sendQueue.TryDequeue(out _)) { } + + // Reset buffer length + _receiveOctets.SetSize(0); + _receiveBufferStream.Position = 0; + + _logger.Log(LogType.Info, "Disconnected."); + OnDisconnected(); + } + + // Updated SetSecurity method + public void SetSecurity(BaseSecurity outputSecurity, BaseSecurity inputSecurity) + { + lock (_securityLock) + { + _logger.Log(LogType.Info, + $"Setting Output Security: {outputSecurity?.GetType()?.Name ?? "None"}" + ); + _outputSecurity = outputSecurity ?? BaseSecurity.Create(SecurityType.NULLSECURITY); + _logger.Log(LogType.Info, + $"Setting Input Security: {inputSecurity?.GetType()?.Name ?? "None"}" + ); + _inputSecurity = inputSecurity ?? BaseSecurity.Create(SecurityType.NULLSECURITY); + _logger.Log(LogType.Info, "Security layers activated."); + } + } + + // Enqueue protocol to be sent + public void Send(Protocol protocol) + { + if (!IsConnected) + { + _logger.Log(LogType.Info, "Cannot queue send: Not connected."); + OnErrorOccurred("Cannot queue send: Not connected."); + return; + } + _sendQueue.Enqueue(protocol); + } + + // Internal task to process the send queue + private async Task ProcessSendQueue(CancellationToken token) + { + while (!token.IsCancellationRequested) + { + if (_sendQueue.TryDequeue(out Protocol? protocol)) + { + NetworkStream? stream = null; + BaseSecurity? currentOsec = null; + + lock (_streamLock) + { + stream = _stream; + } + lock (_securityLock) + { + currentOsec = _outputSecurity; + } + + if (stream == null || !IsConnected) + { + _logger.Log(LogType.Info, + $"Send failed: Stream null or disconnected. Re-queueing {protocol.GetType().Name}?" + ); + // Potentially re-queue or drop? + // _sendQueue.Enqueue(protocol); + await Task.Delay(100, token); // Avoid tight loop on disconnect + continue; + } + + try + { + var dataToSend = protocol.Encode(); + var processedData = dataToSend; + + // Apply Output Security (if active and not Null) + if (currentOsec != null && currentOsec.GetType() != typeof(NullSecurity)) + { + try + { + + processedData = currentOsec.Update(dataToSend); + + // _logger.Log(LogType.Info, $"Output security applied. Original size: {dataToSend.Length}, Processed size: {processedData.Length}"); + } + catch (Exception ex) + { + _logger.Log(LogType.Info, + $"Output security update error: {ex.Message}" + ); + ErrorOccurred?.Invoke($"Output security error: {ex.Message}"); + continue; // Skip sending this protocol + } + } + + // Send the (potentially) processed data + await stream.WriteAsync(processedData, 0, processedData.Length, token); + // _logger.Log(LogType.Info, $"Sent {protocol.GetType().Name} ({processedData.Length} bytes)"); + } + catch (IOException ex) when (ex.InnerException is SocketException se) + { + _logger.Log(LogType.Info, + $"SocketException during send: {se.SocketErrorCode} - {se.Message}" + ); + OnErrorOccurred($"Send error: {se.Message}"); + Disconnect(); // Disconnect on send error + break; // Exit send loop + } + catch (ObjectDisposedException) + { + _logger.Log(LogType.Info, "Send failed: Stream disposed."); + OnErrorOccurred("Send failed: Stream disposed."); + Disconnect(); + break; + } + catch (Exception ex) + { + _logger.Log(LogType.Info, + $"Error sending protocol {protocol.GetType().Name}: {ex.Message}" + ); + OnErrorOccurred($"Send error: {ex.Message}"); + Disconnect(); // Disconnect on generic send error too? + break; + } + } + else + { + // Queue is empty, wait a bit + await Task.Delay(10, token); + } + } + _logger.Log(LogType.Info, "Send loop finished."); + } + + // Internal task to read from network and process data + private async Task ProcessReceivedData(CancellationToken token) + { + int currentBufferLength = _receiveOctets.Length; // Start with any residual data + NetworkStream? stream = null; + + try + { + while (!token.IsCancellationRequested) + { + lock (_streamLock) + { + stream = _stream; + } + if (stream == null || !IsConnected) + { + // Stream closed or disconnected, exit loop + _logger.Log(LogType.Info, + "Receive loop exiting: Stream null or disconnected." + ); + break; + } + + // Ensure buffer has space. + if (currentBufferLength >= _receiveOctets.Capacity) + { + // Resize if needed (Consider a max size limit) + int newCapacity = _receiveOctets.Capacity * 2; + if (newCapacity > 1024 * 1024) + { // Example Limit: 1MB + throw new InvalidOperationException( + "Receive buffer exceeded max size limit." + ); + } + _receiveOctets.Reserve(newCapacity); + _logger.Log(LogType.Info, + $"Receive buffer resized to {_receiveOctets.Capacity}" + ); + } + + int bytesRead = 0; + try + { + if (token.IsCancellationRequested) break; + bytesRead = await stream.ReadAsync( + _receiveOctets.RawBuffer, + currentBufferLength, + _receiveOctets.Capacity - currentBufferLength, + token + ); + } + catch (IOException ex) + when (ex.InnerException is SocketException se + && ( + se.SocketErrorCode == SocketError.ConnectionReset + || se.SocketErrorCode == SocketError.ConnectionAborted + ) + ) + { + _logger.Log(LogType.Info, "Connection reset/aborted during read."); + break; // Exit loop gracefully + } + catch (ObjectDisposedException) + { + _logger.Log(LogType.Info, + "Receive failed: Stream disposed during read." + ); + break; // Exit loop + } + + if (bytesRead == 0) + { + var checkConnection = _client?.Client.Poll(0, SelectMode.SelectRead); + // Connection closed gracefully by the server + _logger.Log(LogType.Info, $"Read ZERO Byte (0 bytes read). Buffer Length:{currentBufferLength} -- Capacity:{_receiveOctets.Capacity} -- Token: {token.GetHashCode()} -- Connection:{checkConnection}"); + break; + } + + currentBufferLength += bytesRead; + _receiveOctets.SetSize(currentBufferLength); + + _logger.Log(LogType.Info, $"Process Buffer:: Read {bytesRead} bytes -- Token: {token.GetHashCode()}"); + // Process the data currently in the buffer + ProcessBuffer(); + + // After processing, the buffer might have been compacted, update length + currentBufferLength = _receiveOctets.Length; + } + } + catch (OperationCanceledException) + { + _logger.Log(LogType.Info, "Receive loop cancelled."); + } + catch (Exception ex) + { + _logger.Log(LogType.Info, + $"Unexpected error in receive loop: {ex.GetType().Name} - {ex.Message} {ex.StackTrace}" + ); + OnErrorOccurred($"Receive loop error: {ex.Message}"); + } + finally + { + _logger.Log(LogType.Info, "Receive loop finished."); + Disconnect(); // Ensure disconnection on loop exit + } + } + + // *** Refactored ProcessBuffer *** + private void ProcessBuffer() + { + BaseSecurity? currentIsec = null; + lock (_securityLock) + { + currentIsec = _inputSecurity; + } + + bool securityApplied = + currentIsec != null && currentIsec.GetType() != typeof(NullSecurity); + Octets dataToProcess; // This will hold the data block we decode from + int originalBlockLength = _receiveOctets.Length; // Length before security + int bytesConsumedFromOriginal = 0; // How many bytes of _receiveOctets are processed + + // 1. Apply Input Security (if active) + if (securityApplied) + { + try + { + // Create a temporary Octets with the current buffer content + Octets currentData = new Octets( + _receiveOctets.RawBuffer, + 0, + originalBlockLength + ); + // Update returns a NEW Octets object with processed data + dataToProcess = currentIsec!.Update(currentData); + // _logger.Log(LogType.Info, $"Input security applied. Original size: {originalBlockLength}, Processed size: {dataToProcess.Length}"); + } + catch (Exception ex) + { + _logger.Log(LogType.Info, + $"Input security update error: {ex.Message} - Clearing receive buffer." + ); + OnErrorOccurred($"Input security error: {ex.Message}"); + _receiveOctets.SetSize(0); + return; + } + } + else + { + // No security, process directly from the receive buffer + dataToProcess = _receiveOctets; + } + + // 2. Process Protocols from 'dataToProcess' + OctetsStream processingStream = new OctetsStream(dataToProcess); + bool processedAnyProtocols = false; + int totalConsumedFromProcessedStream = 0; // Track total bytes consumed *from the processed stream* + + while (processingStream.Position < dataToProcess.Length) + { + int streamPosBeforeDecode = processingStream.Position; + var (p, consumedBytes) = (null as Protocol, 0); + + try + { + (p, consumedBytes) = Protocol.Decode(processingStream, IgnoreBytes); // Decode returns protocol and bytes consumed + } + catch (Exception e) + { + _logger.Log(LogType.Info, + $"Protocol Decode Exception: {e.GetType().Name} - {e.Message} at stream pos {streamPosBeforeDecode}/{dataToProcess.Length}. Discarding original block." + ); + OnErrorOccurred($"Protocol decode exception: {e.GetType().Name} - {e.Message}"); + bytesConsumedFromOriginal = originalBlockLength; // Discard the whole original block on decode error + goto EndProcessing; // Use goto to jump to buffer compacting + } + + // Check consumed bytes: If 0, it means Decode couldn't read a complete message (e.g. insufficient data) + if (consumedBytes == 0) + { + // No full protocol read, break and wait for more data + processingStream.Position = streamPosBeforeDecode; // Reset position to before the failed Decode attempt + break; + } + + // If we reach here, consumedBytes > 0 + totalConsumedFromProcessedStream += consumedBytes; + processedAnyProtocols = true; // Mark that we successfully processed/consumed something + + if (p != null) + { + // Successfully decoded a protocol + // _logger.Log(LogType.Info, $"Decoded: {p.GetType().Name}, consumed {consumedBytes} bytes (processed stream)"); + ProtocolReceived?.Invoke(p); // Fire event + } + // else: p is null, but consumedBytes > 0. This means a type 0 protocol was consumed successfully. + // No action needed other than advancing the stream, which Decode already did. + + } + + // 3. Determine how many bytes of the ORIGINAL buffer were consumed + if (securityApplied) + { + // If security was applied and we processed/consumed *any* bytes from the processed stream, + // assume the whole original block was consumed. + bytesConsumedFromOriginal = processedAnyProtocols ? originalBlockLength : 0; + } + else + { + // No security was applied, bytes consumed is simply the final position in the stream + // after successful decodes/consumptions. + bytesConsumedFromOriginal = processingStream.Position; // Use final stream position + } + + EndProcessing: + // 4. Compact the *original* _receiveOctets buffer + CompactOriginalBuffer(bytesConsumedFromOriginal, originalBlockLength); + } + + // *** Helper to compact the original receive buffer *** + private void CompactOriginalBuffer(int bytesToConsume, int originalLength) + { + if (bytesToConsume <= 0 || _receiveOctets == null) // Add null check + { + return; // Nothing to consume/compact + } + + bytesToConsume = Math.Min(bytesToConsume, originalLength); // Cannot consume more than available + + if (bytesToConsume < originalLength) + { + // Move remaining data to the beginning + int remaining = originalLength - bytesToConsume; + // _logger.Log(LogType.Info, $"Compacting original buffer: Consumed {bytesToConsume}, Moving {remaining} bytes from pos {bytesToConsume}"); + Buffer.BlockCopy( + _receiveOctets.RawBuffer, + bytesToConsume, + _receiveOctets.RawBuffer, + 0, + remaining + ); + _receiveOctets.SetSize(remaining); + } + else // Consumed all + { + // All data processed or skipped, clear buffer + // _logger.Log(LogType.Info, $"Clearing original buffer: Consumed {bytesToConsume} >= Original {originalLength}"); + _receiveOctets.SetSize(0); + } + _receiveBufferStream.Position = _receiveOctets.Length; // Reset stream pos just in case + } + + // Helper to raise ErrorOccurred event + private void OnErrorOccurred(string message) + { + ErrorOccurred?.Invoke(message); + } + + // Helper to raise Disconnected event + private void OnDisconnected() + { + Disconnected?.Invoke(); + } + + // Helper to raise Connected event + private void OnConnected() + { + Connected?.Invoke(); + } + + public void Dispose() + { + _client?.Close(); + _client?.Dispose(); + _client = null; + _cts?.Dispose(); + _cts = null; + } + + public void SetNonce(Octets response_data) + { + Nonce = response_data; + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/NetworkManager.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/NetworkManager.cs.meta new file mode 100644 index 0000000000..0dccd7328a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/NetworkManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 67c9fc10cf3944daba94a4fa2ce72cef \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Octets.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Octets.cs new file mode 100644 index 0000000000..bf1ebb0052 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Octets.cs @@ -0,0 +1,133 @@ +using System; +namespace CSNetwork +{ + public class Octets : IDisposable + { + private byte[] _buffer; + private int _size; + private int _capacity; + + public int Size => _size; + public int Capacity => _capacity; + public int Length => _size; + + public Octets(int capacity = 0) + { + _capacity = capacity; + _buffer = new byte[capacity]; + _size = 0; + } + + public Octets(byte[] data) + { + if (data == null) + { + throw new ArgumentNullException(nameof(data), "Input byte array cannot be null."); + } + _capacity = data.Length; + _buffer = new byte[_capacity]; + Buffer.BlockCopy(data, 0, _buffer, 0, data.Length); + _size = data.Length; + } + + public Octets(byte[] data, int capacity) + { + _capacity = capacity; + _buffer = new byte[_capacity]; + Buffer.BlockCopy(data, 0, _buffer, 0, capacity); + _size = capacity; + } + + /// + /// Creates an Octets instance by copying a slice from a source buffer. + /// + /// The buffer to copy from. + /// The starting position in the source buffer. + /// The number of bytes to copy. + public Octets(byte[] sourceBuffer, int offset, int length) + { + if (sourceBuffer == null) + throw new ArgumentNullException(nameof(sourceBuffer)); + if (offset < 0 || length < 0 || offset + length > sourceBuffer.Length) + throw new ArgumentOutOfRangeException("Invalid offset or length for source buffer."); + + _capacity = length; + _buffer = new byte[_capacity]; + Buffer.BlockCopy(sourceBuffer, offset, _buffer, 0, length); + _size = length; + } + + public void Reserve(int newCapacity) + { + if (newCapacity <= _capacity) + return; + Array.Resize(ref _buffer, newCapacity); + _capacity = newCapacity; + } + + /// + /// Sets the logical size of the data within the buffer. + /// Throws ArgumentOutOfRangeException if newSize is negative or exceeds capacity. + /// + /// The new logical size. + public void SetSize(int newSize) + { + if (newSize < 0 || newSize > _capacity) + { + throw new ArgumentOutOfRangeException(nameof(newSize), $"newSize must be between 0 and capacity ({_capacity})."); + } + _size = newSize; + } + + public void Replace(byte[] data) + { + Reserve(data.Length); + Buffer.BlockCopy(data, 0, _buffer, 0, data.Length); + _size = data.Length; + } + + public void Insert(int pos, byte[] data) + { + if (data.Length == 0) + return; + + int newSize = _size + data.Length; + Reserve(newSize); + + // Shift existing data + Array.Copy(_buffer, pos, _buffer, pos + data.Length, _size - pos); + + // Insert new data + Buffer.BlockCopy(data, 0, _buffer, pos, data.Length); + _size = newSize; + } + + public void Erase(int pos, int length) + { + if (length == 0) + return; + + // Shift remaining data + Array.Copy(_buffer, pos + length, _buffer, pos, _size - (pos + length)); + _size -= length; + } + + public byte[] ToArray() => _buffer[.._size]; + + public byte[] ByteArray => ToArray(); + public byte[] RawBuffer => _buffer; + + public void Dispose() => _buffer = null; + + public override string ToString() + { + return BitConverter.ToString(_buffer, 0, _size).Replace("-", " "); + } + + internal void Resize(int newSize) + { + Reserve(newSize); + SetSize(newSize); + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Octets.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Octets.cs.meta new file mode 100644 index 0000000000..a53973194c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Octets.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: eebdce8bdef53410c807e6b624043f72 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/OctetsStream.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/OctetsStream.cs new file mode 100644 index 0000000000..017e42df57 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/OctetsStream.cs @@ -0,0 +1,447 @@ +using CSNetwork.Protocols; +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +// using System.Reflection.PortableExecutable; +using System.Text; +using static CSNetwork.Protocols.selectrole; + +namespace CSNetwork +{ + public class OctetsStream : IDisposable + { + private Octets _octets; + private int _position; + private static readonly Encoding GbkEncoding = Encoding.GetEncoding(936); + private const int MaxSpare = 16384; + private int _transactionPosition; + + public enum Transaction + { + Begin, + Commit, + Rollback + } + + public int Length => _octets.Length; + + // Position within the stream for reading/writing + public int Position + { + get => _position; + set + { + // Basic bounds check, could be more robust + if (value < 0 || value > _octets.Length) + throw new ArgumentOutOfRangeException(nameof(value), "Position is outside the bounds of the stream."); + _position = value; + } + } + + // Access to the underlying Octets object + public Octets UnderlyingOctets => _octets; + + // Access to the raw buffer for in-place operations (like ISecurity.Update) + public byte[] RawBuffer => _octets.RawBuffer; + + public bool IsEof => _position >= _octets.Length; + + public OctetsStream(Octets octets = null) + { + _octets = octets ?? new Octets(); + _position = 0; + } + + // Helper methods for big-endian conversion + private byte[] GetBigEndianBytes(ushort value) + { + if (BitConverter.IsLittleEndian) + { + return new[] { (byte)(value >> 8), (byte)value }; + } + return BitConverter.GetBytes(value); + } + + private byte[] GetBigEndianBytes(uint value) + { + if (BitConverter.IsLittleEndian) + { + return new[] + { + (byte)(value >> 24), + (byte)(value >> 16), + (byte)(value >> 8), + (byte)value + }; + } + return BitConverter.GetBytes(value); + } + + // Primitive type support + public void Write(byte value) => _octets.Insert(_position++, new[] { value }); + + public void Write(short value) + { + var bytes = GetBigEndianBytes((ushort)value); + _octets.Insert(_position, bytes); + _position += 2; + } + + public void Write(ushort value) + { + var bytes = GetBigEndianBytes(value); + _octets.Insert(_position, bytes); + _position += 2; + } + + public void Write(int value) + { + var bytes = GetBigEndianBytes((uint)value); + _octets.Insert(_position, bytes); + _position += 4; + } + + public void Write(uint value) + { + var bytes = GetBigEndianBytes(value); + _octets.Insert(_position, bytes); + _position += 4; + } + + public void Write(float value) + { + var bytes = BitConverter.GetBytes(value); + if (BitConverter.IsLittleEndian) + Array.Reverse(bytes); + _octets.Insert(_position, bytes); + _position += 4; + } + + public void Write(double value) + { + var bytes = BitConverter.GetBytes(value); + if (BitConverter.IsLittleEndian) + Array.Reverse(bytes); + _octets.Insert(_position, bytes); + _position += 8; + } + + // Read methods for primitive types + public byte ReadByte() + { + if (_position + 1 > _octets.Length) + throw new IndexOutOfRangeException("Attempt to read beyond the end of the stream."); + return ReadBytes(1)[0]; + } + + public short ReadInt16() + { + if (_position + 2 > _octets.Length) + throw new IndexOutOfRangeException("Attempt to read beyond the end of the stream."); + var bytes = ReadBytes(2); + if (BitConverter.IsLittleEndian) + Array.Reverse(bytes); + return BitConverter.ToInt16(bytes, 0); + } + + public ushort ReadUInt16() + { + if (_position + 2 > _octets.Length) + throw new IndexOutOfRangeException("Attempt to read beyond the end of the stream."); + var bytes = ReadBytes(2); + if (BitConverter.IsLittleEndian) + Array.Reverse(bytes); + return BitConverter.ToUInt16(bytes, 0); + } + + public int ReadInt32() + { + if (_position + 4 > _octets.Length) + throw new IndexOutOfRangeException("Attempt to read beyond the end of the stream."); + var bytes = ReadBytes(4); + if (BitConverter.IsLittleEndian) + Array.Reverse(bytes); + return BitConverter.ToInt32(bytes, 0); + } + + public uint ReadUInt32() + { + if (_position + 4 > _octets.Length) + throw new IndexOutOfRangeException("Attempt to read beyond the end of the stream."); + var bytes = ReadBytes(4); + if (BitConverter.IsLittleEndian) + Array.Reverse(bytes); + return BitConverter.ToUInt32(bytes, 0); + } + + public float ReadFloat() + { + if (_position + 4 > _octets.Length) + throw new IndexOutOfRangeException("Attempt to read beyond the end of the stream."); + var bytes = ReadBytes(4); + if (BitConverter.IsLittleEndian) + Array.Reverse(bytes); + return BitConverter.ToSingle(bytes, 0); + } + + public double ReadDouble() + { + if (_position + 8 > _octets.Length) + throw new IndexOutOfRangeException("Attempt to read beyond the end of the stream."); + var bytes = ReadBytes(8); + if (BitConverter.IsLittleEndian) + Array.Reverse(bytes); + return BitConverter.ToDouble(bytes, 0); + } + + // Compact integer support + public void WriteCompactInt(int value) + { + if (value >= 0) + { + WriteCompactUInt((uint)value); + } + else + { + uint unsignedValue = (uint)(-value); + unsignedValue = (unsignedValue << 1) | 1; + WriteCompactUInt(unsignedValue); + } + } + + public int ReadCompactInt() + { + uint value = ReadCompactUInt(); + if ((value & 1) == 0) + return (int)(value >> 1); + else + return -(int)(value >> 1); + } + + // Transaction support + public void HandleTransaction(Transaction trans) + { + switch (trans) + { + case Transaction.Begin: + _transactionPosition = _position; + break; + case Transaction.Rollback: + _position = _transactionPosition; + break; + case Transaction.Commit: + if (_position >= MaxSpare) + { + // Optimize memory usage + var newOctets = new byte[_octets.Length - _position]; + Array.Copy(_octets.ToArray(), _position, newOctets, 0, newOctets.Length); + _octets.Dispose(); + _octets = new Octets(newOctets.Length); + _position = 0; + } + break; + } + } + + // Container support + public void WriteList(IList list) + where T : IMarshallable + { + WriteCompactUInt((uint)list.Count); + foreach (var item in list) + { + item.Marshal(this); + } + } + + public void ReadList(IList list) + where T : IMarshallable, new() + { + uint count = ReadCompactUInt(); + for (int i = 0; i < count; i++) + { + var item = new T(); + item.Unmarshal(this); + list.Add(item); + } + } + + public void WriteCompactUInt(uint value) + { + if (value < 0x80) + { + _octets.Insert(_position, new[] { (byte)value }); + _position++; + } + else if (value < 0x4000) + { + var bytes = GetBigEndianBytes((ushort)(value | 0x8000)); + _octets.Insert(_position, bytes); + _position += 2; + } + else if (value < 0x20000000) + { + var bytes = GetBigEndianBytes(value | 0xc0000000); + _octets.Insert(_position, bytes); + _position += 4; + } + else + { + _octets.Insert(_position, new[] { (byte)0xe0 }); + _octets.Insert(_position + 1, GetBigEndianBytes(value)); + _position += 5; + } + } + + public void GetFirstBytes() + { + IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(Protocol)); + var tempBytes = ReadByteWithoutAdvancePos(41); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 41; i++) + { + sb.Append(tempBytes[i]); + sb.Append(' '); + } + _logger.Debug($"Try Decode: Protocol 10 first bytes : {sb}"); + } + + public uint ReadCompactUInt() + { + byte flag = ReadBytes(1)[0]; + IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(Protocol)); + if ((flag & 0xE0) == 0xE0) + { + var bytes = ReadBytes(4); + return BitConverter.IsLittleEndian + ? ((uint)bytes[0] << 24) + | ((uint)bytes[1] << 16) + | ((uint)bytes[2] << 8) + | bytes[3] + : BitConverter.ToUInt32(bytes, 0); + } + else if ((flag & 0xE0) == 0xC0) + { + var bytes = ReadBytes(3); + uint value = 0; + if (BitConverter.IsLittleEndian) + { + value = ((uint)bytes[0] << 16) | ((uint)bytes[1] << 8) | bytes[2]; + } + else + { + value = BitConverter.ToUInt32(bytes, 0); + } + + return (value | ((uint)flag << 24)) & ~0xC0000000; + } + else if ((flag & 0xE0) == 0x80 || (flag & 0xE0) == 0xA0) + { + var bytes = ReadBytes(1); + return (uint)((bytes[0] | (flag << 8)) & ~0x8000); + } + return flag; + } + + + public void WriteString(string value) + { + var bytes = GbkEncoding.GetBytes(value); + WriteCompactUInt((uint)bytes.Length); + _octets.Insert(_position, bytes); + _position += bytes.Length; + } + + public string ReadString() + { + uint length = ReadCompactUInt(); + var bytes = ReadBytes((int)length); + return GbkEncoding.GetString(bytes); + } + + public byte[] ReadBytes(int count) + { + if (_position + count > _octets.Length) + throw new IndexOutOfRangeException("Attempt to read beyond the end of the stream."); + var result = new byte[count]; + Array.Copy(_octets.ToArray(), _position, result, 0, count); + _position += count; + return result; + } + + public byte[] ReadByteWithoutAdvancePos(int count) + { + if (_position + count > _octets.Length) + return new byte[count]; + var result = new byte[count]; + Array.Copy(_octets.ToArray(), _position, result, 0, count); + return result; + } + + public byte[] ToArray() => _octets.ToArray(); + + public void Dispose() => _octets?.Dispose(); + + public void WriteBytes(byte[] data) + { + _octets.Insert(_position, data); + _position += data.Length; + } + + // Add these methods for Octets support + public void Write(Octets value) + { + WriteCompactUInt((uint)value.Size); + WriteBytes(value.ToArray()); + } + + public Octets ReadOctets() + { + uint size = ReadCompactUInt(); + byte[] data = ReadBytes((int)size); + return new Octets(data); + } + + public void Write(List list) + { + WriteCompactUInt((uint)list.Count); + foreach (var octets in list) + { + Write(octets); + } + } + + public List ReadOctetsList() + { + uint count = ReadCompactUInt(); + var list = new List(); + for (int i = 0; i < count; i++) + { + list.Add(ReadOctets()); + } + return list; + } + + // Erase a section of the underlying buffer + public void Erase(int pos, int length) + { + _octets.Erase(pos, length); + // Adjust position if the erasure happened before the current position + if (pos < _position) + { + _position = Math.Max(pos, _position - length); + } + } + + // Compact the stream by removing processed data (0 to Position) + public void Compact() + { + if (_position > 0) + { + _octets.Erase(0, _position); + _position = 0; // Reset position after compacting + } + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/OctetsStream.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/OctetsStream.cs.meta new file mode 100644 index 0000000000..7cb7baa15a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/OctetsStream.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 089ce5809f78f40c5bfaa6acfa61c49a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols.meta new file mode 100644 index 0000000000..181f60fd96 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c690c872e4183450caadd0dc34fe124e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/AccountProtocols.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/AccountProtocols.cs new file mode 100644 index 0000000000..cae89925f3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/AccountProtocols.cs @@ -0,0 +1,84 @@ +namespace CSNetwork.Protocols +{ + public class ACAnswer : Protocol + { + public int RoleId { get; set; } + public int QType { get; set; } + public int Seq { get; set; } + public int Reserved { get; set; } + public int Answer { get; set; } + + public ACAnswer() : base(ProtocolType.PROTOCOL_ACANSWER) { } + + public override Protocol Clone() => new ACAnswer + { + RoleId = RoleId, + QType = QType, + Seq = Seq, + Reserved = Reserved, + Answer = Answer + }; + + public override void Marshal(OctetsStream os) + { + os.Write(RoleId); + os.Write(QType); + os.Write(Seq); + os.Write(Reserved); + os.Write(Answer); + } + + public override void Unmarshal(OctetsStream os) + { + RoleId = os.ReadInt32(); + QType = os.ReadInt32(); + Seq = os.ReadInt32(); + Reserved = os.ReadInt32(); + Answer = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + public override bool SizePolicy(int size) => size <= 8192; + } + + public class AccountLoginRecord : Protocol + { + public int UserId { get; set; } + public uint LocalSid { get; set; } + public int LoginTime { get; set; } + public int LoginIp { get; set; } + public int CurrentIp { get; set; } + + public AccountLoginRecord() : base(ProtocolType.PROTOCOL_ACCOUNTLOGINRECORD) { } + + public override Protocol Clone() => new AccountLoginRecord + { + UserId = UserId, + LocalSid = LocalSid, + LoginTime = LoginTime, + LoginIp = LoginIp, + CurrentIp = CurrentIp + }; + + public override void Marshal(OctetsStream os) + { + os.Write(UserId); + os.Write(LocalSid); + os.Write(LoginTime); + os.Write(LoginIp); + os.Write(CurrentIp); + } + + public override void Unmarshal(OctetsStream os) + { + UserId = os.ReadInt32(); + LocalSid = os.ReadUInt32(); + LoginTime = os.ReadInt32(); + LoginIp = os.ReadInt32(); + CurrentIp = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/AccountProtocols.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/AccountProtocols.cs.meta new file mode 100644 index 0000000000..54276b952e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/AccountProtocols.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0d4f72ef208ce412cbb3018d9c33a431 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/KeyExchange.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/KeyExchange.cs new file mode 100644 index 0000000000..444a3fa6a2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/KeyExchange.cs @@ -0,0 +1,78 @@ +using CSNetwork.Security; +using System; + +namespace CSNetwork.Protocols +{ + public class KeyExchange : Protocol + { + public Octets Nonce { get; set; } + public byte Blkickuser { get; set; } + + public KeyExchange() + : base(ProtocolType.PROTOCOL_KEYEXCHANGE) + { + Nonce = new Octets(); // Initialize Nonce + } + + public override Protocol Clone() => + new KeyExchange { Nonce = new Octets(Nonce.ToArray()), Blkickuser = Blkickuser }; + + public override void Marshal(OctetsStream os) + { + os.Write(Nonce); // Use Write for Octets + os.Write(Blkickuser); // Use Write for byte + } + + public override void Unmarshal(OctetsStream os) + { + Nonce = os.ReadOctets(); // Use ReadOctets + Blkickuser = os.ReadByte(); // Use ReadByte + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 32; + + public override string ToString => $"KeyExchange(Type={Type}, Nonce={BitConverter.ToString(Nonce.ByteArray)}, BlKickUser={Blkickuser})"; + + public void Setup(NetworkManager mgr, string name) + { + // Convert name to Octets + Octets identity = new Octets(System.Text.Encoding.ASCII.GetBytes(name)); + // Generate input security key with modified nonce + + + BaseSecurity oSecurity = BaseSecurity.Create(SecurityType.ARCFOURSECURITY); + oSecurity.SetParameter(GenerateKey(identity, mgr.Nonce, Nonce)); + + Octets modifiedNonce = new Octets(Nonce.ToArray()); + modifiedNonce.Resize(16); + BaseSecurity iSecurity = BaseSecurity.Create(SecurityType.DECOMPRESSARCFOURSECURITY); + iSecurity.SetParameter(GenerateKey(identity, mgr.Nonce, modifiedNonce)); + + mgr.SetSecurity(oSecurity, iSecurity); + } + + private Octets GenerateKey(Octets identity, Octets password, Octets nonce) + { + // Create HMAC-MD5 hash using the ported class + var hmac = new Security.HMAC_MD5Hash(); // Use the ported class + + // Set the key + hmac.SetParameter(identity); // Use SetParameter + + // Update with identity + hmac.Update(password); // Use Update + + // Update with nonce + hmac.Update(nonce); // Use Update + + // Finalize hash + Octets result = new Octets(); + hmac.Final(result); // Use Final, passing an Octets object + + + return result; // Return the result Octets + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/KeyExchange.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/KeyExchange.cs.meta new file mode 100644 index 0000000000..19156243fc --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/KeyExchange.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9632cdb20632a4880b32b28d56c888ed \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/Protocol.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/Protocol.cs new file mode 100644 index 0000000000..4b9e2b4607 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/Protocol.cs @@ -0,0 +1,210 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; + +namespace CSNetwork.Protocols +{ + public abstract class Protocol + { + private static readonly IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(Protocol)); + public uint Type { get; protected set; } + public ProtocolType GetPType() => (ProtocolType)Type; + private static readonly Dictionary _protocolMap = new Dictionary(); + + protected Protocol(ProtocolType type) => Type = (uint)type; + + public static void Register(uint type) + where T : Protocol, new() => _protocolMap[type] = typeof(T); + + public static void Register(Type type, uint typeId) => _protocolMap[typeId] = type; + + public static Protocol? Create(uint type) => + _protocolMap.TryGetValue(type, out var t) + ? (Protocol?)Activator.CreateInstance(t) + : null; + + public virtual void Process(Manager mgr, uint sid) { } + + public virtual void Notify(Manager mgr, uint sid) + { + mgr.OnRecvProtocol(sid, this); + } + + public abstract Protocol Clone(); + + public virtual void Destroy() { } + + public virtual int PriorPolicy() => 0; + + public virtual bool SizePolicy(int size) => true; + + public abstract void Marshal(OctetsStream os); + public abstract void Unmarshal(OctetsStream os); + + public byte[] Encode() + { + using var os = new OctetsStream(); + os.WriteCompactUInt(Type); + var dataStream = new OctetsStream(); + Marshal(dataStream); + os.WriteCompactUInt((uint)dataStream.Length); + os.WriteBytes(dataStream.ToArray()); + return os.ToArray(); + } + + /// + /// Decodes a protocol from the stream. + /// + /// The stream to decode from. + /// A tuple containing the decoded protocol (or null if decoding failed or no complete protocol was found) + /// and the number of bytes consumed from the stream during this attempt. + public static (Protocol? protocol, int consumedBytes) Decode(OctetsStream stream, int ignoreBytes = 0) + { + if (stream.IsEof) // Check if stream is already at end + return (null, 0); + + int initialPosition = stream.Position; // Store initial position for rollback + + try + { + //stream.HandleTransaction(OctetsStream.Transaction.Begin); + //stream.GetFirstBytes(); + uint type = stream.ReadCompactUInt(); + uint size = stream.ReadCompactUInt(); + int positionAfterHeader = stream.Position; // Position after reading type and size + int headerSize = positionAfterHeader - initialPosition; + + _logger.Debug($"Try Decode: Protocol({type}) {(ProtocolType)type} - size {size}. Stream Pos: {initialPosition}, After Header: {positionAfterHeader}, Stream Length: {stream.Length}"); + + // Check if enough data is available in the stream for the declared payload size + int bytesAvailableForPayload = stream.Length - positionAfterHeader; + if (bytesAvailableForPayload < size) + { + _logger.Debug($"Decode failed: Insufficient data. Need {size} payload bytes, have {bytesAvailableForPayload}. Rolling back."); + stream.HandleTransaction(OctetsStream.Transaction.Rollback); + stream.Position = initialPosition; // Explicitly reset position on insufficient data rollback + return (null, 0); // Not enough data yet, consumed 0 bytes effectively + } + + + if (type == 0) + { + _logger.Info($"Ignoring and consuming type 0 protocol with size {size}."); + // Consume the specified number of bytes from the stream + int bytesToConsume = (int)size; + return (null, stream.Position - initialPosition); + int finalPosition; + if (stream.Position + bytesToConsume <= stream.Length) + { + stream.Position += bytesToConsume; // Advance position + finalPosition = stream.Position; + stream.HandleTransaction(OctetsStream.Transaction.Commit); // Commit the consumption + return (null, finalPosition - initialPosition); // Consumed header + payload + } + else + { + // This case should theoretically not happen if the initial size check passed, + // but handle defensively. Rollback as we couldn't consume fully. + _logger.Warning($"Decode inconsistency: Not enough data to consume type 0 protocol ({bytesToConsume} bytes needed). Rolling back."); + stream.HandleTransaction(OctetsStream.Transaction.Rollback); + stream.Position = initialPosition; // Reset position + return (null, 0); // Consumed 0 bytes effectively due to rollback + } + } + + if (!ValidateProtocol(type, size)) // Keep existing max size validation + { + _logger.Debug($"Decode failed: ValidateProtocol failed for type {type}, size {size}. Rolling back."); + stream.HandleTransaction(OctetsStream.Transaction.Rollback); + stream.Position = initialPosition; // Reset position + return (null, 0); // Consumed 0 bytes effectively + } + + var protocol = Create(type); + if (protocol != null) + { + // Important: Unmarshal should only read 'size' bytes. + // Verify if Unmarshal consumed exactly 'size' bytes. + int positionBeforeUnmarshal = stream.Position; + protocol.Unmarshal(stream); + int positionAfterUnmarshal = stream.Position; + int bytesConsumedByUnmarshal = positionAfterUnmarshal - positionBeforeUnmarshal; + + if (bytesConsumedByUnmarshal != size) + { + _logger.Warning($"Decode Warning: Protocol type {type} Unmarshal consumed {bytesConsumedByUnmarshal} bytes, but header specified size {size}. Committing anyway, but this might indicate an issue."); + // Decide if this should be a hard error (rollback) or just a warning. + // Sticking with commit for now, assuming the unmarshal logic knows best, + // but the discrepancy is logged. + } + + stream.HandleTransaction(OctetsStream.Transaction.Commit); + return (protocol, positionAfterUnmarshal - initialPosition); // Consumed header + payload + } + else + { + // Failed to create protocol instance (unknown type?) + _logger.Warning($"Decode failed: Could not create protocol instance for type {type}. Rolling back."); + stream.HandleTransaction(OctetsStream.Transaction.Rollback); + stream.Position = initialPosition; // Reset position + return (null, 0); // Consumed 0 bytes effectively + } + } + catch (Exception ex) // Catch potential exceptions during read/unmarshal + { + _logger.Error($"Decode exception: {ex.Message} at position {stream.Position}. Rolling back. Stack Trace: {ex.StackTrace}"); + stream.HandleTransaction(OctetsStream.Transaction.Rollback); + stream.Position = initialPosition; // Reset position on error + return (null, 0); // Consumed 0 bytes effectively + } + } + + private static bool ValidateProtocol(uint type, uint size) + { + var stub = _protocolMap.GetValueOrDefault(type); + return stub != null && size <= MaxProtocolSize; + } + + private const int MaxProtocolSize = 16 * 1024 * 1024; // 16MB max size + + public virtual string ToString => $"Protocol Type: {Type}"; + } + + // Add interface for marshallable objects + public interface IMarshallable + { + void Marshal(OctetsStream os); + void Unmarshal(OctetsStream os); + } + + + public class ProtocolFactory + { + public static void RegisterAllProtocols() + { + // Get all types that inherit from Protocol + var protocolTypes = Assembly + .GetExecutingAssembly() + .GetTypes() + .Where(t => t.IsClass && !t.IsAbstract && t.IsSubclassOf(typeof(Protocol))); + + int count = 0; + foreach (var type in protocolTypes) + { + // Get the protocol type from the constructor + var constructor = type.GetConstructor(Type.EmptyTypes); + if (constructor != null) + { + // Create an instance to get its type + var instance = (Protocol)Activator.CreateInstance(type); + // Call the generic Register method with the correct type and protocol type ID + Protocol.Register(type, instance.Type); + count++; + } + } + + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/Protocol.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/Protocol.cs.meta new file mode 100644 index 0000000000..b63c575bd2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/Protocol.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6a01ed16b76194f4fa172f138209073f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ProtocolTypes.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ProtocolTypes.cs new file mode 100644 index 0000000000..87f334c427 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ProtocolTypes.cs @@ -0,0 +1,889 @@ +namespace CSNetwork.Protocols +{ + public enum CallID + { + // Rpc for Game + RPC_TRADESTARTRQST = 4003, + RPC_ADDFRIENDRQST = 204, + + // Rpc for QQ + RPC_GAMEZONELIST = 1001, + RPC_ROLEALLLIST = 1004, + RPC_FRIENDALLLIST = 1006, + RPC_USERGETINFO = 1009, + RPC_USERSETINFO = 1010, + RPC_GROUPGETINFO = 1011, + RPC_GROUPSETINFO = 1012, + RPC_FRIENDDEL = 1016, + RPC_FRIENDMOVE = 1017, + RPC_MSGRETRIEVEOFFLINE = 1021, + RPC_FINDROLEBYNAME = 1022, + RPC_QQADDFRIENDRQST = 14, + RPC_FINDROLE = 1024, + RPC_FACTIONINVITEJOIN = 4813, + RPC_PLAYERPOSITIONRESETRQST = 155, + }; + + public enum ProtocolType + { + PROTOCOL_ACACCUSE = 5055, + PROTOCOL_ACACCUSERE = 5056, + PROTOCOL_ACANSWER = 5032, + PROTOCOL_ACBRIEFINFO = 5018, + PROTOCOL_ACCHEATERS = 5013, + PROTOCOL_ACCONNECTRE = 5004, + PROTOCOL_ACCOUNTINGREQUEST = 503, + PROTOCOL_ACCOUNTINGRESPONSE = 504, + PROTOCOL_ACCOUNTLOGINRECORD = 143, + PROTOCOL_ACFORBIDCHEATER = 8008, + PROTOCOL_ACFORBIDPROCESS = 5015, + PROTOCOL_ACKICKOUTUSER = 5035, + PROTOCOL_ACPERIODINFO = 5019, + PROTOCOL_ACPROTOSTAT = 5024, + PROTOCOL_ACQCODERES = 5012, + PROTOCOL_ACQLOGINFO = 5008, + PROTOCOL_ACQMOUSEINFO = 5022, + PROTOCOL_ACQPATTERNS = 5014, + PROTOCOL_ACQPLATFORMINFO = 5016, + PROTOCOL_ACQPROTOCOLSTATS = 5025, + PROTOCOL_ACQSTROWNER = 5021, + PROTOCOL_ACQTHREADTIMES = 5023, + PROTOCOL_ACQUERY = 5007, + PROTOCOL_ACQUESTION = 5031, + PROTOCOL_ACQUSERONLINE = 5009, + PROTOCOL_ACQUSERSTRS = 5010, + PROTOCOL_ACRELOADCONFIG = 5005, + PROTOCOL_ACRELOADCONFIGRE = 5006, + PROTOCOL_ACREMOTECODE = 5003, + PROTOCOL_ACREMOTEEXE = 5027, + PROTOCOL_ACREMOTEEXERE = 5028, + PROTOCOL_ACREPORT = 5001, + PROTOCOL_ACREPORTCHEATER = 5029, + PROTOCOL_ACSENDCODE = 5011, + PROTOCOL_ACSTATUSANNOUNCE = 5026, + PROTOCOL_ACSTATUSANNOUNCE2 = 5034, + PROTOCOL_ACTRIGGERQUESTION = 5030, + PROTOCOL_ACVERSION = 5020, + PROTOCOL_ACWHOAMI = 5002, + PROTOCOL_ADDCASH = 515, + PROTOCOL_ADDCASH_RE = 516, + PROTOCOL_ADDCASHNOTIFY = 142, + PROTOCOL_ADDFRIEND = 202, + PROTOCOL_ADDFRIEND_RE = 203, + PROTOCOL_ADDFRIENDREMARKS = 236, + PROTOCOL_ADDFRIENDREMARKS_RE = 237, + PROTOCOL_ADDICTIONCONTROL = 556, + PROTOCOL_ANNOUNCEAUTHDVERSION = 137, + PROTOCOL_ANNOUNCECENTRALDELIVERY = 1131, + PROTOCOL_ANNOUNCECHALLENGEALGO = 136, + PROTOCOL_ANNOUNCEFORBIDINFO = 123, + PROTOCOL_ANNOUNCEGM = 121, + PROTOCOL_ANNOUNCELINKTYPE = 372, + PROTOCOL_ANNOUNCELINKVERSION = 1130, + PROTOCOL_ANNOUNCENEWMAIL = 4201, + PROTOCOL_ANNOUNCEPROVIDERID = 73, + PROTOCOL_ANNOUNCESELLRESULT = 610, + PROTOCOL_ANNOUNCESERVERATTRIBUTE = 132, + PROTOCOL_ANNOUNCEZONEID = 505, + PROTOCOL_AU2GAME = 8038, + PROTOCOL_AUADDUPMONEYQUERY_RE = 4055, + PROTOCOL_AUCTIONATTENDLIST = 816, + PROTOCOL_AUCTIONATTENDLIST_RE = 817, + PROTOCOL_AUCTIONBID = 802, + PROTOCOL_AUCTIONBID_RE = 803, + PROTOCOL_AUCTIONCLOSE = 806, + PROTOCOL_AUCTIONCLOSE_RE = 807, + PROTOCOL_AUCTIONEXITBID = 818, + PROTOCOL_AUCTIONEXITBID_RE = 819, + PROTOCOL_AUCTIONGET = 808, + PROTOCOL_AUCTIONGET_RE = 809, + PROTOCOL_AUCTIONGETITEM = 820, + PROTOCOL_AUCTIONGETITEM_RE = 821, + PROTOCOL_AUCTIONLIST = 804, + PROTOCOL_AUCTIONLIST_RE = 805, + PROTOCOL_AUCTIONLISTUPDATE = 823, + PROTOCOL_AUCTIONLISTUPDATE_RE = 824, + PROTOCOL_AUCTIONOPEN = 800, + PROTOCOL_AUCTIONOPEN_RE = 801, + PROTOCOL_AUMAILSENDED = 235, + PROTOCOL_AUTHDVERSION = 8010, + PROTOCOL_AUTOLOCKCHANGED = 785, + PROTOCOL_AUTOLOCKSET = 782, + PROTOCOL_AUTOLOCKSET_RE = 783, + PROTOCOL_AUTOTEAMCOMPOSEFAILED = 967, + PROTOCOL_AUTOTEAMCOMPOSESTART = 966, + PROTOCOL_AUTOTEAMCONFIGREGISTER = 961, + PROTOCOL_AUTOTEAMPLAYERLEAVE = 968, + PROTOCOL_AUTOTEAMPLAYERREADY = 964, + PROTOCOL_AUTOTEAMPLAYERREADY_RE = 965, + PROTOCOL_AUTOTEAMSETGOAL = 962, + PROTOCOL_AUTOTEAMSETGOAL_RE = 963, + PROTOCOL_BATTLECHALLENGE = 852, + PROTOCOL_BATTLECHALLENGE_RE = 853, + PROTOCOL_BATTLECHALLENGEMAP = 854, + PROTOCOL_BATTLECHALLENGEMAP_RE = 855, + PROTOCOL_BATTLEENTER = 860, + PROTOCOL_BATTLEENTER_RE = 861, + PROTOCOL_BATTLEENTERNOTICE = 862, + PROTOCOL_BATTLEFACTIONNOTICE = 874, + PROTOCOL_BATTLEGETMAP = 850, + PROTOCOL_BATTLEGETMAP_RE = 851, + PROTOCOL_BATTLEMAPNOTICE = 870, + PROTOCOL_BATTLESERVERREGISTER = 856, + PROTOCOL_BATTLESTART = 857, + PROTOCOL_BATTLESTART_RE = 858, + PROTOCOL_BATTLESTATUS = 866, + PROTOCOL_BATTLESTATUS_RE = 867, + PROTOCOL_BILLINGBALANCE = 9000, + PROTOCOL_BILLINGBALANCESA = 8048, + PROTOCOL_BILLINGBALANCESA_RE = 8049, + PROTOCOL_BILLINGCANCEL = 8054, + PROTOCOL_BILLINGCONFIRM = 8052, + PROTOCOL_BILLINGCONFIRM_RE = 8053, + PROTOCOL_BILLINGREQUEST = 9001, + PROTOCOL_BUYPOINT = 607, + PROTOCOL_BUYPOINT_RE = 608, + PROTOCOL_C2SGAMEDATASEND = 75, + PROTOCOL_CANCELWAITQUEUE = 165, + PROTOCOL_CANCELWAITQUEUE_RE = 166, + PROTOCOL_CASHLOCK = 4260, + PROTOCOL_CASHLOCK_RE = 4261, + PROTOCOL_CASHMONEYEXCHANGENOTIFY = 157, + PROTOCOL_CASHPASSWORDSET = 4263, + PROTOCOL_CASHPASSWORDSET_RE = 4264, + PROTOCOL_CERTKEY = 547, + PROTOCOL_CERTREQUEST = 545, + PROTOCOL_CHALLENGE = 1, + PROTOCOL_CHANGEDS_RE = 1104, + PROTOCOL_CHATBROADCAST = 120, + PROTOCOL_CHATMESSAGE = 80, + PROTOCOL_CHATMULTICAST = 81, + PROTOCOL_CHATROOMCREATE = 219, + PROTOCOL_CHATROOMCREATE_RE = 220, + PROTOCOL_CHATROOMEXPEL = 226, + PROTOCOL_CHATROOMINVITE = 221, + PROTOCOL_CHATROOMINVITE_RE = 222, + PROTOCOL_CHATROOMJOIN = 223, + PROTOCOL_CHATROOMJOIN_RE = 224, + PROTOCOL_CHATROOMLEAVE = 225, + PROTOCOL_CHATROOMLIST = 228, + PROTOCOL_CHATROOMLIST_RE = 229, + PROTOCOL_CHATROOMSPEAK = 227, + PROTOCOL_CHATSINGLECAST = 94, + PROTOCOL_CHECKNEWMAIL = 4200, + PROTOCOL_COLLECTCLIENTMACHINEINFO = 37, + PROTOCOL_COMPLAIN2GM = 370, + PROTOCOL_COMPLAIN2GM_RE = 371, + PROTOCOL_COUNTRYBATTLEAPPLY = 4751, + PROTOCOL_COUNTRYBATTLEAPPLY_RE = 4752, + PROTOCOL_COUNTRYBATTLECONFIGNOTIFY = 4759, + PROTOCOL_COUNTRYBATTLEDESTROYINSTANCE = 4792, + PROTOCOL_COUNTRYBATTLEEND = 4766, + PROTOCOL_COUNTRYBATTLEENTER = 4765, + PROTOCOL_COUNTRYBATTLEENTERMAPNOTICE = 4757, + PROTOCOL_COUNTRYBATTLEGETBATTLELIMIT = 4784, + PROTOCOL_COUNTRYBATTLEGETBATTLELIMIT_RE = 4785, + PROTOCOL_COUNTRYBATTLEGETCONFIG = 4772, + PROTOCOL_COUNTRYBATTLEGETCONFIG_RE = 4773, + PROTOCOL_COUNTRYBATTLEGETKINGCOMMANDPOINT = 4786, + PROTOCOL_COUNTRYBATTLEGETKINGCOMMANDPOINT_RE = 4787, + PROTOCOL_COUNTRYBATTLEGETMAP = 4767, + PROTOCOL_COUNTRYBATTLEGETMAP_RE = 4768, + PROTOCOL_COUNTRYBATTLEGETPLAYERLOCATION = 4770, + PROTOCOL_COUNTRYBATTLEGETSCORE = 4774, + PROTOCOL_COUNTRYBATTLEGETSCORE_RE = 4775, + PROTOCOL_COUNTRYBATTLEJOINNOTICE = 4753, + PROTOCOL_COUNTRYBATTLEKINGASSIGNASSAULT = 4781, + PROTOCOL_COUNTRYBATTLEKINGASSIGNASSAULT_RE = 4782, + PROTOCOL_COUNTRYBATTLEKINGRESETBATTLELIMIT = 4783, + PROTOCOL_COUNTRYBATTLELEAVENOTICE = 4754, + PROTOCOL_COUNTRYBATTLEMOVE = 4760, + PROTOCOL_COUNTRYBATTLEMOVE_RE = 4761, + PROTOCOL_COUNTRYBATTLEOFFLINENOTICE = 4756, + PROTOCOL_COUNTRYBATTLEONLINENOTICE = 4755, + PROTOCOL_COUNTRYBATTLEPREENTER = 4777, + PROTOCOL_COUNTRYBATTLEPREENTERNOTIFY = 4776, + PROTOCOL_COUNTRYBATTLERESULT = 4778, + PROTOCOL_COUNTRYBATTLERETURNCAPITAL = 4779, + PROTOCOL_COUNTRYBATTLESERVERREGISTER = 4758, + PROTOCOL_COUNTRYBATTLESINGLEBATTLERESULT = 4780, + PROTOCOL_COUNTRYBATTLESTART = 4763, + PROTOCOL_COUNTRYBATTLESTART_RE = 4764, + PROTOCOL_COUNTRYBATTLESYNCPLAYERLOCATION = 4762, + PROTOCOL_COUNTRYBATTLESYNCPLAYERPOS = 4769, + PROTOCOL_CREATEFACTIONFORTRESS = 4406, + PROTOCOL_CREATEFACTIONFORTRESS_RE = 4407, + PROTOCOL_CREATEROLE = 84, + PROTOCOL_CREATEROLE_RE = 85, + PROTOCOL_DBFRIENDEXTLIST_RE = 232, + PROTOCOL_DEBUGADDCASH = 521, + PROTOCOL_DEBUGCOMMAND = 873, + PROTOCOL_DELETEMAIL = 4208, + PROTOCOL_DELETEMAIL_RE = 4209, + PROTOCOL_DELETEROLE = 86, + PROTOCOL_DELETEROLE_RE = 87, + PROTOCOL_DELFACTIONANNOUNCE = 4818, + PROTOCOL_DELFRIEND = 212, + PROTOCOL_DELFRIEND_RE = 213, + PROTOCOL_DELROLEANNOUNCE = 3029, + PROTOCOL_DISABLEAUTOLOCK = 8007, + PROTOCOL_DISCONNECTPLAYER = 106, + PROTOCOL_DISCOUNTANNOUNCE = 8064, + PROTOCOL_DOMAINCMD = 771, + PROTOCOL_DOMAINCMD_RE = 772, + PROTOCOL_DOMAINLOGIN = 700, + PROTOCOL_DOMAINVALIDATE = 770, + PROTOCOL_ENTERWORLD = 72, + PROTOCOL_ERRORINFO = 5, + PROTOCOL_EXCHANGECONSUMEPOINTS = 4954, + PROTOCOL_EXCHANGECONSUMEPOINTS_RE = 4955, + PROTOCOL_FACEMODIFY = 125, + PROTOCOL_FACEMODIFY_RE = 127, + PROTOCOL_FACEMODIFYCANCEL = 126, + PROTOCOL_FACTIONACCEPTJOIN = 4812, + PROTOCOL_FACTIONACCEPTJOIN_RE = 4505, + PROTOCOL_FACTIONALLIANCEAPPLY_RE = 4517, + PROTOCOL_FACTIONALLIANCEREPLY_RE = 4518, + PROTOCOL_FACTIONAPPLYJOIN_RE = 4504, + PROTOCOL_FACTIONAPPOINT_RE = 4510, + PROTOCOL_FACTIONBEGINSYNC = 4808, + PROTOCOL_FACTIONBEGINSYNC_RE = 4809, + PROTOCOL_FACTIONBROADCASTNOTICE_RE = 4507, + PROTOCOL_FACTIONCHANGPROCLAIM_RE = 4508, + PROTOCOL_FACTIONCHAT = 4803, + PROTOCOL_FACTIONCONGREGATEREQUEST = 4823, + PROTOCOL_FACTIONCREATE = 4501, + PROTOCOL_FACTIONCREATE_RE = 4502, + PROTOCOL_FACTIONDEGRADE_RE = 4514, + PROTOCOL_FACTIONDELAYEXPELANNOUNCE = 4526, + PROTOCOL_FACTIONDISMISS_RE = 4515, + PROTOCOL_FACTIONENDSYNC = 4810, + PROTOCOL_FACTIONEXPEL_RE = 4506, + PROTOCOL_FACTIONFORBIDUPDATE = 8167, + PROTOCOL_FACTIONFORTRESSBATTLELIST = 4419, + PROTOCOL_FACTIONFORTRESSBATTLELIST_RE = 4420, + PROTOCOL_FACTIONFORTRESSCHALLENGE = 4416, + PROTOCOL_FACTIONFORTRESSCHALLENGE_RE = 4417, + PROTOCOL_FACTIONFORTRESSENTER = 4412, + PROTOCOL_FACTIONFORTRESSENTERNOTICE = 4413, + PROTOCOL_FACTIONFORTRESSGET = 4421, + PROTOCOL_FACTIONFORTRESSGET_RE = 4422, + PROTOCOL_FACTIONFORTRESSLIST = 4414, + PROTOCOL_FACTIONFORTRESSLIST_RE = 4415, + PROTOCOL_FACTIONHOSTILEAPPLY_RE = 4519, + PROTOCOL_FACTIONHOSTILEREPLY_RE = 4520, + PROTOCOL_FACTIONINFOUPDATE = 8164, + PROTOCOL_FACTIONLEAVE_RE = 4512, + PROTOCOL_FACTIONLISTMEMBER_RE = 4503, + PROTOCOL_FACTIONLISTONLINE = 4819, + PROTOCOL_FACTIONLISTONLINE_RE = 4820, + PROTOCOL_FACTIONLISTRELATION_RE = 4523, + PROTOCOL_FACTIONMASTERRESIGN_RE = 4509, + PROTOCOL_FACTIONMEMBERUPDATE = 8163, + PROTOCOL_FACTIONMSG = 8165, + PROTOCOL_FACTIONOPREQUEST = 4804, + PROTOCOL_FACTIONOPREQUEST_RE = 4805, + PROTOCOL_FACTIONRELATIONRECVAPPLY = 4524, + PROTOCOL_FACTIONRELATIONRECVREPLY = 4525, + PROTOCOL_FACTIONREMOVERELATIONAPPLY_RE = 4521, + PROTOCOL_FACTIONREMOVERELATIONREPLY_RE = 4522, + PROTOCOL_FACTIONRENAME_RE = 4516, + PROTOCOL_FACTIONRENAMEANNOUNCE = 4532, + PROTOCOL_FACTIONRENAMEGSVERIFY = 4527, + PROTOCOL_FACTIONRENAMEGSVERIFY_RE = 4528, + PROTOCOL_FACTIONRESIGN_RE = 4511, + PROTOCOL_FACTIONRESOURCEBATTLEEVENTNOTICE = 4429, + PROTOCOL_FACTIONRESOURCEBATTLEGETMAP = 4434, + PROTOCOL_FACTIONRESOURCEBATTLEGETMAP_RE = 4435, + PROTOCOL_FACTIONRESOURCEBATTLEGETRECORD = 4436, + PROTOCOL_FACTIONRESOURCEBATTLEGETRECORD_RE = 4437, + PROTOCOL_FACTIONRESOURCEBATTLELIMITNOTICE = 4433, + PROTOCOL_FACTIONRESOURCEBATTLENOTIFYPLAYEREVENT = 4438, + PROTOCOL_FACTIONRESOURCEBATTLEPLAYERQUERY = 4430, + PROTOCOL_FACTIONRESOURCEBATTLEPLAYERQUERYRESULT = 4431, + PROTOCOL_FACTIONRESOURCEBATTLEREQUESTCONFIG = 4425, + PROTOCOL_FACTIONRESOURCEBATTLEREQUESTCONFIG_RE = 4426, + PROTOCOL_FACTIONRESOURCEBATTLESERVERREGISTER = 4427, + PROTOCOL_FACTIONRESOURCEBATTLESTATUSNOTICE = 4428, + PROTOCOL_FACTIONSERVERREGISTER = 4409, + PROTOCOL_FACTIONUPGRADE_RE = 4513, + PROTOCOL_FINDSELLPOINTINFO = 619, + PROTOCOL_FINDSELLPOINTINFO_RE = 620, + PROTOCOL_FORWARDCHAT = 8000, + PROTOCOL_FRIENDEXTLIST = 230, + PROTOCOL_FRIENDSTATUS = 214, + PROTOCOL_GAME2AU = 8039, + PROTOCOL_GAMEDATASEND = 34, + PROTOCOL_GETCNETSERVERCONFIG = 4788, + PROTOCOL_GETCNETSERVERCONFIG_RE = 4789, + PROTOCOL_GETCUSTOMDATA = 116, + PROTOCOL_GETCUSTOMDATA_RE = 117, + PROTOCOL_GETFACTIONBASEINFO = 4814, + PROTOCOL_GETFACTIONBASEINFO_RE = 4815, + PROTOCOL_GETFRIENDS = 206, + PROTOCOL_GETFRIENDS_RE = 207, + PROTOCOL_GETHELPSTATES = 130, + PROTOCOL_GETHELPSTATES_RE = 131, + PROTOCOL_GETMAIL = 4204, + PROTOCOL_GETMAIL_RE = 4205, + PROTOCOL_GETMAILATTACHOBJ = 4206, + PROTOCOL_GETMAILATTACHOBJ_RE = 4207, + PROTOCOL_GETMAILLIST = 4202, + PROTOCOL_GETMAILLIST_RE = 4203, + PROTOCOL_GETPLAYERBRIEFINFO = 107, + PROTOCOL_GETPLAYERBRIEFINFO_RE = 108, + PROTOCOL_GETPLAYERFACTIONINFO = 4816, + PROTOCOL_GETPLAYERFACTIONINFO_RE = 4817, + PROTOCOL_GETPLAYERFACTIONRELATION = 4821, + PROTOCOL_GETPLAYERFACTIONRELATION_RE = 4822, + PROTOCOL_GETPLAYERIDBYNAME = 118, + PROTOCOL_GETPLAYERIDBYNAME_RE = 119, + PROTOCOL_GETREWARDLIST = 4952, + PROTOCOL_GETREWARDLIST_RE = 4953, + PROTOCOL_SENDMSG = 11, + // Protocol for QQ + PROTOCOL_ROLESTATUSANNOUNCE = 7, + PROTOCOL_DELIVERROLESTATUS = 9, + PROTOCOL_QQADDFRIEND = 12, + PROTOCOL_QQADDFRIEND_RE = 13, + PROTOCOL_TRADEEND = 4016, + PROTOCOL_GETSAVEDMSG = 217, + PROTOCOL_GETSAVEDMSG_RE = 218, + PROTOCOL_GETSELLLIST = 603, + PROTOCOL_GETSELLLIST_RE = 604, + PROTOCOL_GETTASKDATA = 111, + PROTOCOL_GETTASKDATA_RE = 112, + PROTOCOL_GETUICONFIG = 104, + PROTOCOL_GETUICONFIG_RE = 105, + PROTOCOL_GIFTCODEREDEEM = 4056, + PROTOCOL_GIFTCODEREDEEM_RE = 4057, + PROTOCOL_GMAILENDSYNC = 4216, + PROTOCOL_GMCONTROLGAME = 380, + PROTOCOL_GMCONTROLGAME_RE = 381, + PROTOCOL_GMFORBIDROLE = 366, + PROTOCOL_GMFORBIDROLE_RE = 367, + PROTOCOL_GMFORBIDSELLPOINT = 378, + PROTOCOL_GMFORBIDSELLPOINT_RE = 379, + PROTOCOL_GMGETPLAYERCONSUMEINFO = 382, + PROTOCOL_GMGETPLAYERCONSUMEINFO_RE = 383, + PROTOCOL_GMKICKOUTROLE = 360, + PROTOCOL_GMKICKOUTROLE_RE = 361, + PROTOCOL_GMKICKOUTUSER = 354, + PROTOCOL_GMKICKOUTUSER_RE = 355, + PROTOCOL_GMLISTONLINEUSER = 352, + PROTOCOL_GMLISTONLINEUSER_RE = 353, + PROTOCOL_GMONLINENUM = 350, + PROTOCOL_GMONLINENUM_RE = 351, + PROTOCOL_GMRESTARTSERVER = 358, + PROTOCOL_GMRESTARTSERVER_RE = 359, + PROTOCOL_GMSETTIMELESSAUTOLOCK = 385, + PROTOCOL_GMSETTIMELESSAUTOLOCK_RE = 386, + PROTOCOL_GMSHUTUP = 356, + PROTOCOL_GMSHUTUP_RE = 357, + PROTOCOL_GMSHUTUPROLE = 362, + PROTOCOL_GMSHUTUPROLE_RE = 363, + PROTOCOL_GMTOGGLECHAT = 364, + PROTOCOL_GMTOGGLECHAT_RE = 365, + PROTOCOL_GTRADEDISCARD = 4020, + PROTOCOL_GTRADEEND = 4019, + PROTOCOL_GTRADESTART = 4017, + PROTOCOL_GTRADESTART_RE = 4018, + PROTOCOL_INCREASEFORCEACTIVITY = 4705, + PROTOCOL_KECANDIDATEAPPLY = 4854, + PROTOCOL_KECANDIDATEAPPLY_RE = 4855, + PROTOCOL_KEEPALIVE = 90, + PROTOCOL_KEGETSTATUS = 4852, + PROTOCOL_KEGETSTATUS_RE = 4853, + PROTOCOL_KEKINGNOTIFY = 4864, + PROTOCOL_KEVOTING = 4858, + PROTOCOL_KEVOTING_RE = 4859, + PROTOCOL_KEYEXCHANGE = 2, + PROTOCOL_KEYREESTABLISH = 1105, + PROTOCOL_KICKOUTUSER = 10, + PROTOCOL_KICKOUTUSER2 = 1126, + PROTOCOL_MATRIXCHALLENGE = 551, + PROTOCOL_MATRIXFAILURE = 553, + PROTOCOL_MATRIXRESPONSE = 552, + PROTOCOL_MOBILESERVERREGISTER = 159, + PROTOCOL_NOTIFYFACTIONFORTRESSID = 4423, + PROTOCOL_NOTIFYFACTIONFORTRESSINFO2 = 4411, + PROTOCOL_NOTIFYFACTIONFORTRESSSTATE = 4410, + PROTOCOL_NOTIFYFACTIONPLAYERRENAME = 4424, + PROTOCOL_NOTIFYPLAYERJOINORLEAVEFORCE = 4704, + PROTOCOL_ONDIVORCE = 4048, + PROTOCOL_ONLINEANNOUNCE = 4, + PROTOCOL_PLAYERACCUSE = 161, + PROTOCOL_PLAYERACCUSE_RE = 162, + PROTOCOL_PLAYERASKFORPRESENT = 3068, + PROTOCOL_PLAYERASKFORPRESENT_RE = 3069, + PROTOCOL_PLAYERBASEINFO = 91, + PROTOCOL_PLAYERBASEINFO_RE = 92, + PROTOCOL_PLAYERBASEINFOCRC = 98, + PROTOCOL_PLAYERBASEINFOCRC_RE = 99, + PROTOCOL_PLAYERCHANGEDS = 1102, + PROTOCOL_PLAYERCHANGEDS_RE = 1103, + PROTOCOL_PLAYERENTERLEAVEGT = 4463, + PROTOCOL_PLAYERFACTIONINFO = 4801, + PROTOCOL_PLAYERFACTIONINFO_RE = 4802, + PROTOCOL_PLAYERGIVEPRESENT = 3065, + PROTOCOL_PLAYERGIVEPRESENT_RE = 3066, + PROTOCOL_PLAYERHEARTBEAT = 93, + PROTOCOL_PLAYERINFOUPDATE = 4460, + PROTOCOL_PLAYERKICKOUT = 63, + PROTOCOL_PLAYERKICKOUT_RE = 64, + PROTOCOL_PLAYERLOGIN = 65, + PROTOCOL_PLAYERLOGIN_RE = 66, + PROTOCOL_PLAYERLOGOUT = 69, + PROTOCOL_PLAYERNAMEUPDATE = 158, + PROTOCOL_PLAYEROFFLINE = 67, + PROTOCOL_PLAYEROFFLINE_RE = 68, + PROTOCOL_PLAYERPROFILEGETMATCHRESULT = 954, + PROTOCOL_PLAYERPROFILEGETMATCHRESULT_RE = 955, + PROTOCOL_PLAYERPROFILEGETPROFILEDATA = 951, + PROTOCOL_PLAYERPROFILEGETPROFILEDATA_RE = 952, + PROTOCOL_PLAYERPROFILESETPROFILEDATA = 953, + PROTOCOL_PLAYERRENAME = 3059, + PROTOCOL_PLAYERRENAME_RE = 3060, + PROTOCOL_PLAYERREQUITEFRIEND = 3072, + PROTOCOL_PLAYERSENDMAIL = 4212, + PROTOCOL_PLAYERSENDMAIL_RE = 4213, + PROTOCOL_PLAYERSENDMASSMAIL = 4217, + PROTOCOL_PLAYERSTATUSANNOUNCE = 109, + PROTOCOL_PLAYERSTATUSSYNC = 95, + PROTOCOL_PLAYERTEAMMEMBEROP = 4462, + PROTOCOL_PLAYERTEAMOP = 4461, + PROTOCOL_POSTFACTIONRENAME = 4531, + PROTOCOL_POSTPLAYERRENAME = 3063, + PROTOCOL_PRESERVEMAIL = 4210, + PROTOCOL_PRESERVEMAIL_RE = 4211, + PROTOCOL_PRIVATECHAT = 96, + PROTOCOL_PSHOPACTIVE = 914, + PROTOCOL_PSHOPACTIVE_RE = 915, + PROTOCOL_PSHOPBUY = 902, + PROTOCOL_PSHOPBUY_RE = 903, + PROTOCOL_PSHOPCANCELGOODS = 906, + PROTOCOL_PSHOPCANCELGOODS_RE = 907, + PROTOCOL_PSHOPCLEARGOODS = 920, + PROTOCOL_PSHOPCLEARGOODS_RE = 921, + PROTOCOL_PSHOPCREATE = 900, + PROTOCOL_PSHOPCREATE_RE = 901, + PROTOCOL_PSHOPDRAWITEM = 918, + PROTOCOL_PSHOPDRAWITEM_RE = 919, + PROTOCOL_PSHOPLIST = 926, + PROTOCOL_PSHOPLIST_RE = 927, + PROTOCOL_PSHOPLISTITEM = 928, + PROTOCOL_PSHOPLISTITEM_RE = 929, + PROTOCOL_PSHOPMANAGEFUND = 916, + PROTOCOL_PSHOPMANAGEFUND_RE = 917, + PROTOCOL_PSHOPPLAYERBUY = 908, + PROTOCOL_PSHOPPLAYERBUY_RE = 909, + PROTOCOL_PSHOPPLAYERGET = 924, + PROTOCOL_PSHOPPLAYERGET_RE = 925, + PROTOCOL_PSHOPPLAYERSELL = 910, + PROTOCOL_PSHOPPLAYERSELL_RE = 911, + PROTOCOL_PSHOPSELFGET = 922, + PROTOCOL_PSHOPSELFGET_RE = 923, + PROTOCOL_PSHOPSELL = 904, + PROTOCOL_PSHOPSELL_RE = 905, + PROTOCOL_PSHOPSETTYPE = 912, + PROTOCOL_PSHOPSETTYPE_RE = 913, + PROTOCOL_PUBLICCHAT = 79, + PROTOCOL_QPADDCASH = 152, + PROTOCOL_QPADDCASH_RE = 153, + PROTOCOL_QPANNOUNCEDISCOUNT = 149, + PROTOCOL_QPGETACTIVATEDSERVICES = 150, + PROTOCOL_QPGETACTIVATEDSERVICES_RE = 151, + PROTOCOL_QUERYGAMESERVERATTR = 512, + PROTOCOL_QUERYGAMESERVERATTR_RE = 513, + PROTOCOL_QUERYPLAYERSTATUS = 110, + PROTOCOL_QUERYREWARDTYPE = 510, + PROTOCOL_QUERYREWARDTYPE_RE = 511, + PROTOCOL_QUERYUSERFORBID = 508, + PROTOCOL_QUERYUSERFORBID_RE = 509, + PROTOCOL_QUERYUSERPRIVILEGE = 506, + PROTOCOL_QUERYUSERPRIVILEGE_RE = 507, + PROTOCOL_REFGETREFERENCECODE = 4908, + PROTOCOL_REFGETREFERENCECODE_RE = 4909, + PROTOCOL_REFLISTREFERRALS = 4904, + PROTOCOL_REFLISTREFERRALS_RE = 4905, + PROTOCOL_REFWITHDRAWBONUS = 4906, + PROTOCOL_REFWITHDRAWBONUS_RE = 4907, + PROTOCOL_REMOTELOG = 62, + PROTOCOL_REMOTELOGVITAL = 61, + PROTOCOL_REPORT2GM = 368, + PROTOCOL_REPORT2GM_RE = 369, + PROTOCOL_REPORTCHAT = 156, + PROTOCOL_REPORTIP = 35, + PROTOCOL_RESPONSE = 3, + PROTOCOL_REWARDMATURENOTICE = 4956, + PROTOCOL_ROLELIST = 82, + PROTOCOL_ROLELIST_RE = 83, + PROTOCOL_S2CBROADCAST = 78, + PROTOCOL_S2CGAMEDATASEND = 74, + PROTOCOL_S2CMULTICAST = 77, + PROTOCOL_SELECTROLE = 70, + PROTOCOL_SELECTROLE_RE = 71, + PROTOCOL_SELLCANCEL = 605, + PROTOCOL_SELLCANCEL_RE = 606, + PROTOCOL_SELLPOINT = 601, + PROTOCOL_SELLPOINT_RE = 602, + PROTOCOL_SENDAUCTIONBID = 822, + PROTOCOL_SENDAUMAIL = 233, + PROTOCOL_SENDAUMAIL_RE = 234, + PROTOCOL_SENDBATTLECHALLENGE = 869, + PROTOCOL_SENDREFADDBONUS = 4901, + PROTOCOL_SENDREFCASHUSED = 4902, + PROTOCOL_SENDREWARDADDBONUS = 4951, + PROTOCOL_SENDTASKREWARD = 4962, + PROTOCOL_SERVERFORBIDNOTIFY = 160, + PROTOCOL_SERVERTRIGGERNOTIFY = 163, + PROTOCOL_SETCHATEMOTION = 134, + PROTOCOL_SETCUSTOMDATA = 100, + PROTOCOL_SETCUSTOMDATA_RE = 101, + PROTOCOL_SETFRIENDGROUP = 210, + PROTOCOL_SETFRIENDGROUP_RE = 211, + PROTOCOL_SETGROUPNAME = 208, + PROTOCOL_SETGROUPNAME_RE = 209, + PROTOCOL_SETHELPSTATES = 128, + PROTOCOL_SETHELPSTATES_RE = 129, + PROTOCOL_SETMAXONLINENUM_RE = 374, + PROTOCOL_SETTASKDATA = 113, + PROTOCOL_SETTASKDATA_RE = 114, + PROTOCOL_SETUICONFIG = 102, + PROTOCOL_SETUICONFIG_RE = 103, + PROTOCOL_SNSROLEBRIEFUPDATE = 4471, + PROTOCOL_SSOGETTICKET = 147, + PROTOCOL_SSOGETTICKET_RE = 148, + PROTOCOL_SSOGETTICKETREQ = 8016, + PROTOCOL_STATINFO = 60, + PROTOCOL_STATINFOVITAL = 59, + PROTOCOL_STATUSANNOUNCE = 6, + PROTOCOL_STOCKACCOUNT = 407, + PROTOCOL_STOCKACCOUNT_RE = 408, + PROTOCOL_STOCKBILL = 405, + PROTOCOL_STOCKBILL_RE = 406, + PROTOCOL_STOCKCANCEL = 411, + PROTOCOL_STOCKCANCEL_RE = 412, + PROTOCOL_STOCKCOMMISSION = 401, + PROTOCOL_STOCKCOMMISSION_RE = 409, + PROTOCOL_STOCKTRANSACTION = 402, + PROTOCOL_STOCKTRANSACTION_RE = 410, + PROTOCOL_SWITCHSERVERCANCEL = 4102, + PROTOCOL_SWITCHSERVERSTART = 4101, + PROTOCOL_SWITCHSERVERSUCCESS = 4103, + PROTOCOL_SWITCHSERVERTIMEOUT = 4104, + PROTOCOL_SYNCFORCEGLOBALDATA = 4703, + PROTOCOL_SYNCSELLINFO = 609, + PROTOCOL_SYNMUTADATA = 146, + PROTOCOL_SYSAUCTIONACCOUNT = 4355, + PROTOCOL_SYSAUCTIONACCOUNT_RE = 4356, + PROTOCOL_SYSAUCTIONBID = 4357, + PROTOCOL_SYSAUCTIONBID_RE = 4358, + PROTOCOL_SYSAUCTIONCASHTRANSFER = 4359, + PROTOCOL_SYSAUCTIONCASHTRANSFER_RE = 4360, + PROTOCOL_SYSAUCTIONGETITEM = 4353, + PROTOCOL_SYSAUCTIONGETITEM_RE = 4354, + PROTOCOL_SYSAUCTIONLIST = 4351, + PROTOCOL_SYSAUCTIONLIST_RE = 4352, + PROTOCOL_SYSSENDMAIL_RE = 4215, + PROTOCOL_SYSSENDMAIL3_RE = 8069, + PROTOCOL_TANKBATTLEEND = 4879, + PROTOCOL_TANKBATTLEENTER = 4874, + PROTOCOL_TANKBATTLEPLAYERAPPLY = 4872, + PROTOCOL_TANKBATTLEPLAYERAPPLY_RE = 4873, + PROTOCOL_TANKBATTLEPLAYERENTER = 4875, + PROTOCOL_TANKBATTLEPLAYERGETRANK = 4881, + PROTOCOL_TANKBATTLEPLAYERGETRANK_RE = 4882, + PROTOCOL_TANKBATTLEPLAYERLEAVE = 4876, + PROTOCOL_TANKBATTLEPLAYERSCOREUPDATE = 4880, + PROTOCOL_TANKBATTLESERVERREGISTER = 4871, + PROTOCOL_TANKBATTLESTART = 4877, + PROTOCOL_TANKBATTLESTART_RE = 4878, + PROTOCOL_TOUCHPOINTCOST = 4052, + PROTOCOL_TOUCHPOINTCOST_RE = 4053, + PROTOCOL_TOUCHPOINTQUERY = 4050, + PROTOCOL_TOUCHPOINTQUERY_RE = 4051, + PROTOCOL_TRADEADDGOODS = 4004, + PROTOCOL_TRADEADDGOODS_RE = 4005, + PROTOCOL_TRADECONFIRM = 4012, + PROTOCOL_TRADECONFIRM_RE = 4013, + PROTOCOL_TRADEDISCARD = 4014, + PROTOCOL_TRADEDISCARD_RE = 4015, + PROTOCOL_TRADEMOVEOBJ = 4008, + PROTOCOL_TRADEMOVEOBJ_RE = 4009, + PROTOCOL_TRADEREMOVEGOODS = 4006, + PROTOCOL_TRADEREMOVEGOODS_RE = 4007, + PROTOCOL_TRADESTART = 4001, + PROTOCOL_TRADESTART_RE = 4002, + PROTOCOL_TRADESUBMIT = 4010, + PROTOCOL_TRADESUBMIT_RE = 4011, + PROTOCOL_TRANSBUYPOINT = 616, + PROTOCOL_TRYCHANGEDS = 1101, + PROTOCOL_UNDODELETEROLE = 88, + PROTOCOL_UNDODELETEROLE_RE = 89, + PROTOCOL_UNIQUEDATAMODIFYBROADCAST = 3118, + PROTOCOL_UNIQUEDATAMODIFYNOTICE = 3116, + PROTOCOL_UNIQUEDATAMODIFYREQUIRE = 3115, + PROTOCOL_UNIQUEDATASYNCH = 3117, + PROTOCOL_UPDATEREMAINTIME = 36, + PROTOCOL_USERADDCASH = 144, + PROTOCOL_USERADDCASH_RE = 145, + PROTOCOL_USERCOUPON = 138, + PROTOCOL_USERCOUPON_RE = 139, + PROTOCOL_USERCOUPONEXCHANGE = 140, + PROTOCOL_USERCOUPONEXCHANGE_RE = 141, + PROTOCOL_VERIFYMASTER = 519, + PROTOCOL_VERIFYMASTER_RE = 520, + PROTOCOL_WAITQUEUESTATENOTIFY = 164, + PROTOCOL_WEBTRADEATTENDLIST = 4312, + PROTOCOL_WEBTRADEATTENDLIST_RE = 4313, + PROTOCOL_WEBTRADEGETDETAIL = 4314, + PROTOCOL_WEBTRADEGETDETAIL_RE = 4315, + PROTOCOL_WEBTRADEGETITEM = 4310, + PROTOCOL_WEBTRADEGETITEM_RE = 4311, + PROTOCOL_WEBTRADELIST = 4308, + PROTOCOL_WEBTRADELIST_RE = 4309, + PROTOCOL_WEBTRADEPRECANCELPOST = 4305, + PROTOCOL_WEBTRADEPRECANCELPOST_RE = 4306, + PROTOCOL_WEBTRADEPREPOST = 4302, + PROTOCOL_WEBTRADEPREPOST_RE = 4303, + PROTOCOL_WEBTRADEROLEGETDETAIL = 4329, + PROTOCOL_WEBTRADEROLEPRECANCELPOST = 4328, + PROTOCOL_WEBTRADEROLEPREPOST = 4326, + PROTOCOL_WEBTRADEUPDATE = 4324, + PROTOCOL_WEBTRADEUPDATE_RE = 4325, + PROTOCOL_WORLDCHAT = 133, + RPC_ACTIVATEPLAYERDATA = 1107, + RPC_ADDFACTION = 4600, + RPC_ADDFRIENDRQST = 204, + RPC_ADDMEMBER = 4602, + RPC_ANNOUNCEFACTIONROLEDEL = 4811, + RPC_BATTLEEND = 859, + RPC_CANCHANGEROLENAME = 3403, + RPC_CASHSERIAL = 8009, + RPC_CLEARSTOREHOUSEPASSWD = 3402, + RPC_COUPONEXCHANGE = 8063, + RPC_DBAUCTIONBID = 811, + RPC_DBAUCTIONCLOSE = 815, + RPC_DBAUCTIONGET = 813, + RPC_DBAUCTIONLIST = 812, + RPC_DBAUCTIONOPEN = 810, + RPC_DBAUCTIONTIMEOUT = 814, + RPC_DBAUTOLOCKGET = 392, + RPC_DBAUTOLOCKSET = 784, + RPC_DBAUTOLOCKSETOFFLINE = 391, + RPC_DBBATTLEBONUS = 872, + RPC_DBBATTLECHALLENGE = 865, + RPC_DBBATTLEEND = 868, + RPC_DBBATTLELOAD = 863, + RPC_DBBATTLEMAIL = 871, + RPC_DBBATTLESET = 864, + RPC_DBBUYPOINT = 615, + RPC_DBCLEARCONSUMABLE = 7000, + RPC_DBCOPYROLE = 5101, + RPC_DBCOUNTRYBATTLEBONUS = 4771, + RPC_DBCREATEFACTIONFORTRESS = 4408, + RPC_DBCREATEROLE = 3007, + RPC_DBDELETEMAIL = 4256, + RPC_DBDELETEROLE = 3008, + RPC_DBDELFACTIONFORTRESS = 4403, + RPC_DBEXCHANGECONSUMEPOINTS = 4960, + RPC_DBFACTIONALLIANCEAPPLY = 4612, + RPC_DBFACTIONALLIANCEREPLY = 4613, + RPC_DBFACTIONFORTRESSCHALLENGE = 4418, + RPC_DBFACTIONFORTRESSLOAD = 4401, + RPC_DBFACTIONHOSTILEAPPLY = 4614, + RPC_DBFACTIONHOSTILEREPLY = 4615, + RPC_DBFACTIONPROMOTE = 4611, + RPC_DBFACTIONRELATIONAPPLYTIMEOUT = 4619, + RPC_DBFACTIONRELATIONTIMEOUT = 4618, + RPC_DBFACTIONREMOVERELATIONAPPLY = 4616, + RPC_DBFACTIONREMOVERELATIONREPLY = 4617, + RPC_DBFACTIONRENAME = 4530, + RPC_DBFACTIONRESOURCEBATTLEBONUS = 4432, + RPC_DBFACTIONUPGRADE = 4610, + RPC_DBFORBIDUSER = 5037, + RPC_DBFORCELOAD = 4701, + RPC_DBGAMETALKFACTIONINFO = 4453, + RPC_DBGAMETALKROLEINFO = 4455, + RPC_DBGAMETALKROLELIST = 4451, + RPC_DBGAMETALKROLERELATION = 4452, + RPC_DBGAMETALKROLESTATUS = 4454, + RPC_DBGETCONSUMEINFOS = 384, + RPC_DBGETMAIL = 4252, + RPC_DBGETMAILATTACH = 4253, + RPC_DBGETMAILLIST = 4251, + RPC_DBGETPLAYERPROFILEDATA = 956, + RPC_DBGETREWARD = 4957, + RPC_DBKECANDIDATEAPPLY = 4856, + RPC_DBKECANDIDATECONFIRM = 4857, + RPC_DBKEDELETECANDIDATE = 4863, + RPC_DBKEDELETEKING = 4862, + RPC_DBKEKINGCONFIRM = 4861, + RPC_DBKELOAD = 4851, + RPC_DBKEVOTING = 4860, + RPC_DBLOADGLOBALCONTROL = 3111, + RPC_DBMAPPASSWORDLOAD = 3043, + RPC_DBMAPPASSWORDSAVE = 3044, + RPC_DBMODIFYROLEDATA = 8005, + RPC_DBPLAYERASKFORPRESENT = 3070, + RPC_DBPLAYERCHANGEGENDER = 3071, + RPC_DBPLAYERGIVEPRESENT = 3067, + RPC_DBPLAYERPOSITIONRESET = 3110, + RPC_DBPLAYERRENAME = 3062, + RPC_DBPLAYERREQUITEFRIEND = 3073, + RPC_DBPSHOPACTIVE = 937, + RPC_DBPSHOPBUY = 931, + RPC_DBPSHOPCANCELGOODS = 933, + RPC_DBPSHOPCLEARGOODS = 942, + RPC_DBPSHOPCREATE = 930, + RPC_DBPSHOPDRAWITEM = 939, + RPC_DBPSHOPGET = 941, + RPC_DBPSHOPLOAD = 940, + RPC_DBPSHOPMANAGEFUND = 938, + RPC_DBPSHOPPLAYERBUY = 934, + RPC_DBPSHOPPLAYERSELL = 935, + RPC_DBPSHOPSELL = 932, + RPC_DBPSHOPSETTYPE = 936, + RPC_DBPSHOPTIMEOUT = 943, + RPC_DBPUTCONSUMEPOINTS = 4958, + RPC_DBPUTFACTIONFORTRESS = 4402, + RPC_DBPUTFORCE = 4702, + RPC_DBPUTGLOBALCONTROL = 3112, + RPC_DBPUTPLAYERPROFILEDATA = 957, + RPC_DBPUTREWARDBONUS = 4961, + RPC_DBRAWREAD = 3055, + RPC_DBREFGETREFERRAL = 4910, + RPC_DBREFGETREFERRER = 4911, + RPC_DBREFUPDATEREFERRAL = 4912, + RPC_DBREFUPDATEREFERRER = 4913, + RPC_DBREFWITHDRAWTRANS = 4903, + RPC_DBREWARDMATURE = 4959, + RPC_DBROLENAMELIST = 3064, + RPC_DBSELLCANCEL = 614, + RPC_DBSELLPOINT = 611, + RPC_DBSELLTIMEOUT = 613, + RPC_DBSENDMAIL = 4255, + RPC_DBSENDMASSMAIL = 4257, + RPC_DBSETCASHPASSWORD = 3100, + RPC_DBSETMAILATTR = 4254, + RPC_DBSTOCKBALANCE = 413, + RPC_DBSTOCKCANCEL = 417, + RPC_DBSTOCKCOMMISSION = 416, + RPC_DBSTOCKLOAD = 415, + RPC_DBSTOCKTRANSACTION = 414, + RPC_DBSYNCSELLINFO = 612, + RPC_DBSYSAUCTIONCASHSPEND = 4362, + RPC_DBSYSAUCTIONCASHTRANSFER = 4361, + RPC_DBSYSMAIL3 = 4221, + RPC_DBTANKBATTLEBONUS = 4883, + RPC_DBTRANSPOINTDEAL = 618, + RPC_DBUNDODELETEROLE = 3009, + RPC_DBUNIQUEDATALOAD = 3113, + RPC_DBUNIQUEDATASAVE = 3114, + RPC_DBUPDATEPLAYERCROSSINFO = 1125, + RPC_DBVERIFYMASTER = 4609, + RPC_DBWEBTRADECANCELPOST = 4317, + RPC_DBWEBTRADECANCELSHELF = 4319, + RPC_DBWEBTRADEGETROLESIMPLEINFO = 4322, + RPC_DBWEBTRADELOAD = 4301, + RPC_DBWEBTRADELOADSOLD = 4323, + RPC_DBWEBTRADEPOST = 4316, + RPC_DBWEBTRADEPOSTEXPIRE = 4321, + RPC_DBWEBTRADEPRECANCELPOST = 4307, + RPC_DBWEBTRADEPREPOST = 4304, + RPC_DBWEBTRADESHELF = 4318, + RPC_DBWEBTRADESOLD = 4320, + RPC_DELFACTION = 4601, + RPC_DELMEMBER = 4603, + RPC_DELMEMBERSCHEDULE = 4620, + RPC_DELPLAYERDATA = 1124, + RPC_DELROLE = 3006, + RPC_DELUSER = 3003, + RPC_FACTIONINVITEJOIN = 4813, + RPC_FETCHPLAYERDATA = 1106, + RPC_FORBIDUSER = 8004, + RPC_FREEZEPLAYERDATA = 1112, + RPC_GETADDCASHSN = 514, + RPC_GETCASHTOTAL = 3058, + RPC_GETFACTIONDETAIL = 4608, + RPC_GETFACTIONFORTRESS = 4404, + RPC_GETFACTIONINFO = 4606, + RPC_GETFRIENDLIST = 201, + RPC_GETMESSAGE = 216, + RPC_GETMONEYINVENTORY = 3022, + RPC_GETROLE = 3005, + RPC_GETROLEBASE = 3013, + RPC_GETROLEBASESTATUS = 3025, + RPC_GETROLEDATA = 8003, + RPC_GETROLEEQUIPMENT = 3017, + RPC_GETROLEFORBID = 3031, + RPC_GETROLEID = 3033, + RPC_GETROLEINFO = 3051, + RPC_GETROLEPOCKET = 3053, + RPC_GETROLESTATUS = 3015, + RPC_GETROLESTOREHOUSE = 3027, + RPC_GETROLETASK = 3019, + RPC_GETSERVERDATA = 3057, + RPC_GETTASKDATARPC = 115, + RPC_GETUSER = 3002, + RPC_GETUSERCOUPON = 8062, + RPC_GETUSERFACTION = 4607, + RPC_GETUSERROLES = 3401, + RPC_GQUERYPASSWD = 502, + RPC_MATRIXPASSWD = 550, + RPC_MATRIXPASSWD2 = 8066, + RPC_MATRIXTOKEN = 8070, + RPC_MOVEROLECREATE = 3415, + RPC_PLAYERIDENTITYMATCH = 1113, + RPC_PLAYERPOSITIONRESETRQST = 155, + RPC_POSTCREATEFACTION = 3041, + RPC_POSTCREATEFAMILY = 3049, + RPC_POSTCREATEROLE = 3038, + RPC_POSTDELETEFACTION = 3042, + RPC_POSTDELETEFAMILY = 3050, + RPC_POSTDELETEROLE = 3039, + RPC_PRECREATEFACTION = 3040, + RPC_PRECREATEFAMILY = 3046, + RPC_PRECREATEROLE = 3037, + RPC_PREFACTIONRENAME = 4529, + RPC_PREPLAYERRENAME = 3061, + RPC_PUTFACTIONFORTRESS = 4405, + RPC_PUTFRIENDLIST = 200, + RPC_PUTMESSAGE = 215, + RPC_PUTMONEYINVENTORY = 3023, + RPC_PUTROLE = 3024, + RPC_PUTROLEBASE = 3012, + RPC_PUTROLEDATA = 8002, + RPC_PUTROLEEQUIPMENT = 3016, + RPC_PUTROLEFORBID = 3030, + RPC_PUTROLEPOCKET = 3052, + RPC_PUTROLESTATUS = 3014, + RPC_PUTROLESTOREHOUSE = 3026, + RPC_PUTROLETASK = 3018, + RPC_PUTSERVERDATA = 3056, + RPC_PUTSPOUSE = 4047, + RPC_PUTTASKDATARPC = 135, + RPC_PUTUSER = 3001, + RPC_QUERYUSERID = 8001, + RPC_RENAMEROLE = 3404, + RPC_ROLEID2UID = 3412, + RPC_ROLENAMEEXISTS = 3413, + RPC_SAVEPLAYERDATA = 1114, + RPC_SYSAUCTIONPREPAREITEM = 4363, + RPC_TOUCHPLAYERDATA = 1108, + RPC_TRADEINVENTORY = 3020, + RPC_TRADESAVE = 3021, + RPC_TRADESTARTRQST = 4003, + RPC_TRANSACTIONABORT = 3035, + RPC_TRANSACTIONACQUIRE = 3034, + RPC_TRANSACTIONCOMMIT = 3036, + RPC_UID2LOGICUID = 3411, + RPC_UPDATEFACTION = 4605, + RPC_UPDATEUSERFACTION = 4604, + RPC_USERLOGIN = 15, + RPC_USERLOGIN2 = 8067, + RPC_USERLOGOUT = 33, + RPC_USERROLECOUNT = 3414, + }; +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ProtocolTypes.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ProtocolTypes.cs.meta new file mode 100644 index 0000000000..ad0c53bd04 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ProtocolTypes.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9e255f60e204e4e47b00bd2a2051a9bc \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/RoleListResponse.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/RoleListResponse.cs new file mode 100644 index 0000000000..c7e549997a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/RoleListResponse.cs @@ -0,0 +1,56 @@ +using CSNetwork.Protocols.RPCData; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class RoleListResponse : Protocol + { + public int result; + public int handle; + public int userid; + public uint localsid; + public List rolelist = new List(); + + public RoleListResponse() : base(Protocols.ProtocolType.PROTOCOL_ROLELIST_RE) + { + } + + public RoleListResponse(int l_result, int l_handle, int l_userid, uint l_localsid, List l_rolelist) + : base(ProtocolType.PROTOCOL_ROLELIST_RE) + { + result = l_result; + handle = l_handle; + userid = l_userid; + this.localsid = l_localsid; + rolelist = l_rolelist; + } + + public override Protocol Clone() + { + var clonedList = new List(); + //foreach (var item in rolelist) + //{ + // clonedList.Add((RoleInfo)item.Clone()); + //} + return new RoleListResponse(result, handle, userid, localsid, clonedList); + } + + public override void Marshal(OctetsStream os) + { + os.Write(result); + os.Write(handle); + os.Write(userid); + os.Write(localsid); + os.WriteList(rolelist); + } + + public override void Unmarshal(OctetsStream os) + { + result = os.ReadInt32(); + handle = os.ReadInt32(); + userid = os.ReadInt32(); + localsid = os.ReadUInt32(); + os.ReadList(rolelist); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/RoleListResponse.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/RoleListResponse.cs.meta new file mode 100644 index 0000000000..2531dd6725 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/RoleListResponse.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 522924a3f6cbe476f8eeee9c76711e61 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ShopProtocols.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ShopProtocols.cs new file mode 100644 index 0000000000..f1ef1ead11 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ShopProtocols.cs @@ -0,0 +1,54 @@ +namespace CSNetwork.Protocols +{ + public class PShopPlayerSell : Protocol + { + public uint ItemId { get; set; } + public uint Count { get; set; } + public uint Price { get; set; } + + public PShopPlayerSell() + : base(ProtocolType.PROTOCOL_PSHOPPLAYERSELL) { } + + public override Protocol Clone() => + new PShopPlayerSell + { + ItemId = ItemId, + Count = Count, + Price = Price + }; + + public override void Marshal(OctetsStream os) + { + os.WriteCompactUInt(ItemId); + os.WriteCompactUInt(Count); + os.WriteCompactUInt(Price); + } + + public override void Unmarshal(OctetsStream os) + { + ItemId = os.ReadCompactUInt(); + Count = os.ReadCompactUInt(); + Price = os.ReadCompactUInt(); + } + } + + public class PShopDrawItem : Protocol + { + public uint ItemId { get; set; } + + public PShopDrawItem() + : base(ProtocolType.PROTOCOL_PSHOPDRAWITEM) { } + + public override Protocol Clone() => new PShopDrawItem { ItemId = ItemId }; + + public override void Marshal(OctetsStream os) + { + os.WriteCompactUInt(ItemId); + } + + public override void Unmarshal(OctetsStream os) + { + ItemId = os.ReadCompactUInt(); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ShopProtocols.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ShopProtocols.cs.meta new file mode 100644 index 0000000000..4b93598f17 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ShopProtocols.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 77a18a02db1934866bc5f44896774935 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acanswer.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acanswer.cs new file mode 100644 index 0000000000..dcc6433af8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acanswer.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class acanswer : Protocol + { + public int Roleid { get; set; } + public int Qtype { get; set; } + public int Seq { get; set; } + public int Reserved { get; set; } + public int Answer { get; set; } + + public acanswer() + : base(ProtocolType.PROTOCOL_ACANSWER) { } + + public override Protocol Clone() => + new acanswer + { + Roleid = Roleid, + Qtype = Qtype, + Seq = Seq, + Reserved = Reserved, + Answer = Answer + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Qtype); + os.Write(Seq); + os.Write(Reserved); + os.Write(Answer); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Qtype = os.ReadInt32(); + Seq = os.ReadInt32(); + Reserved = os.ReadInt32(); + Answer = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 8192; + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acanswer.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acanswer.cs.meta new file mode 100644 index 0000000000..1e053ac741 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acanswer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c020e278cf3d14fdb8cf02cf5cb44ba9 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/accountloginrecord.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/accountloginrecord.cs new file mode 100644 index 0000000000..b1391ee444 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/accountloginrecord.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class accountloginrecord : Protocol + { + public int Userid { get; set; } + public int Localsid { get; set; } + public int Login_time { get; set; } + public int Login_ip { get; set; } + public int Current_ip { get; set; } + + public accountloginrecord() : base(ProtocolType.PROTOCOL_ACCOUNTLOGINRECORD) + { + + } + + public override Protocol Clone() => new accountloginrecord + { + Userid = Userid, + Localsid = Localsid, + Login_time = Login_time, + Login_ip = Login_ip, + Current_ip = Current_ip + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + os.Write(Login_time); + os.Write(Login_ip); + os.Write(Current_ip); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Login_time = os.ReadInt32(); + Login_ip = os.ReadInt32(); + Current_ip = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/accountloginrecord.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/accountloginrecord.cs.meta new file mode 100644 index 0000000000..155d5ef477 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/accountloginrecord.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bf5350fb7eeb246719925a633662ba7e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acquestion.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acquestion.cs new file mode 100644 index 0000000000..fa93202cbf --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acquestion.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class acquestion : Protocol + { + public int Roleid { get; set; } + public int Qtype { get; set; } + public int Seq { get; set; } + public int Reserved { get; set; } + + public acquestion() + : base(ProtocolType.PROTOCOL_ACQUESTION) { } + + public override Protocol Clone() => + new acquestion + { + Roleid = Roleid, + Qtype = Qtype, + Seq = Seq, + Reserved = Reserved + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Qtype); + os.Write(Seq); + os.Write(Reserved); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Qtype = os.ReadInt32(); + Seq = os.ReadInt32(); + Reserved = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 8192; + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acquestion.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acquestion.cs.meta new file mode 100644 index 0000000000..b1a254654b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acquestion.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 658e7c69e9357422f860997a0bd1710e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acremotecode.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acremotecode.cs new file mode 100644 index 0000000000..e300e00ed9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acremotecode.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class acremotecode : Protocol + { + public int Dstroleid { get; set; } + public List Content { get; set; } + + public acremotecode() : base(ProtocolType.PROTOCOL_ACREMOTECODE) + { + Content = new List(); + } + + public override Protocol Clone() => new acremotecode + { + Dstroleid = Dstroleid, + Content = new List(Content) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Dstroleid); + os.Write(Content); + } + + public override void Unmarshal(OctetsStream os) + { + Dstroleid = os.ReadInt32(); + Content = os.ReadOctetsList(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 8192; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acremotecode.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acremotecode.cs.meta new file mode 100644 index 0000000000..c2cc6d998c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acremotecode.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0d5c63d1fe34446e9876ff678206c44b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acreport.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acreport.cs new file mode 100644 index 0000000000..32fbd5d622 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acreport.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class acreport : Protocol + { + public int Roleid { get; set; } + public Octets Report { get; set; } + + public acreport() : base(ProtocolType.PROTOCOL_ACREPORT) + { + Report = new Octets(); + } + + public override Protocol Clone() => new acreport + { + Roleid = Roleid, + Report = new Octets(Report.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Report); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Report = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 8192; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acreport.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acreport.cs.meta new file mode 100644 index 0000000000..dc4b2d64e3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/acreport.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8f45ff5bce92742e68d26c68a9e5b128 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriend.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriend.cs new file mode 100644 index 0000000000..7ceb999e25 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriend.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class addfriend : Protocol + { + public int Srcroleid { get; set; } + public int Dstroleid { get; set; } + public Octets Dstname { get; set; } + public int Srclsid { get; set; } + + public addfriend() : base(ProtocolType.PROTOCOL_ADDFRIEND) + { + Dstname = new Octets(); + } + + public override Protocol Clone() => new addfriend + { + Srcroleid = Srcroleid, + Dstroleid = Dstroleid, + Dstname = new Octets(Dstname.ToArray()), + Srclsid = Srclsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Srcroleid); + os.Write(Dstroleid); + os.Write(Dstname); + os.Write(Srclsid); + } + + public override void Unmarshal(OctetsStream os) + { + Srcroleid = os.ReadInt32(); + Dstroleid = os.ReadInt32(); + Dstname = os.ReadOctets(); + Srclsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriend.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriend.cs.meta new file mode 100644 index 0000000000..6b2b2cb670 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriend.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1da6a1381aa374bce957e8a3a64ace83 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriendremarks.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriendremarks.cs new file mode 100644 index 0000000000..e7f66e7e29 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriendremarks.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class addfriendremarks : Protocol + { + public int Roleid { get; set; } + public int Friendroleid { get; set; } + public Octets Friendremarks { get; set; } + public int Srclsid { get; set; } + + public addfriendremarks() : base(ProtocolType.PROTOCOL_ADDFRIENDREMARKS) + { + Friendremarks = new Octets(); + } + + public override Protocol Clone() => new addfriendremarks + { + Roleid = Roleid, + Friendroleid = Friendroleid, + Friendremarks = new Octets(Friendremarks.ToArray()), + Srclsid = Srclsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Friendroleid); + os.Write(Friendremarks); + os.Write(Srclsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Friendroleid = os.ReadInt32(); + Friendremarks = os.ReadOctets(); + Srclsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriendremarks.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriendremarks.cs.meta new file mode 100644 index 0000000000..ce8ed1fd53 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/addfriendremarks.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e3905603a43bc45bf84298688ea2b362 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announceforbidinfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announceforbidinfo.cs new file mode 100644 index 0000000000..3380bb296c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announceforbidinfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class announceforbidinfo : Protocol + { + public int Userid { get; set; } + public int Localsid { get; set; } + + public announceforbidinfo() : base(ProtocolType.PROTOCOL_ANNOUNCEFORBIDINFO) + { + + } + + public override Protocol Clone() => new announceforbidinfo + { + Userid = Userid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 384; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announceforbidinfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announceforbidinfo.cs.meta new file mode 100644 index 0000000000..616c7f2123 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announceforbidinfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 340c8b40b53fc41559b323dafc4e644f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcenewmail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcenewmail.cs new file mode 100644 index 0000000000..04ed39ab32 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcenewmail.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class announcenewmail : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Remain_time { get; set; } + public byte Present_type { get; set; } + public byte L_present_type { get; set; } + + public announcenewmail() : base(ProtocolType.PROTOCOL_ANNOUNCENEWMAIL) + { + + } + + public override Protocol Clone() => new announcenewmail + { + Roleid = Roleid, + Localsid = Localsid, + Remain_time = Remain_time, + Present_type = Present_type, + L_present_type = L_present_type + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Remain_time); + os.Write(Present_type); + os.Write(L_present_type); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Remain_time = os.ReadInt32(); + Present_type = os.ReadByte(); + L_present_type = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcenewmail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcenewmail.cs.meta new file mode 100644 index 0000000000..f8dab0b3df --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcenewmail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7141c5a30572f4163b62efc2a06f909a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcesellresult.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcesellresult.cs new file mode 100644 index 0000000000..81afd7fb33 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcesellresult.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class announcesellresult : Protocol + { + public int Retcode { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Sellid { get; set; } + public int Seller { get; set; } + public int Point { get; set; } + public int Price { get; set; } + public int L_sellid { get; set; } + + public announcesellresult() : base(ProtocolType.PROTOCOL_ANNOUNCESELLRESULT) + { + + } + + public override Protocol Clone() => new announcesellresult + { + Retcode = Retcode, + Roleid = Roleid, + Localsid = Localsid, + Sellid = Sellid, + Seller = Seller, + Point = Point, + Price = Price, + L_sellid = L_sellid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Retcode); + os.Write(Roleid); + os.Write(Localsid); + os.Write(Sellid); + os.Write(Seller); + os.Write(Point); + os.Write(Price); + os.Write(L_sellid); + } + + public override void Unmarshal(OctetsStream os) + { + Retcode = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Sellid = os.ReadInt32(); + Seller = os.ReadInt32(); + Point = os.ReadInt32(); + Price = os.ReadInt32(); + L_sellid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcesellresult.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcesellresult.cs.meta new file mode 100644 index 0000000000..fee6e95657 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/announcesellresult.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2a7729779b2ec479689e86a7aba9df2a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionattendlist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionattendlist.cs new file mode 100644 index 0000000000..c96a20ecf9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionattendlist.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctionattendlist : Protocol + { + public int Roleid { get; set; } + public int Gettype { get; set; } + public int Localsid { get; set; } + + public auctionattendlist() : base(ProtocolType.PROTOCOL_AUCTIONATTENDLIST) + { + + } + + public override Protocol Clone() => new auctionattendlist + { + Roleid = Roleid, + Gettype = Gettype, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Gettype); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Gettype = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionattendlist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionattendlist.cs.meta new file mode 100644 index 0000000000..eca40c0858 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionattendlist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f9aa55bc722364d389706c081cf6ca8b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionbid.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionbid.cs new file mode 100644 index 0000000000..683cbf49fa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionbid.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctionbid : Protocol + { + public int Roleid { get; set; } + public int Auctionid { get; set; } + public int Bidprice { get; set; } + public byte Bin { get; set; } + public int Localsid { get; set; } + public int Money { get; set; } + public int L_auctionid { get; set; } + + public auctionbid() : base(ProtocolType.PROTOCOL_AUCTIONBID) + { + + } + + public override Protocol Clone() => new auctionbid + { + Roleid = Roleid, + Auctionid = Auctionid, + Bidprice = Bidprice, + Bin = Bin, + Localsid = Localsid, + Money = Money, + L_auctionid = L_auctionid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Auctionid); + os.Write(Bidprice); + os.Write(Bin); + os.Write(Localsid); + os.Write(Money); + os.Write(L_auctionid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Auctionid = os.ReadInt32(); + Bidprice = os.ReadInt32(); + Bin = os.ReadByte(); + Localsid = os.ReadInt32(); + Money = os.ReadInt32(); + L_auctionid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionbid.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionbid.cs.meta new file mode 100644 index 0000000000..9b317163f0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionbid.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2dbe62fd70be541efa4d818c46b267f1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionclose.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionclose.cs new file mode 100644 index 0000000000..b58117397f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionclose.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctionclose : Protocol + { + public int Roleid { get; set; } + public int Auctionid { get; set; } + public byte Reason { get; set; } + public int Localsid { get; set; } + + public auctionclose() : base(ProtocolType.PROTOCOL_AUCTIONCLOSE) + { + + } + + public override Protocol Clone() => new auctionclose + { + Roleid = Roleid, + Auctionid = Auctionid, + Reason = Reason, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Auctionid); + os.Write(Reason); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Auctionid = os.ReadInt32(); + Reason = os.ReadByte(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionclose.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionclose.cs.meta new file mode 100644 index 0000000000..daa1b936ef --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionclose.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3c386f6d396bb43e6b02b9906d727641 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionexitbid.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionexitbid.cs new file mode 100644 index 0000000000..647e1432ed --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionexitbid.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctionexitbid : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Auctionid { get; set; } + + public auctionexitbid() : base(ProtocolType.PROTOCOL_AUCTIONEXITBID) + { + + } + + public override Protocol Clone() => new auctionexitbid + { + Roleid = Roleid, + Localsid = Localsid, + Auctionid = Auctionid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Auctionid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Auctionid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionexitbid.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionexitbid.cs.meta new file mode 100644 index 0000000000..26b0570926 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionexitbid.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0374254cedbb84a8996b68cd57595c69 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionget.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionget.cs new file mode 100644 index 0000000000..2faf4b65cc --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionget.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctionget : Protocol + { + public int Roleid { get; set; } + public int Auctionid { get; set; } + public int Localsid { get; set; } + public int L_auctionid { get; set; } + + public auctionget() : base(ProtocolType.PROTOCOL_AUCTIONGET) + { + + } + + public override Protocol Clone() => new auctionget + { + Roleid = Roleid, + Auctionid = Auctionid, + Localsid = Localsid, + L_auctionid = L_auctionid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Auctionid); + os.Write(Localsid); + os.Write(L_auctionid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Auctionid = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_auctionid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionget.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionget.cs.meta new file mode 100644 index 0000000000..e1e7590798 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionget.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3fb148b7ae0d64423b50f0012b09ac44 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctiongetitem.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctiongetitem.cs new file mode 100644 index 0000000000..e2afe51093 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctiongetitem.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctiongetitem : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public auctiongetitem() : base(ProtocolType.PROTOCOL_AUCTIONGETITEM) + { + + } + + public override Protocol Clone() => new auctiongetitem + { + Roleid = Roleid, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctiongetitem.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctiongetitem.cs.meta new file mode 100644 index 0000000000..35e9c6ce8b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctiongetitem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 710fc6794c9f64da5af84708663ffaca \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlist.cs new file mode 100644 index 0000000000..ca7f4de8d4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlist.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctionlist : Protocol + { + public int Roleid { get; set; } + public short Category { get; set; } + public int Item_id { get; set; } + public int Begin { get; set; } + public byte Reverse { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public auctionlist() : base(ProtocolType.PROTOCOL_AUCTIONLIST) + { + + } + + public override Protocol Clone() => new auctionlist + { + Roleid = Roleid, + Category = Category, + Item_id = Item_id, + Begin = Begin, + Reverse = Reverse, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Category); + os.Write(Item_id); + os.Write(Begin); + os.Write(Reverse); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Category = os.ReadInt16(); + Item_id = os.ReadInt32(); + Begin = os.ReadInt32(); + Reverse = os.ReadByte(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlist.cs.meta new file mode 100644 index 0000000000..37a2612953 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: afd3ac7d14fe641419ed7be941950bd1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlistupdate.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlistupdate.cs new file mode 100644 index 0000000000..a21f93d124 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlistupdate.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctionlistupdate : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public auctionlistupdate() : base(ProtocolType.PROTOCOL_AUCTIONLISTUPDATE) + { + + } + + public override Protocol Clone() => new auctionlistupdate + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlistupdate.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlistupdate.cs.meta new file mode 100644 index 0000000000..ffc0c05265 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionlistupdate.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bec9344958c044986bfeb10d6268be11 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionopen.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionopen.cs new file mode 100644 index 0000000000..93b2267062 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionopen.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class auctionopen : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public short Category { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_num { get; set; } + public int Baseprice { get; set; } + public int Binprice { get; set; } + public int Elapse_time { get; set; } + public int Deposit { get; set; } + public Octets Syncdata { get; set; } + public int L_localsid { get; set; } + + public auctionopen() : base(ProtocolType.PROTOCOL_AUCTIONOPEN) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new auctionopen + { + Roleid = Roleid, + Localsid = Localsid, + Category = Category, + Item_id = Item_id, + Item_pos = Item_pos, + Item_num = Item_num, + Baseprice = Baseprice, + Binprice = Binprice, + Elapse_time = Elapse_time, + Deposit = Deposit, + Syncdata = new Octets(Syncdata.ToArray()), + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Category); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_num); + os.Write(Baseprice); + os.Write(Binprice); + os.Write(Elapse_time); + os.Write(Deposit); + os.Write(Syncdata); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Category = os.ReadInt16(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_num = os.ReadInt32(); + Baseprice = os.ReadInt32(); + Binprice = os.ReadInt32(); + Elapse_time = os.ReadInt32(); + Deposit = os.ReadInt32(); + Syncdata = os.ReadOctets(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionopen.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionopen.cs.meta new file mode 100644 index 0000000000..61fdca350a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/auctionopen.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6ae18bfd5a85a48319d23fa0d19ec486 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autolockset.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autolockset.cs new file mode 100644 index 0000000000..dee84386d1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autolockset.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class autolockset : Protocol + { + public int Roleid { get; set; } + public int Userid { get; set; } + public int Timeout { get; set; } + public int Localsid { get; set; } + + public autolockset() + : base(ProtocolType.PROTOCOL_AUTOLOCKSET) { } + + public override Protocol Clone() => + new autolockset + { + Roleid = Roleid, + Userid = Userid, + Timeout = Timeout, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Userid); + os.Write(Timeout); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Userid = os.ReadInt32(); + Timeout = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autolockset.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autolockset.cs.meta new file mode 100644 index 0000000000..ef776664fa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autolockset.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8cb1622b7f7f746c9ae0ef6b7298e429 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autoteamplayerleave.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autoteamplayerleave.cs new file mode 100644 index 0000000000..d3e4e65460 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autoteamplayerleave.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class autoteamplayerleave : Protocol + { + public int Roleid { get; set; } + public byte Reason { get; set; } + public int Localsid { get; set; } + + public autoteamplayerleave() : base(ProtocolType.PROTOCOL_AUTOTEAMPLAYERLEAVE) + { + + } + + public override Protocol Clone() => new autoteamplayerleave + { + Roleid = Roleid, + Reason = Reason, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Reason); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Reason = os.ReadByte(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autoteamplayerleave.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autoteamplayerleave.cs.meta new file mode 100644 index 0000000000..afc6af5d72 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/autoteamplayerleave.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 765875f944f034f149443ef1b6e1d2a7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallenge.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallenge.cs new file mode 100644 index 0000000000..d92acb0eb9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallenge.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class battlechallenge : Protocol + { + public int Roleid { get; set; } + public short Id { get; set; } + public int Factionid { get; set; } + public int Deposit { get; set; } + public int Authentication { get; set; } + public int Localsid { get; set; } + public int L_factionid { get; set; } + + public battlechallenge() : base(ProtocolType.PROTOCOL_BATTLECHALLENGE) + { + + } + + public override Protocol Clone() => new battlechallenge + { + Roleid = Roleid, + Id = Id, + Factionid = Factionid, + Deposit = Deposit, + Authentication = Authentication, + Localsid = Localsid, + L_factionid = L_factionid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Id); + os.Write(Factionid); + os.Write(Deposit); + os.Write(Authentication); + os.Write(Localsid); + os.Write(L_factionid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Id = os.ReadInt16(); + Factionid = os.ReadInt32(); + Deposit = os.ReadInt32(); + Authentication = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_factionid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallenge.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallenge.cs.meta new file mode 100644 index 0000000000..6f45f6b25b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallenge.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c40a9a40562774bebb913a2b26d8521a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallengemap.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallengemap.cs new file mode 100644 index 0000000000..8bf010c111 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallengemap.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class battlechallengemap : Protocol + { + public int Roleid { get; set; } + public int Factionid { get; set; } + public int Localsid { get; set; } + + public battlechallengemap() : base(ProtocolType.PROTOCOL_BATTLECHALLENGEMAP) + { + + } + + public override Protocol Clone() => new battlechallengemap + { + Roleid = Roleid, + Factionid = Factionid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Factionid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Factionid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallengemap.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallengemap.cs.meta new file mode 100644 index 0000000000..582ca8b56b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlechallengemap.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b5666eead365841419fa6fcb33496f85 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battleenter.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battleenter.cs new file mode 100644 index 0000000000..b1fdcaaf8a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battleenter.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class battleenter : Protocol + { + public int Roleid { get; set; } + public int Battle_id { get; set; } + public int Localsid { get; set; } + + public battleenter() : base(ProtocolType.PROTOCOL_BATTLEENTER) + { + + } + + public override Protocol Clone() => new battleenter + { + Roleid = Roleid, + Battle_id = Battle_id, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Battle_id); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Battle_id = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battleenter.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battleenter.cs.meta new file mode 100644 index 0000000000..6d0e873d77 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battleenter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7640bb56a24984fe596b4d74589d8927 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlegetmap.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlegetmap.cs new file mode 100644 index 0000000000..3a26ac1e69 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlegetmap.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class battlegetmap : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public battlegetmap() : base(ProtocolType.PROTOCOL_BATTLEGETMAP) + { + + } + + public override Protocol Clone() => new battlegetmap + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlegetmap.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlegetmap.cs.meta new file mode 100644 index 0000000000..6bafa0f2e3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlegetmap.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c1d74a0834c9d4756bc1b17ca07260ec \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlestatus.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlestatus.cs new file mode 100644 index 0000000000..3d37cc66b6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlestatus.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class battlestatus : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public battlestatus() : base(ProtocolType.PROTOCOL_BATTLESTATUS) + { + + } + + public override Protocol Clone() => new battlestatus + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlestatus.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlestatus.cs.meta new file mode 100644 index 0000000000..dc768e0c77 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/battlestatus.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7ae57d7354c794bac8a8d98a672c1411 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/buypoint.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/buypoint.cs new file mode 100644 index 0000000000..2c6a2a382b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/buypoint.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class buypoint : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Sellid { get; set; } + public int Seller { get; set; } + + public buypoint() : base(ProtocolType.PROTOCOL_BUYPOINT) + { + + } + + public override Protocol Clone() => new buypoint + { + Roleid = Roleid, + Localsid = Localsid, + Sellid = Sellid, + Seller = Seller + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Sellid); + os.Write(Seller); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Sellid = os.ReadInt32(); + Seller = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/buypoint.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/buypoint.cs.meta new file mode 100644 index 0000000000..6065ad6903 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/buypoint.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 146db61741bd445de95e94f961c64ede \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cancelwaitqueue.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cancelwaitqueue.cs new file mode 100644 index 0000000000..23be817d37 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cancelwaitqueue.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class cancelwaitqueue : Protocol + { + public int Userid { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public cancelwaitqueue() : base(ProtocolType.PROTOCOL_CANCELWAITQUEUE) + { + + } + + public override Protocol Clone() => new cancelwaitqueue + { + Userid = Userid, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cancelwaitqueue.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cancelwaitqueue.cs.meta new file mode 100644 index 0000000000..c34893f1c9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cancelwaitqueue.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 27da9141909894fbba762a8e2a70f1b0 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashlock.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashlock.cs new file mode 100644 index 0000000000..37c84d3b63 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashlock.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class cashlock : Protocol + { + public int Userid { get; set; } + public Octets Cash_password { get; set; } + public int Localsid { get; set; } + public byte Lock { get; set; } + public int L_localsid { get; set; } + + public cashlock() : base(ProtocolType.PROTOCOL_CASHLOCK) + { + Cash_password = new Octets(); + } + + public override Protocol Clone() => new cashlock + { + Userid = Userid, + Cash_password = new Octets(Cash_password.ToArray()), + Localsid = Localsid, + Lock = Lock, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Cash_password); + os.Write(Localsid); + os.Write(Lock); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Cash_password = os.ReadOctets(); + Localsid = os.ReadInt32(); + Lock = os.ReadByte(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashlock.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashlock.cs.meta new file mode 100644 index 0000000000..6af5bb0fe5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashlock.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 56eec6e5076674fd49aae1511fdba7da \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashpasswordset.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashpasswordset.cs new file mode 100644 index 0000000000..2eb3859bac --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashpasswordset.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class cashpasswordset : Protocol + { + public int Userid { get; set; } + public Octets Cash_password { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public cashpasswordset() : base(ProtocolType.PROTOCOL_CASHPASSWORDSET) + { + Cash_password = new Octets(); + } + + public override Protocol Clone() => new cashpasswordset + { + Userid = Userid, + Cash_password = new Octets(Cash_password.ToArray()), + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Cash_password); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Cash_password = os.ReadOctets(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashpasswordset.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashpasswordset.cs.meta new file mode 100644 index 0000000000..aa0e25042b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/cashpasswordset.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4370751fd92024b7b8d1e850afce78d1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/challenge.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/challenge.cs new file mode 100644 index 0000000000..014f584613 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/challenge.cs @@ -0,0 +1,60 @@ +using System; + +namespace CSNetwork.Protocols +{ + // Corresponds to GNET::Challenge (Type 1) + // Reverted to original structure, inheriting from Protocol + public class challenge : Protocol + { + // Properties based on C++ definition (inl/challenge) + public Octets nonce { get; set; } // GNET::Octets nonce + public uint version { get; set; } // unsigned int version + public byte algo { get; set; } // unsigned int algo + public Octets edition { get; set; } // unsigned int edition + public byte exp_rate { get; set; } // unsigned int exp_rate + + // Original constructor using ProtocolType enum + public challenge() + : base(ProtocolType.PROTOCOL_CHALLENGE) // Assuming PROTOCOL_CHALLENGE is defined + { + nonce = new Octets(); // Initialize nonce + } + + // Restore original Clone method + public override Protocol Clone() => + new challenge + { + nonce = new Octets(nonce.ToArray()), + version = version, + algo = algo, + edition = edition, + exp_rate = exp_rate + }; + + // Restore original Marshal method based on C++ + public override void Marshal(OctetsStream os) + { + os.Write(nonce); + os.Write(version); + os.Write(algo); + os.Write(edition); + os.Write(exp_rate); + } + + // Restore original Unmarshal method based on C++ + public override void Unmarshal(OctetsStream os) + { + nonce = os.ReadOctets(); + version = os.ReadUInt32(); + algo = os.ReadByte(); // Corrected read method for uint + edition = os.ReadOctets(); + exp_rate = os.ReadByte(); + } + + // Restore original PriorPolicy + public override int PriorPolicy() => 100; // Assuming default or original value + + // Restore original ToString method + public override string ToString => $"Challenge(Type={Type}, Nonce={BitConverter.ToString(nonce.ToArray())}, Version={version}, Algo={algo}, Edition={edition}, ExpRate={exp_rate})"; + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/challenge.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/challenge.cs.meta new file mode 100644 index 0000000000..5018d4e509 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/challenge.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b3e7d3d12a8e749a8971ab9eb87cba1f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatmessage.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatmessage.cs new file mode 100644 index 0000000000..0b245bb73c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatmessage.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class chatmessage : Protocol + { + public byte Channel { get; set; } + public byte Emotion { get; set; } + public int Srcroleid { get; set; } + public Octets Msg { get; set; } + public Octets Data { get; set; } + public int Srclevel { get; set; } + + public chatmessage() : base(ProtocolType.PROTOCOL_CHATMESSAGE) + { + Msg = new Octets(); + Data = new Octets(); + } + + public override Protocol Clone() => new chatmessage + { + Channel = Channel, + Emotion = Emotion, + Srcroleid = Srcroleid, + Msg = new Octets(Msg.ToArray()), + Data = new Octets(Data.ToArray()), + Srclevel = Srclevel + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Channel); + os.Write(Emotion); + os.Write(Srcroleid); + os.Write(Msg); + os.Write(Data); + os.Write(Srclevel); + } + + public override void Unmarshal(OctetsStream os) + { + Channel = os.ReadByte(); + Emotion = os.ReadByte(); + Srcroleid = os.ReadInt32(); + Msg = os.ReadOctets(); + Data = os.ReadOctets(); + Srclevel = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatmessage.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatmessage.cs.meta new file mode 100644 index 0000000000..3ae43da95c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatmessage.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e466b960dfce646a1a9993d0fe57ba36 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomcreate.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomcreate.cs new file mode 100644 index 0000000000..824ffb14b3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomcreate.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class chatroomcreate : Protocol + { + public int Roleid { get; set; } + public Octets Subject { get; set; } + public short Capacity { get; set; } + public Octets Password { get; set; } + public int Localsid { get; set; } + + public chatroomcreate() : base(ProtocolType.PROTOCOL_CHATROOMCREATE) + { + Subject = new Octets(); + Password = new Octets(); + } + + public override Protocol Clone() => new chatroomcreate + { + Roleid = Roleid, + Subject = new Octets(Subject.ToArray()), + Capacity = Capacity, + Password = new Octets(Password.ToArray()), + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Subject); + os.Write(Capacity); + os.Write(Password); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Subject = os.ReadOctets(); + Capacity = os.ReadInt16(); + Password = os.ReadOctets(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 48; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomcreate.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomcreate.cs.meta new file mode 100644 index 0000000000..14c71699ad --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomcreate.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2627f9283f063405ab672d748e4eed71 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomexpel.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomexpel.cs new file mode 100644 index 0000000000..f2584d8940 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomexpel.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class chatroomexpel : Protocol + { + public short Roomid { get; set; } + public int Roleid { get; set; } + public int Owner { get; set; } + public int Localsid { get; set; } + + public chatroomexpel() : base(ProtocolType.PROTOCOL_CHATROOMEXPEL) + { + + } + + public override Protocol Clone() => new chatroomexpel + { + Roomid = Roomid, + Roleid = Roleid, + Owner = Owner, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roomid); + os.Write(Roleid); + os.Write(Owner); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roomid = os.ReadInt16(); + Roleid = os.ReadInt32(); + Owner = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomexpel.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomexpel.cs.meta new file mode 100644 index 0000000000..63c0798fbd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomexpel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d1322d57c7072475da87e3ea062a1a13 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroominvite.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroominvite.cs new file mode 100644 index 0000000000..e5ec9d1b50 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroominvite.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class chatroominvite : Protocol + { + public short Roomid { get; set; } + public int Invitee { get; set; } + public int Inviter { get; set; } + public Octets Name { get; set; } + public Octets Subject { get; set; } + public short Capacity { get; set; } + public short Number { get; set; } + public Octets Password { get; set; } + public int Localsid { get; set; } + + public chatroominvite() : base(ProtocolType.PROTOCOL_CHATROOMINVITE) + { + Name = new Octets(); + Subject = new Octets(); + Password = new Octets(); + } + + public override Protocol Clone() => new chatroominvite + { + Roomid = Roomid, + Invitee = Invitee, + Inviter = Inviter, + Name = new Octets(Name.ToArray()), + Subject = new Octets(Subject.ToArray()), + Capacity = Capacity, + Number = Number, + Password = new Octets(Password.ToArray()), + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roomid); + os.Write(Invitee); + os.Write(Inviter); + os.Write(Name); + os.Write(Subject); + os.Write(Capacity); + os.Write(Number); + os.Write(Password); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roomid = os.ReadInt16(); + Invitee = os.ReadInt32(); + Inviter = os.ReadInt32(); + Name = os.ReadOctets(); + Subject = os.ReadOctets(); + Capacity = os.ReadInt16(); + Number = os.ReadInt16(); + Password = os.ReadOctets(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroominvite.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroominvite.cs.meta new file mode 100644 index 0000000000..bd4003abaa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroominvite.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 19c304f4fac314663b66cbca1305dde2 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomjoin.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomjoin.cs new file mode 100644 index 0000000000..29de180103 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomjoin.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class chatroomjoin : Protocol + { + public short Roomid { get; set; } + public int Ownerid { get; set; } + public Octets Ownername { get; set; } + public int Roleid { get; set; } + public Octets Password { get; set; } + public int Localsid { get; set; } + + public chatroomjoin() : base(ProtocolType.PROTOCOL_CHATROOMJOIN) + { + Ownername = new Octets(); + Password = new Octets(); + } + + public override Protocol Clone() => new chatroomjoin + { + Roomid = Roomid, + Ownerid = Ownerid, + Ownername = new Octets(Ownername.ToArray()), + Roleid = Roleid, + Password = new Octets(Password.ToArray()), + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roomid); + os.Write(Ownerid); + os.Write(Ownername); + os.Write(Roleid); + os.Write(Password); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roomid = os.ReadInt16(); + Ownerid = os.ReadInt32(); + Ownername = os.ReadOctets(); + Roleid = os.ReadInt32(); + Password = os.ReadOctets(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 48; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomjoin.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomjoin.cs.meta new file mode 100644 index 0000000000..7f653fd1f2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomjoin.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7e92e25bd25f6403e924a434b9d63ff0 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomleave.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomleave.cs new file mode 100644 index 0000000000..ffdb45fdfe --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomleave.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class chatroomleave : Protocol + { + public short Roomid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + + public chatroomleave() : base(ProtocolType.PROTOCOL_CHATROOMLEAVE) + { + + } + + public override Protocol Clone() => new chatroomleave + { + Roomid = Roomid, + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roomid); + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roomid = os.ReadInt16(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomleave.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomleave.cs.meta new file mode 100644 index 0000000000..bd1a2d1e64 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomleave.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c8234cd2c2a10432abdf9237f5f1863d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomlist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomlist.cs new file mode 100644 index 0000000000..c9f76accbd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomlist.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class chatroomlist : Protocol + { + public short Begin { get; set; } + public byte Reverse { get; set; } + public int Localsid { get; set; } + + public chatroomlist() : base(ProtocolType.PROTOCOL_CHATROOMLIST) + { + + } + + public override Protocol Clone() => new chatroomlist + { + Begin = Begin, + Reverse = Reverse, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Begin); + os.Write(Reverse); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Begin = os.ReadInt16(); + Reverse = os.ReadByte(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomlist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomlist.cs.meta new file mode 100644 index 0000000000..a5396df0e9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomlist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: afb17be81adb64a41b90862e2867568c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomspeak.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomspeak.cs new file mode 100644 index 0000000000..2f63795b6a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomspeak.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class chatroomspeak : Protocol + { + public short Roomid { get; set; } + public byte Emotion { get; set; } + public Octets Message { get; set; } + public int Src { get; set; } + public int Dst { get; set; } + public int Localsid { get; set; } + + public chatroomspeak() : base(ProtocolType.PROTOCOL_CHATROOMSPEAK) + { + Message = new Octets(); + } + + public override Protocol Clone() => new chatroomspeak + { + Roomid = Roomid, + Emotion = Emotion, + Message = new Octets(Message.ToArray()), + Src = Src, + Dst = Dst, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roomid); + os.Write(Emotion); + os.Write(Message); + os.Write(Src); + os.Write(Dst); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roomid = os.ReadInt16(); + Emotion = os.ReadByte(); + Message = os.ReadOctets(); + Src = os.ReadInt32(); + Dst = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomspeak.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomspeak.cs.meta new file mode 100644 index 0000000000..fcd4f2a9fd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/chatroomspeak.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6f924bcab5f9549cd93965cee9844fe0 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/checknewmail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/checknewmail.cs new file mode 100644 index 0000000000..3fcad5be14 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/checknewmail.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class checknewmail : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public checknewmail() : base(ProtocolType.PROTOCOL_CHECKNEWMAIL) + { + + } + + public override Protocol Clone() => new checknewmail + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/checknewmail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/checknewmail.cs.meta new file mode 100644 index 0000000000..1229ac1ec6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/checknewmail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: faef8a98349604c13b16747a922496bb \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/collectclientmachineinfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/collectclientmachineinfo.cs new file mode 100644 index 0000000000..39adf019e5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/collectclientmachineinfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class collectclientmachineinfo : Protocol + { + public int Userid { get; set; } + public Octets Machineinfo { get; set; } + + public collectclientmachineinfo() : base(ProtocolType.PROTOCOL_COLLECTCLIENTMACHINEINFO) + { + Machineinfo = new Octets(); + } + + public override Protocol Clone() => new collectclientmachineinfo + { + Userid = Userid, + Machineinfo = new Octets(Machineinfo.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Machineinfo); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Machineinfo = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 2048; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/collectclientmachineinfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/collectclientmachineinfo.cs.meta new file mode 100644 index 0000000000..5d6e38e549 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/collectclientmachineinfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4007cf9bc15ba48bcb6f7b40c8b231ad \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/complain2gm.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/complain2gm.cs new file mode 100644 index 0000000000..ade763ae55 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/complain2gm.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class complain2gm : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public Octets Rolename { get; set; } + public Octets Comp_rolename { get; set; } + public int Zoneid { get; set; } + public Octets Mapzone { get; set; } + public Octets Content { get; set; } + + public complain2gm() : base(ProtocolType.PROTOCOL_COMPLAIN2GM) + { + Rolename = new Octets(); + Comp_rolename = new Octets(); + Mapzone = new Octets(); + Content = new Octets(); + } + + public override Protocol Clone() => new complain2gm + { + Roleid = Roleid, + Localsid = Localsid, + Rolename = new Octets(Rolename.ToArray()), + Comp_rolename = new Octets(Comp_rolename.ToArray()), + Zoneid = Zoneid, + Mapzone = new Octets(Mapzone.ToArray()), + Content = new Octets(Content.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Rolename); + os.Write(Comp_rolename); + os.Write(Zoneid); + os.Write(Mapzone); + os.Write(Content); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Rolename = os.ReadOctets(); + Comp_rolename = os.ReadOctets(); + Zoneid = os.ReadInt32(); + Mapzone = os.ReadOctets(); + Content = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/complain2gm.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/complain2gm.cs.meta new file mode 100644 index 0000000000..788d25fff7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/complain2gm.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 02f34df765d71408a8e8ed11fdca9b17 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetbattlelimit.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetbattlelimit.cs new file mode 100644 index 0000000000..3104852873 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetbattlelimit.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlegetbattlelimit : Protocol + { + public int Roleid { get; set; } + public int Domain_id { get; set; } + + public countrybattlegetbattlelimit() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEGETBATTLELIMIT) + { + + } + + public override Protocol Clone() => new countrybattlegetbattlelimit + { + Roleid = Roleid, + Domain_id = Domain_id + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Domain_id); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Domain_id = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetbattlelimit.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetbattlelimit.cs.meta new file mode 100644 index 0000000000..025751d5c1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetbattlelimit.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a52baeb75c4684a319ac00cb636b6458 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetconfig.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetconfig.cs new file mode 100644 index 0000000000..24f1f9f386 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetconfig.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlegetconfig : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public countrybattlegetconfig() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEGETCONFIG) + { + + } + + public override Protocol Clone() => new countrybattlegetconfig + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetconfig.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetconfig.cs.meta new file mode 100644 index 0000000000..bdebb73db2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetconfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3ac2c65277d6e4403b027614bae6f83d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetkingcommandpoint.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetkingcommandpoint.cs new file mode 100644 index 0000000000..7b5a0dfffd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetkingcommandpoint.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlegetkingcommandpoint : Protocol + { + public int Roleid { get; set; } + + public countrybattlegetkingcommandpoint() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEGETKINGCOMMANDPOINT) + { + + } + + public override Protocol Clone() => new countrybattlegetkingcommandpoint + { + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetkingcommandpoint.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetkingcommandpoint.cs.meta new file mode 100644 index 0000000000..ce8ee690b3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetkingcommandpoint.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0da4342e08b614c4eb73103ea4e3cc02 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetmap.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetmap.cs new file mode 100644 index 0000000000..fc1d4a4d55 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetmap.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlegetmap : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public countrybattlegetmap() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEGETMAP) + { + + } + + public override Protocol Clone() => new countrybattlegetmap + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetmap.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetmap.cs.meta new file mode 100644 index 0000000000..6365026c24 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetmap.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: db038734535cc408c95f5635ab0ec238 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetplayerlocation.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetplayerlocation.cs new file mode 100644 index 0000000000..0fec903121 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetplayerlocation.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlegetplayerlocation : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public countrybattlegetplayerlocation() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEGETPLAYERLOCATION) + { + + } + + public override Protocol Clone() => new countrybattlegetplayerlocation + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetplayerlocation.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetplayerlocation.cs.meta new file mode 100644 index 0000000000..92dfc6e76e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetplayerlocation.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f867d00a743c54c32b45dbbd465d07a5 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetscore.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetscore.cs new file mode 100644 index 0000000000..be7ac21d9d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetscore.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlegetscore : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public countrybattlegetscore() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEGETSCORE) + { + + } + + public override Protocol Clone() => new countrybattlegetscore + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetscore.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetscore.cs.meta new file mode 100644 index 0000000000..5113d9b864 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlegetscore.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 310c76bb0119d474089ed3b490939647 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingassignassault.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingassignassault.cs new file mode 100644 index 0000000000..ac9bf9e7a0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingassignassault.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlekingassignassault : Protocol + { + public int King_roleid { get; set; } + public int Domain_id { get; set; } + public byte Assault_type { get; set; } + + public countrybattlekingassignassault() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEKINGASSIGNASSAULT) + { + + } + + public override Protocol Clone() => new countrybattlekingassignassault + { + King_roleid = King_roleid, + Domain_id = Domain_id, + Assault_type = Assault_type + }; + + public override void Marshal(OctetsStream os) + { + os.Write(King_roleid); + os.Write(Domain_id); + os.Write(Assault_type); + } + + public override void Unmarshal(OctetsStream os) + { + King_roleid = os.ReadInt32(); + Domain_id = os.ReadInt32(); + Assault_type = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingassignassault.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingassignassault.cs.meta new file mode 100644 index 0000000000..d50be29176 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingassignassault.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: dad0f79d562854462b84ffe3b6c084bc \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingresetbattlelimit.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingresetbattlelimit.cs new file mode 100644 index 0000000000..070b98c9da --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingresetbattlelimit.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlekingresetbattlelimit : Protocol + { + public int King_roleid { get; set; } + public int Domain_id { get; set; } + public byte Op { get; set; } + + public countrybattlekingresetbattlelimit() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEKINGRESETBATTLELIMIT) + { + + } + + public override Protocol Clone() => new countrybattlekingresetbattlelimit + { + King_roleid = King_roleid, + Domain_id = Domain_id, + Op = Op + }; + + public override void Marshal(OctetsStream os) + { + os.Write(King_roleid); + os.Write(Domain_id); + os.Write(Op); + } + + public override void Unmarshal(OctetsStream os) + { + King_roleid = os.ReadInt32(); + Domain_id = os.ReadInt32(); + Op = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingresetbattlelimit.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingresetbattlelimit.cs.meta new file mode 100644 index 0000000000..9764a4e7d1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlekingresetbattlelimit.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ea5f32cd7d7e94d9ca44f0a9ec174a59 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlemove.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlemove.cs new file mode 100644 index 0000000000..0592400581 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlemove.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlemove : Protocol + { + public int Roleid { get; set; } + public int Dest { get; set; } + public int Localsid { get; set; } + + public countrybattlemove() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEMOVE) + { + + } + + public override Protocol Clone() => new countrybattlemove + { + Roleid = Roleid, + Dest = Dest, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Dest); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Dest = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlemove.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlemove.cs.meta new file mode 100644 index 0000000000..fecc2853c9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlemove.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b5b57aa16287049d2a38b764a265e02e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenter.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenter.cs new file mode 100644 index 0000000000..c71fb55d3a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenter.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlepreenter : Protocol + { + public int Battle_id { get; set; } + public int Roleid { get; set; } + + public countrybattlepreenter() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEPREENTER) + { + + } + + public override Protocol Clone() => new countrybattlepreenter + { + Battle_id = Battle_id, + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Battle_id); + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Battle_id = os.ReadInt32(); + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenter.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenter.cs.meta new file mode 100644 index 0000000000..9908351dbb --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a703b9e44c1ea41c1bc97d9af4414427 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenternotify.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenternotify.cs new file mode 100644 index 0000000000..094ac3c2f1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenternotify.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlepreenternotify : Protocol + { + public int Battle_id { get; set; } + public int Roleid { get; set; } + public int Timeout { get; set; } + public int Localsid { get; set; } + + public countrybattlepreenternotify() : base(ProtocolType.PROTOCOL_COUNTRYBATTLEPREENTERNOTIFY) + { + + } + + public override Protocol Clone() => new countrybattlepreenternotify + { + Battle_id = Battle_id, + Roleid = Roleid, + Timeout = Timeout, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Battle_id); + os.Write(Roleid); + os.Write(Timeout); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Battle_id = os.ReadInt32(); + Roleid = os.ReadInt32(); + Timeout = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenternotify.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenternotify.cs.meta new file mode 100644 index 0000000000..d27b613b78 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlepreenternotify.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bc0a2c30a82ce4dfa932732f15acaadf \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattleresult.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattleresult.cs new file mode 100644 index 0000000000..4d8e2cf094 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattleresult.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattleresult : Protocol + { + public int Player_bonus { get; set; } + public int Localsid { get; set; } + + public countrybattleresult() : base(ProtocolType.PROTOCOL_COUNTRYBATTLERESULT) + { + + } + + public override Protocol Clone() => new countrybattleresult + { + Player_bonus = Player_bonus, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Player_bonus); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Player_bonus = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattleresult.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattleresult.cs.meta new file mode 100644 index 0000000000..251ff707fd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattleresult.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 72255b6f2d22744cb8d0f08b2add84db \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlereturncapital.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlereturncapital.cs new file mode 100644 index 0000000000..3a4da747d9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlereturncapital.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlereturncapital : Protocol + { + public int Roleid { get; set; } + + public countrybattlereturncapital() : base(ProtocolType.PROTOCOL_COUNTRYBATTLERETURNCAPITAL) + { + + } + + public override Protocol Clone() => new countrybattlereturncapital + { + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlereturncapital.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlereturncapital.cs.meta new file mode 100644 index 0000000000..ad98a0c1a3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlereturncapital.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 39006d02a2a154f98b1e6e8e106c2ced \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesinglebattleresult.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesinglebattleresult.cs new file mode 100644 index 0000000000..efb1c77f12 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesinglebattleresult.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlesinglebattleresult : Protocol + { + public int Domain_id { get; set; } + public int Single_battle_total_score { get; set; } + public int Player_single_battle_score { get; set; } + public int Player_rank { get; set; } + public int Localsid { get; set; } + + public countrybattlesinglebattleresult() : base(ProtocolType.PROTOCOL_COUNTRYBATTLESINGLEBATTLERESULT) + { + + } + + public override Protocol Clone() => new countrybattlesinglebattleresult + { + Domain_id = Domain_id, + Single_battle_total_score = Single_battle_total_score, + Player_single_battle_score = Player_single_battle_score, + Player_rank = Player_rank, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Domain_id); + os.Write(Single_battle_total_score); + os.Write(Player_single_battle_score); + os.Write(Player_rank); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Domain_id = os.ReadInt32(); + Single_battle_total_score = os.ReadInt32(); + Player_single_battle_score = os.ReadInt32(); + Player_rank = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesinglebattleresult.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesinglebattleresult.cs.meta new file mode 100644 index 0000000000..ddc4a14971 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesinglebattleresult.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f2718a6ae946b4b86ab8bab311fdfa40 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesyncplayerlocation.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesyncplayerlocation.cs new file mode 100644 index 0000000000..8264afeb5d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesyncplayerlocation.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class countrybattlesyncplayerlocation : Protocol + { + public int Roleid { get; set; } + public int Domain_id { get; set; } + public int Reason { get; set; } + public int Localsid { get; set; } + + public countrybattlesyncplayerlocation() : base(ProtocolType.PROTOCOL_COUNTRYBATTLESYNCPLAYERLOCATION) + { + + } + + public override Protocol Clone() => new countrybattlesyncplayerlocation + { + Roleid = Roleid, + Domain_id = Domain_id, + Reason = Reason, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Domain_id); + os.Write(Reason); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Domain_id = os.ReadInt32(); + Reason = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesyncplayerlocation.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesyncplayerlocation.cs.meta new file mode 100644 index 0000000000..775f4ca7a2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/countrybattlesyncplayerlocation.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: eddbaafaeee1f423db52d4897158091e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createfactionfortress.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createfactionfortress.cs new file mode 100644 index 0000000000..2c0eb38bd5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createfactionfortress.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class createfactionfortress : Protocol + { + public int Roleid { get; set; } + public int Factionid { get; set; } + public Octets Item_cost { get; set; } + public Octets Fortress_info { get; set; } + public Octets Syncdata { get; set; } + + public createfactionfortress() : base(ProtocolType.PROTOCOL_CREATEFACTIONFORTRESS) + { + Item_cost = new Octets(); + Fortress_info = new Octets(); + Syncdata = new Octets(); + } + + public override Protocol Clone() => new createfactionfortress + { + Roleid = Roleid, + Factionid = Factionid, + Item_cost = new Octets(Item_cost.ToArray()), + Fortress_info = new Octets(Fortress_info.ToArray()), + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Factionid); + os.Write(Item_cost); + os.Write(Fortress_info); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Factionid = os.ReadInt32(); + Item_cost = os.ReadOctets(); + Fortress_info = os.ReadOctets(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131071; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createfactionfortress.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createfactionfortress.cs.meta new file mode 100644 index 0000000000..64a7636a8b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createfactionfortress.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7b7fa4384f8ce4446b98962f4c7e44ba \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createrole.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createrole.cs new file mode 100644 index 0000000000..5bfe6615bf --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createrole.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class createrole : Protocol + { + public int Userid { get; set; } + public int Localsid { get; set; } + public Octets Referid { get; set; } + + public createrole() : base(ProtocolType.PROTOCOL_CREATEROLE) + { + Referid = new Octets(); + } + + public override Protocol Clone() => new createrole + { + Userid = Userid, + Localsid = Localsid, + Referid = new Octets(Referid.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + os.Write(Referid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Referid = os.ReadOctets(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 8192; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createrole.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createrole.cs.meta new file mode 100644 index 0000000000..0c36e1e469 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/createrole.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 38049c2c6cf0a42af85bb9f3fba7d884 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deletemail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deletemail.cs new file mode 100644 index 0000000000..2ce739292e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deletemail.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class deletemail : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public byte Mail_id { get; set; } + + public deletemail() : base(ProtocolType.PROTOCOL_DELETEMAIL) + { + + } + + public override Protocol Clone() => new deletemail + { + Roleid = Roleid, + Localsid = Localsid, + Mail_id = Mail_id + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Mail_id); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Mail_id = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deletemail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deletemail.cs.meta new file mode 100644 index 0000000000..8baa14b6bd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deletemail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2e93204d7b5cd4d37a762d7021cefc38 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deleterole.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deleterole.cs new file mode 100644 index 0000000000..d5a89a3ea1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deleterole.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class deleterole : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public deleterole() : base(ProtocolType.PROTOCOL_DELETEROLE) + { + + } + + public override Protocol Clone() => new deleterole + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deleterole.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deleterole.cs.meta new file mode 100644 index 0000000000..b65a8c5843 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deleterole.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 178c5799d47624d7790b6573c4a5c685 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/delfriend.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/delfriend.cs new file mode 100644 index 0000000000..ce9eb87dcd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/delfriend.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class delfriend : Protocol + { + public int Roleid { get; set; } + public int Friendid { get; set; } + public int Localsid { get; set; } + + public delfriend() : base(ProtocolType.PROTOCOL_DELFRIEND) + { + + } + + public override Protocol Clone() => new delfriend + { + Roleid = Roleid, + Friendid = Friendid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Friendid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Friendid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/delfriend.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/delfriend.cs.meta new file mode 100644 index 0000000000..927bdaac37 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/delfriend.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0de507db2414843be9af5c2644fd1b7b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deliverrolestatus.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deliverrolestatus.cs new file mode 100644 index 0000000000..e0f06f6470 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deliverrolestatus.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class deliverrolestatus : Protocol + { + public int Dstroleid { get; set; } + public byte Dstzoneid { get; set; } + public int Srcroleid { get; set; } + public byte Srczoneid { get; set; } + public byte Status { get; set; } + public int Localsid { get; set; } + + public deliverrolestatus() : base(ProtocolType.PROTOCOL_DELIVERROLESTATUS) + { + + } + + public override Protocol Clone() => new deliverrolestatus + { + Dstroleid = Dstroleid, + Dstzoneid = Dstzoneid, + Srcroleid = Srcroleid, + Srczoneid = Srczoneid, + Status = Status, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Dstroleid); + os.Write(Dstzoneid); + os.Write(Srcroleid); + os.Write(Srczoneid); + os.Write(Status); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Dstroleid = os.ReadInt32(); + Dstzoneid = os.ReadByte(); + Srcroleid = os.ReadInt32(); + Srczoneid = os.ReadByte(); + Status = os.ReadByte(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deliverrolestatus.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deliverrolestatus.cs.meta new file mode 100644 index 0000000000..657b03138c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/deliverrolestatus.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 97a54b8a25277404fa7204bde041419b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/enterworld.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/enterworld.cs new file mode 100644 index 0000000000..66a16cf3d1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/enterworld.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class enterworld : Protocol + { + public int Roleid { get; set; } + public int Provider_link_id { get; set; } + public int Locktime { get; set; } + public int Timeout { get; set; } + public int Settime { get; set; } + public uint Localsid { get; set; } + public int L_timeout { get; set; } + + public enterworld() : base(ProtocolType.PROTOCOL_ENTERWORLD) + { + + } + + public override Protocol Clone() => new enterworld + { + Roleid = Roleid, + Provider_link_id = Provider_link_id, + Locktime = Locktime, + Timeout = Timeout, + Settime = Settime, + Localsid = Localsid, + L_timeout = L_timeout + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Provider_link_id); + os.Write(Locktime); + os.Write(Timeout); + os.Write(Settime); + os.Write(Localsid); + os.Write(L_timeout); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Provider_link_id = os.ReadInt32(); + Locktime = os.ReadInt32(); + Timeout = os.ReadInt32(); + Settime = os.ReadInt32(); + Localsid = os.ReadUInt32(); + L_timeout = os.ReadInt32(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/enterworld.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/enterworld.cs.meta new file mode 100644 index 0000000000..78961a6f1d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/enterworld.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2484048ba0d7a45e1a40d03572fc5938 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/errorinfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/errorinfo.cs new file mode 100644 index 0000000000..e79acae7df --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/errorinfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class errorinfo : Protocol + { + public int Errcode { get; set; } + public Octets Info { get; set; } + + public errorinfo() : base(ProtocolType.PROTOCOL_ERRORINFO) + { + Info = new Octets(); + } + + public override Protocol Clone() => new errorinfo + { + Errcode = Errcode, + Info = new Octets(Info.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Errcode); + os.Write(Info); + } + + public override void Unmarshal(OctetsStream os) + { + Errcode = os.ReadInt32(); + Info = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/errorinfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/errorinfo.cs.meta new file mode 100644 index 0000000000..57f1de5bd3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/errorinfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e80116b2bf22147a88fb7af68d318fb4 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/exchangeconsumepoints.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/exchangeconsumepoints.cs new file mode 100644 index 0000000000..ce4b5c9e4d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/exchangeconsumepoints.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class exchangeconsumepoints : Protocol + { + public int Roleid { get; set; } + public int Rewardtype { get; set; } + public int Localsid { get; set; } + + public exchangeconsumepoints() : base(ProtocolType.PROTOCOL_EXCHANGECONSUMEPOINTS) + { + + } + + public override Protocol Clone() => new exchangeconsumepoints + { + Roleid = Roleid, + Rewardtype = Rewardtype, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Rewardtype); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Rewardtype = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/exchangeconsumepoints.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/exchangeconsumepoints.cs.meta new file mode 100644 index 0000000000..ebce425220 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/exchangeconsumepoints.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d1718ba35028e4a5782895aecc2206e4 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionacceptjoin.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionacceptjoin.cs new file mode 100644 index 0000000000..69fa6c1b55 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionacceptjoin.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionacceptjoin : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Factionid { get; set; } + public int Invited_roleid { get; set; } + + public factionacceptjoin() : base(ProtocolType.PROTOCOL_FACTIONACCEPTJOIN) + { + + } + + public override Protocol Clone() => new factionacceptjoin + { + Roleid = Roleid, + Localsid = Localsid, + Factionid = Factionid, + Invited_roleid = Invited_roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Factionid); + os.Write(Invited_roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Factionid = os.ReadInt32(); + Invited_roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionacceptjoin.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionacceptjoin.cs.meta new file mode 100644 index 0000000000..7040a539b2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionacceptjoin.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ca2384728536c40a984f016872ff0e03 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionchat.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionchat.cs new file mode 100644 index 0000000000..2a19c16cf8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionchat.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionchat : Protocol + { + public byte Channel { get; set; } + public byte Emotion { get; set; } + public int Src_roleid { get; set; } + public Octets Msg { get; set; } + public Octets Data { get; set; } + public int Dst_localsid { get; set; } + public byte L_emotion { get; set; } + + public factionchat() : base(ProtocolType.PROTOCOL_FACTIONCHAT) + { + Msg = new Octets(); + Data = new Octets(); + } + + public override Protocol Clone() => new factionchat + { + Channel = Channel, + Emotion = Emotion, + Src_roleid = Src_roleid, + Msg = new Octets(Msg.ToArray()), + Data = new Octets(Data.ToArray()), + Dst_localsid = Dst_localsid, + L_emotion = L_emotion + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Channel); + os.Write(Emotion); + os.Write(Src_roleid); + os.Write(Msg); + os.Write(Data); + os.Write(Dst_localsid); + os.Write(L_emotion); + } + + public override void Unmarshal(OctetsStream os) + { + Channel = os.ReadByte(); + Emotion = os.ReadByte(); + Src_roleid = os.ReadInt32(); + Msg = os.ReadOctets(); + Data = os.ReadOctets(); + Dst_localsid = os.ReadInt32(); + L_emotion = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionchat.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionchat.cs.meta new file mode 100644 index 0000000000..978feb50a3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionchat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1f4a1c0307c624b56a5470d1b73d113d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factiondelayexpelannounce.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factiondelayexpelannounce.cs new file mode 100644 index 0000000000..a22ef56c37 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factiondelayexpelannounce.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factiondelayexpelannounce : Protocol + { + public int Retcode { get; set; } + public byte Opt_type { get; set; } + public int Operater { get; set; } + public int Expelroleid { get; set; } + public int Time { get; set; } + public int Localsid { get; set; } + + public factiondelayexpelannounce() : base(ProtocolType.PROTOCOL_FACTIONDELAYEXPELANNOUNCE) + { + + } + + public override Protocol Clone() => new factiondelayexpelannounce + { + Retcode = Retcode, + Opt_type = Opt_type, + Operater = Operater, + Expelroleid = Expelroleid, + Time = Time, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Retcode); + os.Write(Opt_type); + os.Write(Operater); + os.Write(Expelroleid); + os.Write(Time); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Retcode = os.ReadInt32(); + Opt_type = os.ReadByte(); + Operater = os.ReadInt32(); + Expelroleid = os.ReadInt32(); + Time = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factiondelayexpelannounce.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factiondelayexpelannounce.cs.meta new file mode 100644 index 0000000000..b5cfffa3b2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factiondelayexpelannounce.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ac9dd2635828742e2a3d5cc5b3cf069d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressbattlelist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressbattlelist.cs new file mode 100644 index 0000000000..a38170a2e9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressbattlelist.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionfortressbattlelist : Protocol + { + public int Roleid { get; set; } + + public factionfortressbattlelist() : base(ProtocolType.PROTOCOL_FACTIONFORTRESSBATTLELIST) + { + + } + + public override Protocol Clone() => new factionfortressbattlelist + { + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressbattlelist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressbattlelist.cs.meta new file mode 100644 index 0000000000..51211e380f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressbattlelist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9020ad8c877d449c5ab5b9558e1e4e9b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresschallenge.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresschallenge.cs new file mode 100644 index 0000000000..02062164be --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresschallenge.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionfortresschallenge : Protocol + { + public int Roleid { get; set; } + public int Factionid { get; set; } + public int Target_factionid { get; set; } + public Octets Syncdata { get; set; } + + public factionfortresschallenge() : base(ProtocolType.PROTOCOL_FACTIONFORTRESSCHALLENGE) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new factionfortresschallenge + { + Roleid = Roleid, + Factionid = Factionid, + Target_factionid = Target_factionid, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Factionid); + os.Write(Target_factionid); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Factionid = os.ReadInt32(); + Target_factionid = os.ReadInt32(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresschallenge.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresschallenge.cs.meta new file mode 100644 index 0000000000..8f4032a487 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresschallenge.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3082f1d2a184e4c47b314e0238e62cee \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressenter.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressenter.cs new file mode 100644 index 0000000000..faa9601946 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressenter.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionfortressenter : Protocol + { + public int Roleid { get; set; } + public int Factionid { get; set; } + public int Dst_factionid { get; set; } + + public factionfortressenter() : base(ProtocolType.PROTOCOL_FACTIONFORTRESSENTER) + { + + } + + public override Protocol Clone() => new factionfortressenter + { + Roleid = Roleid, + Factionid = Factionid, + Dst_factionid = Dst_factionid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Factionid); + os.Write(Dst_factionid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Factionid = os.ReadInt32(); + Dst_factionid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressenter.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressenter.cs.meta new file mode 100644 index 0000000000..602c254e6f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressenter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 62a54cebd480d4fc2ae3d0084b1ad04b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressget.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressget.cs new file mode 100644 index 0000000000..70b3201b02 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressget.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionfortressget : Protocol + { + public int Roleid { get; set; } + public int Factionid { get; set; } + + public factionfortressget() : base(ProtocolType.PROTOCOL_FACTIONFORTRESSGET) + { + + } + + public override Protocol Clone() => new factionfortressget + { + Roleid = Roleid, + Factionid = Factionid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Factionid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Factionid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressget.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressget.cs.meta new file mode 100644 index 0000000000..401d23c19a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortressget.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 62c692f5764d84795a4d638b4f5a80c7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresslist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresslist.cs new file mode 100644 index 0000000000..2f7238ce5f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresslist.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionfortresslist : Protocol + { + public int Roleid { get; set; } + public int Begin { get; set; } + + public factionfortresslist() : base(ProtocolType.PROTOCOL_FACTIONFORTRESSLIST) + { + + } + + public override Protocol Clone() => new factionfortresslist + { + Roleid = Roleid, + Begin = Begin + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Begin); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Begin = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresslist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresslist.cs.meta new file mode 100644 index 0000000000..88f9d07f11 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionfortresslist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: cfc8dd85e4fa941dfbc68cc9e38cbbbd \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionlistonline.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionlistonline.cs new file mode 100644 index 0000000000..2e4be3ff01 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionlistonline.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionlistonline : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public factionlistonline() : base(ProtocolType.PROTOCOL_FACTIONLISTONLINE) + { + + } + + public override Protocol Clone() => new factionlistonline + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionlistonline.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionlistonline.cs.meta new file mode 100644 index 0000000000..b47d049eae --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionlistonline.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 48eb959eff3ef4f3498e98e9b2322ed8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionoprequest.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionoprequest.cs new file mode 100644 index 0000000000..4b60e28a72 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionoprequest.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionoprequest : Protocol + { + public int Optype { get; set; } + public int Roleid { get; set; } + public Octets Params { get; set; } + + public factionoprequest() : base(ProtocolType.PROTOCOL_FACTIONOPREQUEST) + { + Params = new Octets(); + } + + public override Protocol Clone() => new factionoprequest + { + Optype = Optype, + Roleid = Roleid, + Params = new Octets(Params.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Optype); + os.Write(Roleid); + os.Write(Params); + } + + public override void Unmarshal(OctetsStream os) + { + Optype = os.ReadInt32(); + Roleid = os.ReadInt32(); + Params = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionoprequest.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionoprequest.cs.meta new file mode 100644 index 0000000000..3ed1de54e8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionoprequest.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9a85c1b7812b4401190cf52ba6f70355 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvapply.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvapply.cs new file mode 100644 index 0000000000..9b4d225015 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvapply.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionrelationrecvapply : Protocol + { + public int Apply_type { get; set; } + public int Src_fid { get; set; } + public int Localsid { get; set; } + + public factionrelationrecvapply() : base(ProtocolType.PROTOCOL_FACTIONRELATIONRECVAPPLY) + { + + } + + public override Protocol Clone() => new factionrelationrecvapply + { + Apply_type = Apply_type, + Src_fid = Src_fid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Apply_type); + os.Write(Src_fid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Apply_type = os.ReadInt32(); + Src_fid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvapply.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvapply.cs.meta new file mode 100644 index 0000000000..222bee6945 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvapply.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b76099789a247493ea814be4cda8c718 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvreply.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvreply.cs new file mode 100644 index 0000000000..dfddf9295c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvreply.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionrelationrecvreply : Protocol + { + public int Pre_apply_type { get; set; } + public byte Agree { get; set; } + public int Src_fid { get; set; } + public int Localsid { get; set; } + + public factionrelationrecvreply() : base(ProtocolType.PROTOCOL_FACTIONRELATIONRECVREPLY) + { + + } + + public override Protocol Clone() => new factionrelationrecvreply + { + Pre_apply_type = Pre_apply_type, + Agree = Agree, + Src_fid = Src_fid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Pre_apply_type); + os.Write(Agree); + os.Write(Src_fid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Pre_apply_type = os.ReadInt32(); + Agree = os.ReadByte(); + Src_fid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvreply.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvreply.cs.meta new file mode 100644 index 0000000000..7a209c0bbf --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrelationrecvreply.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 80f9ab41fdee24e5a8ffa1b99baca081 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrenameannounce.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrenameannounce.cs new file mode 100644 index 0000000000..920f979b53 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrenameannounce.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionrenameannounce : Protocol + { + public int Retcode { get; set; } + public int Operater { get; set; } + public Octets Newname { get; set; } + public int Localsid { get; set; } + + public factionrenameannounce() : base(ProtocolType.PROTOCOL_FACTIONRENAMEANNOUNCE) + { + Newname = new Octets(); + } + + public override Protocol Clone() => new factionrenameannounce + { + Retcode = Retcode, + Operater = Operater, + Newname = new Octets(Newname.ToArray()), + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Retcode); + os.Write(Operater); + os.Write(Newname); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Retcode = os.ReadInt32(); + Operater = os.ReadInt32(); + Newname = os.ReadOctets(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrenameannounce.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrenameannounce.cs.meta new file mode 100644 index 0000000000..2f664880c9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionrenameannounce.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d4b141c23f9fd4cf3b16f812ddf320a2 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetmap.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetmap.cs new file mode 100644 index 0000000000..2e37c89f5e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetmap.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionresourcebattlegetmap : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public factionresourcebattlegetmap() : base(ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETMAP) + { + + } + + public override Protocol Clone() => new factionresourcebattlegetmap + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetmap.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetmap.cs.meta new file mode 100644 index 0000000000..cd27f97421 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetmap.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5b83cf8aabc1e401380fcfca5c7dd54d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetrecord.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetrecord.cs new file mode 100644 index 0000000000..3fd03bd135 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetrecord.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionresourcebattlegetrecord : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public factionresourcebattlegetrecord() : base(ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETRECORD) + { + + } + + public override Protocol Clone() => new factionresourcebattlegetrecord + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetrecord.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetrecord.cs.meta new file mode 100644 index 0000000000..75ba1663c6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlegetrecord.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9617e72e0dbca401083bbcf387f9ba50 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlenotifyplayerevent.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlenotifyplayerevent.cs new file mode 100644 index 0000000000..d6296cddea --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlenotifyplayerevent.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionresourcebattlenotifyplayerevent : Protocol + { + public byte Event_type { get; set; } + public int Roleid { get; set; } + public int Score { get; set; } + public int Localsid { get; set; } + + public factionresourcebattlenotifyplayerevent() : base(ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLENOTIFYPLAYEREVENT) + { + + } + + public override Protocol Clone() => new factionresourcebattlenotifyplayerevent + { + Event_type = Event_type, + Roleid = Roleid, + Score = Score, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Event_type); + os.Write(Roleid); + os.Write(Score); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Event_type = os.ReadByte(); + Roleid = os.ReadInt32(); + Score = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlenotifyplayerevent.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlenotifyplayerevent.cs.meta new file mode 100644 index 0000000000..b084a4bbcd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattlenotifyplayerevent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 98af99454ce0345798b540491c62ea22 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattleplayerqueryresult.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattleplayerqueryresult.cs new file mode 100644 index 0000000000..010faa2d88 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattleplayerqueryresult.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class factionresourcebattleplayerqueryresult : Protocol + { + public int Faction_id { get; set; } + public int Score { get; set; } + public short Rob_horse_count { get; set; } + public short Rob_resource_count { get; set; } + public byte Can_get_bonus { get; set; } + + public factionresourcebattleplayerqueryresult() : base(ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEPLAYERQUERYRESULT) + { + + } + + public override Protocol Clone() => new factionresourcebattleplayerqueryresult + { + Faction_id = Faction_id, + Score = Score, + Rob_horse_count = Rob_horse_count, + Rob_resource_count = Rob_resource_count, + Can_get_bonus = Can_get_bonus + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Faction_id); + os.Write(Score); + os.Write(Rob_horse_count); + os.Write(Rob_resource_count); + os.Write(Can_get_bonus); + } + + public override void Unmarshal(OctetsStream os) + { + Faction_id = os.ReadInt32(); + Score = os.ReadInt32(); + Rob_horse_count = os.ReadInt16(); + Rob_resource_count = os.ReadInt16(); + Can_get_bonus = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 65536; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattleplayerqueryresult.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattleplayerqueryresult.cs.meta new file mode 100644 index 0000000000..d29efeed59 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/factionresourcebattleplayerqueryresult.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5169e57c7990f48009f7d88ec1e35170 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/findsellpointinfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/findsellpointinfo.cs new file mode 100644 index 0000000000..889e052c09 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/findsellpointinfo.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class findsellpointinfo : Protocol + { + public int Startid { get; set; } + public int Localsid { get; set; } + public byte Forward { get; set; } + + public findsellpointinfo() : base(ProtocolType.PROTOCOL_FINDSELLPOINTINFO) + { + + } + + public override Protocol Clone() => new findsellpointinfo + { + Startid = Startid, + Localsid = Localsid, + Forward = Forward + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Startid); + os.Write(Localsid); + os.Write(Forward); + } + + public override void Unmarshal(OctetsStream os) + { + Startid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Forward = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/findsellpointinfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/findsellpointinfo.cs.meta new file mode 100644 index 0000000000..8bad890f1a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/findsellpointinfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3546eae13bdb5430f829928c1b5c925b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendextlist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendextlist.cs new file mode 100644 index 0000000000..30c038650e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendextlist.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class friendextlist : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public friendextlist() : base(ProtocolType.PROTOCOL_FRIENDEXTLIST) + { + + } + + public override Protocol Clone() => new friendextlist + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32768; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendextlist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendextlist.cs.meta new file mode 100644 index 0000000000..d2eb16ac8a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendextlist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8b42d484002f24d0aa7ea55ab7eff710 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendstatus.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendstatus.cs new file mode 100644 index 0000000000..cada88dfac --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendstatus.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class friendstatus : Protocol + { + public int Roleid { get; set; } + public byte Status { get; set; } + public int Localsid { get; set; } + + public friendstatus() : base(ProtocolType.PROTOCOL_FRIENDSTATUS) + { + + } + + public override Protocol Clone() => new friendstatus + { + Roleid = Roleid, + Status = Status, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Status); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Status = os.ReadByte(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendstatus.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendstatus.cs.meta new file mode 100644 index 0000000000..b4a5799785 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/friendstatus.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6144473c4ee1e465c9993db94d922d6e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gamedatasend.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gamedatasend.cs new file mode 100644 index 0000000000..c527de42ea --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gamedatasend.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CSNetwork.C2SCommand; + +namespace CSNetwork.Protocols +{ + public class gamedatasend : Protocol + { + public Octets Data { get; set; } + public CommandID CMDID { get; set; } + public gamedatasend() : base(ProtocolType.PROTOCOL_GAMEDATASEND) + { + Data = new Octets(); + } + + public override Protocol Clone() => new gamedatasend + { + Data = new Octets(Data.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Data); + } + + public override void Unmarshal(OctetsStream os) + { + Data = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 65535; + + public override string ToString => $" Type={Type} - CMD_ID: {Enum.GetName(typeof(CommandID), BitConverter.ToUInt16(Data.ByteArray.Take(2).ToArray()))}"; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gamedatasend.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gamedatasend.cs.meta new file mode 100644 index 0000000000..23ac99fa3d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gamedatasend.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5d0b8c48103284b05975d0021c3262f5 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcnetserverconfig.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcnetserverconfig.cs new file mode 100644 index 0000000000..d0f42ea0f8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcnetserverconfig.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getcnetserverconfig : Protocol + { + public int Roleid { get; set; } + + public getcnetserverconfig() : base(ProtocolType.PROTOCOL_GETCNETSERVERCONFIG) + { + + } + + public override Protocol Clone() => new getcnetserverconfig + { + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcnetserverconfig.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcnetserverconfig.cs.meta new file mode 100644 index 0000000000..39ff834dd6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcnetserverconfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 697530eba868841049046f1e3860db88 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcustomdata.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcustomdata.cs new file mode 100644 index 0000000000..0cfe5ab66d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcustomdata.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getcustomdata : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public getcustomdata() : base(ProtocolType.PROTOCOL_GETCUSTOMDATA) + { + + } + + public override Protocol Clone() => new getcustomdata + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 2048; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcustomdata.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcustomdata.cs.meta new file mode 100644 index 0000000000..3bd4d87908 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getcustomdata.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c783a52f7d7d64c0e9b9484f77ae0b53 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfactionbaseinfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfactionbaseinfo.cs new file mode 100644 index 0000000000..dd31179ad1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfactionbaseinfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getfactionbaseinfo : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public getfactionbaseinfo() : base(ProtocolType.PROTOCOL_GETFACTIONBASEINFO) + { + + } + + public override Protocol Clone() => new getfactionbaseinfo + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 4096; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfactionbaseinfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfactionbaseinfo.cs.meta new file mode 100644 index 0000000000..c246b3fe66 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfactionbaseinfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3fbc2e11707d74df8863317f40ea6684 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfriends.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfriends.cs new file mode 100644 index 0000000000..ae90a10137 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfriends.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getfriends : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public getfriends() : base(ProtocolType.PROTOCOL_GETFRIENDS) + { + + } + + public override Protocol Clone() => new getfriends + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 4096; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfriends.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfriends.cs.meta new file mode 100644 index 0000000000..947f00265a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getfriends.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 518f818de65ee48a4b9782caa0ee8452 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gethelpstates.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gethelpstates.cs new file mode 100644 index 0000000000..befda61672 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gethelpstates.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gethelpstates : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public gethelpstates() : base(ProtocolType.PROTOCOL_GETHELPSTATES) + { + + } + + public override Protocol Clone() => new gethelpstates + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gethelpstates.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gethelpstates.cs.meta new file mode 100644 index 0000000000..59a4d6384c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gethelpstates.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b9fbff82e576c45d6940d30dc9f49b64 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmail.cs new file mode 100644 index 0000000000..0537427a57 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmail.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getmail : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public byte Mail_id { get; set; } + + public getmail() : base(ProtocolType.PROTOCOL_GETMAIL) + { + + } + + public override Protocol Clone() => new getmail + { + Roleid = Roleid, + Localsid = Localsid, + Mail_id = Mail_id + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Mail_id); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Mail_id = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmail.cs.meta new file mode 100644 index 0000000000..1a64a784f2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2d7c610b30a2a4164a2241deffd12766 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmailattachobj.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmailattachobj.cs new file mode 100644 index 0000000000..1fad4dd11d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmailattachobj.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getmailattachobj : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public byte Mail_id { get; set; } + public byte Obj_type { get; set; } + public Octets Syncdata { get; set; } + + public getmailattachobj() : base(ProtocolType.PROTOCOL_GETMAILATTACHOBJ) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new getmailattachobj + { + Roleid = Roleid, + Localsid = Localsid, + Mail_id = Mail_id, + Obj_type = Obj_type, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Mail_id); + os.Write(Obj_type); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Mail_id = os.ReadByte(); + Obj_type = os.ReadByte(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 102400; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmailattachobj.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmailattachobj.cs.meta new file mode 100644 index 0000000000..863ae5883b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmailattachobj.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 57fcbc8dd560f4a5caaf23adfd672379 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmaillist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmaillist.cs new file mode 100644 index 0000000000..690fd09caa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmaillist.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getmaillist : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public getmaillist() : base(ProtocolType.PROTOCOL_GETMAILLIST) + { + + } + + public override Protocol Clone() => new getmaillist + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmaillist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmaillist.cs.meta new file mode 100644 index 0000000000..583f53e783 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getmaillist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c3189cdb82ac645dfb0cd50b77401ef2 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerbriefinfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerbriefinfo.cs new file mode 100644 index 0000000000..7e3e343026 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerbriefinfo.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getplayerbriefinfo : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public byte Reason { get; set; } + + public getplayerbriefinfo() : base(ProtocolType.PROTOCOL_GETPLAYERBRIEFINFO) + { + + } + + public override Protocol Clone() => new getplayerbriefinfo + { + Roleid = Roleid, + Localsid = Localsid, + Reason = Reason + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Reason); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Reason = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 2048; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerbriefinfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerbriefinfo.cs.meta new file mode 100644 index 0000000000..5e0b07ee9f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerbriefinfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 09760d058b53f4e0d9af8147e2743798 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerfactioninfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerfactioninfo.cs new file mode 100644 index 0000000000..e84b9aa74c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerfactioninfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getplayerfactioninfo : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public getplayerfactioninfo() : base(ProtocolType.PROTOCOL_GETPLAYERFACTIONINFO) + { + + } + + public override Protocol Clone() => new getplayerfactioninfo + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 4096; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerfactioninfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerfactioninfo.cs.meta new file mode 100644 index 0000000000..1f4d4f55b8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerfactioninfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f5f9390cc63be4914a12a68caa7b7e3e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayeridbyname.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayeridbyname.cs new file mode 100644 index 0000000000..cee612c5bb --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayeridbyname.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getplayeridbyname : Protocol + { + public Octets Rolename { get; set; } + public int Localsid { get; set; } + public byte Reason { get; set; } + public byte L_reason { get; set; } + + public getplayeridbyname() : base(ProtocolType.PROTOCOL_GETPLAYERIDBYNAME) + { + Rolename = new Octets(); + } + + public override Protocol Clone() => new getplayeridbyname + { + Rolename = new Octets(Rolename.ToArray()), + Localsid = Localsid, + Reason = Reason, + L_reason = L_reason + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Rolename); + os.Write(Localsid); + os.Write(Reason); + os.Write(L_reason); + } + + public override void Unmarshal(OctetsStream os) + { + Rolename = os.ReadOctets(); + Localsid = os.ReadInt32(); + Reason = os.ReadByte(); + L_reason = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayeridbyname.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayeridbyname.cs.meta new file mode 100644 index 0000000000..d96a51034e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayeridbyname.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1169009bd90b1403fa08de2fba614609 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getrewardlist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getrewardlist.cs new file mode 100644 index 0000000000..da3ba9d18b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getrewardlist.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getrewardlist : Protocol + { + public int Roleid { get; set; } + public int Start_index { get; set; } + public int Localsid { get; set; } + + public getrewardlist() : base(ProtocolType.PROTOCOL_GETREWARDLIST) + { + + } + + public override Protocol Clone() => new getrewardlist + { + Roleid = Roleid, + Start_index = Start_index, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Start_index); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Start_index = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getrewardlist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getrewardlist.cs.meta new file mode 100644 index 0000000000..5ddab3a05f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getrewardlist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d9cc414015a874efea82f4ec97612e51 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getsavedmsg.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getsavedmsg.cs new file mode 100644 index 0000000000..c0f660f4b5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getsavedmsg.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getsavedmsg : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public getsavedmsg() : base(ProtocolType.PROTOCOL_GETSAVEDMSG) + { + + } + + public override Protocol Clone() => new getsavedmsg + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getsavedmsg.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getsavedmsg.cs.meta new file mode 100644 index 0000000000..ac50e6561c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getsavedmsg.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2458d930f0f254c12ac03cb940d24b85 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getselllist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getselllist.cs new file mode 100644 index 0000000000..8b1a2d7d06 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getselllist.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getselllist : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public getselllist() : base(ProtocolType.PROTOCOL_GETSELLLIST) + { + + } + + public override Protocol Clone() => new getselllist + { + Roleid = Roleid, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getselllist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getselllist.cs.meta new file mode 100644 index 0000000000..fcfb01582e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getselllist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1d75bd74f3ece45bf801e493c3578b63 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getuiconfig.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getuiconfig.cs new file mode 100644 index 0000000000..d154154a44 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getuiconfig.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class getuiconfig : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public getuiconfig() : base(ProtocolType.PROTOCOL_GETUICONFIG) + { + + } + + public override Protocol Clone() => new getuiconfig + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getuiconfig.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getuiconfig.cs.meta new file mode 100644 index 0000000000..6598ec3168 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getuiconfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5782071a2cb4f4456b9a62e24c8dffdb \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmforbidrole.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmforbidrole.cs new file mode 100644 index 0000000000..7c906040e7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmforbidrole.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmforbidrole : Protocol + { + public byte Fbd_type { get; set; } + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public int Dstroleid { get; set; } + public int Forbid_time { get; set; } + public Octets Reason { get; set; } + + public gmforbidrole() : base(ProtocolType.PROTOCOL_GMFORBIDROLE) + { + Reason = new Octets(); + } + + public override Protocol Clone() => new gmforbidrole + { + Fbd_type = Fbd_type, + Gmroleid = Gmroleid, + Localsid = Localsid, + Dstroleid = Dstroleid, + Forbid_time = Forbid_time, + Reason = new Octets(Reason.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Fbd_type); + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Dstroleid); + os.Write(Forbid_time); + os.Write(Reason); + } + + public override void Unmarshal(OctetsStream os) + { + Fbd_type = os.ReadByte(); + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Dstroleid = os.ReadInt32(); + Forbid_time = os.ReadInt32(); + Reason = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmforbidrole.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmforbidrole.cs.meta new file mode 100644 index 0000000000..41c3fbc87a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmforbidrole.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a1e0fcec5b4954c70ba4db43ab713836 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmgetplayerconsumeinfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmgetplayerconsumeinfo.cs new file mode 100644 index 0000000000..fa55d721f0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmgetplayerconsumeinfo.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmgetplayerconsumeinfo : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public byte Reason { get; set; } + + public gmgetplayerconsumeinfo() : base(ProtocolType.PROTOCOL_GMGETPLAYERCONSUMEINFO) + { + + } + + public override Protocol Clone() => new gmgetplayerconsumeinfo + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Reason = Reason + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Reason); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Reason = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmgetplayerconsumeinfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmgetplayerconsumeinfo.cs.meta new file mode 100644 index 0000000000..75f7bb458c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmgetplayerconsumeinfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 921f1587eadf64858abd4141b93d6626 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutrole.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutrole.cs new file mode 100644 index 0000000000..6900eeb070 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutrole.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmkickoutrole : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public int Kickroleid { get; set; } + public int Forbid_time { get; set; } + public Octets Reason { get; set; } + public int L_forbid_time { get; set; } + + public gmkickoutrole() : base(ProtocolType.PROTOCOL_GMKICKOUTROLE) + { + Reason = new Octets(); + } + + public override Protocol Clone() => new gmkickoutrole + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Kickroleid = Kickroleid, + Forbid_time = Forbid_time, + Reason = new Octets(Reason.ToArray()), + L_forbid_time = L_forbid_time + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Kickroleid); + os.Write(Forbid_time); + os.Write(Reason); + os.Write(L_forbid_time); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Kickroleid = os.ReadInt32(); + Forbid_time = os.ReadInt32(); + Reason = os.ReadOctets(); + L_forbid_time = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutrole.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutrole.cs.meta new file mode 100644 index 0000000000..1eb6ae5a7d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutrole.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f0b0d9cbbf4e6443fb5611743921fe93 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutuser.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutuser.cs new file mode 100644 index 0000000000..efd3337605 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutuser.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmkickoutuser : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public int Kickuserid { get; set; } + public int Forbid_time { get; set; } + public Octets Reason { get; set; } + public int L_forbid_time { get; set; } + + public gmkickoutuser() : base(ProtocolType.PROTOCOL_GMKICKOUTUSER) + { + Reason = new Octets(); + } + + public override Protocol Clone() => new gmkickoutuser + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Kickuserid = Kickuserid, + Forbid_time = Forbid_time, + Reason = new Octets(Reason.ToArray()), + L_forbid_time = L_forbid_time + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Kickuserid); + os.Write(Forbid_time); + os.Write(Reason); + os.Write(L_forbid_time); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Kickuserid = os.ReadInt32(); + Forbid_time = os.ReadInt32(); + Reason = os.ReadOctets(); + L_forbid_time = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutuser.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutuser.cs.meta new file mode 100644 index 0000000000..5ca5c8694c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmkickoutuser.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6f901630301ca49c7ac8f9c335f3497a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmlistonlineuser.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmlistonlineuser.cs new file mode 100644 index 0000000000..e5bbe4a6a2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmlistonlineuser.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmlistonlineuser : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public int Handler { get; set; } + public Octets Cond { get; set; } + + public gmlistonlineuser() : base(ProtocolType.PROTOCOL_GMLISTONLINEUSER) + { + Cond = new Octets(); + } + + public override Protocol Clone() => new gmlistonlineuser + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Handler = Handler, + Cond = new Octets(Cond.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Handler); + os.Write(Cond); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Handler = os.ReadInt32(); + Cond = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmlistonlineuser.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmlistonlineuser.cs.meta new file mode 100644 index 0000000000..d79fc8e21c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmlistonlineuser.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f24de6364e55d464285aa456efd4dfb6 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmonlinenum.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmonlinenum.cs new file mode 100644 index 0000000000..bd761b8300 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmonlinenum.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmonlinenum : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + + public gmonlinenum() : base(ProtocolType.PROTOCOL_GMONLINENUM) + { + + } + + public override Protocol Clone() => new gmonlinenum + { + Gmroleid = Gmroleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmonlinenum.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmonlinenum.cs.meta new file mode 100644 index 0000000000..b3a71de4e7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmonlinenum.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5c8cf099f66b04cc9ad73e448458b3db \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmrestartserver.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmrestartserver.cs new file mode 100644 index 0000000000..255e54cf50 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmrestartserver.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmrestartserver : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public int Gsid { get; set; } + public int Restart_time { get; set; } + + public gmrestartserver() : base(ProtocolType.PROTOCOL_GMRESTARTSERVER) + { + + } + + public override Protocol Clone() => new gmrestartserver + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Gsid = Gsid, + Restart_time = Restart_time + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Gsid); + os.Write(Restart_time); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Gsid = os.ReadInt32(); + Restart_time = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmrestartserver.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmrestartserver.cs.meta new file mode 100644 index 0000000000..da46b16b4b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmrestartserver.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c06f020e74a6545f596a438c0dd2fbaa \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmsettimelessautolock.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmsettimelessautolock.cs new file mode 100644 index 0000000000..38e0835683 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmsettimelessautolock.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmsettimelessautolock : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public int Dstroleid { get; set; } + public byte Enable { get; set; } + + public gmsettimelessautolock() : base(ProtocolType.PROTOCOL_GMSETTIMELESSAUTOLOCK) + { + + } + + public override Protocol Clone() => new gmsettimelessautolock + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Dstroleid = Dstroleid, + Enable = Enable + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Dstroleid); + os.Write(Enable); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Dstroleid = os.ReadInt32(); + Enable = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmsettimelessautolock.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmsettimelessautolock.cs.meta new file mode 100644 index 0000000000..7c2b6cf469 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmsettimelessautolock.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7828c60371389439698d87b8f74a7af8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutup.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutup.cs new file mode 100644 index 0000000000..68c8680042 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutup.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmshutup : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public int Dstuserid { get; set; } + public int Forbid_time { get; set; } + public Octets Reason { get; set; } + + public gmshutup() : base(ProtocolType.PROTOCOL_GMSHUTUP) + { + Reason = new Octets(); + } + + public override Protocol Clone() => new gmshutup + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Dstuserid = Dstuserid, + Forbid_time = Forbid_time, + Reason = new Octets(Reason.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Dstuserid); + os.Write(Forbid_time); + os.Write(Reason); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Dstuserid = os.ReadInt32(); + Forbid_time = os.ReadInt32(); + Reason = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutup.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutup.cs.meta new file mode 100644 index 0000000000..9f32705bda --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutup.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9d8368989b6d6416fab841b06974bd89 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutuprole.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutuprole.cs new file mode 100644 index 0000000000..7727d71c7b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutuprole.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmshutuprole : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public int Dstroleid { get; set; } + public int Forbid_time { get; set; } + public Octets Reason { get; set; } + + public gmshutuprole() : base(ProtocolType.PROTOCOL_GMSHUTUPROLE) + { + Reason = new Octets(); + } + + public override Protocol Clone() => new gmshutuprole + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Dstroleid = Dstroleid, + Forbid_time = Forbid_time, + Reason = new Octets(Reason.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Dstroleid); + os.Write(Forbid_time); + os.Write(Reason); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Dstroleid = os.ReadInt32(); + Forbid_time = os.ReadInt32(); + Reason = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 256; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutuprole.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutuprole.cs.meta new file mode 100644 index 0000000000..e9e9500858 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmshutuprole.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 92dff41805ec5491c98bdf6faf02365a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmtogglechat.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmtogglechat.cs new file mode 100644 index 0000000000..7aae9ef9b7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmtogglechat.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class gmtogglechat : Protocol + { + public int Gmroleid { get; set; } + public int Localsid { get; set; } + public byte Enable { get; set; } + + public gmtogglechat() : base(ProtocolType.PROTOCOL_GMTOGGLECHAT) + { + + } + + public override Protocol Clone() => new gmtogglechat + { + Gmroleid = Gmroleid, + Localsid = Localsid, + Enable = Enable + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gmroleid); + os.Write(Localsid); + os.Write(Enable); + } + + public override void Unmarshal(OctetsStream os) + { + Gmroleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Enable = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmtogglechat.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmtogglechat.cs.meta new file mode 100644 index 0000000000..89c9c7b980 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/gmtogglechat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 456085895a4624a6aab46425f558dd90 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kecandidateapply.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kecandidateapply.cs new file mode 100644 index 0000000000..f59eb1cb6d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kecandidateapply.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class kecandidateapply : Protocol + { + public int Roleid { get; set; } + public int Item_id { get; set; } + public int Item_num { get; set; } + public Octets Syncdata { get; set; } + + public kecandidateapply() : base(ProtocolType.PROTOCOL_KECANDIDATEAPPLY) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new kecandidateapply + { + Roleid = Roleid, + Item_id = Item_id, + Item_num = Item_num, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Item_id); + os.Write(Item_num); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_num = os.ReadInt32(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kecandidateapply.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kecandidateapply.cs.meta new file mode 100644 index 0000000000..b7d0e82e63 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kecandidateapply.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: dda98adfe6b3e42d5bd61e939bb49e10 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kegetstatus.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kegetstatus.cs new file mode 100644 index 0000000000..1df55f0176 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kegetstatus.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class kegetstatus : Protocol + { + public int Roleid { get; set; } + + public kegetstatus() : base(ProtocolType.PROTOCOL_KEGETSTATUS) + { + + } + + public override Protocol Clone() => new kegetstatus + { + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kegetstatus.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kegetstatus.cs.meta new file mode 100644 index 0000000000..4bcb766088 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kegetstatus.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5ba5cfea371d0482280ea11357be6a9c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kevoting.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kevoting.cs new file mode 100644 index 0000000000..1a279d87a2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kevoting.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class kevoting : Protocol + { + public int Roleid { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_num { get; set; } + public int Candidate_roleid { get; set; } + public Octets Syncdata { get; set; } + + public kevoting() : base(ProtocolType.PROTOCOL_KEVOTING) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new kevoting + { + Roleid = Roleid, + Item_id = Item_id, + Item_pos = Item_pos, + Item_num = Item_num, + Candidate_roleid = Candidate_roleid, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_num); + os.Write(Candidate_roleid); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_num = os.ReadInt32(); + Candidate_roleid = os.ReadInt32(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kevoting.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kevoting.cs.meta new file mode 100644 index 0000000000..3e5225bff5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/kevoting.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 943791455500941efb4199de3bad4c0a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/keyreestablish.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/keyreestablish.cs new file mode 100644 index 0000000000..14376cf6a1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/keyreestablish.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class keyreestablish : Protocol + { + public int Roleid { get; set; } + public int Userid { get; set; } + public byte Flag { get; set; } + public int Src_zoneid { get; set; } + public Octets Random { get; set; } + public int L_src_zoneid { get; set; } + + public keyreestablish() : base(ProtocolType.PROTOCOL_KEYREESTABLISH) + { + Random = new Octets(); + } + + public override Protocol Clone() => new keyreestablish + { + Roleid = Roleid, + Userid = Userid, + Flag = Flag, + Src_zoneid = Src_zoneid, + Random = new Octets(Random.ToArray()), + L_src_zoneid = L_src_zoneid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Userid); + os.Write(Flag); + os.Write(Src_zoneid); + os.Write(Random); + os.Write(L_src_zoneid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Userid = os.ReadInt32(); + Flag = os.ReadByte(); + Src_zoneid = os.ReadInt32(); + Random = os.ReadOctets(); + L_src_zoneid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/keyreestablish.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/keyreestablish.cs.meta new file mode 100644 index 0000000000..b8dfa575da --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/keyreestablish.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 37d40734e704042388464186ce9f6e75 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixchallenge.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixchallenge.cs new file mode 100644 index 0000000000..8dc600b0b3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixchallenge.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class matrixchallenge : Protocol + { + public int Algorithm { get; set; } + public int Nonce { get; set; } + public int L_nonce { get; set; } + + public matrixchallenge() : base(ProtocolType.PROTOCOL_MATRIXCHALLENGE) + { + + } + + public override Protocol Clone() => new matrixchallenge + { + Algorithm = Algorithm, + Nonce = Nonce, + L_nonce = L_nonce + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Algorithm); + os.Write(Nonce); + os.Write(L_nonce); + } + + public override void Unmarshal(OctetsStream os) + { + Algorithm = os.ReadInt32(); + Nonce = os.ReadInt32(); + L_nonce = os.ReadInt32(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixchallenge.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixchallenge.cs.meta new file mode 100644 index 0000000000..c5fa645585 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixchallenge.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7aad8b2ba6dfa436eaa8c6faeba5ead5 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixresponse.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixresponse.cs new file mode 100644 index 0000000000..d52e571ca2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixresponse.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class matrixresponse : Protocol + { + public int Response { get; set; } + + public matrixresponse() : base(ProtocolType.PROTOCOL_MATRIXRESPONSE) + { + + } + + public override Protocol Clone() => new matrixresponse + { + Response = Response + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Response); + } + + public override void Unmarshal(OctetsStream os) + { + Response = os.ReadInt32(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixresponse.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixresponse.cs.meta new file mode 100644 index 0000000000..c5484ecd56 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/matrixresponse.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6666830670b9b4f1397a811efa05a238 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/onlineannounce.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/onlineannounce.cs new file mode 100644 index 0000000000..40cb09b02a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/onlineannounce.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class onlineannounce : Protocol + { + + + public int Userid { get; set; } + public uint Localsid { get; set; } + public int Remain_time { get; set; } + public byte Zoneid { get; set; } + public int Free_time_left { get; set; } + public int Free_time_end { get; set; } + public int Creatime { get; set; } + public byte Referrer_flag { get; set; } + public byte Passwd_flag { get; set; } + public byte Usbbind { get; set; } + public byte Accountinfo_flag { get; set; } + + public onlineannounce() : base(ProtocolType.PROTOCOL_ONLINEANNOUNCE) + { + + } + + public override Protocol Clone() => new onlineannounce + { + Userid = Userid, + Localsid = Localsid, + Remain_time = Remain_time, + Zoneid = Zoneid, + Free_time_left = Free_time_left, + Free_time_end = Free_time_end, + Creatime = Creatime, + Referrer_flag = Referrer_flag, + Passwd_flag = Passwd_flag, + Usbbind = Usbbind, + Accountinfo_flag = Accountinfo_flag, + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + os.Write(Remain_time); + os.Write(Zoneid); + os.Write(Free_time_left); + os.Write(Free_time_end); + os.Write(Creatime); + os.Write(Referrer_flag); + os.Write(Passwd_flag); + os.Write(Usbbind); + os.Write(Accountinfo_flag); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadUInt32(); + Remain_time = os.ReadInt32(); + Zoneid = os.ReadByte(); + Free_time_left = os.ReadInt32(); + Free_time_end = os.ReadInt32(); + Creatime = os.ReadInt32(); + Referrer_flag = os.ReadByte(); + Passwd_flag = os.ReadByte(); + Usbbind = os.ReadByte(); + Accountinfo_flag = os.ReadByte(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 64; + + public override string ToString => $"Userid: {Userid}, Localsid: {Localsid}, Remain_time: {Remain_time}, Zoneid: {Zoneid}, Free_time_left: {Free_time_left}, Free_time_end: {Free_time_end}, Creatime: {Creatime}, Referrer_flag: {Referrer_flag}, Passwd_flag: {Passwd_flag}, Usbbind: {Usbbind}, Accountinfo_flag: {Accountinfo_flag}"; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/onlineannounce.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/onlineannounce.cs.meta new file mode 100644 index 0000000000..876fc9bb02 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/onlineannounce.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5debf91bf72494cef90e1a49927abd02 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playeraccuse.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playeraccuse.cs new file mode 100644 index 0000000000..6bbd2ee58a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playeraccuse.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playeraccuse : Protocol + { + public int Roleid { get; set; } + public int Dst_roleid { get; set; } + public Octets Content { get; set; } + + public playeraccuse() : base(ProtocolType.PROTOCOL_PLAYERACCUSE) + { + Content = new Octets(); + } + + public override Protocol Clone() => new playeraccuse + { + Roleid = Roleid, + Dst_roleid = Dst_roleid, + Content = new Octets(Content.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Dst_roleid); + os.Write(Content); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Dst_roleid = os.ReadInt32(); + Content = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playeraccuse.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playeraccuse.cs.meta new file mode 100644 index 0000000000..479ad93aa3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playeraccuse.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b3a7073bc8b534153a3aa73becab33ee \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo.cs new file mode 100644 index 0000000000..2e135903e8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playerbaseinfo : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public playerbaseinfo() : base(ProtocolType.PROTOCOL_PLAYERBASEINFO) + { + + } + + public override Protocol Clone() => new playerbaseinfo + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 2048; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo.cs.meta new file mode 100644 index 0000000000..2e4852c37f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 930dfab774e5e47bfb8f33be0ddad9b0 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo_re.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo_re.cs new file mode 100644 index 0000000000..d120f81411 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo_re.cs @@ -0,0 +1,47 @@ +using CSNetwork.Protocols.rpcdata; +using System; +using System.Collections.Generic; +using System.Text; + +namespace CSNetwork.Protocols +{ + public class playerbaseinfo_re : Protocol + { + public int Retcode { get; set; } + public int Roleid { get; set; } + public uint Localsid { get; set; } + public GRoleBase Player { get; set; } + + public playerbaseinfo_re() : base(ProtocolType.PROTOCOL_PLAYERBASEINFO_RE) + { + Player = new GRoleBase(); + } + + public override Protocol Clone() => new playerbaseinfo_re + { + Retcode = Retcode, + Roleid = Roleid, + Localsid = Localsid, + Player = Player + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Retcode); + os.Write(Roleid); + Player.Marshal(os); + } + + public override void Unmarshal(OctetsStream os) + { + Retcode = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadUInt32(); + Player.Unmarshal(os); + } + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1536; + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo_re.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo_re.cs.meta new file mode 100644 index 0000000000..34211ea861 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfo_re.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bbc6cba74d97941b79f5f7183d2d74e1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfocrc.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfocrc.cs new file mode 100644 index 0000000000..7a703c5923 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfocrc.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playerbaseinfocrc : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public playerbaseinfocrc() : base(ProtocolType.PROTOCOL_PLAYERBASEINFOCRC) + { + + } + + public override Protocol Clone() => new playerbaseinfocrc + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfocrc.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfocrc.cs.meta new file mode 100644 index 0000000000..bd47e3da91 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerbaseinfocrc.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: eaf622e5c6f864e6f8707b07ec50d7ab \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerlogout.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerlogout.cs new file mode 100644 index 0000000000..bff70ce596 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerlogout.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playerlogout : Protocol + { + public int Result { get; set; } + public int Roleid { get; set; } + public int Provider_link_id { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public playerlogout() : base(ProtocolType.PROTOCOL_PLAYERLOGOUT) + { + + } + + public override Protocol Clone() => new playerlogout + { + Result = Result, + Roleid = Roleid, + Provider_link_id = Provider_link_id, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Result); + os.Write(Roleid); + os.Write(Provider_link_id); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Result = os.ReadInt32(); + Roleid = os.ReadInt32(); + Provider_link_id = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerlogout.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerlogout.cs.meta new file mode 100644 index 0000000000..ebdd504c20 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerlogout.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 346a64042ab914b3f92aa4ae3773152a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playernameupdate.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playernameupdate.cs new file mode 100644 index 0000000000..f94785d8ea --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playernameupdate.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playernameupdate : Protocol + { + public int Roleid { get; set; } + public Octets Newname { get; set; } + + public playernameupdate() : base(ProtocolType.PROTOCOL_PLAYERNAMEUPDATE) + { + Newname = new Octets(); + } + + public override Protocol Clone() => new playernameupdate + { + Roleid = Roleid, + Newname = new Octets(Newname.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Newname); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Newname = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playernameupdate.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playernameupdate.cs.meta new file mode 100644 index 0000000000..10a91b66be --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playernameupdate.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 921b4e26f807a40c8b3abfb6d6bc0be9 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetmatchresult.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetmatchresult.cs new file mode 100644 index 0000000000..3c0d409b3a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetmatchresult.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playerprofilegetmatchresult : Protocol + { + public int Roleid { get; set; } + public int Match_mode { get; set; } + public int Localsid { get; set; } + + public playerprofilegetmatchresult() : base(ProtocolType.PROTOCOL_PLAYERPROFILEGETMATCHRESULT) + { + + } + + public override Protocol Clone() => new playerprofilegetmatchresult + { + Roleid = Roleid, + Match_mode = Match_mode, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Match_mode); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Match_mode = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetmatchresult.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetmatchresult.cs.meta new file mode 100644 index 0000000000..976391904f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetmatchresult.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 10cd6f55249934b07ba8bc11c9b1d37d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetprofiledata.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetprofiledata.cs new file mode 100644 index 0000000000..011b1201be --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetprofiledata.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playerprofilegetprofiledata : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public playerprofilegetprofiledata() : base(ProtocolType.PROTOCOL_PLAYERPROFILEGETPROFILEDATA) + { + + } + + public override Protocol Clone() => new playerprofilegetprofiledata + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetprofiledata.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetprofiledata.cs.meta new file mode 100644 index 0000000000..ff729866dc --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilegetprofiledata.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5268af06aeae24e8d8f5070e3bd5d5fe \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilesetprofiledata.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilesetprofiledata.cs new file mode 100644 index 0000000000..dac801e3c6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilesetprofiledata.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playerprofilesetprofiledata : Protocol + { + public int Roleid { get; set; } + + public playerprofilesetprofiledata() : base(ProtocolType.PROTOCOL_PLAYERPROFILESETPROFILEDATA) + { + + } + + public override Protocol Clone() => new playerprofilesetprofiledata + { + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilesetprofiledata.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilesetprofiledata.cs.meta new file mode 100644 index 0000000000..169505fee2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playerprofilesetprofiledata.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4170781ba359e47a4b74f16148818016 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmail.cs new file mode 100644 index 0000000000..c2caecaa90 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmail.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playersendmail : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Receiver { get; set; } + public Octets Title { get; set; } + public Octets Context { get; set; } + public int Attach_obj_id { get; set; } + public int Attach_obj_num { get; set; } + public int Attach_obj_pos { get; set; } + public int Attach_money { get; set; } + public Octets Sender_name { get; set; } + public Octets Syncdata { get; set; } + public int L_attach_obj_num { get; set; } + + public playersendmail() : base(ProtocolType.PROTOCOL_PLAYERSENDMAIL) + { + Title = new Octets(); + Context = new Octets(); + Sender_name = new Octets(); + Syncdata = new Octets(); + } + + public override Protocol Clone() => new playersendmail + { + Roleid = Roleid, + Localsid = Localsid, + Receiver = Receiver, + Title = new Octets(Title.ToArray()), + Context = new Octets(Context.ToArray()), + Attach_obj_id = Attach_obj_id, + Attach_obj_num = Attach_obj_num, + Attach_obj_pos = Attach_obj_pos, + Attach_money = Attach_money, + Sender_name = new Octets(Sender_name.ToArray()), + Syncdata = new Octets(Syncdata.ToArray()), + L_attach_obj_num = L_attach_obj_num + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Receiver); + os.Write(Title); + os.Write(Context); + os.Write(Attach_obj_id); + os.Write(Attach_obj_num); + os.Write(Attach_obj_pos); + os.Write(Attach_money); + os.Write(Sender_name); + os.Write(Syncdata); + os.Write(L_attach_obj_num); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Receiver = os.ReadInt32(); + Title = os.ReadOctets(); + Context = os.ReadOctets(); + Attach_obj_id = os.ReadInt32(); + Attach_obj_num = os.ReadInt32(); + Attach_obj_pos = os.ReadInt32(); + Attach_money = os.ReadInt32(); + Sender_name = os.ReadOctets(); + Syncdata = os.ReadOctets(); + L_attach_obj_num = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 102400; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmail.cs.meta new file mode 100644 index 0000000000..ce22021380 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 62261cd514ae24849b4ad88249e53678 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmassmail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmassmail.cs new file mode 100644 index 0000000000..ab47027df5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmassmail.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class playersendmassmail : Protocol + { + public byte Mass_type { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + public Octets Title { get; set; } + public Octets Context { get; set; } + public Octets Sender_name { get; set; } + public int Cost_obj_id { get; set; } + public int Cost_obj_num { get; set; } + public int Cost_obj_pos { get; set; } + public int Cost_money { get; set; } + public Octets Syncdata { get; set; } + public int L_cost_obj_pos { get; set; } + + public playersendmassmail() : base(ProtocolType.PROTOCOL_PLAYERSENDMASSMAIL) + { + Title = new Octets(); + Context = new Octets(); + Sender_name = new Octets(); + Syncdata = new Octets(); + } + + public override Protocol Clone() => new playersendmassmail + { + Mass_type = Mass_type, + Roleid = Roleid, + Localsid = Localsid, + Title = new Octets(Title.ToArray()), + Context = new Octets(Context.ToArray()), + Sender_name = new Octets(Sender_name.ToArray()), + Cost_obj_id = Cost_obj_id, + Cost_obj_num = Cost_obj_num, + Cost_obj_pos = Cost_obj_pos, + Cost_money = Cost_money, + Syncdata = new Octets(Syncdata.ToArray()), + L_cost_obj_pos = L_cost_obj_pos + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Mass_type); + os.Write(Roleid); + os.Write(Localsid); + os.Write(Title); + os.Write(Context); + os.Write(Sender_name); + os.Write(Cost_obj_id); + os.Write(Cost_obj_num); + os.Write(Cost_obj_pos); + os.Write(Cost_money); + os.Write(Syncdata); + os.Write(L_cost_obj_pos); + } + + public override void Unmarshal(OctetsStream os) + { + Mass_type = os.ReadByte(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Title = os.ReadOctets(); + Context = os.ReadOctets(); + Sender_name = os.ReadOctets(); + Cost_obj_id = os.ReadInt32(); + Cost_obj_num = os.ReadInt32(); + Cost_obj_pos = os.ReadInt32(); + Cost_money = os.ReadInt32(); + Syncdata = os.ReadOctets(); + L_cost_obj_pos = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmassmail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmassmail.cs.meta new file mode 100644 index 0000000000..d30afbe27c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/playersendmassmail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b17e034fd11ee4d9d96827fded820233 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/preservemail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/preservemail.cs new file mode 100644 index 0000000000..0d5d9c9137 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/preservemail.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class preservemail : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public byte Mail_id { get; set; } + public byte Blpreserve { get; set; } + + public preservemail() : base(ProtocolType.PROTOCOL_PRESERVEMAIL) + { + + } + + public override Protocol Clone() => new preservemail + { + Roleid = Roleid, + Localsid = Localsid, + Mail_id = Mail_id, + Blpreserve = Blpreserve + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Mail_id); + os.Write(Blpreserve); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Mail_id = os.ReadByte(); + Blpreserve = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/preservemail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/preservemail.cs.meta new file mode 100644 index 0000000000..9b0b4a0525 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/preservemail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 546b56867ba89405eb211a43cd2e65e6 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/privatechat.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/privatechat.cs new file mode 100644 index 0000000000..596c22f3d3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/privatechat.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class privatechat : Protocol + { + public byte Channel { get; set; } + public byte Emotion { get; set; } + public Octets Src_name { get; set; } + public int Srcroleid { get; set; } + public Octets Dst_name { get; set; } + public int Dstroleid { get; set; } + public Octets Msg { get; set; } + public Octets Data { get; set; } + public int Src_level { get; set; } + + public privatechat() : base(ProtocolType.PROTOCOL_PRIVATECHAT) + { + Src_name = new Octets(); + Dst_name = new Octets(); + Msg = new Octets(); + Data = new Octets(); + } + + public override Protocol Clone() => new privatechat + { + Channel = Channel, + Emotion = Emotion, + Src_name = new Octets(Src_name.ToArray()), + Srcroleid = Srcroleid, + Dst_name = new Octets(Dst_name.ToArray()), + Dstroleid = Dstroleid, + Msg = new Octets(Msg.ToArray()), + Data = new Octets(Data.ToArray()), + Src_level = Src_level + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Channel); + os.Write(Emotion); + os.Write(Src_name); + os.Write(Srcroleid); + os.Write(Dst_name); + os.Write(Dstroleid); + os.Write(Msg); + os.Write(Data); + os.Write(Src_level); + } + + public override void Unmarshal(OctetsStream os) + { + Channel = os.ReadByte(); + Emotion = os.ReadByte(); + Src_name = os.ReadOctets(); + Srcroleid = os.ReadInt32(); + Dst_name = os.ReadOctets(); + Dstroleid = os.ReadInt32(); + Msg = os.ReadOctets(); + Data = os.ReadOctets(); + Src_level = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/privatechat.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/privatechat.cs.meta new file mode 100644 index 0000000000..45c461e2e9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/privatechat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f0c3639e418ae4d8ab6ee6373262aa72 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopactive.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopactive.cs new file mode 100644 index 0000000000..2ae9472e0e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopactive.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopactive : Protocol + { + public int Roleid { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_num { get; set; } + public Octets Syncdata { get; set; } + public int L_item_num { get; set; } + + public pshopactive() : base(ProtocolType.PROTOCOL_PSHOPACTIVE) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new pshopactive + { + Roleid = Roleid, + Item_id = Item_id, + Item_pos = Item_pos, + Item_num = Item_num, + Syncdata = new Octets(Syncdata.ToArray()), + L_item_num = L_item_num + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_num); + os.Write(Syncdata); + os.Write(L_item_num); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_num = os.ReadInt32(); + Syncdata = os.ReadOctets(); + L_item_num = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopactive.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopactive.cs.meta new file mode 100644 index 0000000000..64ee4c0cc5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopactive.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 924fac3d9574746a29fff3366b167473 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopbuy.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopbuy.cs new file mode 100644 index 0000000000..1b019cf6de --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopbuy.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopbuy : Protocol + { + public int Roleid { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_count { get; set; } + public int Item_price { get; set; } + + public pshopbuy() : base(ProtocolType.PROTOCOL_PSHOPBUY) + { + + } + + public override Protocol Clone() => new pshopbuy + { + Roleid = Roleid, + Item_id = Item_id, + Item_pos = Item_pos, + Item_count = Item_count, + Item_price = Item_price + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_count); + os.Write(Item_price); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_count = os.ReadInt32(); + Item_price = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopbuy.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopbuy.cs.meta new file mode 100644 index 0000000000..749c8a3a76 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopbuy.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8bb55c081d12243b5a7f802a5591538c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcancelgoods.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcancelgoods.cs new file mode 100644 index 0000000000..1d628ad55e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcancelgoods.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopcancelgoods : Protocol + { + public int Roleid { get; set; } + public int Canceltype { get; set; } + public int Pos { get; set; } + + public pshopcancelgoods() : base(ProtocolType.PROTOCOL_PSHOPCANCELGOODS) + { + + } + + public override Protocol Clone() => new pshopcancelgoods + { + Roleid = Roleid, + Canceltype = Canceltype, + Pos = Pos + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Canceltype); + os.Write(Pos); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Canceltype = os.ReadInt32(); + Pos = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcancelgoods.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcancelgoods.cs.meta new file mode 100644 index 0000000000..98554913f6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcancelgoods.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 636dd72bf8d7b4b8eaa9ae37741eceb5 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcleargoods.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcleargoods.cs new file mode 100644 index 0000000000..5829873c6e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcleargoods.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopcleargoods : Protocol + { + public int Roleid { get; set; } + + public pshopcleargoods() : base(ProtocolType.PROTOCOL_PSHOPCLEARGOODS) + { + + } + + public override Protocol Clone() => new pshopcleargoods + { + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcleargoods.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcleargoods.cs.meta new file mode 100644 index 0000000000..0772089c96 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcleargoods.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 648f69cb2451246c79e20b6a7e3d21ae \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcreate.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcreate.cs new file mode 100644 index 0000000000..64e928ee0e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcreate.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopcreate : Protocol + { + public int Roleid { get; set; } + public int Shoptype { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_num { get; set; } + public Octets Syncdata { get; set; } + public int L_item_pos { get; set; } + + public pshopcreate() : base(ProtocolType.PROTOCOL_PSHOPCREATE) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new pshopcreate + { + Roleid = Roleid, + Shoptype = Shoptype, + Item_id = Item_id, + Item_pos = Item_pos, + Item_num = Item_num, + Syncdata = new Octets(Syncdata.ToArray()), + L_item_pos = L_item_pos + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Shoptype); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_num); + os.Write(Syncdata); + os.Write(L_item_pos); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Shoptype = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_num = os.ReadInt32(); + Syncdata = os.ReadOctets(); + L_item_pos = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcreate.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcreate.cs.meta new file mode 100644 index 0000000000..97fae30778 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopcreate.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 915199c5518ab49d884a40cc9e00f347 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopdrawitem.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopdrawitem.cs new file mode 100644 index 0000000000..0118a8a145 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopdrawitem.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopdrawitem : Protocol + { + public int Roleid { get; set; } + public int Item_pos { get; set; } + public Octets Syncdata { get; set; } + + public pshopdrawitem() : base(ProtocolType.PROTOCOL_PSHOPDRAWITEM) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new pshopdrawitem + { + Roleid = Roleid, + Item_pos = Item_pos, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Item_pos); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopdrawitem.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopdrawitem.cs.meta new file mode 100644 index 0000000000..1de49db7f2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopdrawitem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2e996ed021a4d45af8964a8b156c593d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplist.cs new file mode 100644 index 0000000000..6dcac593cf --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplist.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshoplist : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Shoptype { get; set; } + + public pshoplist() : base(ProtocolType.PROTOCOL_PSHOPLIST) + { + + } + + public override Protocol Clone() => new pshoplist + { + Roleid = Roleid, + Localsid = Localsid, + Shoptype = Shoptype + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Shoptype); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Shoptype = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplist.cs.meta new file mode 100644 index 0000000000..1b8f0de8ab --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3fdb967d17e78408b80814422f643096 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplistitem.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplistitem.cs new file mode 100644 index 0000000000..cb12d58c31 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplistitem.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshoplistitem : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Itemid { get; set; } + public byte Listtype { get; set; } + public int Page_num { get; set; } + public byte L_listtype { get; set; } + + public pshoplistitem() : base(ProtocolType.PROTOCOL_PSHOPLISTITEM) + { + + } + + public override Protocol Clone() => new pshoplistitem + { + Roleid = Roleid, + Localsid = Localsid, + Itemid = Itemid, + Listtype = Listtype, + Page_num = Page_num, + L_listtype = L_listtype + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Itemid); + os.Write(Listtype); + os.Write(Page_num); + os.Write(L_listtype); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Itemid = os.ReadInt32(); + Listtype = os.ReadByte(); + Page_num = os.ReadInt32(); + L_listtype = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplistitem.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplistitem.cs.meta new file mode 100644 index 0000000000..8787aa1bc4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshoplistitem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: dc9c7b7368be24b32b6cc4c930a8b4a0 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopmanagefund.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopmanagefund.cs new file mode 100644 index 0000000000..57525d774e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopmanagefund.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopmanagefund : Protocol + { + public int Roleid { get; set; } + public int Optype { get; set; } + public int Money { get; set; } + public int Yinpiao { get; set; } + public Octets Syncdata { get; set; } + public int L_money { get; set; } + + public pshopmanagefund() : base(ProtocolType.PROTOCOL_PSHOPMANAGEFUND) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new pshopmanagefund + { + Roleid = Roleid, + Optype = Optype, + Money = Money, + Yinpiao = Yinpiao, + Syncdata = new Octets(Syncdata.ToArray()), + L_money = L_money + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Optype); + os.Write(Money); + os.Write(Yinpiao); + os.Write(Syncdata); + os.Write(L_money); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Optype = os.ReadInt32(); + Money = os.ReadInt32(); + Yinpiao = os.ReadInt32(); + Syncdata = os.ReadOctets(); + L_money = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopmanagefund.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopmanagefund.cs.meta new file mode 100644 index 0000000000..e9ca9d4456 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopmanagefund.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: dfff89f830f8b464ca4d02bbba57bced \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerbuy.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerbuy.cs new file mode 100644 index 0000000000..2580b5e964 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerbuy.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopplayerbuy : Protocol + { + public int Roleid { get; set; } + public int Master { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_count { get; set; } + public int Yp_cost { get; set; } + public Octets Syncdata { get; set; } + + public pshopplayerbuy() : base(ProtocolType.PROTOCOL_PSHOPPLAYERBUY) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new pshopplayerbuy + { + Roleid = Roleid, + Master = Master, + Item_id = Item_id, + Item_pos = Item_pos, + Item_count = Item_count, + Yp_cost = Yp_cost, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Master); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_count); + os.Write(Yp_cost); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Master = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_count = os.ReadInt32(); + Yp_cost = os.ReadInt32(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerbuy.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerbuy.cs.meta new file mode 100644 index 0000000000..6ce7c9b04a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerbuy.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9a3aad680e2ee47e89ae684f956e34b7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerget.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerget.cs new file mode 100644 index 0000000000..64ddebceb6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerget.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopplayerget : Protocol + { + public int Roleid { get; set; } + public int Master { get; set; } + + public pshopplayerget() : base(ProtocolType.PROTOCOL_PSHOPPLAYERGET) + { + + } + + public override Protocol Clone() => new pshopplayerget + { + Roleid = Roleid, + Master = Master + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Master); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Master = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerget.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerget.cs.meta new file mode 100644 index 0000000000..7b86470984 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayerget.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8b4e9b81ac2444b9593681ff35a08a9e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayersell.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayersell.cs new file mode 100644 index 0000000000..deac9b586c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayersell.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopplayersell : Protocol + { + public int Roleid { get; set; } + public int Master { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_count { get; set; } + public int Item_price { get; set; } + public int Inv_pos { get; set; } + public Octets Syncdata { get; set; } + + public pshopplayersell() : base(ProtocolType.PROTOCOL_PSHOPPLAYERSELL) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new pshopplayersell + { + Roleid = Roleid, + Master = Master, + Item_id = Item_id, + Item_pos = Item_pos, + Item_count = Item_count, + Item_price = Item_price, + Inv_pos = Inv_pos, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Master); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_count); + os.Write(Item_price); + os.Write(Inv_pos); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Master = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_count = os.ReadInt32(); + Item_price = os.ReadInt32(); + Inv_pos = os.ReadInt32(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayersell.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayersell.cs.meta new file mode 100644 index 0000000000..a96aef4e22 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopplayersell.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f51794367cc464c919ad5254867c4139 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopselfget.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopselfget.cs new file mode 100644 index 0000000000..da6e00fbe6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopselfget.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopselfget : Protocol + { + public int Roleid { get; set; } + + public pshopselfget() : base(ProtocolType.PROTOCOL_PSHOPSELFGET) + { + + } + + public override Protocol Clone() => new pshopselfget + { + Roleid = Roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopselfget.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopselfget.cs.meta new file mode 100644 index 0000000000..753b2d893a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopselfget.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: df3ed6f227c034b06b4f972e1b8b5d7d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsell.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsell.cs new file mode 100644 index 0000000000..782586aef4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsell.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopsell : Protocol + { + public int Roleid { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_count { get; set; } + public int Item_price { get; set; } + public int Inv_pos { get; set; } + public Octets Syncdata { get; set; } + + public pshopsell() : base(ProtocolType.PROTOCOL_PSHOPSELL) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new pshopsell + { + Roleid = Roleid, + Item_id = Item_id, + Item_pos = Item_pos, + Item_count = Item_count, + Item_price = Item_price, + Inv_pos = Inv_pos, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_count); + os.Write(Item_price); + os.Write(Inv_pos); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_count = os.ReadInt32(); + Item_price = os.ReadInt32(); + Inv_pos = os.ReadInt32(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsell.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsell.cs.meta new file mode 100644 index 0000000000..045eb5c707 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsell.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 93e8ddb7a47254846b18b62155d11a12 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsettype.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsettype.cs new file mode 100644 index 0000000000..c6dcef6535 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsettype.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class pshopsettype : Protocol + { + public int Roleid { get; set; } + public int Newtype { get; set; } + + public pshopsettype() : base(ProtocolType.PROTOCOL_PSHOPSETTYPE) + { + + } + + public override Protocol Clone() => new pshopsettype + { + Roleid = Roleid, + Newtype = Newtype + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Newtype); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Newtype = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsettype.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsettype.cs.meta new file mode 100644 index 0000000000..aa6e8beb01 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/pshopsettype.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8c2712e46ec71442da562626b33adfd7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/publicchat.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/publicchat.cs new file mode 100644 index 0000000000..4bd6bee704 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/publicchat.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class publicchat : Protocol + { + public byte Channel { get; set; } + public byte Emotion { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + public Octets Msg { get; set; } + public Octets Data { get; set; } + + public publicchat() : base(ProtocolType.PROTOCOL_PUBLICCHAT) + { + Msg = new Octets(); + Data = new Octets(); + } + + public override Protocol Clone() => new publicchat + { + Channel = Channel, + Emotion = Emotion, + Roleid = Roleid, + Localsid = Localsid, + Msg = new Octets(Msg.ToArray()), + Data = new Octets(Data.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Channel); + os.Write(Emotion); + os.Write(Roleid); + os.Write(Localsid); + os.Write(Msg); + os.Write(Data); + } + + public override void Unmarshal(OctetsStream os) + { + Channel = os.ReadByte(); + Emotion = os.ReadByte(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Msg = os.ReadOctets(); + Data = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/publicchat.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/publicchat.cs.meta new file mode 100644 index 0000000000..7cf62978b6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/publicchat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f3f3103a4493046cda72f7dea73590cf \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpaddcash.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpaddcash.cs new file mode 100644 index 0000000000..8dd46cf3c6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpaddcash.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class qpaddcash : Protocol + { + public int Userid { get; set; } + public int Cash { get; set; } + public int Cash_after_discount { get; set; } + public int Merchant_id { get; set; } + + public qpaddcash() : base(ProtocolType.PROTOCOL_QPADDCASH) + { + + } + + public override Protocol Clone() => new qpaddcash + { + Userid = Userid, + Cash = Cash, + Cash_after_discount = Cash_after_discount, + Merchant_id = Merchant_id + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Cash); + os.Write(Cash_after_discount); + os.Write(Merchant_id); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Cash = os.ReadInt32(); + Cash_after_discount = os.ReadInt32(); + Merchant_id = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpaddcash.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpaddcash.cs.meta new file mode 100644 index 0000000000..454e4d470d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpaddcash.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a3db8233d44a44e8e85bf4a3950551f0 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpannouncediscount.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpannouncediscount.cs new file mode 100644 index 0000000000..beebd59d39 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpannouncediscount.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class qpannouncediscount : Protocol + { + public int Localsid { get; set; } + + public qpannouncediscount() : base(ProtocolType.PROTOCOL_QPANNOUNCEDISCOUNT) + { + + } + + public override Protocol Clone() => new qpannouncediscount + { + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpannouncediscount.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpannouncediscount.cs.meta new file mode 100644 index 0000000000..b30c188c8e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpannouncediscount.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7cfa2d6aecc95472f930bf07a05782cb \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpgetactivatedservices.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpgetactivatedservices.cs new file mode 100644 index 0000000000..cae782d76b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpgetactivatedservices.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class qpgetactivatedservices : Protocol + { + public int Userid { get; set; } + + public qpgetactivatedservices() : base(ProtocolType.PROTOCOL_QPGETACTIVATEDSERVICES) + { + + } + + public override Protocol Clone() => new qpgetactivatedservices + { + Userid = Userid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpgetactivatedservices.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpgetactivatedservices.cs.meta new file mode 100644 index 0000000000..bac8907fb7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qpgetactivatedservices.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4e501eb518b1d4dd38737ee5e7043274 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qqaddfriend.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qqaddfriend.cs new file mode 100644 index 0000000000..8e362f388c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qqaddfriend.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class qqaddfriend : Protocol + { + public int Srcroleid { get; set; } + public byte Srczoneid { get; set; } + public Octets Srcrolename { get; set; } + public int Dstroleid { get; set; } + public byte Dstzoneid { get; set; } + public Octets Dstrolename { get; set; } + public int Localsid { get; set; } + + public qqaddfriend() : base(ProtocolType.PROTOCOL_QQADDFRIEND) + { + Srcrolename = new Octets(); + Dstrolename = new Octets(); + } + + public override Protocol Clone() => new qqaddfriend + { + Srcroleid = Srcroleid, + Srczoneid = Srczoneid, + Srcrolename = new Octets(Srcrolename.ToArray()), + Dstroleid = Dstroleid, + Dstzoneid = Dstzoneid, + Dstrolename = new Octets(Dstrolename.ToArray()), + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Srcroleid); + os.Write(Srczoneid); + os.Write(Srcrolename); + os.Write(Dstroleid); + os.Write(Dstzoneid); + os.Write(Dstrolename); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Srcroleid = os.ReadInt32(); + Srczoneid = os.ReadByte(); + Srcrolename = os.ReadOctets(); + Dstroleid = os.ReadInt32(); + Dstzoneid = os.ReadByte(); + Dstrolename = os.ReadOctets(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qqaddfriend.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qqaddfriend.cs.meta new file mode 100644 index 0000000000..53acf2d79d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/qqaddfriend.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bcba0ded58f764291b4b54f416d40182 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refgetreferencecode.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refgetreferencecode.cs new file mode 100644 index 0000000000..ccb6384ce5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refgetreferencecode.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class refgetreferencecode : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public refgetreferencecode() : base(ProtocolType.PROTOCOL_REFGETREFERENCECODE) + { + + } + + public override Protocol Clone() => new refgetreferencecode + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refgetreferencecode.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refgetreferencecode.cs.meta new file mode 100644 index 0000000000..dc00aa6883 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refgetreferencecode.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 857209224650040bfbbcc5afc5608503 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reflistreferrals.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reflistreferrals.cs new file mode 100644 index 0000000000..42e3c8f45f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reflistreferrals.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class reflistreferrals : Protocol + { + public int Roleid { get; set; } + public int Start_index { get; set; } + public int Localsid { get; set; } + + public reflistreferrals() : base(ProtocolType.PROTOCOL_REFLISTREFERRALS) + { + + } + + public override Protocol Clone() => new reflistreferrals + { + Roleid = Roleid, + Start_index = Start_index, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Start_index); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Start_index = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reflistreferrals.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reflistreferrals.cs.meta new file mode 100644 index 0000000000..8df9fb1b09 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reflistreferrals.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8689cab7b06ee4764bb20f3e8410fd05 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refwithdrawbonus.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refwithdrawbonus.cs new file mode 100644 index 0000000000..11efb3b96c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refwithdrawbonus.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class refwithdrawbonus : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public refwithdrawbonus() : base(ProtocolType.PROTOCOL_REFWITHDRAWBONUS) + { + + } + + public override Protocol Clone() => new refwithdrawbonus + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refwithdrawbonus.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refwithdrawbonus.cs.meta new file mode 100644 index 0000000000..055e758b93 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/refwithdrawbonus.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b45a7064f0a5b42b289452f744bc7680 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/report2gm.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/report2gm.cs new file mode 100644 index 0000000000..5a0f05dc07 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/report2gm.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class report2gm : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public Octets Rolename { get; set; } + public int Zoneid { get; set; } + public Octets Mapzone { get; set; } + public Octets Content { get; set; } + public int Aid { get; set; } + public Octets Line { get; set; } + public int Com_roleid { get; set; } + public Octets Com_rolename { get; set; } + + public report2gm() : base(ProtocolType.PROTOCOL_REPORT2GM) + { + Rolename = new Octets(); + Mapzone = new Octets(); + Content = new Octets(); + Line = new Octets(); + Com_rolename = new Octets(); + } + + public override Protocol Clone() => new report2gm + { + Roleid = Roleid, + Localsid = Localsid, + Rolename = new Octets(Rolename.ToArray()), + Zoneid = Zoneid, + Mapzone = new Octets(Mapzone.ToArray()), + Content = new Octets(Content.ToArray()), + Aid = Aid, + Line = new Octets(Line.ToArray()), + Com_roleid = Com_roleid, + Com_rolename = new Octets(Com_rolename.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Rolename); + os.Write(Zoneid); + os.Write(Mapzone); + os.Write(Content); + os.Write(Aid); + os.Write(Line); + os.Write(Com_roleid); + os.Write(Com_rolename); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Rolename = os.ReadOctets(); + Zoneid = os.ReadInt32(); + Mapzone = os.ReadOctets(); + Content = os.ReadOctets(); + Aid = os.ReadInt32(); + Line = os.ReadOctets(); + Com_roleid = os.ReadInt32(); + Com_rolename = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/report2gm.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/report2gm.cs.meta new file mode 100644 index 0000000000..94f3a197fb --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/report2gm.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 223536b0117104af99884e7a76d5b28e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reportchat.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reportchat.cs new file mode 100644 index 0000000000..8d15cbea7c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reportchat.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class reportchat : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Dst_roleid { get; set; } + public Octets Dst_rolename { get; set; } + public Octets Content { get; set; } + + public reportchat() : base(ProtocolType.PROTOCOL_REPORTCHAT) + { + Dst_rolename = new Octets(); + Content = new Octets(); + } + + public override Protocol Clone() => new reportchat + { + Roleid = Roleid, + Localsid = Localsid, + Dst_roleid = Dst_roleid, + Dst_rolename = new Octets(Dst_rolename.ToArray()), + Content = new Octets(Content.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Dst_roleid); + os.Write(Dst_rolename); + os.Write(Content); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Dst_roleid = os.ReadInt32(); + Dst_rolename = os.ReadOctets(); + Content = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reportchat.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reportchat.cs.meta new file mode 100644 index 0000000000..ea08a7a23a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/reportchat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1ed33c3dd93fd4ff3bddac024cccf641 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/response.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/response.cs new file mode 100644 index 0000000000..71fafbb9c5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/response.cs @@ -0,0 +1,137 @@ +using System; +using System.Security.Cryptography; // Added for MD5 and HMACMD5 + +namespace CSNetwork.Protocols +{ + // Corresponds to GNET::Response (Type 3) + public class response : Protocol + { + // Properties based on C++ definition (inl/response) + public Octets identity { get; set; } // GNET::Octets identity + public Octets response_data { get; set; } // GNET::Octets response - Renamed to avoid conflict with class name + public byte use_token { get; set; } // char use_token + public Octets cli_fingerprint { get; set; } // GNET::Octets cli_fingerprint + + // Original constructor using ProtocolType enum + public response() + : base(ProtocolType.PROTOCOL_RESPONSE) // Assuming PROTOCOL_RESPONSE is defined + { + identity = new Octets(); + response_data = new Octets(); + cli_fingerprint = new Octets(); + // use_token default is 0 (byte default) + } + + // Added Parameterized Constructor (Matches C++ version) + public response(Octets l_identity, Octets l_response_data, byte l_use_token, Octets l_cli_fingerprint) + : base(ProtocolType.PROTOCOL_RESPONSE) + { + identity = l_identity; + response_data = l_response_data; + use_token = l_use_token; + cli_fingerprint = l_cli_fingerprint; + } + + // Restore original Clone method + public override Protocol Clone() => + new response + { + identity = new Octets(identity.ToArray()), // Assuming Octets has a constructor taking byte[] + response_data = new Octets(response_data.ToArray()), + use_token = use_token, + cli_fingerprint = new Octets(cli_fingerprint.ToArray()) + }; + + // Restore original Marshal method based on C++ + public override void Marshal(OctetsStream os) + { + os.Write(identity); + os.Write(response_data); + os.Write(use_token); + os.Write(cli_fingerprint); + } + + // Restore original Unmarshal method based on C++ + public override void Unmarshal(OctetsStream os) + { + identity = os.ReadOctets(); + response_data = os.ReadOctets(); + use_token = os.ReadByte(); + cli_fingerprint = os.ReadOctets(); + } + + // Updated PriorPolicy to match C++ + public override int PriorPolicy() => 101; // Changed from 100 to 101 + + // Added SizePolicy method (Matches C++ version) + // Assuming base Protocol class has a virtual SizePolicy method + public override bool SizePolicy(int size) // Using int for size, adjust if needed + { + return size <= 512; + } + + // Added Setup method (Matches C++ version) + // Uses standard .NET Cryptography classes + public void Setup(Octets name, Octets passwd, Octets challenge) + { + byte[] digestBytes; + byte[] responseBytes; + + // Calculate MD5 hash of name + passwd + using (MD5 md5 = MD5.Create()) + { + // Assuming Octets has ToArray() or similar to get byte[] + byte[] nameBytes = name.ToArray(); + byte[] passwdBytes = passwd.ToArray(); + byte[] combined = new byte[nameBytes.Length + passwdBytes.Length]; + Buffer.BlockCopy(nameBytes, 0, combined, 0, nameBytes.Length); + Buffer.BlockCopy(passwdBytes, 0, combined, nameBytes.Length, passwdBytes.Length); + digestBytes = md5.ComputeHash(combined); + } + + // Calculate HMAC-MD5 using the digest as the key + using (HMACMD5 hmac = new HMACMD5(digestBytes)) + { + // Assuming Octets has ToArray() or similar to get byte[] + responseBytes = hmac.ComputeHash(challenge.ToArray()); + } + + // Assign results back to Octets properties + // Assuming Octets has a constructor or method to accept byte[] + response_data = new Octets(responseBytes); + identity = new Octets(name.ToArray()); // Keep identity as the original name bytes + + // C++ code explicitly sets identity using replace(name.begin(), name.size()) + // If your Octets.Replace takes byte[], this is equivalent: + // identity.Replace(name.ToArray()); + // If identity should be a *new* Octets instance with name's data: + // identity = new Octets(name.ToArray()); // Choose based on Octets implementation + + use_token = 0; + } + + // Added Process method placeholder (Matches C++ version) + // TODO: Implement actual processing logic based on your Manager/Session structure + // Need to define or import Manager and SessionID types + // public override void Process(Manager manager, SessionID sid) + // { + // // Placeholder for processing logic + // Console.WriteLine($"Processing Response protocol for session {sid}"); + // } + + // Restore original ToString method logic using BitConverter + public override string ToString + { + get + { + // Use BitConverter.ToString and assume Octets has ToArray() or similar + // Added null checks for safety + string identityHex = identity != null ? BitConverter.ToString(identity.ToArray()).Replace("-", "") : "null"; + string responseDataHex = response_data != null ? BitConverter.ToString(response_data.ToArray()).Replace("-", "") : "null"; + string fingerprintHex = cli_fingerprint != null ? BitConverter.ToString(cli_fingerprint.ToArray()).Replace("-", "") : "null"; + + return $"Response(Type={Type}, Identity={identityHex}, ResponseData={responseDataHex}, UseToken={use_token}, Fingerprint={fingerprintHex})"; + } + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/response.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/response.cs.meta new file mode 100644 index 0000000000..b345153cf9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/response.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4b782ebc4283c4d10b42e7de6404315e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rewardmaturenotice.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rewardmaturenotice.cs new file mode 100644 index 0000000000..9f17e67718 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rewardmaturenotice.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class rewardmaturenotice : Protocol + { + public int Roleid { get; set; } + public int Bonus_reward { get; set; } + public int Localsid { get; set; } + + public rewardmaturenotice() : base(ProtocolType.PROTOCOL_REWARDMATURENOTICE) + { + + } + + public override Protocol Clone() => new rewardmaturenotice + { + Roleid = Roleid, + Bonus_reward = Bonus_reward, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Bonus_reward); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Bonus_reward = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rewardmaturenotice.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rewardmaturenotice.cs.meta new file mode 100644 index 0000000000..cd17fc74b7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rewardmaturenotice.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9b18dfffd635f4832af8369a0c63a7d4 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolelist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolelist.cs new file mode 100644 index 0000000000..d2b297e3a7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolelist.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class rolelist : Protocol + { + public int Userid { get; set; } + public uint Localsid { get; set; } + public int Handle { get; set; } + + public rolelist() : base(ProtocolType.PROTOCOL_ROLELIST) + { + + } + + public override Protocol Clone() => new rolelist + { + Userid = Userid, + Localsid = Localsid, + Handle = Handle + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + os.Write(Handle); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadUInt32(); + Handle = os.ReadInt32(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolelist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolelist.cs.meta new file mode 100644 index 0000000000..9011ed9d0a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolelist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 919cff54132fd42b2bc9797c7f3e68ce \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolestatusannounce.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolestatusannounce.cs new file mode 100644 index 0000000000..6621ff1d70 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolestatusannounce.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class rolestatusannounce : Protocol + { + public byte Zoneid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + public byte Status { get; set; } + public Octets Rolename { get; set; } + + public rolestatusannounce() : base(ProtocolType.PROTOCOL_ROLESTATUSANNOUNCE) + { + Rolename = new Octets(); + } + + public override Protocol Clone() => new rolestatusannounce + { + Zoneid = Zoneid, + Roleid = Roleid, + Localsid = Localsid, + Status = Status, + Rolename = new Octets(Rolename.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Zoneid); + os.Write(Roleid); + os.Write(Localsid); + os.Write(Status); + os.Write(Rolename); + } + + public override void Unmarshal(OctetsStream os) + { + Zoneid = os.ReadByte(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Status = os.ReadByte(); + Rolename = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolestatusannounce.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolestatusannounce.cs.meta new file mode 100644 index 0000000000..26df3d14ac --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rolestatusannounce.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a10652fbc7e6c4ab3adc0b6c8f5c1416 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata.meta new file mode 100644 index 0000000000..132f76e94a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 87c7276d201944c52b7e9146185555c2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleBase.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleBase.cs new file mode 100644 index 0000000000..388eebfb40 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleBase.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +namespace CSNetwork.Protocols.rpcdata +{ + public class GRoleBase : IMarshallable + { + public char version; + public uint id; + public Octets name; + public int race; + public int cls; + public byte gender; + public Octets custom_data; + public Octets config_data; + public uint custom_stamp; + public byte status; + public int delete_time; + public int create_time; + public int lastlogin_time; + public List forbid = new List(); + public Octets help_states; + public int reserved1; + public int reserved2; + public int reserved3; + + public GRoleBase() { } + + public GRoleBase( + char l_version, uint l_id, Octets l_name, int l_race, int l_cls, byte l_gender, + Octets l_custom_data, Octets l_config_data, uint l_custom_stamp, byte l_status, + int l_delete_time, int l_create_time, int l_lastlogin_time, + List l_forbid, Octets l_help_states, + int l_reserved1, int l_reserved2, int l_reserved3) + { + version = l_version; + id = l_id; + name = l_name; + race = l_race; + cls = l_cls; + gender = l_gender; + custom_data = l_custom_data; + config_data = l_config_data; + custom_stamp = l_custom_stamp; + status = l_status; + delete_time = l_delete_time; + create_time = l_create_time; + lastlogin_time = l_lastlogin_time; + forbid = l_forbid ?? new List(); + help_states = l_help_states; + reserved1 = l_reserved1; + reserved2 = l_reserved2; + reserved3 = l_reserved3; + } + + public void Marshal(OctetsStream os) + { + // Serialize in a fixed order (must match Unmarshal). + os.Write((byte)version); // store char as byte + os.Write(id); + os.Write(name); + os.Write(race); + os.Write(cls); + os.Write(gender); + os.Write(custom_data); + os.Write(config_data); + os.Write(custom_stamp); + os.Write(status); + os.Write(delete_time); + os.Write(create_time); + os.Write(lastlogin_time); + os.WriteList(forbid); + os.Write(help_states); + os.Write(reserved1); + os.Write(reserved2); + os.Write(reserved3); + } + + public void Unmarshal(OctetsStream os) + { + // Must read back in exactly the same order as Marshal. + version = (char)os.ReadByte(); + id = os.ReadUInt32(); + name = os.ReadOctets(); + race = os.ReadInt32(); + cls = os.ReadInt32(); + gender = os.ReadByte(); + custom_data = os.ReadOctets(); + config_data = os.ReadOctets(); + custom_stamp = os.ReadUInt32(); + status = os.ReadByte(); + delete_time = os.ReadInt32(); + create_time = os.ReadInt32(); + lastlogin_time = os.ReadInt32(); + os.ReadList(forbid); + help_states = os.ReadOctets(); + reserved1 = os.ReadInt32(); + reserved2 = os.ReadInt32(); + reserved3 = os.ReadInt32(); + } + + public GRoleBase Clone() + { + // Sao chép sâu các Octets; danh sách forbid: nếu có ICloneable thì clone, không thì add như hiện trạng. + var clonedForbid = new List(forbid?.Count ?? 0); + if (forbid != null) + { + foreach (var f in forbid) + { + if (f is ICloneable c) clonedForbid.Add((GRoleForbid)c.Clone()); + else clonedForbid.Add(f); + } + } + + Octets clonedName = name != null ? new Octets(name.ToArray()) : new Octets(); + Octets clonedCustom = custom_data != null ? new Octets(custom_data.ToArray()) : new Octets(); + Octets clonedConfig = config_data != null ? new Octets(config_data.ToArray()) : new Octets(); + Octets clonedHelpStates = help_states != null ? new Octets(help_states.ToArray()) : new Octets(); + + return new GRoleBase( + version, id, clonedName, race, cls, gender, + clonedCustom, clonedConfig, custom_stamp, status, + delete_time, create_time, lastlogin_time, + clonedForbid, clonedHelpStates, + reserved1, reserved2, reserved3 + ); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleBase.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleBase.cs.meta new file mode 100644 index 0000000000..855e949954 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleBase.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a62ea892e91ab432aaaea98160b7bb53 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleForbid.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleForbid.cs new file mode 100644 index 0000000000..945a6601ae --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleForbid.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CSNetwork.Protocols.rpcdata +{ + public class GRoleForbid : IMarshallable + { + public byte type; + public int time; + public int createtime; + public Octets reason; + + public GRoleForbid() { } + + public GRoleForbid(byte type = 0, int time = 0, int createtime = 0, Octets reason = null) + { + this.type = type; + this.time = time; + this.createtime = createtime; + this.reason = reason ?? new Octets(0); + } + + public void Marshal(OctetsStream os) + { + os.Write(type); + os.Write(time); + os.Write(createtime); + os.Write(reason); + } + + public void Unmarshal(OctetsStream os) + { + type = os.ReadByte(); + time = os.ReadInt32(); + createtime = os.ReadInt32(); + reason = os.ReadOctets(); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleForbid.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleForbid.cs.meta new file mode 100644 index 0000000000..73ec28da39 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleForbid.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0d4e7e94cb1c04785b195998b328504d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleInventory.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleInventory.cs new file mode 100644 index 0000000000..a9d2a545ef --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleInventory.cs @@ -0,0 +1,62 @@ +namespace CSNetwork.Protocols.RPCData +{ + public class GRoleInventory : IMarshallable + { + public uint id; + public int pos; + public int count; + public int max_count; + public Octets data; + public int proctype; + public int expire_date; + public int guid1; + public int guid2; + public int mask; + + public GRoleInventory() { } + + public GRoleInventory(uint l_id, int l_pos, int l_count, int l_max_count, Octets l_data, int l_proctype, int l_expire_date, int l_guid1, int l_guid2, int l_mask) + { + this.id = l_id; + this.pos = l_pos; + this.count = l_count; + this.max_count = l_max_count; + this.data = l_data; + this.proctype = l_proctype; + this.expire_date = l_expire_date; + this.guid1 = l_guid1; + this.guid2 = l_guid2; + this.mask = l_mask; + } + + public void Marshal(OctetsStream os) + { + os.Write(id); + os.Write(pos); + os.Write(count); + os.Write(max_count); + os.Write(data); + os.Write(proctype); + os.Write(expire_date); + os.Write(guid1); + os.Write(guid2); + os.Write(mask); + } + + public void Unmarshal(OctetsStream os) + { + id = os.ReadUInt32(); + pos = os.ReadInt32(); + count = os.ReadInt32(); + max_count = os.ReadInt32(); + data = os.ReadOctets(); + proctype = os.ReadInt32(); + expire_date = os.ReadInt32(); + guid1 = os.ReadInt32(); + guid2 = os.ReadInt32(); + mask = os.ReadInt32(); + } + + + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleInventory.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleInventory.cs.meta new file mode 100644 index 0000000000..df963714e0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/GRoleInventory.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1328599e789e7479996a159d49ac2cef \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/RoleInfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/RoleInfo.cs new file mode 100644 index 0000000000..2929615f2f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/RoleInfo.cs @@ -0,0 +1,140 @@ +using System.Collections.Generic; + +namespace CSNetwork.Protocols.RPCData +{ + public class RoleInfo : IMarshallable + { + public int roleid; + public byte gender; + public byte race; + public byte occupation; + public int level; + public int level2; + public Octets name; + public Octets custom_data; + public List equipment = new List(); + public byte status; + public int delete_time; + public int create_time; + public int lastlogin_time; + public float posx; + public float posy; + public float posz; + public int worldtag; + public Octets custom_status; + public Octets charactermode; + public int referrer_role; + public int cash_add; + public Octets reincarnation_data; + public Octets realm_data; + + public RoleInfo() { } + + public RoleInfo(int l_roleid, byte l_gender, byte l_race, byte l_occupation, int l_level, int l_level2, + Octets l_name, Octets l_custom_data, List l_equipment, byte l_status, + int l_delete_time, int l_create_time, int l_lastlogin_time, float l_posx, float l_posy, + float l_posz, int l_worldtag, Octets l_custom_status, Octets l_charactermode, + int l_referrer_role, int l_cash_add, Octets l_reincarnation_data, Octets l_realm_data) + { + roleid = l_roleid; + gender = l_gender; + race = l_race; + occupation = l_occupation; + level = l_level; + level2 = l_level2; + name = l_name; + custom_data = l_custom_data; + equipment = l_equipment; + status = l_status; + delete_time = l_delete_time; + create_time = l_create_time; + lastlogin_time = l_lastlogin_time; + posx = l_posx; + posy = l_posy; + posz = l_posz; + worldtag = l_worldtag; + custom_status = l_custom_status; + charactermode = l_charactermode; + referrer_role = l_referrer_role; + cash_add = l_cash_add; + reincarnation_data = l_reincarnation_data; + realm_data = l_realm_data; + } + + public void Marshal(OctetsStream os) + { + os.Write(roleid); + os.Write(gender); + os.Write(race); + os.Write(occupation); + os.Write(level); + os.Write(level2); + os.Write(name); + os.Write(custom_data); + os.WriteList(equipment); + os.Write(status); + os.Write(delete_time); + os.Write(create_time); + os.Write(lastlogin_time); + os.Write(posx); + os.Write(posy); + os.Write(posz); + os.Write(worldtag); + os.Write(custom_status); + os.Write(charactermode); + os.Write(referrer_role); + os.Write(cash_add); + os.Write(reincarnation_data); + os.Write(realm_data); + } + + public void Unmarshal(OctetsStream os) + { + roleid = os.ReadInt32(); + gender = os.ReadByte(); + race = os.ReadByte(); + occupation = os.ReadByte(); + level = os.ReadInt32(); + level2 = os.ReadInt32(); + name = os.ReadOctets(); + custom_data = os.ReadOctets(); + os.ReadList(equipment); + status = os.ReadByte(); + delete_time = os.ReadInt32(); + create_time = os.ReadInt32(); + lastlogin_time = os.ReadInt32(); + posx = os.ReadFloat(); + posy = os.ReadFloat(); + posz = os.ReadFloat(); + worldtag = os.ReadInt32(); + custom_status = os.ReadOctets(); + charactermode = os.ReadOctets(); + referrer_role = os.ReadInt32(); + cash_add = os.ReadInt32(); + reincarnation_data = os.ReadOctets(); + realm_data = os.ReadOctets(); + } + + public RoleInfo Clone() + { + var clonedEquipment = new List(); + //foreach (var item in equipment) + //{ + // clonedEquipment.Add((GRoleInventory)item.Clone()); + //} + + Octets clonedName = name != null ? new Octets(name.ToArray()) : new Octets(); + Octets clonedCustomData = custom_data != null ? new Octets(custom_data.ToArray()) : new Octets(); + Octets clonedCustomStatus = custom_status != null ? new Octets(custom_status.ToArray()) : new Octets(); + Octets clonedCharMode = charactermode != null ? new Octets(charactermode.ToArray()) : new Octets(); + Octets clonedReincarnation = reincarnation_data != null ? new Octets(reincarnation_data.ToArray()) : new Octets(); + Octets clonedRealm = realm_data != null ? new Octets(realm_data.ToArray()) : new Octets(); + + return new RoleInfo(roleid, gender, race, occupation, level, level2, + clonedName, clonedCustomData, clonedEquipment, status, + delete_time, create_time, lastlogin_time, posx, posy, + posz, worldtag, clonedCustomStatus, clonedCharMode, + referrer_role, cash_add, clonedReincarnation, clonedRealm); + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/RoleInfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/RoleInfo.cs.meta new file mode 100644 index 0000000000..dc87ec653a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/rpcdata/RoleInfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 792f07a786bd14ae0aebe78ed44eed44 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole.cs new file mode 100644 index 0000000000..ad0b1abd6f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class selectrole : Protocol + { + public enum EFlag { + NORMAL = 0, + ORIGINAL_CROSS = 1, + CROSS_ORIGINAL = 2, + DIRECT_CROSS = 3 + } + public int Roleid { get; set; } + public byte Flag { get; set; }//PlayerLogin protocol flag meanings: 0 normal login, 1 original server -> cross server, 2 cross server -> original server, 3 direct login to cross server + + public selectrole() : base(ProtocolType.PROTOCOL_SELECTROLE) + { + + } + + public override Protocol Clone() => new selectrole + { + Roleid = Roleid, + Flag = Flag + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Flag); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Flag = os.ReadByte(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole.cs.meta new file mode 100644 index 0000000000..f5e5663eab --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b067f23e232bb42b0b5ab96e782b4262 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole_re.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole_re.cs new file mode 100644 index 0000000000..01154e6f40 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole_re.cs @@ -0,0 +1,52 @@ +using System; + +namespace CSNetwork.Protocols +{ + // Corresponds to GNET::SelectRole_Re (Type ?) - Need to confirm/add ProtocolType + public class SelectRole_Re : Protocol + { + // Properties based on C++ definition (inl/selectrole_re) + public int result { get; set; } // int result + public Octets auth { get; set; } // GNET::ByteVector auth -> Octets + + // Constructor - Assuming PROTOCOL_SELECTROLE_RE exists in ProtocolType + // Replace 'ProtocolType.?' with the actual enum value + public SelectRole_Re() + : base(ProtocolType.PROTOCOL_SELECTROLE_RE) + { + auth = new Octets(); // Initialize auth + } + + // Clone method + public override Protocol Clone() => + new SelectRole_Re + { + result = result, + auth = new Octets(auth.ToArray()) // Deep copy for Octets + }; + + // Marshal method based on C++ + public override void Marshal(OctetsStream os) + { + os.Write(result); + os.Write(auth); + } + + // Unmarshal method based on C++ + public override void Unmarshal(OctetsStream os) + { + result = os.ReadInt32(); // Read int + auth = os.ReadOctets(); // Read Octets + } + + // PriorPolicy based on C++ + public override int PriorPolicy() => 101; + + // SizePolicy based on C++ + public override bool SizePolicy(int size) => size <= 1024; + + // ToString method for logging/debugging + public override string ToString => $"SelectRole_Re(Type={Type}, Result={result}, Auth Length={auth?.Length ?? 0})"; + // Optionally include auth bytes if needed, but can be large:// return $"SelectRole_Re(Type={Type}, Result={result}, Auth={BitConverter.ToString(auth.ToArray())})"; } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole_re.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole_re.cs.meta new file mode 100644 index 0000000000..422b0a63be --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/selectrole_re.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9fe5cb6637a6a4fb8a1c5402f41634a1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellcancel.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellcancel.cs new file mode 100644 index 0000000000..1d2d372873 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellcancel.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sellcancel : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Sellid { get; set; } + public int L_localsid { get; set; } + + public sellcancel() : base(ProtocolType.PROTOCOL_SELLCANCEL) + { + + } + + public override Protocol Clone() => new sellcancel + { + Roleid = Roleid, + Localsid = Localsid, + Sellid = Sellid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Sellid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Sellid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellcancel.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellcancel.cs.meta new file mode 100644 index 0000000000..86d65d179b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellcancel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 86bc9f2d5ad264f45ad56d51ee6882f7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellpoint.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellpoint.cs new file mode 100644 index 0000000000..db4d156b6a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellpoint.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sellpoint : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Point { get; set; } + public int Price { get; set; } + public int L_localsid { get; set; } + + public sellpoint() : base(ProtocolType.PROTOCOL_SELLPOINT) + { + + } + + public override Protocol Clone() => new sellpoint + { + Roleid = Roleid, + Localsid = Localsid, + Point = Point, + Price = Price, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Point); + os.Write(Price); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Point = os.ReadInt32(); + Price = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellpoint.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellpoint.cs.meta new file mode 100644 index 0000000000..897a816280 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sellpoint.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 085f868ba29ac4b92a0a32d376a50584 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendaumail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendaumail.cs new file mode 100644 index 0000000000..acb02f066e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendaumail.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sendaumail : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Friend_id { get; set; } + public int Mail_template_id { get; set; } + + public sendaumail() : base(ProtocolType.PROTOCOL_SENDAUMAIL) + { + + } + + public override Protocol Clone() => new sendaumail + { + Roleid = Roleid, + Localsid = Localsid, + Friend_id = Friend_id, + Mail_template_id = Mail_template_id + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Friend_id); + os.Write(Mail_template_id); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Friend_id = os.ReadInt32(); + Mail_template_id = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendaumail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendaumail.cs.meta new file mode 100644 index 0000000000..826769ea6f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendaumail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 92de47c6f0a5f4dcd85596bf73710e3a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendmsg.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendmsg.cs new file mode 100644 index 0000000000..434e52f783 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendmsg.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sendmsg : Protocol + { + public int Srcroleid { get; set; } + public byte Srczoneid { get; set; } + public int Dstroleid { get; set; } + public byte Dstzoneid { get; set; } + public Octets Msg { get; set; } + public int Time { get; set; } + public int Localsid { get; set; } + + public sendmsg() : base(ProtocolType.PROTOCOL_SENDMSG) + { + Msg = new Octets(); + } + + public override Protocol Clone() => new sendmsg + { + Srcroleid = Srcroleid, + Srczoneid = Srczoneid, + Dstroleid = Dstroleid, + Dstzoneid = Dstzoneid, + Msg = new Octets(Msg.ToArray()), + Time = Time, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Srcroleid); + os.Write(Srczoneid); + os.Write(Dstroleid); + os.Write(Dstzoneid); + os.Write(Msg); + os.Write(Time); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Srcroleid = os.ReadInt32(); + Srczoneid = os.ReadByte(); + Dstroleid = os.ReadInt32(); + Dstzoneid = os.ReadByte(); + Msg = os.ReadOctets(); + Time = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendmsg.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendmsg.cs.meta new file mode 100644 index 0000000000..be662e19d2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sendmsg.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 009fa86c29cac439788d181daa989098 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setcustomdata.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setcustomdata.cs new file mode 100644 index 0000000000..eb6297afcb --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setcustomdata.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class setcustomdata : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public Octets Custom_data { get; set; } + + public setcustomdata() : base(ProtocolType.PROTOCOL_SETCUSTOMDATA) + { + Custom_data = new Octets(); + } + + public override Protocol Clone() => new setcustomdata + { + Roleid = Roleid, + Localsid = Localsid, + Custom_data = new Octets(Custom_data.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Custom_data); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Custom_data = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1536; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setcustomdata.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setcustomdata.cs.meta new file mode 100644 index 0000000000..9185475a8a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setcustomdata.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5616d9a1b8c364937bad307df4bc9ab9 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setfriendgroup.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setfriendgroup.cs new file mode 100644 index 0000000000..80311e28d8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setfriendgroup.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class setfriendgroup : Protocol + { + public byte Gid { get; set; } + public int Roleid { get; set; } + public int Friendid { get; set; } + public int Localsid { get; set; } + + public setfriendgroup() : base(ProtocolType.PROTOCOL_SETFRIENDGROUP) + { + + } + + public override Protocol Clone() => new setfriendgroup + { + Gid = Gid, + Roleid = Roleid, + Friendid = Friendid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Gid); + os.Write(Roleid); + os.Write(Friendid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Gid = os.ReadByte(); + Roleid = os.ReadInt32(); + Friendid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setfriendgroup.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setfriendgroup.cs.meta new file mode 100644 index 0000000000..dde746f7eb --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setfriendgroup.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f76143d35218d477d984076ffefad9b1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setgroupname.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setgroupname.cs new file mode 100644 index 0000000000..24a3c83b2f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setgroupname.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class setgroupname : Protocol + { + public int Roleid { get; set; } + public byte Gid { get; set; } + public Octets Name { get; set; } + public int Localsid { get; set; } + + public setgroupname() : base(ProtocolType.PROTOCOL_SETGROUPNAME) + { + Name = new Octets(); + } + + public override Protocol Clone() => new setgroupname + { + Roleid = Roleid, + Gid = Gid, + Name = new Octets(Name.ToArray()), + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Gid); + os.Write(Name); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Gid = os.ReadByte(); + Name = os.ReadOctets(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setgroupname.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setgroupname.cs.meta new file mode 100644 index 0000000000..2654a7d42f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setgroupname.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c9804e56ab861451aa15314a16f0b4c5 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sethelpstates.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sethelpstates.cs new file mode 100644 index 0000000000..221548618b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sethelpstates.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sethelpstates : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public Octets Help_states { get; set; } + + public sethelpstates() : base(ProtocolType.PROTOCOL_SETHELPSTATES) + { + Help_states = new Octets(); + } + + public override Protocol Clone() => new sethelpstates + { + Roleid = Roleid, + Localsid = Localsid, + Help_states = new Octets(Help_states.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Help_states); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Help_states = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 4096; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sethelpstates.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sethelpstates.cs.meta new file mode 100644 index 0000000000..c83e9ba00f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sethelpstates.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4c66e02686a8e481f9435155b330d611 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setuiconfig.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setuiconfig.cs new file mode 100644 index 0000000000..b1eacfa056 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setuiconfig.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class setuiconfig : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public Octets Ui_config { get; set; } + + public setuiconfig() : base(ProtocolType.PROTOCOL_SETUICONFIG) + { + Ui_config = new Octets(); + } + + public override Protocol Clone() => new setuiconfig + { + Roleid = Roleid, + Localsid = Localsid, + Ui_config = new Octets(Ui_config.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Ui_config); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Ui_config = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 4096; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setuiconfig.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setuiconfig.cs.meta new file mode 100644 index 0000000000..c85a8fbfe3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/setuiconfig.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: faa0ebe41fe2945989685151f37bf88a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ssogetticket.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ssogetticket.cs new file mode 100644 index 0000000000..31f8b0fcd6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ssogetticket.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class ssogetticket : Protocol + { + public int Toaid { get; set; } + public int Tozoneid { get; set; } + public Octets Info { get; set; } + public Octets Local_context { get; set; } + + public ssogetticket() : base(ProtocolType.PROTOCOL_SSOGETTICKET) + { + Info = new Octets(); + Local_context = new Octets(); + } + + public override Protocol Clone() => new ssogetticket + { + Toaid = Toaid, + Tozoneid = Tozoneid, + Info = new Octets(Info.ToArray()), + Local_context = new Octets(Local_context.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Toaid); + os.Write(Tozoneid); + os.Write(Info); + os.Write(Local_context); + } + + public override void Unmarshal(OctetsStream os) + { + Toaid = os.ReadInt32(); + Tozoneid = os.ReadInt32(); + Info = os.ReadOctets(); + Local_context = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 2048; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ssogetticket.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ssogetticket.cs.meta new file mode 100644 index 0000000000..bf0836c578 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/ssogetticket.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fa4dcd80bd9534a16a7b2c28a8f7aa4f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/statusannounce.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/statusannounce.cs new file mode 100644 index 0000000000..3ed7b41dae --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/statusannounce.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class statusannounce : Protocol + { + public int Userid { get; set; } + public int Localsid { get; set; } + public byte Status { get; set; } + + public statusannounce() : base(ProtocolType.PROTOCOL_STATUSANNOUNCE) + { + + } + + public override Protocol Clone() => new statusannounce + { + Userid = Userid, + Localsid = Localsid, + Status = Status + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + os.Write(Status); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Status = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/statusannounce.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/statusannounce.cs.meta new file mode 100644 index 0000000000..a08ab3e26d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/statusannounce.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c8bde114f534f468a8594c38638e2859 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockaccount.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockaccount.cs new file mode 100644 index 0000000000..b9ee31e2ee --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockaccount.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class stockaccount : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public stockaccount() : base(ProtocolType.PROTOCOL_STOCKACCOUNT) + { + + } + + public override Protocol Clone() => new stockaccount + { + Roleid = Roleid, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockaccount.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockaccount.cs.meta new file mode 100644 index 0000000000..7d28c0f8a0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockaccount.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 619a6a9185acd40e4ac4ff13f2bec248 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockbill.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockbill.cs new file mode 100644 index 0000000000..80ef116796 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockbill.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class stockbill : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public stockbill() : base(ProtocolType.PROTOCOL_STOCKBILL) + { + + } + + public override Protocol Clone() => new stockbill + { + Roleid = Roleid, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockbill.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockbill.cs.meta new file mode 100644 index 0000000000..c8a905f8e1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockbill.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2a07ddd8ca7404c049dac2f0e5be32cb \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcancel.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcancel.cs new file mode 100644 index 0000000000..36a4d48d2a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcancel.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class stockcancel : Protocol + { + public int Roleid { get; set; } + public int Tid { get; set; } + public int Price { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public stockcancel() : base(ProtocolType.PROTOCOL_STOCKCANCEL) + { + + } + + public override Protocol Clone() => new stockcancel + { + Roleid = Roleid, + Tid = Tid, + Price = Price, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Tid); + os.Write(Price); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Tid = os.ReadInt32(); + Price = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcancel.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcancel.cs.meta new file mode 100644 index 0000000000..ae2b2e9669 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcancel.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f968c3a22c0f04a66a9f3a871e7aecae \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcommission.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcommission.cs new file mode 100644 index 0000000000..4ebda60034 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcommission.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class stockcommission : Protocol + { + public int Roleid { get; set; } + public byte Isbuy { get; set; } + public int Price { get; set; } + public int Volume { get; set; } + public int Localsid { get; set; } + public int L_volume { get; set; } + + public stockcommission() : base(ProtocolType.PROTOCOL_STOCKCOMMISSION) + { + + } + + public override Protocol Clone() => new stockcommission + { + Roleid = Roleid, + Isbuy = Isbuy, + Price = Price, + Volume = Volume, + Localsid = Localsid, + L_volume = L_volume + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Isbuy); + os.Write(Price); + os.Write(Volume); + os.Write(Localsid); + os.Write(L_volume); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Isbuy = os.ReadByte(); + Price = os.ReadInt32(); + Volume = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_volume = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcommission.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcommission.cs.meta new file mode 100644 index 0000000000..bef158b158 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/stockcommission.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5b0c31c882187477a9048ce9c5eed26a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionaccount.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionaccount.cs new file mode 100644 index 0000000000..29b2a1f859 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionaccount.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sysauctionaccount : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public sysauctionaccount() : base(ProtocolType.PROTOCOL_SYSAUCTIONACCOUNT) + { + + } + + public override Protocol Clone() => new sysauctionaccount + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionaccount.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionaccount.cs.meta new file mode 100644 index 0000000000..ccdb3046b2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionaccount.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: eb686925385694028b696294d5399f64 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionbid.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionbid.cs new file mode 100644 index 0000000000..512e87feb3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionbid.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sysauctionbid : Protocol + { + public int Roleid { get; set; } + public int Sa_id { get; set; } + public int Bid_price { get; set; } + public int Localsid { get; set; } + public int L_localsid { get; set; } + + public sysauctionbid() : base(ProtocolType.PROTOCOL_SYSAUCTIONBID) + { + + } + + public override Protocol Clone() => new sysauctionbid + { + Roleid = Roleid, + Sa_id = Sa_id, + Bid_price = Bid_price, + Localsid = Localsid, + L_localsid = L_localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Sa_id); + os.Write(Bid_price); + os.Write(Localsid); + os.Write(L_localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Sa_id = os.ReadInt32(); + Bid_price = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionbid.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionbid.cs.meta new file mode 100644 index 0000000000..f3a961b9f9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionbid.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9c42e9d44ce29465ea5d7338299bc264 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctioncashtransfer.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctioncashtransfer.cs new file mode 100644 index 0000000000..0a104e3c60 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctioncashtransfer.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sysauctioncashtransfer : Protocol + { + public int Roleid { get; set; } + public byte Withdraw { get; set; } + public int Cash { get; set; } + public int Localsid { get; set; } + public Octets Syncdata { get; set; } + + public sysauctioncashtransfer() : base(ProtocolType.PROTOCOL_SYSAUCTIONCASHTRANSFER) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new sysauctioncashtransfer + { + Roleid = Roleid, + Withdraw = Withdraw, + Cash = Cash, + Localsid = Localsid, + Syncdata = new Octets(Syncdata.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Withdraw); + os.Write(Cash); + os.Write(Localsid); + os.Write(Syncdata); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Withdraw = os.ReadByte(); + Cash = os.ReadInt32(); + Localsid = os.ReadInt32(); + Syncdata = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctioncashtransfer.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctioncashtransfer.cs.meta new file mode 100644 index 0000000000..6fe4f4387f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctioncashtransfer.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8dd04d95dc254432e96f58c410467c7f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctiongetitem.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctiongetitem.cs new file mode 100644 index 0000000000..9b7252fdf2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctiongetitem.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sysauctiongetitem : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public sysauctiongetitem() : base(ProtocolType.PROTOCOL_SYSAUCTIONGETITEM) + { + + } + + public override Protocol Clone() => new sysauctiongetitem + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 512; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctiongetitem.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctiongetitem.cs.meta new file mode 100644 index 0000000000..7c2c25246b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctiongetitem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b13b03dde6de547b4a34b45548136a9f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionlist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionlist.cs new file mode 100644 index 0000000000..0982f7e61a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionlist.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class sysauctionlist : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public sysauctionlist() : base(ProtocolType.PROTOCOL_SYSAUCTIONLIST) + { + + } + + public override Protocol Clone() => new sysauctionlist + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionlist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionlist.cs.meta new file mode 100644 index 0000000000..2a20b8f049 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/sysauctionlist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5aceb703494ce453ab4e9b66b1b961d5 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tankbattleplayergetrank.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tankbattleplayergetrank.cs new file mode 100644 index 0000000000..5814ee2b6b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tankbattleplayergetrank.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class tankbattleplayergetrank : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public tankbattleplayergetrank() : base(ProtocolType.PROTOCOL_TANKBATTLEPLAYERGETRANK) + { + + } + + public override Protocol Clone() => new tankbattleplayergetrank + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tankbattleplayergetrank.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tankbattleplayergetrank.cs.meta new file mode 100644 index 0000000000..79c74ad938 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tankbattleplayergetrank.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b43a28eb6744645e298687468ca81f33 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeaddgoods.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeaddgoods.cs new file mode 100644 index 0000000000..b4ba07e378 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeaddgoods.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class tradeaddgoods : Protocol + { + public int Tid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Money { get; set; } + + public tradeaddgoods() : base(ProtocolType.PROTOCOL_TRADEADDGOODS) + { + + } + + public override Protocol Clone() => new tradeaddgoods + { + Tid = Tid, + Roleid = Roleid, + Localsid = Localsid, + Money = Money + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Tid); + os.Write(Roleid); + os.Write(Localsid); + os.Write(Money); + } + + public override void Unmarshal(OctetsStream os) + { + Tid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Money = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeaddgoods.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeaddgoods.cs.meta new file mode 100644 index 0000000000..9e4f1eab36 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeaddgoods.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: cc7932c233d9b4156b15623d9f2b5b93 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeconfirm.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeconfirm.cs new file mode 100644 index 0000000000..05315ff5c3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeconfirm.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class tradeconfirm : Protocol + { + public int Tid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + + public tradeconfirm() : base(ProtocolType.PROTOCOL_TRADECONFIRM) + { + + } + + public override Protocol Clone() => new tradeconfirm + { + Tid = Tid, + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Tid); + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Tid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeconfirm.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeconfirm.cs.meta new file mode 100644 index 0000000000..ae312b8c3b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeconfirm.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6e8fba51dda504bc689483501d5e510b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradediscard.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradediscard.cs new file mode 100644 index 0000000000..596ca20e00 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradediscard.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class tradediscard : Protocol + { + public int Tid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + + public tradediscard() : base(ProtocolType.PROTOCOL_TRADEDISCARD) + { + + } + + public override Protocol Clone() => new tradediscard + { + Tid = Tid, + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Tid); + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Tid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradediscard.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradediscard.cs.meta new file mode 100644 index 0000000000..525eef88fd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradediscard.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2df530750badc4101bea56ed399efee8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeend.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeend.cs new file mode 100644 index 0000000000..a3a93101f6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeend.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class tradeend : Protocol + { + public int Tid { get; set; } + public byte Cause { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + + public tradeend() : base(ProtocolType.PROTOCOL_TRADEEND) + { + + } + + public override Protocol Clone() => new tradeend + { + Tid = Tid, + Cause = Cause, + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Tid); + os.Write(Cause); + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Tid = os.ReadInt32(); + Cause = os.ReadByte(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeend.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeend.cs.meta new file mode 100644 index 0000000000..f9fe44b704 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradeend.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2f85468bd57f84e72b97ee303ec6c356 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/trademoveobj.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/trademoveobj.cs new file mode 100644 index 0000000000..cb96dc864c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/trademoveobj.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class trademoveobj : Protocol + { + public int Tid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + public byte Dst_pos { get; set; } + + public trademoveobj() : base(ProtocolType.PROTOCOL_TRADEMOVEOBJ) + { + + } + + public override Protocol Clone() => new trademoveobj + { + Tid = Tid, + Roleid = Roleid, + Localsid = Localsid, + Dst_pos = Dst_pos + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Tid); + os.Write(Roleid); + os.Write(Localsid); + os.Write(Dst_pos); + } + + public override void Unmarshal(OctetsStream os) + { + Tid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Dst_pos = os.ReadByte(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/trademoveobj.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/trademoveobj.cs.meta new file mode 100644 index 0000000000..58a0db3ebe --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/trademoveobj.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9386c24bf5c3e40df99f0b84fe02eda1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/traderemovegoods.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/traderemovegoods.cs new file mode 100644 index 0000000000..c271549844 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/traderemovegoods.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class traderemovegoods : Protocol + { + public int Tid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Money { get; set; } + + public traderemovegoods() : base(ProtocolType.PROTOCOL_TRADEREMOVEGOODS) + { + + } + + public override Protocol Clone() => new traderemovegoods + { + Tid = Tid, + Roleid = Roleid, + Localsid = Localsid, + Money = Money + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Tid); + os.Write(Roleid); + os.Write(Localsid); + os.Write(Money); + } + + public override void Unmarshal(OctetsStream os) + { + Tid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Money = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/traderemovegoods.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/traderemovegoods.cs.meta new file mode 100644 index 0000000000..ce723147e5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/traderemovegoods.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 32d40480b036048d18dda3ced785af06 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradestart.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradestart.cs new file mode 100644 index 0000000000..8cbae08902 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradestart.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class tradestart : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + public int Partner_roleid { get; set; } + + public tradestart() : base(ProtocolType.PROTOCOL_TRADESTART) + { + + } + + public override Protocol Clone() => new tradestart + { + Roleid = Roleid, + Localsid = Localsid, + Partner_roleid = Partner_roleid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + os.Write(Partner_roleid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Partner_roleid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradestart.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradestart.cs.meta new file mode 100644 index 0000000000..2e6453555e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradestart.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e2296c8d4f5324c53ad264ff597bc263 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradesubmit.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradesubmit.cs new file mode 100644 index 0000000000..e4694cf640 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradesubmit.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class tradesubmit : Protocol + { + public int Tid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + + public tradesubmit() : base(ProtocolType.PROTOCOL_TRADESUBMIT) + { + + } + + public override Protocol Clone() => new tradesubmit + { + Tid = Tid, + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Tid); + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Tid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradesubmit.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradesubmit.cs.meta new file mode 100644 index 0000000000..57b4bd98e4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/tradesubmit.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 740ad55f9f82e48d5b4487e8993434ec \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/undodeleterole.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/undodeleterole.cs new file mode 100644 index 0000000000..dee81261e6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/undodeleterole.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class undodeleterole : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public undodeleterole() : base(ProtocolType.PROTOCOL_UNDODELETEROLE) + { + + } + + public override Protocol Clone() => new undodeleterole + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 101; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/undodeleterole.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/undodeleterole.cs.meta new file mode 100644 index 0000000000..073f18749f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/undodeleterole.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ec411fbf1ef7d4dc891a6ab8eb33db50 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/uniquedatamodifybroadcast.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/uniquedatamodifybroadcast.cs new file mode 100644 index 0000000000..bdfefcb561 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/uniquedatamodifybroadcast.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class uniquedatamodifybroadcast : Protocol + { + public int Handle { get; set; } + + public uniquedatamodifybroadcast() : base(ProtocolType.PROTOCOL_UNIQUEDATAMODIFYBROADCAST) + { + + } + + public override Protocol Clone() => new uniquedatamodifybroadcast + { + Handle = Handle + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Handle); + } + + public override void Unmarshal(OctetsStream os) + { + Handle = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/uniquedatamodifybroadcast.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/uniquedatamodifybroadcast.cs.meta new file mode 100644 index 0000000000..68194e750f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/uniquedatamodifybroadcast.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f6ce712e75a75476380e8e2417313594 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/updateremaintime.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/updateremaintime.cs new file mode 100644 index 0000000000..0e51c6ad1c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/updateremaintime.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class updateremaintime : Protocol + { + public int Userid { get; set; } + public int Localsid { get; set; } + public int Remain_time { get; set; } + public int Free_time_left { get; set; } + public int Free_time_end { get; set; } + public int L_free_time_left { get; set; } + + public updateremaintime() : base(ProtocolType.PROTOCOL_UPDATEREMAINTIME) + { + + } + + public override Protocol Clone() => new updateremaintime + { + Userid = Userid, + Localsid = Localsid, + Remain_time = Remain_time, + Free_time_left = Free_time_left, + Free_time_end = Free_time_end, + L_free_time_left = L_free_time_left + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + os.Write(Remain_time); + os.Write(Free_time_left); + os.Write(Free_time_end); + os.Write(L_free_time_left); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Remain_time = os.ReadInt32(); + Free_time_left = os.ReadInt32(); + Free_time_end = os.ReadInt32(); + L_free_time_left = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 64; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/updateremaintime.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/updateremaintime.cs.meta new file mode 100644 index 0000000000..349ae182ab --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/updateremaintime.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 583fea0f34fb24c7989cb00da69bcd5a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/useraddcash.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/useraddcash.cs new file mode 100644 index 0000000000..57cfb0da3b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/useraddcash.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class useraddcash : Protocol + { + public int Userid { get; set; } + public Octets Cardnum { get; set; } + public Octets Cardpasswd { get; set; } + public int Localsid { get; set; } + + public useraddcash() : base(ProtocolType.PROTOCOL_USERADDCASH) + { + Cardnum = new Octets(); + Cardpasswd = new Octets(); + } + + public override Protocol Clone() => new useraddcash + { + Userid = Userid, + Cardnum = new Octets(Cardnum.ToArray()), + Cardpasswd = new Octets(Cardpasswd.ToArray()), + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Cardnum); + os.Write(Cardpasswd); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Cardnum = os.ReadOctets(); + Cardpasswd = os.ReadOctets(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/useraddcash.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/useraddcash.cs.meta new file mode 100644 index 0000000000..14a16a7f8a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/useraddcash.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3b280aaeb8cb54d00b4b7e144be6158d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercoupon.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercoupon.cs new file mode 100644 index 0000000000..af6662c011 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercoupon.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class usercoupon : Protocol + { + public int Userid { get; set; } + public int Localsid { get; set; } + + public usercoupon() : base(ProtocolType.PROTOCOL_USERCOUPON) + { + + } + + public override Protocol Clone() => new usercoupon + { + Userid = Userid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercoupon.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercoupon.cs.meta new file mode 100644 index 0000000000..d9bdc9c5a1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercoupon.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e2a3a6c334c124a31b9001b4152a42be \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercouponexchange.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercouponexchange.cs new file mode 100644 index 0000000000..57203d4475 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercouponexchange.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class usercouponexchange : Protocol + { + public int Userid { get; set; } + public int Coupon_number { get; set; } + public int Localsid { get; set; } + + public usercouponexchange() : base(ProtocolType.PROTOCOL_USERCOUPONEXCHANGE) + { + + } + + public override Protocol Clone() => new usercouponexchange + { + Userid = Userid, + Coupon_number = Coupon_number, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Coupon_number); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Coupon_number = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 16; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercouponexchange.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercouponexchange.cs.meta new file mode 100644 index 0000000000..c6f51ba50a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/usercouponexchange.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7f926ab79ff064d7b8c0ce7450253d54 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/waitqueuestatenotify.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/waitqueuestatenotify.cs new file mode 100644 index 0000000000..04c5a48e9f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/waitqueuestatenotify.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class waitqueuestatenotify : Protocol + { + public int Localsid { get; set; } + public byte Vip { get; set; } + public short Vq_size { get; set; } + public short Cur_queue_pos { get; set; } + public int Waittime { get; set; } + + public waitqueuestatenotify() : base(ProtocolType.PROTOCOL_WAITQUEUESTATENOTIFY) + { + + } + + public override Protocol Clone() => new waitqueuestatenotify + { + Localsid = Localsid, + Vip = Vip, + Vq_size = Vq_size, + Cur_queue_pos = Cur_queue_pos, + Waittime = Waittime + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Localsid); + os.Write(Vip); + os.Write(Vq_size); + os.Write(Cur_queue_pos); + os.Write(Waittime); + } + + public override void Unmarshal(OctetsStream os) + { + Localsid = os.ReadInt32(); + Vip = os.ReadByte(); + Vq_size = os.ReadInt16(); + Cur_queue_pos = os.ReadInt16(); + Waittime = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/waitqueuestatenotify.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/waitqueuestatenotify.cs.meta new file mode 100644 index 0000000000..df9ed9f698 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/waitqueuestatenotify.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 888eb9c2a84304c75a90f157c26e1dce \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeattendlist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeattendlist.cs new file mode 100644 index 0000000000..210fde9bf4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeattendlist.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtradeattendlist : Protocol + { + public int Roleid { get; set; } + public byte Getsell { get; set; } + public int Begin { get; set; } + public int Localsid { get; set; } + + public webtradeattendlist() : base(ProtocolType.PROTOCOL_WEBTRADEATTENDLIST) + { + + } + + public override Protocol Clone() => new webtradeattendlist + { + Roleid = Roleid, + Getsell = Getsell, + Begin = Begin, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Getsell); + os.Write(Begin); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Getsell = os.ReadByte(); + Begin = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeattendlist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeattendlist.cs.meta new file mode 100644 index 0000000000..dd73d51641 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeattendlist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 774302d53092d4d16b87d824d47215fe \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetdetail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetdetail.cs new file mode 100644 index 0000000000..f4615751d9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetdetail.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtradegetdetail : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public webtradegetdetail() : base(ProtocolType.PROTOCOL_WEBTRADEGETDETAIL) + { + + } + + public override Protocol Clone() => new webtradegetdetail + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetdetail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetdetail.cs.meta new file mode 100644 index 0000000000..5a0306717e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetdetail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2e5677ecaea8a4fee8fbc0ef49364b80 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetitem.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetitem.cs new file mode 100644 index 0000000000..ee7cf76f0b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetitem.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtradegetitem : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public webtradegetitem() : base(ProtocolType.PROTOCOL_WEBTRADEGETITEM) + { + + } + + public override Protocol Clone() => new webtradegetitem + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetitem.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetitem.cs.meta new file mode 100644 index 0000000000..be11173e39 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradegetitem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3066679989d804cc894a7d42b7dfa12d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradelist.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradelist.cs new file mode 100644 index 0000000000..afc0a3acd8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradelist.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtradelist : Protocol + { + public int Roleid { get; set; } + public int Category { get; set; } + public int Begin { get; set; } + public byte Reverse { get; set; } + public int Localsid { get; set; } + + public webtradelist() : base(ProtocolType.PROTOCOL_WEBTRADELIST) + { + + } + + public override Protocol Clone() => new webtradelist + { + Roleid = Roleid, + Category = Category, + Begin = Begin, + Reverse = Reverse, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Category); + os.Write(Begin); + os.Write(Reverse); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Category = os.ReadInt32(); + Begin = os.ReadInt32(); + Reverse = os.ReadByte(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradelist.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradelist.cs.meta new file mode 100644 index 0000000000..12e4051c42 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradelist.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9b5a0ee8fbb234fd5a7c3f4bd527ca97 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprecancelpost.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprecancelpost.cs new file mode 100644 index 0000000000..ef035d1409 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprecancelpost.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtradeprecancelpost : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public webtradeprecancelpost() : base(ProtocolType.PROTOCOL_WEBTRADEPRECANCELPOST) + { + + } + + public override Protocol Clone() => new webtradeprecancelpost + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprecancelpost.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprecancelpost.cs.meta new file mode 100644 index 0000000000..e9af2314fa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprecancelpost.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9c6e31cfebf3a422b88f6bdfb2867869 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprepost.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprepost.cs new file mode 100644 index 0000000000..2c8178fad4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprepost.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtradeprepost : Protocol + { + public int Roleid { get; set; } + public int Posttype { get; set; } + public int Money { get; set; } + public int Item_id { get; set; } + public int Item_pos { get; set; } + public int Item_num { get; set; } + public int Price { get; set; } + public int Sellperiod { get; set; } + public int Buyer_roleid { get; set; } + public int Localsid { get; set; } + public Octets Syncdata { get; set; } + public int L_money { get; set; } + + public webtradeprepost() : base(ProtocolType.PROTOCOL_WEBTRADEPREPOST) + { + Syncdata = new Octets(); + } + + public override Protocol Clone() => new webtradeprepost + { + Roleid = Roleid, + Posttype = Posttype, + Money = Money, + Item_id = Item_id, + Item_pos = Item_pos, + Item_num = Item_num, + Price = Price, + Sellperiod = Sellperiod, + Buyer_roleid = Buyer_roleid, + Localsid = Localsid, + Syncdata = new Octets(Syncdata.ToArray()), + L_money = L_money + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Posttype); + os.Write(Money); + os.Write(Item_id); + os.Write(Item_pos); + os.Write(Item_num); + os.Write(Price); + os.Write(Sellperiod); + os.Write(Buyer_roleid); + os.Write(Localsid); + os.Write(Syncdata); + os.Write(L_money); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Posttype = os.ReadInt32(); + Money = os.ReadInt32(); + Item_id = os.ReadInt32(); + Item_pos = os.ReadInt32(); + Item_num = os.ReadInt32(); + Price = os.ReadInt32(); + Sellperiod = os.ReadInt32(); + Buyer_roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + Syncdata = os.ReadOctets(); + L_money = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 131072; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprepost.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprepost.cs.meta new file mode 100644 index 0000000000..5ceb759449 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeprepost.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 358a74e9ab4334e7197210066ce13db8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderolegetdetail.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderolegetdetail.cs new file mode 100644 index 0000000000..14df3046ba --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderolegetdetail.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtraderolegetdetail : Protocol + { + public int Userid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + + public webtraderolegetdetail() : base(ProtocolType.PROTOCOL_WEBTRADEROLEGETDETAIL) + { + + } + + public override Protocol Clone() => new webtraderolegetdetail + { + Userid = Userid, + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderolegetdetail.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderolegetdetail.cs.meta new file mode 100644 index 0000000000..b80e898061 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderolegetdetail.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d7c4e2111601b495ba0f56a32633f3a5 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprecancelpost.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprecancelpost.cs new file mode 100644 index 0000000000..93e0c107c1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprecancelpost.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtraderoleprecancelpost : Protocol + { + public int Userid { get; set; } + public int Roleid { get; set; } + public int Localsid { get; set; } + + public webtraderoleprecancelpost() : base(ProtocolType.PROTOCOL_WEBTRADEROLEPRECANCELPOST) + { + + } + + public override Protocol Clone() => new webtraderoleprecancelpost + { + Userid = Userid, + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprecancelpost.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprecancelpost.cs.meta new file mode 100644 index 0000000000..8e0253ea33 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprecancelpost.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 39cd411d2b5274b068735adb445a1186 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprepost.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprepost.cs new file mode 100644 index 0000000000..af844cfed3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprepost.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtraderoleprepost : Protocol + { + public int Userid { get; set; } + public int Roleid { get; set; } + public int Price { get; set; } + public int Sellperiod { get; set; } + public int Buyer_roleid { get; set; } + public int Localsid { get; set; } + public int L_sellperiod { get; set; } + + public webtraderoleprepost() : base(ProtocolType.PROTOCOL_WEBTRADEROLEPREPOST) + { + + } + + public override Protocol Clone() => new webtraderoleprepost + { + Userid = Userid, + Roleid = Roleid, + Price = Price, + Sellperiod = Sellperiod, + Buyer_roleid = Buyer_roleid, + Localsid = Localsid, + L_sellperiod = L_sellperiod + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Userid); + os.Write(Roleid); + os.Write(Price); + os.Write(Sellperiod); + os.Write(Buyer_roleid); + os.Write(Localsid); + os.Write(L_sellperiod); + } + + public override void Unmarshal(OctetsStream os) + { + Userid = os.ReadInt32(); + Roleid = os.ReadInt32(); + Price = os.ReadInt32(); + Sellperiod = os.ReadInt32(); + Buyer_roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + L_sellperiod = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 128; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprepost.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprepost.cs.meta new file mode 100644 index 0000000000..8bc67432b7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtraderoleprepost.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 35efe704f00cb41fe899a72076b0c2cd \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeupdate.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeupdate.cs new file mode 100644 index 0000000000..5b655e6edd --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeupdate.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class webtradeupdate : Protocol + { + public int Roleid { get; set; } + public int Localsid { get; set; } + + public webtradeupdate() : base(ProtocolType.PROTOCOL_WEBTRADEUPDATE) + { + + } + + public override Protocol Clone() => new webtradeupdate + { + Roleid = Roleid, + Localsid = Localsid + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Roleid); + os.Write(Localsid); + } + + public override void Unmarshal(OctetsStream os) + { + Roleid = os.ReadInt32(); + Localsid = os.ReadInt32(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 32; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeupdate.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeupdate.cs.meta new file mode 100644 index 0000000000..a086692bd5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/webtradeupdate.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: dbc8a03f626ab4cb5b62d0066ae0b3b6 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/worldchat.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/worldchat.cs new file mode 100644 index 0000000000..10697e499a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/worldchat.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Protocols +{ + public class worldchat : Protocol + { + public byte Channel { get; set; } + public byte Emotion { get; set; } + public int Roleid { get; set; } + public Octets Name { get; set; } + public Octets Msg { get; set; } + public Octets Data { get; set; } + + public worldchat() : base(ProtocolType.PROTOCOL_WORLDCHAT) + { + Name = new Octets(); + Msg = new Octets(); + Data = new Octets(); + } + + public override Protocol Clone() => new worldchat + { + Channel = Channel, + Emotion = Emotion, + Roleid = Roleid, + Name = new Octets(Name.ToArray()), + Msg = new Octets(Msg.ToArray()), + Data = new Octets(Data.ToArray()) + }; + + public override void Marshal(OctetsStream os) + { + os.Write(Channel); + os.Write(Emotion); + os.Write(Roleid); + os.Write(Name); + os.Write(Msg); + os.Write(Data); + } + + public override void Unmarshal(OctetsStream os) + { + Channel = os.ReadByte(); + Emotion = os.ReadByte(); + Roleid = os.ReadInt32(); + Name = os.ReadOctets(); + Msg = os.ReadOctets(); + Data = os.ReadOctets(); + } + + public override int PriorPolicy() => 1; + + public override bool SizePolicy(int size) => size <= 1024; + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/worldchat.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/worldchat.cs.meta new file mode 100644 index 0000000000..03e6ac20ef --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/worldchat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4e6223992a639473e87b93c8d75bcf1b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security.meta new file mode 100644 index 0000000000..090a001ced --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50896e558b7814bb3aeb920584f31081 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/ARCFourSecurity.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/ARCFourSecurity.cs new file mode 100644 index 0000000000..b8e31e30b7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/ARCFourSecurity.cs @@ -0,0 +1,181 @@ +using CSNetwork.Security; +using System; + +namespace CSNetwork.Security +{ + /// + /// Implements the ARCFOUR (RC4) stream cipher. + /// Ported from GNET::ARCFourSecurity in gnsecure.h. + /// + public class ARCFourSecurity : BaseSecurity // Inherit from Security + { + private readonly byte[] _perm = new byte[256]; + private byte _index1; + private byte _index2; + private bool _initialized = false; + + // Constructor to register the type + public ARCFourSecurity() + : base(SecurityType.ARCFOURSECURITY) + { + } + byte[] _key; + /// + /// Initializes the RC4 state using the Key Scheduling Algorithm (KSA). + /// + /// The secret key as Octets. + /// + public override void SetParameter(Octets keyOctets) + { + + byte[] key = keyOctets.ByteArray; + _key = key; + if (key == null || key.Length == 0) + { + throw new ArgumentException("ARCFour key cannot be null or empty.", nameof(keyOctets)); + } + + int keylen = key.Length; + + for (int i = 0; i < 256; i++) + { + _perm[i] = (byte)i; + } + + byte j = 0; + for (int i = 0; i < 256; i++) + { + j = (byte)(j + _perm[i] + key[i % keylen]); + // Swap perm[i] and perm[j] + byte temp = _perm[i]; + _perm[i] = _perm[j]; + _perm[j] = temp; + } + + _index1 = 0; + _index2 = 0; + _initialized = true; + } + + /// + /// Encrypts or decrypts the data in the Octets using the RC4 PRGA. + /// Modifies the input Octets in place. + /// + /// The Octets containing the data. + /// The same Octets object with data transformed. + public override Octets Update(Octets data) + { + if (!_initialized) + { + throw new InvalidOperationException("ARCFourSecurity has not been initialized with SetParameter."); + } + if (data == null) throw new ArgumentNullException(nameof(data)); + + byte[] buffer = data.RawBuffer; // Get direct buffer access + int offset = 0; // Octets data always starts at 0 + int length = data.Length; // Use Octets length + + if (offset < 0 || length < 0 || offset + length > buffer.Length) + throw new ArgumentOutOfRangeException("Invalid offset or length derived from Octets."); + + for (int i = 0; i < length; i++) + { + _index1++; // Note: byte overflows wrap around from 255 to 0 automatically + _index2 = (byte)(_index2 + _perm[_index1]); + + // Swap perm[index1] and perm[index2] + byte temp = _perm[_index1]; + _perm[_index1] = _perm[_index2]; + _perm[_index2] = temp; + + byte j = (byte)(_perm[_index1] + _perm[_index2]); + byte keystreamByte = _perm[j]; + + buffer[offset + i] ^= keystreamByte; + } + + return data; // Return the modified Octets + } + + /// + /// Encrypts or decrypts the byte array using the stateful RC4 PRGA. + /// Required implementation for the abstract base class. + /// + /// The byte array containing the data. + /// A new byte array containing the transformed data. + public override byte[] Update(byte[] data) // Implement the abstract method + { + if (!_initialized) + { + throw new InvalidOperationException("ARCFourSecurity has not been initialized with SetParameter."); + } + if (data == null) throw new ArgumentNullException(nameof(data)); + + int length = data.Length; + byte[] result = new byte[length]; // Create a new buffer for the result + + for (int i = 0; i < length; i++) + { + _index1++; + _index2 = (byte)(_index2 + _perm[_index1]); + + // Swap perm[index1] and perm[index2] + byte temp = _perm[_index1]; + _perm[_index1] = _perm[_index2]; + _perm[_index2] = temp; + + byte j = (byte)(_perm[_index1] + _perm[_index2]); + byte keystreamByte = _perm[j]; + + result[i] = (byte)(data[i] ^ keystreamByte); // Apply XOR to original data and store in result + } + + return result; // Return the new array with transformed data + } + + // Keep the renamed UpdateBytes method if you need it for specific use cases, + // or remove it if Update(byte[]) now covers all needs. + public byte[] UpdateBytes(byte[] data) // Renamed to avoid override conflict if BaseSecurity defines Update(byte[]) + { + if (!_initialized) + { + throw new InvalidOperationException("ARCFourSecurity has not been initialized with SetParameter."); + } + if (data == null) throw new ArgumentNullException(nameof(data)); + + byte[] buffer = data; // Work directly on the input buffer + int offset = 0; + int length = data.Length; + + // Create a copy if you need to return a new array, + // otherwise modify 'data' in place if that's acceptable. + byte[] result = new byte[length]; + Array.Copy(data, result, length); + buffer = result; // Operate on the result buffer + + + for (int i = 0; i < length; i++) + { + _index1++; + _index2 = (byte)(_index2 + _perm[_index1]); + + byte temp = _perm[_index1]; + _perm[_index1] = _perm[_index2]; + _perm[_index2] = temp; + + byte j = (byte)(_perm[_index1] + _perm[_index2]); + byte keystreamByte = _perm[j]; + + buffer[offset + i] ^= keystreamByte; // Modify the result buffer + } + + return result; // Return the modified buffer + } + + // Clone creates a new, uninitialized instance for the factory + public override BaseSecurity Clone() + { + return new ARCFourSecurity(); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/ARCFourSecurity.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/ARCFourSecurity.cs.meta new file mode 100644 index 0000000000..3e487c18f0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/ARCFourSecurity.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ed232d5091d53473ca011b5363a1a1bf \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/BaseSecurity.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/BaseSecurity.cs new file mode 100644 index 0000000000..079130e326 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/BaseSecurity.cs @@ -0,0 +1,84 @@ +using CSNetwork.Security; +using System; +using System.Collections.Generic; + +namespace CSNetwork.Security +{ + /// + /// Security types matching the C++ implementation + /// + public enum SecurityType + { + RANDOM = 0, + NULLSECURITY = 1, + ARCFOURSECURITY = 2, + MD5HASH = 3, + HMAC_MD5HASH = 4, + COMPRESSARCFOURSECURITY = 5, + DECOMPRESSARCFOURSECURITY = 6, + SHA256HASH = 7 + } + + /// + /// Base class for security implementations + /// + public abstract class BaseSecurity + { + protected SecurityType Type { get; set; } + + private static Dictionary _securityMap = + new Dictionary(); + + public static void Initizalize(){ + _securityMap[SecurityType.NULLSECURITY] = new NullSecurity(); + _securityMap[SecurityType.ARCFOURSECURITY] = new ARCFourSecurity(); + // _securityMap[SecurityType.COMPRESSARCFOURSECURITY] = new CompressArcFourSecurity(); + _securityMap[SecurityType.DECOMPRESSARCFOURSECURITY] = new DecompressArcFourSecurity(); + } + + + protected BaseSecurity() { } + + protected BaseSecurity(SecurityType type) + { + Type = type; + if (!_securityMap.ContainsKey(type)) + { + _securityMap[type] = this; + } + } + + public virtual void SetParameter(Octets param) { } + + public virtual void GetParameter(Octets param) { } + + public abstract Octets Update(Octets data); + public abstract byte[] Update(byte[] data); + + + public virtual Octets Final(Octets data) + { + return data; + } + + public abstract BaseSecurity Clone(); + + public static BaseSecurity Create(SecurityType type) + { + if (_securityMap.TryGetValue(type, out BaseSecurity security)) + { + return security.Clone(); + } + + // Default to null security if type not found + if (_securityMap.TryGetValue(SecurityType.NULLSECURITY, out BaseSecurity nullSecurity)) + { + return nullSecurity.Clone(); + } + + throw new InvalidOperationException( + $"Security type {type} not registered and no NULLSECURITY fallback available" + ); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/BaseSecurity.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/BaseSecurity.cs.meta new file mode 100644 index 0000000000..7f7779ca5f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/BaseSecurity.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5cb0e78c3e6554125ba05bab407609da \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/DecompressArcFourSecurity.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/DecompressArcFourSecurity.cs new file mode 100644 index 0000000000..f4fb07920f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/DecompressArcFourSecurity.cs @@ -0,0 +1,105 @@ +using System; +using System.IO; +using System.IO.Compression; +using CSNetwork; +using CSNetwork.Security; + +namespace CSNetwork.Security +{ + /// + /// Implements ARCFour decryption followed by ZLib decompression. + /// Used for the input security layer based on GNET::DECOMPRESSARCFOURSECURITY. + /// + public class DecompressArcFourSecurity : BaseSecurity + { + private static readonly IPrefixedLogger _logger = LoggerFactory.GetLogger(nameof(DecompressArcFourSecurity)); + + private ARCFourSecurity _arcFour; // Internal RC4 instance + private byte[] _key; + Decompress decompressor = new Decompress(); + // Constructor to register the type + public DecompressArcFourSecurity() + : base() + { + _arcFour = new ARCFourSecurity(); + _key = Array.Empty(); + } + + /// + /// Initializes the internal RC4 state. + /// + /// The secret key as Octets. + public override void SetParameter(Octets keyOctets) + { + _key = keyOctets.ToArray(); // Assuming parameter contains the key + _arcFour.SetParameter(keyOctets); // Pass Octets directly + _logger.Log(LogType.Debug, $"Key set (Length: {_key.Length})"); + } + + /// + /// Decrypts (RC4) and then decompresses (ZLib) the incoming data. + /// + /// The Octets containing the encrypted and compressed data. + /// A new Octets object containing the decrypted and decompressed data. + public override Octets Update(Octets data) + { + if (data == null || data.Length == 0) + { + return new Octets(); // Return empty if input is empty + } + // 1. Decrypt using ARCFour + Octets decryptedData; + try + { + // Pass a clone of the data to ARC4 Update, assuming it might modify input + // or just to be safe. Ensure _arcFour.Update returns a *new* Octets. + // *** If ARCFourSecurity.Update modified the input Octets in-place, this would be wrong. *** + // *** Assuming ARCFourSecurity.Update follows the abstract Security pattern and returns new Octets *** + decryptedData = _arcFour.Update(data); + } + catch (Exception ex) + { + _logger.Log(LogType.Error, $"ARCFour Decryption Error: {ex.Message}. Input Length: {data.Length}"); + _logger.LogException(ex); + throw new InvalidOperationException("ARCFour decryption failed.", ex); + } + + // 2. Decompress the decrypted data using ZLib + if (decryptedData.Length == 0) + { + // Decryption resulted in empty data + return decryptedData; + } + + Octets decompressedData; + try + { + decompressedData = decompressor.Update(decryptedData); + //_logger.Log(LogType.Debug, $"Decompressed {decryptedData.Length} bytes to {decompressedData.Length} bytes. Decompressed Data: {decompressedData.ToString()}"); + } + catch (Exception ex) + { + //_logger.Log(LogType.Error, $"MPPC Decompression Error after decryption: {ex.Message}. Decrypted Length: {decryptedData.Length}"); + string firstBytes = BitConverter.ToString(decryptedData.RawBuffer, 0, Math.Min(decryptedData.Length, 16)); + _logger.Log(LogType.Debug, $"Decrypted Data (first {Math.Min(decryptedData.Length, 16)} bytes): {firstBytes}"); + _logger.LogException(ex); + throw new InvalidDataException("MPPC decompression failed after decryption.", ex); + } + + return decompressedData; + } + + // Clone creates a new, uninitialized instance for the factory + public override BaseSecurity Clone() + { + // Return a new instance with the same key but a fresh ARCFour state + return new DecompressArcFourSecurity(); + } + public override byte[] Update(byte[] data) + { + var octest = new Octets(data); + var result = Update(octest); + return result.RawBuffer; + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/DecompressArcFourSecurity.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/DecompressArcFourSecurity.cs.meta new file mode 100644 index 0000000000..610fcc4796 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/DecompressArcFourSecurity.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 68b4522dc0cfe488585db201c691a9d7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/HMAC_MD5Hash.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/HMAC_MD5Hash.cs new file mode 100644 index 0000000000..43f5d3c4a2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/HMAC_MD5Hash.cs @@ -0,0 +1,135 @@ +using System; + +namespace CSNetwork.Security +{ + /// + /// A C# port of the GNET::HMAC_MD5Hash class from security.h. + /// Uses the ported MD5Hash class. + /// + public class HMAC_MD5Hash + { + private byte[] _kOpad; // Outer padded key + private MD5Hash _innerMD5; // Inner hash state + + private const int BlockSize = 64; + + public HMAC_MD5Hash() + { + // Initialize required members, though SetParameter does the main setup + _kOpad = new byte[BlockSize]; + _innerMD5 = new MD5Hash(); // Initialize inner hash context + } + + // Sets the key for the HMAC operation. + public void SetParameter(Octets key) + { + SetParameter(key.ByteArray); + } + + public void SetParameter(byte[] key) + { + byte[] kIpad = new byte[BlockSize]; + // Reinitialize inner MD5 context + _innerMD5 = new MD5Hash(); + + int keyLen = key.Length; + byte[] actualKey; + + if (keyLen > BlockSize) + { + // If key is longer than block size, hash it + actualKey = MD5Hash.Digest(key); + keyLen = actualKey.Length; // Should be 16 for MD5 + } + else + { + actualKey = key; + } + + // Copy key to ipad and opad buffers, padding with 0 if necessary + // (though the memset below overwrites the padding anyway) + Buffer.BlockCopy(actualKey, 0, kIpad, 0, keyLen); + Buffer.BlockCopy(actualKey, 0, _kOpad, 0, keyLen); + + // XOR key with ipad and opad values + for (int i = 0; i < keyLen; i++) + { + kIpad[i] ^= 0x36; + _kOpad[i] ^= 0x5c; + } + + // Fill the remainder of ipad and opad buffers with the XOR constants + for (int i = keyLen; i < BlockSize; i++) + { + kIpad[i] = 0x36; + _kOpad[i] = 0x5c; + } + + // Start the inner hash computation with the inner padded key + _innerMD5.Update(kIpad, BlockSize); + + // Zeroize sensitive intermediate data + Array.Clear(kIpad, 0, kIpad.Length); + } + + // Updates the HMAC with message data. + public void Update(Octets message) + { + _innerMD5.Update(message.ByteArray, message.Length); + } + public void Update(byte[] message) + { + _innerMD5.Update(message, message.Length); + } + + + // Finalizes the HMAC computation. + // Returns the final HMAC hash as Octets. + public Octets Final(Octets digest) + { + // 1. Finalize the inner hash: H(K XOR ipad || message) + byte[] innerHashResult = _innerMD5.Final(); + + // 2. Calculate the outer hash: H(K XOR opad || innerHashResult) + MD5Hash outerMD5 = new MD5Hash(); // Create a new context for the outer hash + outerMD5.Update(_kOpad, BlockSize); // Start outer hash with outer padded key + outerMD5.Update(innerHashResult, innerHashResult.Length); // Append the inner hash result + byte[] finalHash = outerMD5.Final(); // Finalize outer hash + + // Zeroize sensitive intermediate data + Array.Clear(innerHashResult, 0, innerHashResult.Length); + // Optionally zeroize _kOpad if instance won't be reused with same key + + digest.Replace(finalHash); + return digest; + } + + // Convenience method to return byte[] directly + public byte[] Final() + { + Octets tempOctets = new Octets(); + Final(tempOctets); + return tempOctets.ByteArray; + } + + // Static method to compute HMAC in one go (like C# System.Security.Cryptography.HMACMD5) + // This is useful for testing but mirrors the C++ instance-based approach above for direct porting. + public static byte[] ComputeHash(byte[] key, byte[] message) + { + HMAC_MD5Hash hmac = new HMAC_MD5Hash(); + hmac.SetParameter(key); + hmac.Update(new Octets(message)); + return hmac.Final(); + } + + public static Octets ComputeHash(Octets key, Octets message) + { + HMAC_MD5Hash hmac = new HMAC_MD5Hash(); + hmac.SetParameter(key); + hmac.Update(message); + Octets result = new Octets(); + hmac.Final(result); + return result; + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/HMAC_MD5Hash.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/HMAC_MD5Hash.cs.meta new file mode 100644 index 0000000000..2cf6dfc992 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/HMAC_MD5Hash.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: eb066bc25dc224234988de0a1918dae5 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/MD5Hash.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/MD5Hash.cs new file mode 100644 index 0000000000..9c031afadf --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/MD5Hash.cs @@ -0,0 +1,302 @@ +using System; + +namespace CSNetwork.Security +{ + /// + /// A C# port of the GNET::MD5Hash class from security.h (portable version). + /// + public class MD5Hash + { + private uint[] _state; // state (ABCD) + private ulong _count; // number of bits, modulo 2^64 (lsb first) + private byte[] _buffer; // input buffer + private const int BufferSize = 64; + + public MD5Hash() + { + Init(); + } + + // MD5 initialization. Begins an MD5 operation, writing a new context. + private void Init() + { + _count = 0; + _state = new uint[4]; + _state[0] = 0x67452301; + _state[1] = 0xefcdab89; + _state[2] = 0x98badcfe; + _state[3] = 0x10325476; + _buffer = new byte[BufferSize]; + } + + // MD5 block update operation. Continues an MD5 message-digest + // operation, processing another message block, and updating the + // context. + public void Update(byte[] input, int inputLen) + { + int bufferIndex = (int)(_count / 8) % BufferSize; + _count += (ulong)inputLen * 8; + + int partLen = BufferSize - bufferIndex; + int i = 0; + + // Transform as many times as possible. + if (inputLen >= partLen) + { + Buffer.BlockCopy(input, 0, _buffer, bufferIndex, partLen); + Transform(_buffer, 0); + + for (i = partLen; i + BufferSize -1 < inputLen; i += BufferSize) + { + Transform(input, i); + } + bufferIndex = 0; + } + + // Buffer remaining input + if (i < inputLen) + { + Buffer.BlockCopy(input, i, _buffer, bufferIndex, inputLen - i); + } + } + + public void Update(Octets o) + { + Update(o.ByteArray, o.Length); + } + + + // MD5 finalization. Ends an MD5 message-digest operation, writing the + // the message digest and zeroizing the context. + // Returns the 16-byte MD5 digest. + public byte[] Final() + { + byte[] bits = Encode(_count); + + // Pad out to 56 mod 64. + int index = (int)(_count / 8) % 64; + int padLen = (index < 56) ? (56 - index) : (120 - index); + byte[] padding = new byte[padLen]; + padding[0] = 0x80; + Update(padding, padLen); + + // Append length (before padding) + Update(bits, 8); + + // Store state in digest + byte[] digest = Encode(_state); + + // Zeroize sensitive information. + // Array.Clear(_buffer, 0, _buffer.Length); + // Array.Clear(_state, 0, _state.Length); + // _count = 0; // Not strictly necessary for correctness but good practice + + // Re-initialize for potential reuse, mirroring C++ behavior + // where a new MD5Hash object is created for subsequent digests + // within HMAC_MD5Hash.Final. If the instance needs to be reusable + // after Final, Init() should be called. Let's keep state for now. + + return digest; + } + + public Octets Final(Octets digest) + { + byte[] hash = Final(); + digest.Replace(hash); + return digest; + } + + // MD5 basic transformation. Transforms state based on block. + private void Transform(byte[] block, int blockOffset) + { + uint a = _state[0], b = _state[1], c = _state[2], d = _state[3]; + uint[] x = Decode(block, blockOffset, 16); + + // Round 1 + FF(ref a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ + FF(ref d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ + FF(ref c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ + FF(ref b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ + FF(ref a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ + FF(ref d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ + FF(ref c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ + FF(ref b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ + FF(ref a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ + FF(ref d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ + FF(ref c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ + FF(ref b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ + FF(ref a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ + FF(ref d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ + FF(ref c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ + FF(ref b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ + + // Round 2 + GG(ref a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ + GG(ref d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ + GG(ref c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ + GG(ref b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ + GG(ref a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ + GG(ref d, a, b, c, x[10], S22, 0x2441453); /* 22 */ + GG(ref c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ + GG(ref b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ + GG(ref a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ + GG(ref d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ + GG(ref c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ + GG(ref b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ + GG(ref a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ + GG(ref d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ + GG(ref c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ + GG(ref b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ + + // Round 3 + HH(ref a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ + HH(ref d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ + HH(ref c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ + HH(ref b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ + HH(ref a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ + HH(ref d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ + HH(ref c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ + HH(ref b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ + HH(ref a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ + HH(ref d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ + HH(ref c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ + HH(ref b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ + HH(ref a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ + HH(ref d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ + HH(ref c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ + HH(ref b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ + + // Round 4 + II(ref a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ + II(ref d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ + II(ref c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ + II(ref b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ + II(ref a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ + II(ref d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ + II(ref c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ + II(ref b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ + II(ref a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ + II(ref d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ + II(ref c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ + II(ref b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ + II(ref a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ + II(ref d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ + II(ref c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ + II(ref b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ + + _state[0] += a; + _state[1] += b; + _state[2] += c; + _state[3] += d; + } + + // Encodes input (ulong) into output (byte[]). Assumes len is multiple of 8. + private static byte[] Encode(ulong input) + { + byte[] output = new byte[8]; + output[0] = (byte)(input & 0xff); + output[1] = (byte)((input >> 8) & 0xff); + output[2] = (byte)((input >> 16) & 0xff); + output[3] = (byte)((input >> 24) & 0xff); + output[4] = (byte)((input >> 32) & 0xff); + output[5] = (byte)((input >> 40) & 0xff); + output[6] = (byte)((input >> 48) & 0xff); + output[7] = (byte)((input >> 56) & 0xff); + return output; + } + + // Encodes input (uint[]) into output (byte[]). Assumes len is multiple of 4. + private static byte[] Encode(uint[] input) + { + byte[] output = new byte[input.Length * 4]; + for (int i = 0, j = 0; i < input.Length; i++, j += 4) + { + output[j] = (byte)(input[i] & 0xff); + output[j+1] = (byte)((input[i] >> 8) & 0xff); + output[j+2] = (byte)((input[i] >> 16) & 0xff); + output[j+3] = (byte)((input[i] >> 24) & 0xff); + } + return output; + } + + + // Decodes input (byte[]) into output (uint[]). Assumes len is a multiple of 4. + private static uint[] Decode(byte[] input, int offset, int count) + { + uint[] output = new uint[count]; + for (int i = 0, j = offset; i < count; i++, j += 4) + { + output[i] = ((uint)input[j]) | (((uint)input[j+1]) << 8) | + (((uint)input[j+2]) << 16) | (((uint)input[j+3]) << 24); + } + return output; + } + + + // Constants for MD5Transform routine. + private const int S11 = 7; + private const int S12 = 12; + private const int S13 = 17; + private const int S14 = 22; + private const int S21 = 5; + private const int S22 = 9; + private const int S23 = 14; + private const int S24 = 20; + private const int S31 = 4; + private const int S32 = 11; + private const int S33 = 16; + private const int S34 = 23; + private const int S41 = 6; + private const int S42 = 10; + private const int S43 = 15; + private const int S44 = 21; + + // F, G, H and I are basic MD5 functions. + private static uint F(uint x, uint y, uint z) { return (z ^ (x & (y ^ z))); } + private static uint G(uint x, uint y, uint z) { return (y ^ (z & (x ^ y))); } + private static uint H(uint x, uint y, uint z) { return x ^ y ^ z; } + private static uint I(uint x, uint y, uint z) { return y ^ (x | ~z); } + + // rotates x left n bits. + private static uint RotateLeft(uint x, int n) { return (x << n) | (x >> (32-n)); } + + // FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. + // Rotation is separate from addition to prevent recomputation. + private static void FF(ref uint a, uint b, uint c, uint d, uint x, int s, uint ac) { + a += F(b, c, d) + x + ac; + a = RotateLeft(a, s); + a += b; + } + private static void GG(ref uint a, uint b, uint c, uint d, uint x, int s, uint ac) { + a += G(b, c, d) + x + ac; + a = RotateLeft(a, s); + a += b; + } + private static void HH(ref uint a, uint b, uint c, uint d, uint x, int s, uint ac) { + a += H(b, c, d) + x + ac; + a = RotateLeft(a, s); + a += b; + } + private static void II(ref uint a, uint b, uint c, uint d, uint x, int s, uint ac) { + a += I(b, c, d) + x + ac; + a = RotateLeft(a, s); + a += b; + } + + // Static Digest method replicating C++ + public static Octets Digest(Octets o) + { + MD5Hash ctx = new MD5Hash(); + ctx.Update(o.ByteArray, o.Length); + byte[] hash = ctx.Final(); + return new Octets(hash); + } + + public static byte[] Digest(byte[] data) + { + MD5Hash ctx = new MD5Hash(); + ctx.Update(data, data.Length); + return ctx.Final(); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/MD5Hash.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/MD5Hash.cs.meta new file mode 100644 index 0000000000..7d7606c093 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/MD5Hash.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 69be965ef68764accb448708fbd5ff8a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/NullSecurity.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/NullSecurity.cs new file mode 100644 index 0000000000..dffd57284d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/NullSecurity.cs @@ -0,0 +1,37 @@ +namespace CSNetwork.Security +{ + /// + /// A security implementation that does nothing. + /// + public class NullSecurity : BaseSecurity // Inherit from Security + { + // Constructor to register the type + public NullSecurity() + : base(SecurityType.NULLSECURITY) + { + } + + // SetParameter does nothing + public override void SetParameter(Octets param) + { + // No parameters needed + } + + // Update returns the data unchanged + public override Octets Update(Octets data) + { + return data; // No transformation + } + + // Clone creates a new instance + public override BaseSecurity Clone() + { + return new NullSecurity(); + } + + public override byte[] Update(byte[] data) + { + return data; + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/NullSecurity.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/NullSecurity.cs.meta new file mode 100644 index 0000000000..562ce5b6b0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/NullSecurity.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c6e696984a5d345fb9e3bc07e3b4ae23 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SHA256Hash.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SHA256Hash.cs new file mode 100644 index 0000000000..c53e7800cb --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SHA256Hash.cs @@ -0,0 +1,87 @@ +using System; +using System.Security.Cryptography; + +namespace CSNetwork.Security +{ + /// + /// SHA256 hash implementation using .NET's built-in cryptography + /// + public class SHA256Hash : BaseSecurity + { + private SHA256 _sha256; + + public SHA256Hash() + : base() + { + Initialize(); + } + + public SHA256Hash(SecurityType type) + : base(type) + { + Initialize(); + } + + public SHA256Hash(SHA256Hash other) + : base() + { + Type = other.Type; + Initialize(); + } + + private void Initialize() + { + _sha256 = SHA256.Create(); + } + + public override Octets Update(Octets data) + { + // In .NET's implementation, we accumulate data and compute the hash in Final + // This is different from the C++ approach that updates incrementally + return data; + } + + + + public override BaseSecurity Clone() + { + return new SHA256Hash(this); + } + + /// + /// Static method to compute SHA256 hash directly from Octets + /// + public static Octets Digest(Octets data) + { + SHA256Hash hashObj = new SHA256Hash(); + hashObj.Update(data); + Octets result = new Octets(0); + return hashObj.Final(data); + } + + /// + /// Static method to compute SHA256 hash directly from byte array + /// + public static byte[] Digest(byte[] data) + { + using (SHA256 sha256 = SHA256.Create()) + { + return sha256.ComputeHash(data); + } + } + + /// + /// Static method to compute SHA256 hash directly from string + /// + public static byte[] Digest(string data) + { + byte[] bytes = System.Text.Encoding.UTF8.GetBytes(data); + return Digest(bytes); + } + + public override byte[] Update(byte[] data) + { + return data; + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SHA256Hash.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SHA256Hash.cs.meta new file mode 100644 index 0000000000..d17725baba --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SHA256Hash.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4b08d219745f4431ab0180b52fd0d154 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SecurityFactory.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SecurityFactory.cs new file mode 100644 index 0000000000..bdb1dbf86b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SecurityFactory.cs @@ -0,0 +1,22 @@ +namespace CSNetwork.Security +{ + /// + /// Factory class to initialize and register all security implementations + /// + public static class SecurityFactory + { + private static bool _initialized = false; + + public static void Initialize() + { + if (_initialized) + return; + + // Register security implementations + new SHA256Hash(SecurityType.SHA256HASH); + // Add other security implementations as needed + + _initialized = true; + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SecurityFactory.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SecurityFactory.cs.meta new file mode 100644 index 0000000000..c9697fba0d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/SecurityFactory.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 51bd328ad251e4e3ebc5a88f36f81f3f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/StreamCompress.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/StreamCompress.cs new file mode 100644 index 0000000000..12fb2deb35 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/StreamCompress.cs @@ -0,0 +1,336 @@ +using System; +using System.Collections.Generic; + +namespace CSNetwork.Security +{ + + public class Decompress + { + private const int CTRL_OFF_EOB = 0; + private const int MPPC_HIST_LEN = 8192; + + private byte[] history = new byte[MPPC_HIST_LEN]; + private int historyPos; + private uint bitPos; + private uint adjust_bitPos; + private uint bitsProcessed; + private uint totalBits; + private List legacyInput = new List(); + private int readPos; + private int adjust_readPos; + + public Decompress() + { + historyPos = 0; + bitPos = 0; + } + + public Decompress(Decompress source) + { + Array.Copy(source.history, history, MPPC_HIST_LEN); + historyPos = source.historyPos; + bitPos = source.bitPos; + adjust_bitPos = source.adjust_bitPos; + bitsProcessed = source.bitsProcessed; + totalBits = source.totalBits; + legacyInput = new List(source.legacyInput); + readPos = source.readPos; + adjust_readPos = source.adjust_readPos; + } + + private bool PassBits(uint n) + { + bitPos += n; + bitsProcessed += n; + if (bitsProcessed < totalBits) + return true; + + bitPos = adjust_bitPos; + readPos = adjust_readPos; + return false; + } + + private uint ByteOrder32(uint value) + { + return ((value & 0x000000FF) << 24) + | ((value & 0x0000FF00) << 8) + | ((value & 0x00FF0000) >> 8) + | ((value & 0xFF000000) >> 24); + } + + private uint Fetch() + { + readPos += (int)(bitPos >> 3); + bitPos &= 7; + + byte[] fourBytes = new byte[4]; + for (int i = 0; i < 4 && readPos + i < legacyInput.Count; i++) + { + fourBytes[i] = legacyInput[readPos + i]; + } + + uint value = BitConverter.ToUInt32(fourBytes, 0); + return ByteOrder32(value) << (int)bitPos; + } + + private void LameCopy(int dstPos, int srcPos, int len) + { + if (dstPos - srcPos > 3) + { + while (len > 3) + { + // Copy 4 bytes at once for efficiency + Buffer.BlockCopy(history, srcPos, history, dstPos, 4); + dstPos += 4; + srcPos += 4; + len -= 4; + } + } + + while (len-- > 0) + { + history[dstPos++] = history[srcPos++]; + } + } + + public Octets Update(Octets input) + { + // Add input to legacy buffer + foreach (byte b in input.ToArray()) + { + legacyInput.Add(b); + } + + totalBits = (uint)(legacyInput.Count * 8 - bitPos); + readPos = 0; + bitsProcessed = 7; + + Octets output = new Octets(); + int histHead = historyPos; + + while (totalBits > bitsProcessed) + { + adjust_bitPos = bitPos; + adjust_readPos = readPos; + uint val = Fetch(); + + if (val < 0x80000000) + { + if (!PassBits(8)) + break; + history[historyPos++] = (byte)(val >> 24); + if (historyPos == MPPC_HIST_LEN) + historyPos = 0; + continue; + } + + if (val < 0xC0000000) + { + if (!PassBits(9)) + break; + history[historyPos++] = (byte)(((val >> 23) | 0x80) & 0xFF); + if (historyPos == MPPC_HIST_LEN) + historyPos = 0; + continue; + } + + uint offset = 0, + length = 0; + if (val >= 0xF0000000) + { + if (!PassBits(10)) + break; + offset = (val >> 22) & 0x3F; + if (offset == CTRL_OFF_EOB) + { + uint advance = 8 - (bitPos & 7); + if (advance < 8) + if (!PassBits(advance)) + break; + + // Copy current history segment to output + if (historyPos >= histHead) + { + byte[] segment = new byte[historyPos - histHead]; + Array.Copy(history, histHead, segment, 0, segment.Length); + + // If output is empty, replace it, otherwise insert at the end + if (output.Size == 0) + output.Replace(segment); + else + output.Insert(output.Size, segment); + } + else + { + // Wrap around case - two segments + byte[] segment1 = new byte[MPPC_HIST_LEN - histHead]; + Array.Copy(history, histHead, segment1, 0, segment1.Length); + + // Add first segment (from histHead to end of buffer) + if (output.Size == 0) + output.Replace(segment1); + else + output.Insert(output.Size, segment1); + + // Add second segment (from beginning to historyPos) + if (historyPos > 0) + { + byte[] segment2 = new byte[historyPos]; + Array.Copy(history, 0, segment2, 0, historyPos); + output.Insert(output.Size, segment2); + } + } + + if (historyPos == MPPC_HIST_LEN) + historyPos = 0; + + histHead = historyPos; + continue; + } + } + else if (val >= 0xE0000000) + { + if (!PassBits(12)) + break; + offset = ((val >> 20) & 0xFF) + 64; + } + else if (val >= 0xC0000000) + { + if (!PassBits(16)) + break; + offset = ((val >> 16) & 0x1FFF) + 320; + } + else + { + // Invalid data + bitPos = adjust_bitPos; + readPos = adjust_readPos; + break; + } + + val = Fetch(); + if (val < 0x80000000) + { + if (!PassBits(1)) + break; + length = 3; + } + else if (val < 0xC0000000) + { + if (!PassBits(4)) + break; + length = 4 | ((val >> 28) & 3); + } + else if (val < 0xE0000000) + { + if (!PassBits(6)) + break; + length = 8 | ((val >> 26) & 7); + } + else if (val < 0xF0000000) + { + if (!PassBits(8)) + break; + length = 16 | ((val >> 24) & 15); + } + else if (val < 0xF8000000) + { + if (!PassBits(10)) + break; + length = 32 | ((val >> 22) & 0x1F); + } + else if (val < 0xFC000000) + { + if (!PassBits(12)) + break; + length = 64 | ((val >> 20) & 0x3F); + } + else if (val < 0xFE000000) + { + if (!PassBits(14)) + break; + length = 128 | ((val >> 18) & 0x7F); + } + else if (val < 0xFF000000) + { + if (!PassBits(16)) + break; + length = 256 | ((val >> 16) & 0xFF); + } + else if (val < 0xFF800000) + { + if (!PassBits(18)) + break; + length = 0x200 | ((val >> 14) & 0x1FF); + } + else if (val < 0xFFC00000) + { + if (!PassBits(20)) + break; + length = 0x400 | ((val >> 12) & 0x3FF); + } + else if (val < 0xFFE00000) + { + if (!PassBits(22)) + break; + length = 0x800 | ((val >> 10) & 0x7FF); + } + else if (val < 0xFFF00000) + { + if (!PassBits(24)) + break; + length = 0x1000 | ((val >> 8) & 0xFFF); + } + else + { + bitPos = adjust_bitPos; + readPos = adjust_readPos; + break; + } + + if (historyPos - (int)offset < 0 || historyPos + (int)length > MPPC_HIST_LEN) + break; + + LameCopy(historyPos, historyPos - (int)offset, (int)length); + historyPos += (int)length; + if (historyPos >= MPPC_HIST_LEN) + historyPos = 0; + } + + // Copy remaining history segment to output + if (historyPos >= histHead) + { + byte[] result = new byte[historyPos - histHead]; + Array.Copy(history, histHead, result, 0, result.Length); + if (output.Size == 0) + output.Replace(result); + else + output.Insert(output.Size, result); + } + else + { + if (histHead < MPPC_HIST_LEN) + { + byte[] segment1 = new byte[MPPC_HIST_LEN - histHead]; + Array.Copy(history, histHead, segment1, 0, segment1.Length); + if (output.Size == 0) + output.Replace(segment1); + else + output.Insert(output.Size, segment1); + } + + if (historyPos > 0) + { + byte[] segment2 = new byte[historyPos]; + Array.Copy(history, 0, segment2, 0, historyPos); + output.Insert(output.Size, segment2); + } + } + + // Remove processed bytes from legacy input + legacyInput.RemoveRange(0, readPos); + + return output; + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/StreamCompress.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/StreamCompress.cs.meta new file mode 100644 index 0000000000..7cfd3636e3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Security/StreamCompress.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9ff33ababe98d4fa492838e85758754c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj.meta new file mode 100644 index 0000000000..140e6e249f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c59b2ec21de843799f3f23a0b1b09b2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.dgspec.json b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.dgspec.json new file mode 100644 index 0000000000..fe0b20c2ce --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.dgspec.json @@ -0,0 +1,73 @@ +{ + "format": 1, + "restore": { + "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj": {} + }, + "projects": { + "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj", + "projectName": "CSNetwork", + "projectPath": "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj", + "packagesPath": "/Users/leducanh/.nuget/packages/", + "outputPath": "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/Users/leducanh/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "netstandard2.1" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.1": { + "targetAlias": "netstandard2.1", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.300" + }, + "frameworks": { + "netstandard2.1": { + "targetAlias": "netstandard2.1", + "dependencies": { + "System.Reflection.Metadata": { + "target": "Package", + "version": "[9.0.8, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "NETStandard.Library": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/9.0.301/RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/TestClient.deps.json.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.dgspec.json.meta similarity index 75% rename from Assets/Plugins/TestClient.deps.json.meta rename to Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.dgspec.json.meta index e9bc20ebdf..f535c6fff2 100644 --- a/Assets/Plugins/TestClient.deps.json.meta +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.dgspec.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7417da7f5b819be40aefcec927362f6a +guid: 7b30970fc3ad34f41840f55aec8faca6 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.props b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.props new file mode 100644 index 0000000000..9864a1fd0b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /Users/leducanh/.nuget/packages/ + /Users/leducanh/.nuget/packages/ + PackageReference + 6.13.2 + + + + + \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.props.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.props.meta new file mode 100644 index 0000000000..8f1df1891f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.props.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c9b1e8618d361465cbba4fd1b0ebf3d7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.targets b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.targets new file mode 100644 index 0000000000..3dc06ef3cc --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.targets.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.targets.meta new file mode 100644 index 0000000000..5bdcb30b71 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/CSNetwork.csproj.nuget.g.targets.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 37506648d7c7247d895d8726916797a5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug.meta new file mode 100644 index 0000000000..d563c59956 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dda2989fd942d4b7faeb13f15db61c0a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1.meta new file mode 100644 index 0000000000..63d9d23fed --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 87277df6245c941f7ba4d75ddf3a01e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs new file mode 100644 index 0000000000..669815a71e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfo.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfo.cs new file mode 100644 index 0000000000..668ded32bc --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("CSNetwork")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7dd1d7ecd58f6b2da58fc494035e0e234503cd30")] +[assembly: System.Reflection.AssemblyProductAttribute("CSNetwork")] +[assembly: System.Reflection.AssemblyTitleAttribute("CSNetwork")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfo.cs.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfo.cs.meta new file mode 100644 index 0000000000..43db7dee54 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fd0941e177f5c41ddacd6f50ccafc96c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfoInputs.cache b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfoInputs.cache new file mode 100644 index 0000000000..512a4a89fb --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +d9404c20ac17582d7f048be547c9c19d0a3f0220d8b66785b342d07d4ee8b3d9 diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfoInputs.cache.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfoInputs.cache.meta new file mode 100644 index 0000000000..cbf7c1783f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfoInputs.cache.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 47fc1b498340b454b9ae3fcb57aa5da1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.GeneratedMSBuildEditorConfig.editorconfig b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000000..3109362f81 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,8 @@ +is_global = true +build_property.RootNamespace = CSNetwork +build_property.ProjectDir = /Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.CsWinRTUseWindowsUIXamlProjections = false +build_property.EffectiveAnalysisLevelStyle = +build_property.EnableCodeStyleSeverity = diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.GeneratedMSBuildEditorConfig.editorconfig.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.GeneratedMSBuildEditorConfig.editorconfig.meta new file mode 100644 index 0000000000..72fae3cb23 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.GeneratedMSBuildEditorConfig.editorconfig.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d59d1d12d3d43415b8907f6fa81704dd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.assets.cache b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.assets.cache new file mode 100644 index 0000000000..a788a1c1f9 Binary files /dev/null and b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.assets.cache differ diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.assets.cache.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.assets.cache.meta new file mode 100644 index 0000000000..58bcf72a3d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.assets.cache.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ebc601a68b0f143efa88c63b5b708d44 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.AssemblyReference.cache b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.AssemblyReference.cache new file mode 100644 index 0000000000..f4a69498a3 Binary files /dev/null and b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.AssemblyReference.cache differ diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.AssemblyReference.cache.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.AssemblyReference.cache.meta new file mode 100644 index 0000000000..103ef57d7e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.AssemblyReference.cache.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 750f2fb669b104dc1bdd2aeac3ca8d52 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.CoreCompileInputs.cache b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000000..d41095a0ec --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +edc410003353a7c92512866bf011e4d56b8cde300dd5370f4c828e976b3e2c59 diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.CoreCompileInputs.cache.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.CoreCompileInputs.cache.meta new file mode 100644 index 0000000000..e7a76190c4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.CoreCompileInputs.cache.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1fe4f7a53baf348a58f1721052a9c5aa +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.FileListAbsolute.txt b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.FileListAbsolute.txt new file mode 100644 index 0000000000..a6b464315c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +/Users/leducanh/Documents/PortingProjects/UnityProject/perfect-world-unity/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.deps.json +/Users/leducanh/Documents/PortingProjects/UnityProject/perfect-world-unity/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll +/Users/leducanh/Documents/PortingProjects/UnityProject/perfect-world-unity/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.pdb +/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.AssemblyReference.cache +/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.GeneratedMSBuildEditorConfig.editorconfig +/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfoInputs.cache +/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.AssemblyInfo.cs +/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.CoreCompileInputs.cache +/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.dll +/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.pdb diff --git a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.deps.json.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.FileListAbsolute.txt.meta similarity index 75% rename from Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.deps.json.meta rename to Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.FileListAbsolute.txt.meta index 8a5f87f538..5ce688b746 100644 --- a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.deps.json.meta +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.csproj.FileListAbsolute.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9117d707eb63a6442b7b36c6b7669bf3 +guid: 2e3b87de97a3947348e341601dfb44d4 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.dll b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.dll new file mode 100644 index 0000000000..3f28de2e06 Binary files /dev/null and b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.dll differ diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.dll.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.dll.meta new file mode 100644 index 0000000000..73df0221aa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/Debug/netstandard2.1/CSNetwork.dll.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e3cf084cf53b24fe7a6bffb17846d608 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.assets.json b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.assets.json new file mode 100644 index 0000000000..19c973e70f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.assets.json @@ -0,0 +1,351 @@ +{ + "version": 3, + "targets": { + ".NETStandard,Version=v2.1": { + "System.Buffers/4.5.1": { + "type": "package", + "compile": { + "ref/netstandard2.0/System.Buffers.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "related": ".xml" + } + } + }, + "System.Collections.Immutable/9.0.8": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Collections.Immutable.dll": { + "related": ".xml" + } + } + }, + "System.Memory/4.5.5": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "compile": { + "lib/netstandard2.0/System.Memory.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "related": ".xml" + } + } + }, + "System.Numerics.Vectors/4.4.0": { + "type": "package", + "compile": { + "ref/netstandard2.0/System.Numerics.Vectors.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "related": ".xml" + } + } + }, + "System.Reflection.Metadata/9.0.8": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "9.0.8", + "System.Memory": "4.5.5" + }, + "compile": { + "lib/netstandard2.0/System.Reflection.Metadata.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Reflection.Metadata.dll": { + "related": ".xml" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + } + } + }, + "libraries": { + "System.Buffers/4.5.1": { + "sha512": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "type": "package", + "path": "system.buffers/4.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Buffers.dll", + "lib/net461/System.Buffers.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.1/System.Buffers.dll", + "lib/netstandard1.1/System.Buffers.xml", + "lib/netstandard2.0/System.Buffers.dll", + "lib/netstandard2.0/System.Buffers.xml", + "lib/uap10.0.16299/_._", + "ref/net45/System.Buffers.dll", + "ref/net45/System.Buffers.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.1/System.Buffers.dll", + "ref/netstandard1.1/System.Buffers.xml", + "ref/netstandard2.0/System.Buffers.dll", + "ref/netstandard2.0/System.Buffers.xml", + "ref/uap10.0.16299/_._", + "system.buffers.4.5.1.nupkg.sha512", + "system.buffers.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Collections.Immutable/9.0.8": { + "sha512": "Eje6exD7AGKPg5SIkmjyWTBq0KK6SpfTBfdFUmpGG07mNbYimFJ+jyVnILcs0ikFOXoYTBpBOxKYgAk2hhjYOw==", + "type": "package", + "path": "system.collections.immutable/9.0.8", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Collections.Immutable.targets", + "buildTransitive/net462/_._", + "buildTransitive/net8.0/_._", + "buildTransitive/netcoreapp2.0/System.Collections.Immutable.targets", + "lib/net462/System.Collections.Immutable.dll", + "lib/net462/System.Collections.Immutable.xml", + "lib/net8.0/System.Collections.Immutable.dll", + "lib/net8.0/System.Collections.Immutable.xml", + "lib/net9.0/System.Collections.Immutable.dll", + "lib/net9.0/System.Collections.Immutable.xml", + "lib/netstandard2.0/System.Collections.Immutable.dll", + "lib/netstandard2.0/System.Collections.Immutable.xml", + "system.collections.immutable.9.0.8.nupkg.sha512", + "system.collections.immutable.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Memory/4.5.5": { + "sha512": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "type": "package", + "path": "system.memory/4.5.5", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Memory.dll", + "lib/net461/System.Memory.xml", + "lib/netcoreapp2.1/_._", + "lib/netstandard1.1/System.Memory.dll", + "lib/netstandard1.1/System.Memory.xml", + "lib/netstandard2.0/System.Memory.dll", + "lib/netstandard2.0/System.Memory.xml", + "ref/netcoreapp2.1/_._", + "system.memory.4.5.5.nupkg.sha512", + "system.memory.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Numerics.Vectors/4.4.0": { + "sha512": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==", + "type": "package", + "path": "system.numerics.vectors/4.4.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Numerics.Vectors.dll", + "lib/net46/System.Numerics.Vectors.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.0/System.Numerics.Vectors.dll", + "lib/netstandard1.0/System.Numerics.Vectors.xml", + "lib/netstandard2.0/System.Numerics.Vectors.dll", + "lib/netstandard2.0/System.Numerics.Vectors.xml", + "lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll", + "lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.xml", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Numerics.Vectors.dll", + "ref/net46/System.Numerics.Vectors.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.0/System.Numerics.Vectors.dll", + "ref/netstandard1.0/System.Numerics.Vectors.xml", + "ref/netstandard2.0/System.Numerics.Vectors.dll", + "ref/netstandard2.0/System.Numerics.Vectors.xml", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "system.numerics.vectors.4.4.0.nupkg.sha512", + "system.numerics.vectors.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Reflection.Metadata/9.0.8": { + "sha512": "oJQezcASFomKvSp+06pzvSFRTnzdUJtiO19peAdZ9RwiqZinBV56u7zW5fEGf2/VrQFL3qZSV7UapgG31XRWQA==", + "type": "package", + "path": "system.reflection.metadata/9.0.8", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Reflection.Metadata.targets", + "buildTransitive/net462/_._", + "buildTransitive/net8.0/_._", + "buildTransitive/netcoreapp2.0/System.Reflection.Metadata.targets", + "lib/net462/System.Reflection.Metadata.dll", + "lib/net462/System.Reflection.Metadata.xml", + "lib/net8.0/System.Reflection.Metadata.dll", + "lib/net8.0/System.Reflection.Metadata.xml", + "lib/net9.0/System.Reflection.Metadata.dll", + "lib/net9.0/System.Reflection.Metadata.xml", + "lib/netstandard2.0/System.Reflection.Metadata.dll", + "lib/netstandard2.0/System.Reflection.Metadata.xml", + "system.reflection.metadata.9.0.8.nupkg.sha512", + "system.reflection.metadata.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "sha512": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==", + "type": "package", + "path": "system.runtime.compilerservices.unsafe/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net461/System.Runtime.CompilerServices.Unsafe.xml", + "lib/net6.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net6.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netcoreapp3.1/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netcoreapp3.1/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512", + "system.runtime.compilerservices.unsafe.nuspec", + "useSharedDesignerContext.txt" + ] + } + }, + "projectFileDependencyGroups": { + ".NETStandard,Version=v2.1": [ + "System.Reflection.Metadata >= 9.0.8" + ] + }, + "packageFolders": { + "/Users/leducanh/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj", + "projectName": "CSNetwork", + "projectPath": "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj", + "packagesPath": "/Users/leducanh/.nuget/packages/", + "outputPath": "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/Users/leducanh/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "netstandard2.1" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netstandard2.1": { + "targetAlias": "netstandard2.1", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.300" + }, + "frameworks": { + "netstandard2.1": { + "targetAlias": "netstandard2.1", + "dependencies": { + "System.Reflection.Metadata": { + "target": "Package", + "version": "[9.0.8, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "NETStandard.Library": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/local/share/dotnet/sdk/9.0.301/RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.assets.json.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.assets.json.meta new file mode 100644 index 0000000000..61e57426df --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.assets.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0241313731e934a48bf078b4d8e802fe +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.nuget.cache b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.nuget.cache new file mode 100644 index 0000000000..4526c4d492 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.nuget.cache @@ -0,0 +1,15 @@ +{ + "version": 2, + "dgSpecHash": "f7IQ1w8FLOY=", + "success": true, + "projectFilePath": "/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj", + "expectedPackageFiles": [ + "/Users/leducanh/.nuget/packages/system.buffers/4.5.1/system.buffers.4.5.1.nupkg.sha512", + "/Users/leducanh/.nuget/packages/system.collections.immutable/9.0.8/system.collections.immutable.9.0.8.nupkg.sha512", + "/Users/leducanh/.nuget/packages/system.memory/4.5.5/system.memory.4.5.5.nupkg.sha512", + "/Users/leducanh/.nuget/packages/system.numerics.vectors/4.4.0/system.numerics.vectors.4.4.0.nupkg.sha512", + "/Users/leducanh/.nuget/packages/system.reflection.metadata/9.0.8/system.reflection.metadata.9.0.8.nupkg.sha512", + "/Users/leducanh/.nuget/packages/system.runtime.compilerservices.unsafe/6.0.0/system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.nuget.cache.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.nuget.cache.meta new file mode 100644 index 0000000000..6d43617b86 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.nuget.cache.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e0fed64ab40f14f5d99605194495f759 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.packagespec.json b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.packagespec.json new file mode 100644 index 0000000000..df2fe85f21 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.packagespec.json @@ -0,0 +1 @@ +"restore":{"projectUniqueName":"/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj","projectName":"CSNetwork","projectPath":"/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/CSNetwork.csproj","outputPath":"/Users/leducanh/Documents/PortingProjects/UnityProject/pwcsclient/CSNetwork/obj/","projectStyle":"PackageReference","originalTargetFrameworks":["netstandard2.1"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"netstandard2.1":{"targetAlias":"netstandard2.1","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"},"SdkAnalysisLevel":"9.0.300"}"frameworks":{"netstandard2.1":{"targetAlias":"netstandard2.1","dependencies":{"System.Reflection.Metadata":{"target":"Package","version":"[9.0.8, )"}},"imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"NETStandard.Library":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"/usr/local/share/dotnet/sdk/9.0.301/RuntimeIdentifierGraph.json"}} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.packagespec.json.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.packagespec.json.meta new file mode 100644 index 0000000000..f14a4f19a3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/project.packagespec.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 06822ff233fd24894a31933761c0243c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.model.nuget.info b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.model.nuget.info new file mode 100644 index 0000000000..bdc2a77147 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.model.nuget.info @@ -0,0 +1 @@ +17575628435645208 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.model.nuget.info.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.model.nuget.info.meta new file mode 100644 index 0000000000..6621178a6f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.model.nuget.info.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f4cc754a187ce44f286e6c41e2dd31da +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.restore.info b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.restore.info new file mode 100644 index 0000000000..bdc2a77147 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.restore.info @@ -0,0 +1 @@ +17575628435645208 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.restore.info.meta b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.restore.info.meta new file mode 100644 index 0000000000..d670f5118c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/obj/rider.project.restore.info.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6b5d47e7c27734921854b90b644022b8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs b/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs index fb34944012..8af7240540 100644 --- a/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs +++ b/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs @@ -200,6 +200,7 @@ namespace BrewMonster.Network void OnDestroy() { _gameSession.Disconnect(); + _gameSession.Dispose(); CECNPC.ReleaseStaticRes(); } } diff --git a/Assets/PerfectWorld/Scripts/UI/GameScene.meta b/Assets/PerfectWorld/Scripts/UI/GameScene.meta new file mode 100644 index 0000000000..3225e9f8ec --- /dev/null +++ b/Assets/PerfectWorld/Scripts/UI/GameScene.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b77de0a26ef5c47a1ac950ba7257abb4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/UI/GameScene/EnterWorldTest.cs b/Assets/PerfectWorld/Scripts/UI/GameScene/EnterWorldTest.cs new file mode 100644 index 0000000000..3b09023c18 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/UI/GameScene/EnterWorldTest.cs @@ -0,0 +1,13 @@ +using BrewMonster.Network; +using UnityEngine; + +namespace BrewMonster.UI +{ + public class EnterWorldTest : MonoBehaviour + { + public void EnterWorld() + { + UnityGameSession.EnterWorldAsync(null, null); + } + } +} diff --git a/Assets/PerfectWorld/Scripts/UI/GameScene/EnterWorldTest.cs.meta b/Assets/PerfectWorld/Scripts/UI/GameScene/EnterWorldTest.cs.meta new file mode 100644 index 0000000000..806650a3d4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/UI/GameScene/EnterWorldTest.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 15fc8bf7015394eac8f0a9a0b8cc1f79 \ No newline at end of file diff --git a/Assets/Plugins/TestClient.deps.json b/Assets/Plugins/TestClient.deps.json deleted file mode 100644 index b8a911cb39..0000000000 --- a/Assets/Plugins/TestClient.deps.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "runtimeTarget": { - "name": ".NETStandard,Version=v2.1/", - "signature": "" - }, - "compilationOptions": {}, - "targets": { - ".NETStandard,Version=v2.1": {}, - ".NETStandard,Version=v2.1/": { - "TestClient/1.0.0": { - "dependencies": { - "CSNetwork": "1.0.0" - }, - "runtime": { - "TestClient.dll": {} - } - }, - "System.Buffers/4.5.1": { - "runtime": { - "lib/netstandard2.0/System.Buffers.dll": { - "assemblyVersion": "4.0.3.0", - "fileVersion": "4.6.28619.1" - } - } - }, - "System.Collections.Immutable/9.0.8": { - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Collections.Immutable.dll": { - "assemblyVersion": "9.0.0.0", - "fileVersion": "9.0.825.36511" - } - } - }, - "System.Memory/4.5.5": { - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Memory.dll": { - "assemblyVersion": "4.0.1.2", - "fileVersion": "4.6.31308.1" - } - } - }, - "System.Numerics.Vectors/4.4.0": { - "runtime": { - "lib/netstandard2.0/System.Numerics.Vectors.dll": { - "assemblyVersion": "4.1.3.0", - "fileVersion": "4.6.25519.3" - } - } - }, - "System.Reflection.Metadata/9.0.8": { - "dependencies": { - "System.Collections.Immutable": "9.0.8", - "System.Memory": "4.5.5" - }, - "runtime": { - "lib/netstandard2.0/System.Reflection.Metadata.dll": { - "assemblyVersion": "9.0.0.0", - "fileVersion": "9.0.825.36511" - } - } - }, - "System.Runtime.CompilerServices.Unsafe/6.0.0": { - "runtime": { - "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { - "assemblyVersion": "6.0.0.0", - "fileVersion": "6.0.21.52210" - } - } - }, - "CSNetwork/1.0.0": { - "dependencies": { - "System.Reflection.Metadata": "9.0.8" - }, - "runtime": { - "CSNetwork.dll": { - "assemblyVersion": "1.0.0.0", - "fileVersion": "1.0.0.0" - } - } - } - } - }, - "libraries": { - "TestClient/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - }, - "System.Buffers/4.5.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", - "path": "system.buffers/4.5.1", - "hashPath": "system.buffers.4.5.1.nupkg.sha512" - }, - "System.Collections.Immutable/9.0.8": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Eje6exD7AGKPg5SIkmjyWTBq0KK6SpfTBfdFUmpGG07mNbYimFJ+jyVnILcs0ikFOXoYTBpBOxKYgAk2hhjYOw==", - "path": "system.collections.immutable/9.0.8", - "hashPath": "system.collections.immutable.9.0.8.nupkg.sha512" - }, - "System.Memory/4.5.5": { - "type": "package", - "serviceable": true, - "sha512": "sha512-XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", - "path": "system.memory/4.5.5", - "hashPath": "system.memory.4.5.5.nupkg.sha512" - }, - "System.Numerics.Vectors/4.4.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==", - "path": "system.numerics.vectors/4.4.0", - "hashPath": "system.numerics.vectors.4.4.0.nupkg.sha512" - }, - "System.Reflection.Metadata/9.0.8": { - "type": "package", - "serviceable": true, - "sha512": "sha512-oJQezcASFomKvSp+06pzvSFRTnzdUJtiO19peAdZ9RwiqZinBV56u7zW5fEGf2/VrQFL3qZSV7UapgG31XRWQA==", - "path": "system.reflection.metadata/9.0.8", - "hashPath": "system.reflection.metadata.9.0.8.nupkg.sha512" - }, - "System.Runtime.CompilerServices.Unsafe/6.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==", - "path": "system.runtime.compilerservices.unsafe/6.0.0", - "hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512" - }, - "CSNetwork/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/TestClient.dll b/Assets/Plugins/TestClient.dll deleted file mode 100644 index 5e23e85275..0000000000 Binary files a/Assets/Plugins/TestClient.dll and /dev/null differ diff --git a/Assets/Plugins/TestClient.dll.meta b/Assets/Plugins/TestClient.dll.meta deleted file mode 100644 index ddaed96a08..0000000000 --- a/Assets/Plugins/TestClient.dll.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 32253f0b4e14bb44fbbebd2587b3e90f \ No newline at end of file diff --git a/Assets/Scenes/WorldRender.unity b/Assets/Scenes/WorldRender.unity index 8019ff8c38..e92e7951bb 100644 --- a/Assets/Scenes/WorldRender.unity +++ b/Assets/Scenes/WorldRender.unity @@ -98242,6 +98242,85 @@ MonoBehaviour: _meshFilter: {fileID: 364486940} _meshRenderer: {fileID: 364486939} _material: {fileID: 2100000, guid: 38603659d794349f6abdd4959b09ee3c, type: 2} +--- !u!1 &364651597 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364651600} + - component: {fileID: 364651599} + - component: {fileID: 364651598} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &364651598 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364651597} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_MoveRepeatDelay: 0.5 + m_MoveRepeatRate: 0.1 + m_XRTrackingOrigin: {fileID: 0} + m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3} + m_DeselectOnBackgroundClick: 1 + m_PointerBehavior: 0 + m_CursorLockBehavior: 0 + m_ScrollDeltaPerTick: 6 +--- !u!114 &364651599 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364651597} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &364651600 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364651597} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &365113123 GameObject: m_ObjectHideFlags: 0 @@ -541942,6 +542021,7 @@ Transform: SceneRoots: m_ObjectHideFlags: 0 m_Roots: + - {fileID: 364651600} - {fileID: 2065063583} - {fileID: 929195785} - {fileID: 90096988} diff --git a/Assets/Scripts/CanvasController.cs b/Assets/Scripts/CanvasController.cs index 214f98307d..ae5585106f 100644 --- a/Assets/Scripts/CanvasController.cs +++ b/Assets/Scripts/CanvasController.cs @@ -37,23 +37,11 @@ public class CanvasController : MonoBehaviour private void OnClickSelectChacter(RoleInfo roleInfo) { - TestClientProgram.HandleSelectRole(roleInfo, (result) => - { - context.Post(_ => - { - bgr.gameObject.SetActive(false); - screenLogin.gameObject.SetActive(false); - screenCharacter.gameObject.SetActive(false); - //gameController.InitCharacter(result); - }, null); - }); + } private void OnDestroy() { - TestClientProgram.HandleLogOut((result) => - { - Debug.LogError(result); - }); + } } diff --git a/Assets/Scripts/ScreenLogin.cs b/Assets/Scripts/ScreenLogin.cs index 4c2b86cac0..06314e2205 100644 --- a/Assets/Scripts/ScreenLogin.cs +++ b/Assets/Scripts/ScreenLogin.cs @@ -23,7 +23,6 @@ public class ScreenLogin : MonoBehaviour string _password = ifPassword.text; string _ip = ip.options[ip.value].text; Debug.LogError("Login..."); - TestClientProgram.HandleLogin(_ip, _username, _password, HandleLoginComplete, HandleLoginFaile); } private void HandleLoginComplete(List roleInfos)