diff --git a/Assets/ModelRenderer/Art/Animations/models/players/形象/法师女/躯干/tcks_法师女/站立_通用.anim b/Assets/ModelRenderer/Art/Animations/models/players/形象/法师女/躯干/tcks_法师女/站立_通用.anim index 176448a1af..0b3cfe2f76 100644 --- a/Assets/ModelRenderer/Art/Animations/models/players/形象/法师女/躯干/tcks_法师女/站立_通用.anim +++ b/Assets/ModelRenderer/Art/Animations/models/players/形象/法师女/躯干/tcks_法师女/站立_通用.anim @@ -10685,7 +10685,745 @@ AnimationClip: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: - genericBindings: [] + genericBindings: + - serializedVersion: 2 + path: 2018908708 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2018908708 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 116356734 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3927517603 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2294152019 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1159701105 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1751650893 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 873093031 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2440853979 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 116356734 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3927517603 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1569192055 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2294152019 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1159701105 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3636174899 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1751650893 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 873093031 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 805450933 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2440853979 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1569192055 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3636174899 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 805450933 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 @@ -10697,7 +11435,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 + m_LoopTime: 1 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/ModelRenderer/Art/Animations/models/players/形象/羽灵女/躯干/tcks_羽灵女/翅膀前进_通用.anim b/Assets/ModelRenderer/Art/Animations/models/players/形象/羽灵女/躯干/tcks_羽灵女/翅膀前进_通用.anim index 932b1472a2..d5ec3d38f5 100644 --- a/Assets/ModelRenderer/Art/Animations/models/players/形象/羽灵女/躯干/tcks_羽灵女/翅膀前进_通用.anim +++ b/Assets/ModelRenderer/Art/Animations/models/players/形象/羽灵女/躯干/tcks_羽灵女/翅膀前进_通用.anim @@ -5879,7 +5879,745 @@ AnimationClip: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: - genericBindings: [] + genericBindings: + - serializedVersion: 2 + path: 2018908708 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2440853979 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 116356734 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3927517603 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1569192055 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2440853979 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 116356734 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3927517603 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1569192055 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2294152019 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1159701105 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3636174899 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1751650893 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 873093031 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 805450933 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2018908708 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2294152019 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1159701105 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3636174899 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1751650893 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 873093031 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 805450933 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 @@ -5891,7 +6629,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 + m_LoopTime: 1 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/ModelRenderer/Art/Animations/models/players/形象/羽灵女/躯干/tcks_羽灵女/翅膀悬停_通用.anim b/Assets/ModelRenderer/Art/Animations/models/players/形象/羽灵女/躯干/tcks_羽灵女/翅膀悬停_通用.anim index 4a39d10246..a440fabbbf 100644 --- a/Assets/ModelRenderer/Art/Animations/models/players/形象/羽灵女/躯干/tcks_羽灵女/翅膀悬停_通用.anim +++ b/Assets/ModelRenderer/Art/Animations/models/players/形象/羽灵女/躯干/tcks_羽灵女/翅膀悬停_通用.anim @@ -5807,7 +5807,745 @@ AnimationClip: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: - genericBindings: [] + genericBindings: + - serializedVersion: 2 + path: 2018908708 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2294152019 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1159701105 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2440853979 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 116356734 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3927517603 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1569192055 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2294152019 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1159701105 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3636174899 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1751650893 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 873093031 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 805450933 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2018908708 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2440853979 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 116356734 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3927517603 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1569192055 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3636174899 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1751650893 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 873093031 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 805450933 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 @@ -5819,7 +6557,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 + m_LoopTime: 1 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/ModelRenderer/Art/Animations/models/players/形象/羽芒男/躯干/tcks_羽芒男/翅膀前进_通用.anim b/Assets/ModelRenderer/Art/Animations/models/players/形象/羽芒男/躯干/tcks_羽芒男/翅膀前进_通用.anim index f31dcea27a..568e2e0dba 100644 --- a/Assets/ModelRenderer/Art/Animations/models/players/形象/羽芒男/躯干/tcks_羽芒男/翅膀前进_通用.anim +++ b/Assets/ModelRenderer/Art/Animations/models/players/形象/羽芒男/躯干/tcks_羽芒男/翅膀前进_通用.anim @@ -3836,7 +3836,637 @@ AnimationClip: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: - genericBindings: [] + genericBindings: + - serializedVersion: 2 + path: 2018908708 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4049683447 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4049683447 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3447873746 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 527377115 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1724170906 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2018908708 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3447873746 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 527377115 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1724170906 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 @@ -3848,7 +4478,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 + m_LoopTime: 1 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/ModelRenderer/Art/Animations/models/players/形象/羽芒男/躯干/tcks_羽芒男/翅膀悬停_通用.anim b/Assets/ModelRenderer/Art/Animations/models/players/形象/羽芒男/躯干/tcks_羽芒男/翅膀悬停_通用.anim index 917bd05537..b14adfaa26 100644 --- a/Assets/ModelRenderer/Art/Animations/models/players/形象/羽芒男/躯干/tcks_羽芒男/翅膀悬停_通用.anim +++ b/Assets/ModelRenderer/Art/Animations/models/players/形象/羽芒男/躯干/tcks_羽芒男/翅膀悬停_通用.anim @@ -6077,7 +6077,637 @@ AnimationClip: m_Center: {x: 0, y: 0, z: 0} m_Extent: {x: 0, y: 0, z: 0} m_ClipBindingConstant: - genericBindings: [] + genericBindings: + - serializedVersion: 2 + path: 2018908708 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1340948032 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1988792091 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3885673468 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3497741423 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4049683447 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3447873746 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1724170906 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2116945202 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3473806278 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2956762170 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 933035377 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 5356599 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3146785657 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3499712485 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 429469044 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2839275161 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2128347294 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1101621778 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 785229228 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2169235899 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2469333914 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 4049683447 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3447873746 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 527377115 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1724170906 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2018908708 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3548896427 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 2293061301 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 649084008 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 390191502 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1370950910 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3775421998 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 838263118 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3508646861 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 1190253016 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 661140589 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3769069077 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 3950068453 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + - serializedVersion: 2 + path: 527377115 + attribute: 2 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + isIntCurve: 0 + isSerializeReferenceCurve: 0 pptrCurveMapping: [] m_AnimationClipSettings: serializedVersion: 2 @@ -6089,7 +6719,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 0 + m_LoopTime: 1 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset b/Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset index 62ea994ad9..81e92ecbf1 100644 --- a/Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset +++ b/Assets/PerfectWorld/Resources/UI/DialogScriptTableObject.asset @@ -27,5 +27,5 @@ MonoBehaviour: prefab: {fileID: 977375840943150650, guid: 51bad2e6d1ec69a4683135ce85288faa, type: 3} - id: Win_Hpmpxp prefab: {fileID: 6032603119232429246, guid: 8350aa55906d08448bb47e10a473ca61, type: 3} - - id: DlgMessageBox - prefab: {fileID: 5492547392745930423, guid: 54cccb2c6a758a24183474cd385ccb2c, type: 3} + - id: Win_Produce + prefab: {fileID: 5750242998044155948, guid: ecf0d8daf08db6f4a8d94a4bb07847ec, type: 3} diff --git a/Assets/PerfectWorld/Scripts/Common/DataProcess/ElementDataManProvider.cs b/Assets/PerfectWorld/Scripts/Common/DataProcess/ElementDataManProvider.cs index 45e9c9355a..905b313812 100644 --- a/Assets/PerfectWorld/Scripts/Common/DataProcess/ElementDataManProvider.cs +++ b/Assets/PerfectWorld/Scripts/Common/DataProcess/ElementDataManProvider.cs @@ -42,6 +42,9 @@ namespace BrewMonster else { BMLogger.Log("ElementDataManProvider: Successfully loaded element data"); + // Build suite equip tab now that data is loaded + // 数据加载完成后构建套装装备表 + BrewMonster.Network.EC_Game.BuildSuiteEquipTab(); } } catch (Exception ex) diff --git a/Assets/PerfectWorld/Scripts/Common/EC_C2SCmdCache.cs b/Assets/PerfectWorld/Scripts/Common/EC_C2SCmdCache.cs new file mode 100644 index 0000000000..c2884e59bc --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Common/EC_C2SCmdCache.cs @@ -0,0 +1,741 @@ +using BrewMonster.Network; +using BrewMonster.Scripts.Managers; +using CSNetwork.C2SCommand; +using CSNetwork.Protocols; +using CSNetwork.S2CCommand; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace BrewMonster.Common +{ + using CounterTable = Dictionary; + public class CECC2SCmdCache + { + public struct presentInfo + { + public int roleid; + public int mailid; + public int itemid; + public int index; + public int slot; + }; + + int m_idLastPickUpItem; // ID of picked up item last time + int m_idLastSelTarget; // ID of selected item last time + bool m_bGetExpProps; + bool m_bEnterSanctuary; + + CounterTable m_CounterMap = new CounterTable(); + CounterTable m_CounterMap2 = new CounterTable(); + + List m_UseItemCmdList = new List(); + List m_GetPlayerBriefInfoList = new List(); + List m_PlayerBaseInfoList = new List(); + List m_EnterSanctuaryList = new List(); + List m_PresentInfoList = new List(); + + public CECC2SCmdCache() + { + m_idLastPickUpItem = 0; + m_idLastSelTarget = 0; + m_bGetExpProps = false; + m_bEnterSanctuary = false; + InitCounters(); + } + + // Initialize counters + bool InitCounters() + { + // 'Use item' command time counter + CECCounter pCnt = new CECCounter(); + pCnt.SetPeriod(200); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.USE_ITEM)) + { + m_CounterMap[(int)CommandID.USE_ITEM] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.USE_ITEM, pCnt); + } + + // 'Pickup item' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(500); + if (m_CounterMap.ContainsKey((int)CommandID.PICKUP)) + { + m_CounterMap[(int)CommandID.PICKUP] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.PICKUP, pCnt); + } + + // 'Select target' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(250); + if (m_CounterMap.ContainsKey((int)CommandID.SELECT_TARGET)) + { + m_CounterMap[(int)CommandID.SELECT_TARGET] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.SELECT_TARGET, pCnt); + } + + // 'Get extend properties' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(2000); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.GET_EXT_PROP)) + { + m_CounterMap[(int)CommandID.GET_EXT_PROP] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.GET_EXT_PROP, pCnt); + } + + // 'Cast skill' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(200); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.CAST_SKILL)) + { + m_CounterMap[(int)CommandID.CAST_SKILL] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.CAST_SKILL, pCnt); + } + + // 'Revive ask' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(500); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.REVIVE_VILLAGE)) + { + m_CounterMap[(int)CommandID.REVIVE_VILLAGE] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.REVIVE_VILLAGE, pCnt); + } + + // 'Enter sanctuary' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(2000); + if (m_CounterMap.ContainsKey((int)CommandID.ENTER_SANCTUARY)) + { + m_CounterMap[(int)CommandID.ENTER_SANCTUARY] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.ENTER_SANCTUARY, pCnt); + } + + // 'Enter instance' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(2000); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.ENTER_INSTANCE)) + { + m_CounterMap[(int)CommandID.ENTER_INSTANCE] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.ENTER_INSTANCE, pCnt); + } + + // 'Rush fly' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(500); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.ACTIVE_RUSH_FLY)) + { + m_CounterMap[(int)CommandID.ACTIVE_RUSH_FLY] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.ACTIVE_RUSH_FLY, pCnt); + } + + // 'Cancel action' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(200); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.CANCEL_ACTION)) + { + m_CounterMap[(int)CommandID.CANCEL_ACTION] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.CANCEL_ACTION, pCnt); + } + + // 'Control pet' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(400); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.PET_CTRL)) + { + m_CounterMap[(int)CommandID.PET_CTRL] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.PET_CTRL, pCnt); + } + + // 'Hello' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(2000); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.SEVNPC_HELLO)) + { + m_CounterMap[(int)CommandID.SEVNPC_HELLO] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.SEVNPC_HELLO, pCnt); + } + + // 'Present' command time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(1000); + pCnt.Reset(true); + if (m_CounterMap.ContainsKey((int)CommandID.PLAYER_GIVE_PRESENT)) + { + m_CounterMap[(int)CommandID.PLAYER_GIVE_PRESENT] = pCnt; + } + else + { + m_CounterMap.Add((int)CommandID.PLAYER_GIVE_PRESENT, pCnt); + } + + // 'GetPlayerBriefInfo' time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(2000); + pCnt.Reset(true); + if (m_CounterMap2.ContainsKey((int)ProtocolType.PROTOCOL_GETPLAYERBRIEFINFO)) + { + m_CounterMap2[(int)ProtocolType.PROTOCOL_GETPLAYERBRIEFINFO] = pCnt; + } + else + { + m_CounterMap2.Add((int)ProtocolType.PROTOCOL_GETPLAYERBRIEFINFO, pCnt); + } + + // 'PlayerBaseInfo' time counter + pCnt = new CECCounter(); + pCnt.SetPeriod(2000); + pCnt.Reset(true); + if (m_CounterMap2.ContainsKey((int)ProtocolType.PROTOCOL_PLAYERBASEINFO)) + { + m_CounterMap2[(int)ProtocolType.PROTOCOL_PLAYERBASEINFO] = pCnt; + } + else + { + m_CounterMap2.Add((int)ProtocolType.PROTOCOL_PLAYERBASEINFO, pCnt); + } + + pCnt = new CECCounter(); + pCnt.SetPeriod(10 * 1000); + pCnt.Reset(true); + if (m_CounterMap2.ContainsKey((int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETMAP)) + { + m_CounterMap2[(int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETMAP] = pCnt; + } + else + { + m_CounterMap2.Add((int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETMAP, pCnt); + } + + pCnt = new CECCounter(); + pCnt.SetPeriod(10 * 1000); + pCnt.Reset(true); + if (m_CounterMap2.ContainsKey((int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETRECORD)) + { + m_CounterMap2[(int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETRECORD] = pCnt; + } + else + { + m_CounterMap2.Add((int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETRECORD, pCnt); + } + return true; + } + + // Remove all un-sent commands in cache + public void RemoveAllCmds() + { + m_UseItemCmdList.Clear(); + + // C2S ʱ + m_CounterMap[(int)CommandID.USE_ITEM].Reset(true); + + m_EnterSanctuaryList.Clear(); + m_CounterMap[(int)CommandID.ENTER_SANCTUARY].Reset(true); + m_bEnterSanctuary = false; + + m_PresentInfoList.Clear(); + m_CounterMap[(int)CommandID.PLAYER_GIVE_PRESENT].Reset(true); + + // Эʱ + m_GetPlayerBriefInfoList.Clear(); + m_CounterMap2[(int)ProtocolType.PROTOCOL_GETPLAYERBRIEFINFO].Reset(true); + + m_PlayerBaseInfoList.Clear(); + m_CounterMap2[(int)ProtocolType.PROTOCOL_PLAYERBASEINFO].Reset(true); + + m_CounterMap2[(int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETMAP].Reset(true); + m_CounterMap2[(int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETRECORD].Reset(true); + } + + // Tick routine + public bool Tick(float dwDeltaTime) + { + float dwRealTime = Time.fixedUnscaledDeltaTime * 1000; + + foreach (var item in m_CounterMap) + { + item.Value.IncCounter(dwRealTime); + } + foreach (var item in m_CounterMap2) + { + item.Value.IncCounter(dwRealTime); + } + + // Try to send 'use item' command in cache + SendCachedCmdUseItem(); + + // Try to send 'get extend properties' command + SendCachedCmdGetExtProp(); + + // Try to send 'GetPlayerBriefInfo' + SendCachedGetPlayerBriefInfo(); + // Try to send 'PlayerBaseInfo' + SendCachedPlayerBaseInfo(); + // Try to send 'PresentInfo' + SendCachedPresentInfo(); + + if (m_bEnterSanctuary) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.ENTER_SANCTUARY]; + if (pCnt.IsFull()) + { + for (int i = 0; i < m_EnterSanctuaryList.Count; i++) + { + int id = m_EnterSanctuaryList[i]; + UnityGameSession.Instance.GameSession.c2s_SendCmdEnterSanctuary(id); + } + + m_EnterSanctuaryList.Clear(); + m_bEnterSanctuary = false; + } + } + + return true; + } + + // Send 'use item' command + void SendCachedCmdUseItem() + { + CECCounter pCnt = m_CounterMap[(int)CommandID.USE_ITEM]; + if (!pCnt.IsFull() || m_UseItemCmdList.Count == 0) + return; + + pCnt.Reset(); + + // Send the first item + cmd_use_item Cmd = m_UseItemCmdList[0]; + UnityGameSession.Instance.GameSession.c2s_SendCmdUseItem(Cmd.where, (byte)Cmd.index, Cmd.item_id, Cmd.byCount); + m_UseItemCmdList.Clear(); + } + + // Send cached 'get extend properties' command + void SendCachedCmdGetExtProp() + { + CECCounter pCnt = m_CounterMap[(int)CommandID.GET_EXT_PROP]; + if (!m_bGetExpProps || !pCnt.IsFull()) + return; + + pCnt.Reset(); + + m_bGetExpProps = false; + UnityGameSession.Instance.GameSession.c2s_SendCmdGetExtProps(); + } + + // Send cached 'GetPlayerBriefInfo' command + void SendCachedGetPlayerBriefInfo() + { + CECCounter pCnt = m_CounterMap2[(int)ProtocolType.PROTOCOL_GETPLAYERBRIEFINFO]; + if (!pCnt.IsFull() || m_GetPlayerBriefInfoList.Count == 0) + return; + + pCnt.Reset(); + + getplayerbriefinfo p = m_GetPlayerBriefInfoList[0]; + if (p.Playerlist.Count != 0) + { + // ȡһidЭ + getplayerbriefinfo temp = p; + temp.Playerlist.Clear(); + temp.Playerlist.Add(p.Playerlist[0]); + UnityGameSession.Instance.GameSession.SendProtocol(temp); + + // б + p.Playerlist.Remove(p.Playerlist[0]); + } + + if (p.Playerlist.Count == 0) + m_GetPlayerBriefInfoList.Remove(p); + } + + // Remove the cached 'PlayerBaseInfo' request + public void RemovePlayerBaseInfo(int iRoleID) + { + int pos = m_PlayerBaseInfoList.Find(x => x == iRoleID); + if (pos != 0) + { + m_PlayerBaseInfoList.RemoveAt(pos); + } + } + + // Send cached 'PlayerBaseInfo' protocol + void SendCachedPlayerBaseInfo() + { + CECCounter pCnt = m_CounterMap2[(int)ProtocolType.PROTOCOL_PLAYERBASEINFO]; + if (!pCnt.IsFull() || m_PlayerBaseInfoList.Count == 0) + return; + + pCnt.Reset(); + + List aRoles = new List(); + for (int i = 0; i < m_PlayerBaseInfoList.Count; i++) + { + aRoles.Add(m_PlayerBaseInfoList[i]); + } + + UnityGameSession.Instance.GameSession.GetRoleBaseInfo(aRoles.Count, aRoles); + } + + void SendCachedPresentInfo() + { + CECCounter pCnt = m_CounterMap[(int)CommandID.PLAYER_GIVE_PRESENT]; + if (!pCnt.IsFull() || m_PresentInfoList.Count == 0) + return; + + pCnt.Reset(); + + presentInfo info = m_PresentInfoList[0]; + UnityGameSession.Instance.GameSession.c2s_SendCmdGivePresent(info.roleid, info.mailid, info.itemid, info.index, info.slot); + m_PresentInfoList.Remove(info); + } + + // Send commands ... + public void SendCmdUseItem(byte byPackage, byte bySlot, int tid, byte byCount) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.USE_ITEM]; + if (m_UseItemCmdList.Count == 0 && pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdUseItem(byPackage, bySlot, tid, byCount); + return; + } + + cmd_use_item Cmd = new cmd_use_item(); + if (m_UseItemCmdList.Count == 0) + { + Cmd.where = byPackage; + Cmd.index = bySlot; + Cmd.item_id = tid; + Cmd.byCount = byCount; + m_UseItemCmdList.Add(Cmd); + return; + } + int idx = -1; + for (int i = 0; i < m_UseItemCmdList.Count; i++) + { + Cmd = m_UseItemCmdList[i]; + + if (Cmd.where == byPackage && Cmd.index == bySlot) + { + CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer(); + EC_Inventory pPack = pHost.GetPack(byPackage); + if (pPack == null) return; + EC_IvtrItem pItem = pPack.GetItem(bySlot); + if (pItem == null || !pItem.CheckUseCondition()) + return; + + int iTotal = Cmd.byCount + byCount; + if (iTotal >= pItem.GetCount()) + iTotal = pItem.GetCount(); + + AAssist.a_ClampRoof(ref iTotal, 255); + + Cmd.byCount = (byte)iTotal; + break; + } + idx++; + } + if (idx < 0) + { + Cmd = new cmd_use_item(); + Cmd.where = byPackage; + Cmd.index = bySlot; + Cmd.item_id = tid; + Cmd.byCount = byCount; + m_UseItemCmdList.Add(Cmd); + } + + // Try to send command in cache + SendCachedCmdUseItem(); + } + /* Send 'pick up item' command + + The strategy to send 'pick up item' command: + + 1. if the item is just the one which was to be picked up, check whether + enough time has passed since last command was sent. If true, send + command again, otherwise just throw command + 2. if the item isn't the one which was to be picked up, send command + directly. + */ + public void SendCmdPickUp(int idItem, int tid) + { + //StackChecker::ACTrace(5); + + CECCounter pCnt = m_CounterMap[(int)CommandID.PICKUP]; + if (m_idLastPickUpItem != idItem || pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.RequestPickupItem(idItem, tid); + m_idLastPickUpItem = idItem; + } + } + + // Send 'select target' command + // The strategy to send 'select target' command is like as SendCmdPickUp() + public void SendCmdSelectTarget(int id) + { + // Set selection first before server returns, so as to reduce the player waiting time. + CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer(); + pHost.SetSelectedTarget(id); + + CECCounter pCnt = m_CounterMap[(int)CommandID.SELECT_TARGET]; + if (m_idLastSelTarget != id || pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdSelectTarget(id); + m_idLastSelTarget = id; + } + } + + // Send 'get extend properties' command + public void SendCmdExtProps() + { + // If there is already a request waiting, return directly + if (m_bGetExpProps) + return; + + CECCounter pCnt = m_CounterMap[(int)CommandID.GET_EXT_PROP]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdGetExtProps(); + return; + } + + m_bGetExpProps = true; + } + + // Send 'revive ask' command + public void SendCmdReviveVillage(int param = 0) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.REVIVE_VILLAGE]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdReviveVillage(param); + } + } + + // Send 'revive ask' command + public void SendCmdReviveItem(int param = 0) + { + // This command merge time counter with REVIVE_VILLAGE + CECCounter pCnt = m_CounterMap[(int)CommandID.REVIVE_VILLAGE]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdReviveItem(param); + } + } + + // Send 'cast skill' command + public void SendCmdCastSkill(int idSkill, byte byPVPMask, int iNumTarget, int[] aTargets) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.CAST_SKILL]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdCastSkill(idSkill, byPVPMask, iNumTarget, aTargets); + } + } + + // Send 'cast instant skill' command + public void SendCmdCastInstantSkill(int idSkill, byte byPVPMask, int iNumTarget, int[] aTargets) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.CAST_SKILL]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdCastInstantSkill(idSkill, byPVPMask, iNumTarget, aTargets); + } + } + + // Send 'enter sanctuary' command + void SendCmdEnterSanctuary(int id) + { + for (int i = 0; i < m_EnterSanctuaryList.Count; i++) + { + if (m_EnterSanctuaryList[i] == id) return; + } + + // Delay this command some time + m_bEnterSanctuary = true; + CECCounter pCnt = m_CounterMap[(int)CommandID.ENTER_SANCTUARY]; + pCnt.Reset(); + m_EnterSanctuaryList.Add(id); + } + + // Send 'enter instance' commnad + void SendCmdEnterInstance(int iTransIdx, int idInst) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.ENTER_INSTANCE]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdEnterInstance(iTransIdx, idInst); + } + } + + void SendCmdActiveRushFly(bool bActive) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.ACTIVE_RUSH_FLY]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdActiveRushFly(bActive); + } + } + + public void SendCmdCancelAction() + { + CECCounter pCnt = m_CounterMap[(int)CommandID.CANCEL_ACTION]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdCancelAction(); + } + } + void SendCmdPetCtrl(int idTarget, int cmd, byte[] pParamBuf, int iParamLen) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.PET_CTRL]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdPetCtrl(idTarget, cmd, pParamBuf, iParamLen); + } + } + + public void SendCmdNPCSevHello(int nid) + { + CECCounter pCnt = m_CounterMap[(int)CommandID.SEVNPC_HELLO]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + UnityGameSession.Instance.GameSession.c2s_SendCmdNPCSevHello(nid); + } + } + + void SendCmdFactionPVPQueryInfo(int idFaction) + { + int piMax = -1; + CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer(); + if (pHost.GetCoolTime((int)CSNetwork.GPDataType.CoolTimeIndex.GP_CT_QUERY_MAFIA_PVP_INFO, ref piMax) == 0) + { + UnityGameSession.Instance.GameSession.c2s_SendCmdQueryFactionPVPInfo(idFaction); + } + } + + // Send protocols ... + void SendGetPlayerBriefInfo(int iNumPlayer, int[] aIDs, int iReason) + { + if (iNumPlayer == 0 || aIDs == null || aIDs.Length == 0) + return; + + // 1.ϲӵб + getplayerbriefinfo p = new getplayerbriefinfo(); + p.Roleid = EC_Game.GetGameRun().GetHostPlayer().GetCharacterID(); + p.Reason = (byte)iReason; + for (int i = 0; i < iNumPlayer; ++i) + { + if (aIDs[i] != 0) + p.Playerlist.Add(aIDs[i]); + } + if (p.Playerlist.Count > 0) + m_GetPlayerBriefInfoList.Add(p); + + // 2.鲢 + SendCachedGetPlayerBriefInfo(); + } + + void SendGetPlayerBaseInfo(int iNumRole, int[] aRoleIDs) + { + if (iNumRole == 0 || aRoleIDs == null || aRoleIDs.Length == 0) + return; + + for (int i = 0; i < iNumRole; i++) + { + if (aRoleIDs[i] != 0) + m_PlayerBaseInfoList.Add(aRoleIDs[i]); + } + + SendCachedPlayerBaseInfo(); + } + + void SendGivePresentProtocol(int roleid, int mailid, int itemid, int index, int slot) + { + presentInfo info = new presentInfo(); + info.roleid = roleid; + info.mailid = mailid; + info.itemid = itemid; + info.index = index; + info.slot = slot; + m_PresentInfoList.Add(info); + } + void SendFactionPVPGetMap() + { + CECCounter pCnt = m_CounterMap2[(int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETMAP]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + factionresourcebattlegetmap p = new factionresourcebattlegetmap(); + p.Roleid = EC_Game.GetGameRun().GetHostPlayer().GetCharacterID(); + UnityGameSession.Instance.GameSession.SendProtocol(p); + } + } + void SendFactionPVPGetRank() + { + CECCounter pCnt = m_CounterMap2[(int)ProtocolType.PROTOCOL_FACTIONRESOURCEBATTLEGETRECORD]; + if (pCnt.IsFull()) + { + pCnt.Reset(); + factionresourcebattlegetrecord p = new factionresourcebattlegetrecord(); + p.Roleid = EC_Game.GetGameRun().GetHostPlayer().GetCharacterID(); + UnityGameSession.Instance.GameSession.SendProtocol(p); + } + } + } +} diff --git a/Assets/PerfectWorld/Scripts/Common/EC_C2SCmdCache.cs.meta b/Assets/PerfectWorld/Scripts/Common/EC_C2SCmdCache.cs.meta new file mode 100644 index 0000000000..8a09afb3b8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Common/EC_C2SCmdCache.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a442b391d3e801346ac42d47da8c93b2 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/GameData/EC_RoleType.cs b/Assets/PerfectWorld/Scripts/GameData/EC_RoleType.cs index 6c68d43354..665c65cbe3 100644 --- a/Assets/PerfectWorld/Scripts/GameData/EC_RoleType.cs +++ b/Assets/PerfectWorld/Scripts/GameData/EC_RoleType.cs @@ -204,3 +204,21 @@ public struct ROLEEXTPROP_DEF armor = 0; } }; + +// Profession +public enum PROFESSION +{ + PROF_WARRIOR = 0, // 0:���� + PROF_MAGE, // 1:��ʦ + PROF_MONK, // 2:��ʦ + PROF_HAG, // 3:���� + PROF_ORC, // 4:���� + PROF_GHOST, // 5:�̿� + PROF_ARCHOR, // 6:��â + PROF_ANGEL, // 7:���� + PROF_JIANLING, // 8:���� + PROF_MEILING, // 9:���� + PROF_YEYING, // 10:ҹӰ + PROF_YUEXIAN, // 11:���� + NUM_PROFESSION, +}; \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/GameData/ExpTypes.cs b/Assets/PerfectWorld/Scripts/GameData/ExpTypes.cs index ba788aaf41..aa4482b4b9 100644 --- a/Assets/PerfectWorld/Scripts/GameData/ExpTypes.cs +++ b/Assets/PerfectWorld/Scripts/GameData/ExpTypes.cs @@ -30,6 +30,8 @@ namespace BrewMonster [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public ushort[] name; // Name + public string Name => ByteToStringUtils.UshortArrayToUnicodeString(name); + public int num_params; // Number of parameters public int param1; // Parameter 1 public int param2; // Parameter 2 @@ -559,6 +561,8 @@ namespace BrewMonster [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public ushort[] name; // Suite name, max 15 characters + public string Name => ByteToStringUtils.UshortArrayToUnicodeString(name); + public int max_equips; // Maximum equipment in suite [StructLayout(LayoutKind.Sequential, Pack = 1)] diff --git a/Assets/PerfectWorld/Scripts/MainFiles/EC_Game.cs b/Assets/PerfectWorld/Scripts/MainFiles/EC_Game.cs index cb2a0a2a2e..c700460d61 100644 --- a/Assets/PerfectWorld/Scripts/MainFiles/EC_Game.cs +++ b/Assets/PerfectWorld/Scripts/MainFiles/EC_Game.cs @@ -25,6 +25,8 @@ namespace BrewMonster.Network private static BrewMonster.CECStringTab m_ItemDesc; // Item desciption string table private static BrewMonster.CECStringTab m_ItemExtDesc; // Item extend description string table private static BrewMonster.CECStringTab m_ItemExtProp; // Item extend prop string table + private static BrewMonster.CECStringTab ItemColTab; // Item color string table + private static Dictionary m_SuiteEquipTab; // Item suite string table private static BrewMonster.CECStringTab m_SkillDesc = new CECStringTab(); // Skill description string table private static BrewMonster.CECStringTab m_BuffDesc; // Buff description string table @@ -76,7 +78,15 @@ namespace BrewMonster.Network { return m_ItemExtProp; } - + public static BrewMonster.CECStringTab GetItemColTab() + { + return ItemColTab; + } + public static Dictionary GetSuiteEquipTab() + { + Debug.Log("[EC_Game] GetSuiteEquipTab: " + m_SuiteEquipTab.Count); + return m_SuiteEquipTab; + } public static bool TryGetItemMsg(int templateId, out int messageId, out int displayMode) { messageId = 0; @@ -140,6 +150,8 @@ namespace BrewMonster.Network m_SkillDesc = new BrewMonster.CECStringTab(); m_BuffDesc = new BrewMonster.CECStringTab(); m_ItemExtProp = new BrewMonster.CECStringTab(); + ItemColTab = new BrewMonster.CECStringTab(); + m_SuiteEquipTab = new Dictionary(); try { // Addressables-only loading (no StreamingAssets/configs file IO). @@ -174,10 +186,17 @@ namespace BrewMonster.Network { Debug.LogWarning("[EC_Game] Failed to load item_ext_prop.txt"); } + var itemColTa = Addressables.LoadAssetAsync("Assets/Addressable/item_col.txt").WaitForCompletion(); + if (!ItemColTab.InitFromTextAsset(itemColTa, true)) + { + Debug.LogWarning("[EC_Game] Failed to load item_col.txt"); + } + // Note: There's no buff_desc.txt file in the configs folder // You may need to create this file or use a different source for buff descriptions // (If you add it to Addressables later, load it here.) - + // BuildSuiteEquipTab() is now called from ElementDataManProvider after data is loaded + // BuildSuiteEquipTab() 现在在 ElementDataManProvider 数据加载完成后调用 // Load item message map (template -> message id) LoadItemMsgMap(); @@ -433,6 +452,86 @@ namespace BrewMonster.Network map = list[0].strMap; return true; } + + /// + /// Build suite equip tab mapping. Must be called after m_pElementDataMan is initialized and data is loaded. + /// 构建套装装备表映射。必须在 m_pElementDataMan 初始化且数据加载完成后调用。 + /// + public static void BuildSuiteEquipTab() + { + if (m_pElementDataMan == null) + { + return; + } + + // Ensure m_SuiteEquipTab is initialized + // 确保 m_SuiteEquipTab 已初始化 + if (m_SuiteEquipTab == null) + { + m_SuiteEquipTab = new Dictionary(); + } + + DATA_TYPE DataType = DATA_TYPE.DT_INVALID; + elementdataman _edm = ElementDataManProvider.GetElementDataMan(); + for (int i = 0; i < _edm.essence_id_data_type_map.Count; i++) + { + uint tid = _edm.get_data_id(ID_SPACE.ID_SPACE_ESSENCE, i, ref DataType); + object pData = _edm.get_data_ptr(tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType); + switch (DataType) + { + case DATA_TYPE.DT_SUITE_ESSENCE: + SUITE_ESSENCE pSuiteEss = (SUITE_ESSENCE)pData; + pSuiteEss.max_equips = 0; + for (int j=0; j<12; j++) + { + if( pSuiteEss.equipments[j].id != 0 ) + { + pSuiteEss.max_equips ++; + int index = (int)pSuiteEss.equipments[j].id; + m_SuiteEquipTab[index] = (int)tid; + } + } + break; + case DATA_TYPE.DT_POKER_SUITE_ESSENCE: + POKER_SUITE_ESSENCE pPokerSuiteEss = (POKER_SUITE_ESSENCE)pData; + for (int j=0; j<6; j++) + { + if( pPokerSuiteEss.list[j] != 0 ) + { + int index = (int)pPokerSuiteEss.list[j]; + m_SuiteEquipTab[index] = (int)tid; + } + } + break; + + case DATA_TYPE.DT_FASHION_SUITE_ESSENCE: + FASHION_SUITE_ESSENCE pFashionSuiteEss = (FASHION_SUITE_ESSENCE)pData; + for (int j=0; j<6; j++) + { + if( pFashionSuiteEss.list[j] != 0 ) + { + int index = (int)pFashionSuiteEss.list[j]; + m_SuiteEquipTab[index] = (int)tid; + } + } + break; + } + } + } + public static int GetItemNameColorIdx(int tid, int iDefIndex = 0) + { + int iIndex = iDefIndex; + string color = ItemColTab.GetWideString(tid); + if (!string.IsNullOrEmpty(color)) + iIndex = color.GetHashCode(); + if (iIndex < 0 || iIndex >= 10) + { + iIndex = 0; + } + return iIndex; + } + + #endregion } } \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_Inventory.cs b/Assets/PerfectWorld/Scripts/Managers/EC_Inventory.cs index 71a171410d..46d718d016 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_Inventory.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_Inventory.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Unity.VisualScripting; using UnityEngine; namespace BrewMonster.Scripts.Managers @@ -24,13 +25,13 @@ namespace BrewMonster.Scripts.Managers IVTRTYPE_TRASHBOX2 = 4, // Trash box - material box IVTRTYPE_TRASHBOX3 = 5, // Trash box - fashion box IVTRTYPE_ACCOUNT_BOX = 6, // User account box - IVTRTYPE_GENERALCARD_BOX = 7; // ư + IVTRTYPE_GENERALCARD_BOX = 7; // ���ư��� }; - // ע IVTRTYPE_CLIENT_GENERALCARD_PACK öֵܺ Inventory type ֵظ + // ע�� IVTRTYPE_CLIENT_GENERALCARD_PACK ö��ֵ���ܺ������ Inventory type ֵ�ظ����� public static class IVTRTYPE_PACK_CLIENT_GENERALCAR { - public const int IVTRTYPE_CLIENT_GENERALCARD_PACK = 1024; // ͻ˱ذ ڿͼҪѻÿͨ췢͡Ϊͳһ촰ڵƷӱذ + public const int IVTRTYPE_CLIENT_GENERALCARD_PACK = 1024; // �ͻ��˱��ذ����� ���ڿ���ͼ��Ҫ����ѻ�ÿ���ͨ�����췢�͡�Ϊ��ͳһ�������촰�ڵ���Ʒ�����ӱ��ذ����� }; public EC_Inventory() @@ -168,14 +169,7 @@ namespace BrewMonster.Scripts.Managers { return false; } - - var newItem = new EC_IvtrItem(tid, iExpireDate) - { - Slot = firstEmpty, - State = 0, - Crc = 0, - Content = null - }; + var newItem = EC_IvtrItem.CreateItem(tid, iExpireDate, iAmount); newItem.SetCount(iAmount); m_aItems[firstEmpty] = newItem; @@ -203,15 +197,7 @@ namespace BrewMonster.Scripts.Managers if (pDst == null) { - var clone = new EC_IvtrItem(pSrc.GetTemplateID(), pSrc.GetExpireDate()) - { - Slot = iDest, - Package = pSrc.Package, - State = pSrc.State, - Crc = pSrc.Crc, - Content = pSrc.Content != null ? (byte[])pSrc.Content.Clone() : null - }; - clone.SetCount(iAmount); + var clone = EC_IvtrItem.CreateItem(pSrc.GetTemplateID(), pSrc.GetExpireDate(), iAmount); m_aItems[iDest] = clone; } else diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_InventoryUI.cs b/Assets/PerfectWorld/Scripts/Managers/EC_InventoryUI.cs index 2ec6e46f6e..8b0b0af771 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_InventoryUI.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_InventoryUI.cs @@ -85,7 +85,7 @@ namespace BrewMonster.Scripts.Managers private byte currentSelectedPackage; private int currentSelectedSlot; private EC_IvtrItem currentSelectedItem; - private EC_IvtrEquip currentSelectedEquipment; + private EC_IvtrItem currentSelectedEquipment; private const byte PKG_INVENTORY = 0; private const byte PKG_EQUIPMENT = 1; @@ -281,18 +281,12 @@ namespace BrewMonster.Scripts.Managers /// /// Create EC_IvtrEquip object from InventoryItemData /// - private EC_IvtrEquip CreateEquipmentFromItemData(EC_IvtrItem itemData) + private EC_IvtrItem CreateEquipmentFromItemData(EC_IvtrItem itemData) { if (itemData == null) return null; - var equipment = new EC_IvtrEquip(itemData.m_tid, itemData.m_expire_date); - - // Set basic properties (use default values since InventoryItemData doesn't have these) - equipment.Price = 0; - equipment.Count = itemData.m_iCount; - equipment.PriceScale = 1.0f; - equipment.ScaleType = 0; + var equipment = EC_IvtrItem.CreateItem(itemData.m_tid, itemData.m_expire_date, itemData.m_iCount); // Parse item info if available (use Content field) if (itemData.Content != null && itemData.Content.Length > 0) @@ -856,11 +850,11 @@ namespace BrewMonster.Scripts.Managers string fullDesc = null; if (showEquipmentDetails && currentSelectedEquipment != null) { - fullDesc = currentSelectedEquipment.GetDesc(); + fullDesc = currentSelectedEquipment.GetDesc(EC_IvtrItem.DescType.DESC_NORMAL, EC_Game.GetGameRun().GetHostPlayer().GetEquipment()); } else { - fullDesc = item.GetDesc(); + fullDesc = item.GetDesc(EC_IvtrItem.DescType.DESC_NORMAL, EC_Game.GetGameRun().GetHostPlayer().GetEquipment()); } if (!string.IsNullOrEmpty(fullDesc)) @@ -880,55 +874,7 @@ namespace BrewMonster.Scripts.Managers // C++ code doesn't check IsInitialized() - it just calls GetWideString() directly // 完全按照C++代码获取扩展描述:g_pGame->GetItemExtDesc(m_tid) // C++代码不检查IsInitialized() - 它直接调用GetWideString() - string szExtDesc = null; - try - { - var itemExtDescTab = EC_Game.GetItemExtDesc(); - if (itemExtDescTab != null) - { - // First try to get mapped message ID (like TryGetItemExtDesc does) - // 首先尝试获取映射的消息ID(如TryGetItemExtDesc所做) - if (EC_Game.TryGetItemMsg(item.m_tid, out int messageId, out int displayMode)) - { - szExtDesc = itemExtDescTab.GetWideString(messageId); - } - - // Fallback: direct lookup using tid (exactly like C++: m_ItemExtDesc.GetWideString(tid)) - // 回退:直接使用tid查找(完全像C++:m_ItemExtDesc.GetWideString(tid)) - if (string.IsNullOrEmpty(szExtDesc)) - { - szExtDesc = itemExtDescTab.GetWideString(item.m_tid); - } - } - } - catch (System.Exception ex) - { - // Only log once to avoid spam - // 仅记录一次以避免垃圾日志 - if (!m_HasLoggedExtDescError) - { - Debug.LogWarning($"[InventoryUI] Error getting extended description: {ex.Message}"); - m_HasLoggedExtDescError = true; - } - } - - // Display extended description if found (exactly like C++ checks: if (!szExtDesc || !szExtDesc[0])) - // 如果找到扩展描述则显示(完全像C++检查:if (!szExtDesc || !szExtDesc[0])) - string displayText = !string.IsNullOrEmpty(szExtDesc) - ? szExtDesc.Replace("\\r", "\n") - : ""; - - // Debug logging to diagnose issues - // 调试日志以诊断问题 - if (string.IsNullOrEmpty(displayText)) - { - Debug.Log($"[InventoryUI] Extended description is empty for tid={item.m_tid}. szExtDesc was null/empty."); - } - else - { - Debug.Log($"[InventoryUI] Found extended description for tid={item.m_tid}, length={displayText.Length}"); - } - + // Setup equip and drop buttons SetupEquipButton(package, item); SetupDropButton(package, item); @@ -937,17 +883,7 @@ namespace BrewMonster.Scripts.Managers // 先显示面板 ShowDetailPanel(true); - // Set text directly - if this causes rebuild issues, we'll use coroutine - // 直接设置文本 - 如果这导致重建问题,我们将使用协程 - if (extendedDescText != null) - { - extendedDescText.Set(displayText); - Debug.Log($"[InventoryUI] Set extended description text, extendedDescText is {(extendedDescText == null ? "null" : "not null")}"); - } - else - { - Debug.LogWarning("[InventoryUI] extendedDescText is null! Check Inspector assignment."); - } + } private void SetupEquipButton(byte package, EC_IvtrItem item) diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrArmor.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrArmor.cs.meta deleted file mode 100644 index 3b702f712f..0000000000 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrArmor.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: c94b2c779cdb94d398d4aa10eb44cac6 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrEquip.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrEquip.cs.meta deleted file mode 100644 index 71ac740d78..0000000000 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrEquip.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 50210c0839c503b42843db0237a9c3a8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.cs.meta deleted file mode 100644 index 8045c9c72f..0000000000 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 423a6efd71f143f08096d684ca414bba -timeCreated: 1757752654 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.meta new file mode 100644 index 0000000000..83b999b8d5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c5535276db3184cac9313d3cc28bca47 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrArmor.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmor.cs similarity index 99% rename from Assets/PerfectWorld/Scripts/Managers/EC_IvtrArmor.cs rename to Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmor.cs index 1a87d95aae..7342e66121 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrArmor.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmor.cs @@ -77,7 +77,7 @@ namespace PerfectWorld.Scripts.Managers public EC_IvtrArmor(int tid, int expire_date) : base(tid, expire_date) { - m_iCID = ICID_WEAPON; + m_iCID = (int)InventoryClassId.ICID_ARMOR; elementdataman pDB = ElementDataManProvider.GetElementDataMan(); DATA_TYPE DataType = DATA_TYPE.DT_INVALID; m_pDBEssence = (ARMOR_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType); @@ -86,7 +86,7 @@ namespace PerfectWorld.Scripts.Managers m_iPileLimit = m_pDBEssence.pile_num_max; m_iPrice = m_pDBEssence.price; m_iShopPrice = m_pDBEssence.shop_price; - m_i64EquipMask = EC_IvtrEquip.ICID_WEAPON; + m_i64EquipMask = m_pDBSubType.equip_mask; m_iProcType = (int)m_pDBEssence.proc_type; FixProps = m_pDBEssence.fixed_props; @@ -499,6 +499,7 @@ namespace PerfectWorld.Scripts.Managers AddSharpenerDesc(); AddEngravedDesc(); AddMakerDesc(); + m_strDesc += "\\r"; AddSuiteDesc(); AddExtDescText(); return m_strDesc; diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmor.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmor.cs.meta new file mode 100644 index 0000000000..eb86dd22d2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmor.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 30e9ab67f87a542d59ff94440cb4e78c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmorrune.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmorrune.cs new file mode 100644 index 0000000000..d6265d5373 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmorrune.cs @@ -0,0 +1,16 @@ + +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrArmorrune : EC_IvtrItem + { + public EC_IvtrArmorrune(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrArmorrune(EC_IvtrArmorrune other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmorrune.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmorrune.cs.meta new file mode 100644 index 0000000000..7c6f4748db --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArmorrune.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a1e7bdbebb3744fd78b3c9906d93f2ab \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArrow.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArrow.cs new file mode 100644 index 0000000000..b539ae2fd2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArrow.cs @@ -0,0 +1,14 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrArrow : EC_IvtrEquip + { + public EC_IvtrArrow(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrArrow(EC_IvtrArrow other) : base(other) + { + } + } +} \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArrow.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArrow.cs.meta new file mode 100644 index 0000000000..c85739af4b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrArrow.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d252cb1fcb2e946688fd6836548fd0d4 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoHp.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoHp.cs new file mode 100644 index 0000000000..72f8f163fa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoHp.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrAutoHp : EC_IvtrItem + { + public EC_IvtrAutoHp(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrAutoHp(EC_IvtrAutoHp other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoHp.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoHp.cs.meta new file mode 100644 index 0000000000..2f58dd1e84 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoHp.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 67deebf01a6fc4678a8eb801cae72d0e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoMp.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoMp.cs new file mode 100644 index 0000000000..5bb5775c17 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoMp.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrAutoMp : EC_IvtrItem + { + public EC_IvtrAutoMp(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrAutoMp(EC_IvtrAutoMp other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoMp.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoMp.cs.meta new file mode 100644 index 0000000000..af7c51314b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrAutoMp.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5e4aa169619834c7fa8e2421d81b9f36 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrBible.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrBible.cs new file mode 100644 index 0000000000..3a1e3607c3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrBible.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrBible : EC_IvtrItem + { + public EC_IvtrBible(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrBible(EC_IvtrBible other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrBible.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrBible.cs.meta new file mode 100644 index 0000000000..332fe117d7 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrBible.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f352a8dce1daf4a078e5f1df0222d854 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCertificate.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCertificate.cs new file mode 100644 index 0000000000..17af84f155 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCertificate.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrCertificate : EC_IvtrItem + { + public EC_IvtrCertificate(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrCertificate(EC_IvtrCertificate other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCertificate.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCertificate.cs.meta new file mode 100644 index 0000000000..443976210f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCertificate.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 150298d1bd0fb446a8cc9231d5145cad \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCongregate.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCongregate.cs new file mode 100644 index 0000000000..0508913946 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCongregate.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrCongregate : EC_IvtrItem + { + public EC_IvtrCongregate(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrCongregate(EC_IvtrCongregate other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCongregate.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCongregate.cs.meta new file mode 100644 index 0000000000..9251a506a3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrCongregate.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bf279660c3b2b4027bc9d97e691c1870 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDamagerune.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDamagerune.cs new file mode 100644 index 0000000000..405849bb17 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDamagerune.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrDamagerune : EC_IvtrItem + { + public EC_IvtrDamagerune(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrDamagerune(EC_IvtrDamagerune other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDamagerune.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDamagerune.cs.meta new file mode 100644 index 0000000000..15e7015b3d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDamagerune.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d2481f9333ffc4852bb83fb78511f6da \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDecoration.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDecoration.cs new file mode 100644 index 0000000000..bd2bc8d3e5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDecoration.cs @@ -0,0 +1,79 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Define and Macro +// +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////// +// +// Reference to External variables and functions +// +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////// +// +// Local Types and Variables and Global variables +// +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////// +// +// Local functions +// +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////// +// +// Implement CECIvtrDecoration +// +/////////////////////////////////////////////////////////////////////////// +using BrewMonster; +using ModelRenderer.Scripts.GameData; +using System.Collections.Generic; +using BrewMonster.Network; +using BrewMonster.Scripts.Managers; +using BrewMonster.Scripts; +namespace PerfectWorld.Scripts.Managers +{ + + public class EC_IvtrDecoration : EC_IvtrEquip + { + protected IVTR_ESSENCE_DECORATION m_Essence; + protected DECORATION_MAJOR_TYPE m_pDBMajorType; + protected DECORATION_SUB_TYPE m_pDBSubType; + protected DECORATION_ESSENCE m_pDBEssence; + + public EC_IvtrDecoration(int tid, int expire_date) : base(tid, expire_date) + { + m_iCID = (int)InventoryClassId.ICID_DECORATION; + elementdataman pDB = ElementDataManProvider.GetElementDataMan(); + DATA_TYPE DataType = DATA_TYPE.DT_INVALID; + m_pDBEssence = (DECORATION_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType); + m_pDBMajorType = (DECORATION_MAJOR_TYPE)pDB.get_data_ptr(m_pDBEssence.id_major_type, ID_SPACE.ID_SPACE_ESSENCE, ref DataType); + m_pDBSubType = (DECORATION_SUB_TYPE)pDB.get_data_ptr(m_pDBEssence.id_sub_type, ID_SPACE.ID_SPACE_ESSENCE, ref DataType); + m_iPileLimit = m_pDBEssence.pile_num_max; + m_iPrice = m_pDBEssence.price; + m_iShopPrice = m_pDBEssence.shop_price; + m_i64EquipMask = m_pDBSubType.equip_mask; + m_iProcType = (int)m_pDBEssence.proc_type; + + FixProps = m_pDBEssence.fixed_props; + RepairFee = m_pDBEssence.repairfee; + ReputationReq = m_pDBEssence.require_reputation; + } + + public EC_IvtrDecoration(EC_IvtrDecoration other) : base(other) + { + m_pDBEssence = other.m_pDBEssence; + m_pDBMajorType = other.m_pDBMajorType; + m_pDBSubType = other.m_pDBSubType; + m_Essence = other.m_Essence; + } + + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDecoration.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDecoration.cs.meta new file mode 100644 index 0000000000..3dc57a1d75 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDecoration.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 238a4e2d1554d44b0a9f3f283a9badd7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDestroyingEssence.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDestroyingEssence.cs new file mode 100644 index 0000000000..6e05875dd8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDestroyingEssence.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrDestroyingEssence : EC_IvtrItem + { + public EC_IvtrDestroyingEssence(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrDestroyingEssence(EC_IvtrDestroyingEssence other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDestroyingEssence.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDestroyingEssence.cs.meta new file mode 100644 index 0000000000..c0c4fb2b54 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDestroyingEssence.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 584e97711b3bb4f97a18866bd56ce985 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDoubleExp.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDoubleExp.cs new file mode 100644 index 0000000000..52778da300 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDoubleExp.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrDoubleExp : EC_IvtrItem + { + public EC_IvtrDoubleExp(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrDoubleExp(EC_IvtrDoubleExp other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDoubleExp.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDoubleExp.cs.meta new file mode 100644 index 0000000000..75b93a1eb0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDoubleExp.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 684f0b389343e420dbf9d02a184554b8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDyeTicket.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDyeTicket.cs new file mode 100644 index 0000000000..11d8162ba5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDyeTicket.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrDyeTicket : EC_IvtrItem + { + public EC_IvtrDyeTicket(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrDyeTicket(EC_IvtrDyeTicket other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDyeTicket.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDyeTicket.cs.meta new file mode 100644 index 0000000000..c4abf8e13f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDyeTicket.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2b30a0678c3bb488e8579f6b1cff0847 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDynSkillEquip.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDynSkillEquip.cs new file mode 100644 index 0000000000..4e18b6edc4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDynSkillEquip.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrDynSkillEquip : EC_IvtrEquip + { + public EC_IvtrDynSkillEquip(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrDynSkillEquip(EC_IvtrDynSkillEquip other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDynSkillEquip.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDynSkillEquip.cs.meta new file mode 100644 index 0000000000..651665273d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrDynSkillEquip.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a1a5aae82e25b4ce5aeb499cb804f9fa \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrElement.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrElement.cs new file mode 100644 index 0000000000..f667324b31 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrElement.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrElement : EC_IvtrItem + { + public EC_IvtrElement(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrElement(EC_IvtrElement other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrElement.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrElement.cs.meta new file mode 100644 index 0000000000..6afa910abc --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrElement.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 28e3dc4074f0246449da8b794ca2a018 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrEquip.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrEquip.cs similarity index 95% rename from Assets/PerfectWorld/Scripts/Managers/EC_IvtrEquip.cs rename to Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrEquip.cs index 98862b8712..c2e77eb454 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrEquip.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrEquip.cs @@ -15,6 +15,8 @@ using System.Reflection; using BrewMonster.Scripts.Managers; using BrewMonster.Scripts; using UnityEngine.AddressableAssets; +using CSNetwork.Protocols; +using Unity.VisualScripting; namespace PerfectWorld.Scripts.Managers { @@ -26,12 +28,75 @@ namespace PerfectWorld.Scripts.Managers { #region Constants and Enums - // Item Class IDs - public const int ICID_EQUIP = 1; - public const int ICID_WEAPON = 2; + public enum EQUIP_CLASS_ID + { + ICID_ITEM = -100, + ICID_EQUIP = -101, + ICID_ARMOR = 0, + ICID_ARMORRUNE, + ICID_ARROW, + ICID_DECORATION, + ICID_DMGRUNE, + ICID_ELEMENT, + ICID_FASHION, + ICID_FLYSWORD, + ICID_MATERIAL, + ICID_MEDICINE, + ICID_REVSCROLL, + ICID_SKILLTOME, + ICID_TOSSMAT, + ICID_TOWNSCROLL, + ICID_UNIONSCROLL, + ICID_WEAPON, + ICID_TASKITEM, + ICID_STONE, + ICID_WING, + ICID_TASKDICE, + ICID_TASKNMMATTER, + ICID_ERRORITEM, + ICID_FACETICKET, + ICID_FACEPILL, + ICID_GM_GENERATOR, + ICID_RECIPE, + ICID_PETEGG, + ICID_PETFOOD, + ICID_PETFACETICKET, + ICID_FIREWORK, + ICID_TANKCALLIN, + ICID_SKILLMATTER, + ICID_REFINETICKET, + ICID_DESTROYINGESSENCE, + ICID_BIBLE, + ICID_SPEAKER, + ICID_AUTOHP, + ICID_AUTOMP, + ICID_DOUBLEEXP, + ICID_TRANSMITSCROLL, + ICID_DYETICKET, + ICID_GOBLIN, + ICID_GOBLIN_EQUIP, + ICID_GOBLIN_EXPPILL, + ICID_CERTIFICATE, + ICID_TARGETITEM, + ICID_LOOKINFOITEM, + ICID_INCSKILLABILITY, + ICID_WEDDINGBOOKCARD, + ICID_WEDDINGINVITECARD, + ICID_SHARPENER, + ICID_FACTIONMATERIAL, + ICID_CONGREGATE, + ICID_FORCETOKEN, + ICID_DYNSKILLEQUIP, + ICID_MONEYCONVERTIBLE, + ICID_MONSTERSPIRIT, + ICID_GENERALCARD, + ICID_GENERALCARD_DICE, + ICID_SHOPTOKEN, + ICID_UNIVERSAL_TOKEN, + } // Item Made From Types - public enum ITEM_MAKE_TAG + public enum ITEM_MAKE_TAG { IMT_NULL, IMT_CREATE, // GM ���� @@ -109,6 +174,9 @@ namespace PerfectWorld.Scripts.Managers // Basic Item Properties public int TemplateId { get; set; } public int ExpireDate { get; set; } + /// + /// class id + /// public int CID { get; set; } public int Price { get; set; } public int Count { get; set; } @@ -506,7 +574,7 @@ namespace PerfectWorld.Scripts.Managers { TemplateId = tid; ExpireDate = expireDate; - CID = ICID_EQUIP; + CID = (int)InventoryClassId.ICID_EQUIP; Price = 0; Count = 1; PriceScale = 1.0f; @@ -583,7 +651,6 @@ namespace PerfectWorld.Scripts.Managers // [6 x short requirements][2 x int endurance][short essenceSize][maker info][essence bytes][short numHole][WORD stoneMask][numHole x int holes][int numProp][props] if (TryParseEquipInfoNative(infoData, dataLen)) { - BMLogger.Log("CECIvtrEquip::SetItemInfo, native order success"); ParseProperties(); return true; } @@ -591,7 +658,6 @@ namespace PerfectWorld.Scripts.Managers // Fallback to legacy/custom order if server payload differs if (TryParseEquipInfoLegacy(infoData, dataLen)) { - BMLogger.Log("CECIvtrEquip::SetItemInfo, legacy order success"); ParseProperties(); return true; } @@ -1233,7 +1299,6 @@ namespace PerfectWorld.Scripts.Managers } } - Debug.Log($"[EC_IvtrEquip] Loaded {s_propIdToType.Count} property mappings from Addressables"); } else { @@ -1304,7 +1369,7 @@ namespace PerfectWorld.Scripts.Managers /// /// Decide equipment name color /// - public int DecideNameCol() + protected override int DecideNameCol() { int index = GetColorStrID(TemplateId); if (index >= 0) @@ -1329,10 +1394,16 @@ namespace PerfectWorld.Scripts.Managers /// /// Get color string ID for template /// - private int GetColorStrID(int templateId) + public override int GetColorStrID(int templateId) { // This would normally query the game's color system - return -1; + int iIndex = EC_Game.GetItemNameColorIdx(templateId); + if (iIndex <= 0) + return -1; + else if (iIndex < 7) + return (int)DescriptipionMsg.ITEMDESC_COL_LIGHTBLUE + iIndex - 1; + else + return (int)DescriptipionMsg.ITEMDESC_COL2_START + iIndex - 7 + 1; } #endregion @@ -1409,7 +1480,7 @@ namespace PerfectWorld.Scripts.Managers // 5) Add-on properties (non-embedded, non-suite, non-engraved) if (!string.IsNullOrEmpty(strAddon)) m_strDesc += strAddon; - + AddPriceDesc(white, false); // 6) Tessera / stones (socketed gems) BuildTesseraDesc(); @@ -1425,10 +1496,10 @@ namespace PerfectWorld.Scripts.Managers // 10) Maker & destroying info if any AddMakerDesc(); // Destroying description is added by caller when needed; keep it optional here. - + m_strDesc += "\\r"; + AddExtDescText(); + Debug.Log("m_strDesc add ext desc text: " + m_strDesc); // 11) Price (sell price scaled) - AddPriceDesc(white, false); - return m_strDesc; } @@ -2177,6 +2248,11 @@ namespace PerfectWorld.Scripts.Managers public int GetSuiteID() { // This would normally query the game's suite equip table + Dictionary suiteEquipTab = EC_Game.GetSuiteEquipTab(); + if (suiteEquipTab.TryGetValue(GetTemplateID(), out int suiteId)) + { + return suiteId; + } return 0; } @@ -4134,6 +4210,19 @@ namespace PerfectWorld.Scripts.Managers } } + struct SUITEITEM + { + public bool bEnabled; + public int tid; + public char[] szName; + public string Name => new string(szName); + public SUITEITEM(bool bEnabled, int tid) + { + this.bEnabled = bEnabled; + this.tid = tid; + this.szName = new char[32]; + } + } /// /// Add suite description /// @@ -4152,63 +4241,128 @@ namespace PerfectWorld.Scripts.Managers // ASSERT in C++ return; } - - // In C#, we'd need to cast to SUITE_ESSENCE struct - // For now, use placeholder values - string suiteName = "Suite"; // TODO: Get from SUITE_ESSENCE.name - int maxEquips = 12; // TODO: Get from SUITE_ESSENCE.max_equips - - // Get host player (would normally come from EC_Game.GetGameRun().GetHostPlayer()) - // Check if this equipment is in host's equipment pack - bool showDetail = false; // TODO: Check if m_pDescIvtr == pHostPlayer->GetEquipment() + SUITE_ESSENCE pSuiteEss = (SUITE_ESSENCE)pData; + CECHostPlayer hostPlayer = EC_Game.GetGameRun().GetHostPlayer(); // Colors - int nameCol = DecideNameCol(); + int iNameCol = DecideNameCol(); int lblue = (int)DescriptipionMsg.ITEMDESC_COL_LIGHTBLUE; + int green = (int)DescriptipionMsg.ITEMDESC_COL_GREEN; + int gray = (int)DescriptipionMsg.ITEMDESC_COL_GRAY; + int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE; int yellow = (int)DescriptipionMsg.ITEMDESC_COL_YELLOW; // Save current description string strCurDesc = m_strDesc; - - if (!showDetail) + bool bShowDetail = true; + if (hostPlayer.GetEquipment() != m_pDescIvtr) + bShowDetail = false; + else { - // Isn't equipment inventory, only add total suite number info. + for(int i = 0; i < m_pDescIvtr.GetSize(); i++) + { + EC_IvtrItem pItem = m_pDescIvtr.GetItem(i); + if (pItem == null) + { + bShowDetail = false; + continue; + } + if (pItem.m_tid == this.m_tid) + { + bShowDetail = true; + break; + } + } + } + + if (!bShowDetail) + { m_strDesc = "\\r\\r"; - AddDescText(nameCol, false, "{0} ({1})", suiteName, maxEquips); + AddDescText(iNameCol, true, "{0} {1}/{2}", pSuiteEss.Name, 0, pSuiteEss.max_equips); m_strDesc = strCurDesc + m_strDesc; return; } - - // Maximum number of suite items + // Maximum number of suite items const int MAX_NUM = 12; + SUITEITEM[] aSuiteItems = new SUITEITEM[MAX_NUM]; - // Get equipped suite item list - int[] aEquipped = new int[MAX_NUM]; - int itemCnt = 0; // TODO: Get from pHostPlayer->GetEquippedSuiteItem(idSuite, aEquipped) - if (itemCnt == 0) - return; - - m_strDesc = "\\r\\r"; - - // Build suite addon properties at first - if (itemCnt > 1) + + int maxEquips = (pSuiteEss.max_equips > MAX_NUM) ? MAX_NUM : (int)pSuiteEss.max_equips; + for(int i = 0; i < maxEquips; i++) { - // Change color - AddDescText(lblue, false, ""); - - // In C++, this loops through suite addons and displays them - // For now, skip detailed addon display + aSuiteItems[i].bEnabled = false; + aSuiteItems[i].tid = (int)pSuiteEss.equipments[i].id; + aSuiteItems[i].szName = new char[32]; + aSuiteItems[i].szName[0] = '\0'; + EC_IvtrItem pEquipItem = CreateItem((int)pSuiteEss.equipments[i].id, 0,1); + if (pEquipItem != null) + { + aSuiteItems[i].szName = pEquipItem.GetName().ToCharArray(); + //delete pEquipItem; + } + else + { + aSuiteItems[i].tid = 0; + } + } + int iItemCnt; + int[] aEquipped = new int[MAX_NUM]; + iItemCnt = hostPlayer.GetEquippedSuiteItem(idSuite,ref aEquipped); + if(iItemCnt == 0) return; + + m_strDesc += "\\r\\r"; + // Build suite addon properties at first + for (int i = 0; i < MAX_NUM; i++) + { + for(int j = 0; j < iItemCnt; j++) + { + if (aSuiteItems[i].tid == aEquipped[j]) + { + aSuiteItems[i].bEnabled = true; + break; + } + } } - // Add suite name - AddDescText(yellow, true, "{0} ({1} / {2})", suiteName, itemCnt, maxEquips); - - // List suite item names would go here - // In C++, this creates SUITEITEM array and lists enabled/disabled items - // green, gray, white colors would be used here for enabled/disabled items - // For now, simplified version + if(iItemCnt > 1) + { + // Change color + AddDescText(lblue, false, ""); + + for (int i=1; i < iItemCnt; i++) + { + int idProp = (int)pSuiteEss.addons[i-1].id; + if (idProp == 0) + continue; + + pData = dataMan.get_data_ptr((uint)idProp, ID_SPACE.ID_SPACE_ADDON, ref dataType); + if (dataType != DATA_TYPE.DT_EQUIPMENT_ADDON) + { + continue; + } + + EQUIPMENT_ADDON pAddOn = (EQUIPMENT_ADDON)pData; + + AddDescText(-1, false, "(%d) ", i+1); + AddDescText(-1, true, "%s", pAddOn.Name); + } + } + // Add suite name + AddDescText(yellow/*iNameCol*/, true, "{0} ({1} / {2})", pSuiteEss.Name, iItemCnt, pSuiteEss.max_equips); + for (int i=0; i < pSuiteEss.max_equips; i++) + { + SUITEITEM suiteItem = aSuiteItems[i]; + if (suiteItem.tid == 0) + continue; + + int col = suiteItem.bEnabled ? green : gray; + bool bRet = (i == pSuiteEss.max_equips-1) ? false : true; + + // Add item name + AddDescText(col, bRet, " %s", suiteItem.Name); + } } - + /// /// Add destroying description /// @@ -4493,27 +4647,22 @@ namespace PerfectWorld.Scripts.Managers if (string.IsNullOrEmpty(Maker)) return; - BMLogger.Log("[THN]EC_IvtrEquip: AddMakerDesc: Maker: " + Maker); - m_strDesc += "\\r"; + m_strDesc += "\\r"; // For signed marks (IMT_SIGN), Maker already contains color codes and formatted text. if (MadeFrom == (byte)ITEM_MAKE_TAG.IMT_SIGN) { - BMLogger.Log("[THN]EC_IvtrEquip: AddMakerDesc IF: Maker: " + Maker); m_strDesc += Maker; } else { - BMLogger.Log("[THN]EC_IvtrEquip: AddMakerDesc ELSE: Maker: " + Maker); // Normal "made by" line using item-desc string if available string fmt = GetItemDescString(DescriptipionMsg.ITEMDESC_MADEFROM); if (string.IsNullOrEmpty(fmt)) { fmt = "Made by {0}"; } - BMLogger.Log("[THN]EC_IvtrEquip: AddMakerDesc ELSE: fmt: " + fmt); AddDescText((int)DescriptipionMsg.ITEMDESC_COL_GREEN, false, fmt, Maker); - BMLogger.Log("[THN]EC_IvtrEquip: AddMakerDesc ELSE: m_strDesc: " + m_strDesc); - } + } } /// diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrEquip.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrEquip.cs.meta new file mode 100644 index 0000000000..81db6a40d0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrEquip.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f740d7d39c73f41a7a352c569c5442db \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFacePill.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFacePill.cs new file mode 100644 index 0000000000..815c598198 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFacePill.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrFacePill : EC_IvtrItem + { + public EC_IvtrFacePill(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrFacePill(EC_IvtrFacePill other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFacePill.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFacePill.cs.meta new file mode 100644 index 0000000000..8009dce62b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFacePill.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a8785f321cb1c42e784355f0e452a2f8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFaceTicket.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFaceTicket.cs new file mode 100644 index 0000000000..9c1fd6ccaa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFaceTicket.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrFaceTicket : EC_IvtrItem + { + public EC_IvtrFaceTicket(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrFaceTicket(EC_IvtrFaceTicket other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFaceTicket.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFaceTicket.cs.meta new file mode 100644 index 0000000000..dc9acdba94 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFaceTicket.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 97a6a36bce3c046a88e5c12e8ac79b03 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFactionMaterial.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFactionMaterial.cs new file mode 100644 index 0000000000..3429a0b219 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFactionMaterial.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrFactionMaterial : EC_IvtrItem + { + public EC_IvtrFactionMaterial(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrFactionMaterial(EC_IvtrFactionMaterial other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFactionMaterial.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFactionMaterial.cs.meta new file mode 100644 index 0000000000..20cddc454f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFactionMaterial.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e3a3f865615ba4eaca9942d99698c332 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFashion.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFashion.cs new file mode 100644 index 0000000000..a6c1751657 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFashion.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrFashion : EC_IvtrItem + { + public EC_IvtrFashion(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrFashion(EC_IvtrFashion other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFashion.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFashion.cs.meta new file mode 100644 index 0000000000..d9d6ea16e4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFashion.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8cbdfe37e56eb46be91ac835220dfb25 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFirework.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFirework.cs new file mode 100644 index 0000000000..71d75113d0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFirework.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrFirework : EC_IvtrItem + { + public EC_IvtrFirework(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrFirework(EC_IvtrFirework other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFirework.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFirework.cs.meta new file mode 100644 index 0000000000..c2130f4714 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFirework.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9a4c28d0768f341b2aef5ec207875a31 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFlysword.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFlysword.cs new file mode 100644 index 0000000000..210d40eda0 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFlysword.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrFlysword : EC_IvtrItem + { + public EC_IvtrFlysword(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrFlysword(EC_IvtrFlysword other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFlysword.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFlysword.cs.meta new file mode 100644 index 0000000000..eb9291c8e5 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrFlysword.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 76745e0d1f528425eac71363b77c8cdd \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrForceToken.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrForceToken.cs new file mode 100644 index 0000000000..26dc9fed3e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrForceToken.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrForceToken : EC_IvtrItem + { + public EC_IvtrForceToken(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrForceToken(EC_IvtrForceToken other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrForceToken.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrForceToken.cs.meta new file mode 100644 index 0000000000..7c1d676914 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrForceToken.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: de39c4a9aa1e1434c96ce485ea144291 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCard.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCard.cs new file mode 100644 index 0000000000..de46434948 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCard.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrGeneralCard : EC_IvtrItem + { + public EC_IvtrGeneralCard(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrGeneralCard(EC_IvtrGeneralCard other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCard.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCard.cs.meta new file mode 100644 index 0000000000..2344d68880 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCard.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bfe40c592c38542d2a590310173f5c8c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCardDice.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCardDice.cs new file mode 100644 index 0000000000..df28fd9d9a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCardDice.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrGeneralCardDice : EC_IvtrItem + { + public EC_IvtrGeneralCardDice(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrGeneralCardDice(EC_IvtrGeneralCardDice other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCardDice.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCardDice.cs.meta new file mode 100644 index 0000000000..3d919e4baf --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGeneralCardDice.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ab3e2b5b4e09949a69cfc003d0103804 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGmGenerator.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGmGenerator.cs new file mode 100644 index 0000000000..75f77cf24c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGmGenerator.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrGmGenerator : EC_IvtrItem + { + public EC_IvtrGmGenerator(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrGmGenerator(EC_IvtrGmGenerator other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGmGenerator.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGmGenerator.cs.meta new file mode 100644 index 0000000000..cd7c06a818 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGmGenerator.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 92617801fcd734adfa84fb4d4ca84f0c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblin.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblin.cs new file mode 100644 index 0000000000..44878eb090 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblin.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrGoblin : EC_IvtrItem + { + public EC_IvtrGoblin(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrGoblin(EC_IvtrGoblin other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblin.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblin.cs.meta new file mode 100644 index 0000000000..4903722714 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblin.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c8726058514b64b129c6b619e7e1d3fa \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinEquip.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinEquip.cs new file mode 100644 index 0000000000..26374a3219 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinEquip.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrGoblinEquip : EC_IvtrEquip + { + public EC_IvtrGoblinEquip(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrGoblinEquip(EC_IvtrGoblinEquip other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinEquip.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinEquip.cs.meta new file mode 100644 index 0000000000..b92fb38bb4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinEquip.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 89be2e126b8d44151bdd559226b0f306 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinExpPill.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinExpPill.cs new file mode 100644 index 0000000000..b6c49d6aaa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinExpPill.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrGoblinExpPill : EC_IvtrItem + { + public EC_IvtrGoblinExpPill(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrGoblinExpPill(EC_IvtrGoblinExpPill other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinExpPill.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinExpPill.cs.meta new file mode 100644 index 0000000000..becac7c872 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrGoblinExpPill.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4b383fd16faa444fa8dc9a5c4e4aac86 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrIncSkillAbility.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrIncSkillAbility.cs new file mode 100644 index 0000000000..93c8043715 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrIncSkillAbility.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrIncSkillAbility : EC_IvtrItem + { + public EC_IvtrIncSkillAbility(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrIncSkillAbility(EC_IvtrIncSkillAbility other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrIncSkillAbility.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrIncSkillAbility.cs.meta new file mode 100644 index 0000000000..044cd3f346 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrIncSkillAbility.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4050b6d604fee48c399953ca2707f650 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrItem.cs similarity index 83% rename from Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.cs rename to Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrItem.cs index 92590d7e46..8f3142b426 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrItem.cs @@ -167,17 +167,14 @@ namespace BrewMonster.Scripts.Managers } } - Debug.Log($"[Inventory] Loaded multi-sprite atlas with {atlasSprites.Length} sprites"); } else { - Debug.LogWarning("[Inventory] Failed to load multi-sprite atlas: iconlist_ivtrm_multisprite"); _multiSpriteAtlas = new Sprite[0]; // Prevent repeated loading attempts } } catch (Exception ex) { - Debug.LogError($"[Inventory] Error loading multi-sprite atlas: {ex.Message}"); _multiSpriteAtlas = new Sprite[0]; // Prevent repeated loading attempts } } @@ -332,7 +329,6 @@ namespace BrewMonster.Scripts.Managers try { var val = getNameMethod.Invoke(data, null) as string; - Debug.Log($"[Inventory] GetName method result: '{val}' (length: {val?.Length ?? 0})"); if (!string.IsNullOrEmpty(val) && !string.IsNullOrWhiteSpace(val)) return val; } catch (Exception ex) @@ -459,15 +455,12 @@ namespace BrewMonster.Scripts.Managers ci += extraLen; } - var item = new EC_IvtrItem(tid, expireDate) - { - Package = byPackage, - Slot = slotIndex, - State = state, - Crc = crc, - Content = extra - }; - item.SetCount(amount); + var item = EC_IvtrItem.CreateItem(tid, expireDate, amount); + item.Package = byPackage; + item.Slot = slotIndex; + item.State = state; + item.Crc = crc; + item.Content = extra; items.Add(item); } @@ -814,16 +807,191 @@ namespace BrewMonster.Scripts.Managers var pItem = new EC_IvtrItem(tid, expire_date); DATA_TYPE DataType = DATA_TYPE.DT_INVALID; object data = ElementDataManProvider.GetElementDataMan().get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType); + Debug.Log("DataType: " + DataType); switch(DataType) { case DATA_TYPE.DT_WEAPON_ESSENCE: pItem = new EC_IvtrWeapon(tid, expire_date); break; + case DATA_TYPE.DT_PROJECTILE_ESSENCE: + pItem = new EC_IvtrArrow(tid, expire_date); + break; case DATA_TYPE.DT_ARMOR_ESSENCE: pItem = new EC_IvtrArmor(tid, expire_date); break; + case DATA_TYPE.DT_DECORATION_ESSENCE: + pItem = new EC_IvtrDecoration(tid, expire_date); + break; + case DATA_TYPE.DT_FASHION_ESSENCE: + pItem = new EC_IvtrFashion(tid, expire_date); + break; + case DATA_TYPE.DT_MEDICINE_ESSENCE: + pItem = new EC_IvtrMedicine(tid, expire_date); + break; + case DATA_TYPE.DT_MATERIAL_ESSENCE: + pItem = new EC_IvtrMaterial(tid, expire_date); + break; + case DATA_TYPE.DT_DAMAGERUNE_ESSENCE: + pItem = new EC_IvtrDamagerune(tid, expire_date); + break; + case DATA_TYPE.DT_ARMORRUNE_ESSENCE: + pItem = new EC_IvtrArmorrune(tid, expire_date); + break; + case DATA_TYPE.DT_SKILLTOME_ESSENCE: + pItem = new EC_IvtrSkilltome(tid, expire_date); + break; + case DATA_TYPE.DT_FLYSWORD_ESSENCE: + pItem = new EC_IvtrFlysword(tid, expire_date); + break; + case DATA_TYPE.DT_TOWNSCROLL_ESSENCE: + pItem = new EC_IvtrTownscroll(tid, expire_date); + break; + case DATA_TYPE.DT_UNIONSCROLL_ESSENCE: + pItem = new EC_IvtrUnionscroll(tid, expire_date); + break; + case DATA_TYPE.DT_REVIVESCROLL_ESSENCE: + pItem = new EC_IvtrRevScroll(tid, expire_date); + break; + case DATA_TYPE.DT_ELEMENT_ESSENCE: + pItem = new EC_IvtrElement(tid, expire_date); + break; + case DATA_TYPE.DT_TOSSMATTER_ESSENCE: + pItem = new EC_IvtrTossMat(tid, expire_date); + break; + case DATA_TYPE.DT_TASKMATTER_ESSENCE: + pItem = new EC_IvtrTaskmatter(tid, expire_date); + break; + case DATA_TYPE.DT_STONE_ESSENCE: + pItem = new EC_IvtrStone(tid, expire_date); + break; + case DATA_TYPE.DT_WINGMANWING_ESSENCE: + pItem = new EC_IvtrWing(tid, expire_date); + break; + case DATA_TYPE.DT_TASKDICE_ESSENCE: + pItem = new EC_IvtrTaskDice(tid, expire_date); + break; + case DATA_TYPE.DT_TASKNORMALMATTER_ESSENCE: + pItem = new EC_IvtrTaskNmMatter(tid, expire_date); + break; + case DATA_TYPE.DT_FACETICKET_ESSENCE: + pItem = new EC_IvtrFaceTicket(tid, expire_date); + break; + case DATA_TYPE.DT_FACEPILL_ESSENCE: + pItem = new EC_IvtrFacePill(tid, expire_date); + break; + case DATA_TYPE.DT_GM_GENERATOR_ESSENCE: + pItem = new EC_IvtrGmGenerator(tid, expire_date); + break; + case DATA_TYPE.DT_RECIPE_ESSENCE: + pItem = new EC_IvtrRecipe(tid, expire_date); + break; + case DATA_TYPE.DT_PET_EGG_ESSENCE: + pItem = new EC_IvtrPetEgg(tid, expire_date); + break; + case DATA_TYPE.DT_PET_FOOD_ESSENCE: + pItem = new EC_IvtrPetFood(tid, expire_date); + break; + case DATA_TYPE.DT_PET_FACETICKET_ESSENCE: + pItem = new EC_IvtrPetFaceTicket(tid, expire_date); + break; + case DATA_TYPE.DT_FIREWORKS_ESSENCE: + pItem = new EC_IvtrFirework(tid, expire_date); + break; + case DATA_TYPE.DT_WAR_TANKCALLIN_ESSENCE: + pItem = new EC_IvtrWarTankCallin(tid, expire_date); + break; + case DATA_TYPE.DT_SKILLMATTER_ESSENCE: + pItem = new EC_IvtrSkillMat(tid, expire_date); + break; + case DATA_TYPE.DT_INC_SKILL_ABILITY_ESSENCE: + pItem = new EC_IvtrIncSkillAbility(tid, expire_date); + break; + case DATA_TYPE.DT_REFINE_TICKET_ESSENCE: + pItem = new EC_IvtrRefineTicket(tid, expire_date); + break; + case DATA_TYPE.DT_DESTROYING_ESSENCE: + pItem = new EC_IvtrDestroyingEssence(tid, expire_date); + break; + case DATA_TYPE.DT_BIBLE_ESSENCE: + pItem = new EC_IvtrBible(tid, expire_date); + break; + case DATA_TYPE.DT_SPEAKER_ESSENCE: + pItem = new EC_IvtrSpeaker(tid, expire_date); + break; + case DATA_TYPE.DT_AUTOHP_ESSENCE: + pItem = new EC_IvtrAutoHp(tid, expire_date); + break; + case DATA_TYPE.DT_AUTOMP_ESSENCE: + pItem = new EC_IvtrAutoMp(tid, expire_date); + break; + case DATA_TYPE.DT_DOUBLE_EXP_ESSENCE: + pItem = new EC_IvtrDoubleExp(tid, expire_date); + break; + case DATA_TYPE.DT_DYE_TICKET_ESSENCE: + pItem = new EC_IvtrDyeTicket(tid, expire_date); + break; + case DATA_TYPE.DT_TRANSMITSCROLL_ESSENCE: + pItem = new EC_IvtrTransmitScroll(tid, expire_date); + break; + case DATA_TYPE.DT_GOBLIN_ESSENCE: + pItem = new EC_IvtrGoblin(tid, expire_date); + break; + case DATA_TYPE.DT_GOBLIN_EQUIP_ESSENCE: + pItem = new EC_IvtrGoblinEquip(tid, expire_date); + break; + case DATA_TYPE.DT_GOBLIN_EXPPILL_ESSENCE: + pItem = new EC_IvtrGoblinExpPill(tid, expire_date); + break; + case DATA_TYPE.DT_SELL_CERTIFICATE_ESSENCE: + pItem = new EC_IvtrCertificate(tid, expire_date); + break; + case DATA_TYPE.DT_TARGET_ITEM_ESSENCE: + pItem = new EC_IvtrTargetItem(tid, expire_date); + break; + case DATA_TYPE.DT_LOOK_INFO_ESSENCE: + pItem = new EC_IvtrLookInfoItem(tid, expire_date); + break; + case DATA_TYPE.DT_WEDDING_BOOKCARD_ESSENCE: + pItem = new EC_IvtrWeddingBookCard(tid, expire_date); + break; + case DATA_TYPE.DT_WEDDING_INVITECARD_ESSENCE: + pItem = new EC_IvtrWeddingInviteCard(tid, expire_date); + break; + case DATA_TYPE.DT_SHARPENER_ESSENCE: + pItem = new EC_IvtrSharpener(tid, expire_date); + break; + case DATA_TYPE.DT_FACTION_MATERIAL_ESSENCE: + pItem = new EC_IvtrFactionMaterial(tid, expire_date); + break; + case DATA_TYPE.DT_CONGREGATE_ESSENCE: + pItem = new EC_IvtrCongregate(tid, expire_date); + break; + case DATA_TYPE.DT_FORCE_TOKEN_ESSENCE: + pItem = new EC_IvtrForceToken(tid, expire_date); + break; + case DATA_TYPE.DT_DYNSKILLEQUIP_ESSENCE: + pItem = new EC_IvtrDynSkillEquip(tid, expire_date); + break; + case DATA_TYPE.DT_MONEY_CONVERTIBLE_ESSENCE: + pItem = new EC_IvtrMoneyConvertible(tid, expire_date); + break; + case DATA_TYPE.DT_MONSTER_SPIRIT_ESSENCE: + pItem = new EC_IvtrMonsterSpirit(tid, expire_date); + break; + case DATA_TYPE.DT_POKER_ESSENCE: + pItem = new EC_IvtrGeneralCard(tid, expire_date); + break; + case DATA_TYPE.DT_POKER_DICE_ESSENCE: + pItem = new EC_IvtrGeneralCardDice(tid, expire_date); + break; + case DATA_TYPE.DT_SHOP_TOKEN_ESSENCE: + pItem = new EC_IvtrShopToken(tid, expire_date); + break; + case DATA_TYPE.DT_UNIVERSAL_TOKEN_ESSENCE: + pItem = new EC_IvtrUniversalToken(tid, expire_date); + break; default: - BMLogger.Log("[THN]EC_IvtrItem: CreateItem: Default Item: tid: " + tid + ", expire_date: " + expire_date + ", pItem: " + pItem.GetName()); + pItem = new EC_IvtrUnknown(tid, expire_date); break; } pItem.SetCount(iCount); @@ -965,7 +1133,7 @@ namespace BrewMonster.Scripts.Managers /// Clone item (shallow copy, same as C++ default). public virtual EC_IvtrItem Clone() { - return new EC_IvtrItem(this); + return CreateItem(m_tid, m_expire_date, m_iCount, m_iCID); } /// Get item cool time in milliseconds (0 by default). @@ -1298,10 +1466,23 @@ namespace BrewMonster.Scripts.Managers // Add special properties description / 添加特殊属性描述 var pDescTab = EC_Game.GetItemDesc(); // Note: ITEMDESC_COL2_BRIGHTBLUE constant - adjust based on actual string table / 注意:ITEMDESC_COL2_BRIGHTBLUE常量 - 根据实际字符串表调整 - int green = 1000; // ITEMDESC_COL2_BRIGHTBLUE placeholder - adjust this value - + int green = (int)DescriptipionMsg.ITEMDESC_COL2_BRIGHTBLUE; // ITEMDESC_COL2_BRIGHTBLUE placeholder - adjust this value + if(typeof(EC_IvtrArmor) == this.GetType()) + { + Debug.Log("This is an armor"); + } + + Debug.Log("armor m_iCID: " + m_iCID); + Debug.Log("armor m_iProcType: " + m_iProcType); if (m_iCID != (int)InventoryClassId.ICID_GOBLIN) // goblin does not need to display these special properties / 地精不需要显示这些特殊属性 { + Debug.Log("m_iCID != (int)InventoryClassId.ICID_GOBLIN"); + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_NO_USER_TRASH: " + (m_iProcType & (int)ProcType.PROC_NO_USER_TRASH)); + Debug.Log("!((m_iProcType & (int)ProcType.PROC_BINDING) != 0): " + !((m_iProcType & (int)ProcType.PROC_BINDING) != 0)); + Debug.Log("((m_iProcType & (int)ProcType.PROC_DROPWHENDIE) != 0): " + ((m_iProcType & (int)ProcType.PROC_DROPWHENDIE) != 0)); + Debug.Log("((m_iProcType & (int)ProcType.PROC_DROPPABLE) != 0): " + ((m_iProcType & (int)ProcType.PROC_DROPPABLE) != 0)); + Debug.Log("((m_iProcType & (int)ProcType.PROC_SELLABLE) != 0): " + ((m_iProcType & (int)ProcType.PROC_SELLABLE) != 0)); // Exact C++ logic: (PROC_NO_USER_TRASH) || (!PROC_BINDING && (PROC_DROPWHENDIE || ...)) // 精确的C++逻辑:(PROC_NO_USER_TRASH) || (!PROC_BINDING && (PROC_DROPWHENDIE || ...)) if ((m_iProcType & (int)ProcType.PROC_NO_USER_TRASH) != 0 @@ -1325,121 +1506,140 @@ namespace BrewMonster.Scripts.Managers m_strDesc += szCol; } } - - // Note: These message IDs are placeholders - adjust based on actual string table / 注意:这些消息ID是占位符 - 根据实际字符串表调整 + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_DROPWHENDIE: " + (m_iProcType & (int)ProcType.PROC_DROPWHENDIE)); if ((m_iProcType & (int)ProcType.PROC_DROPWHENDIE) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_DEAD_PROTECT placeholder - adjust this value - string desc = pDescTab.GetWideString(2000); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_DEAD_PROTECT); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_DROPPABLE: " + (m_iProcType & (int)ProcType.PROC_DROPPABLE)); if ((m_iProcType & (int)ProcType.PROC_DROPPABLE) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_NO_DROP placeholder - adjust this value - string desc = pDescTab.GetWideString(2001); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NO_DROP); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_SELLABLE: " + (m_iProcType & (int)ProcType.PROC_SELLABLE)); if ((m_iProcType & (int)ProcType.PROC_SELLABLE) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_NO_TRADE placeholder - adjust this value - string desc = pDescTab.GetWideString(2002); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NO_TRADE); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_TRADEABLE: " + (m_iProcType & (int)ProcType.PROC_TRADEABLE)); if ((m_iProcType & (int)ProcType.PROC_TRADEABLE) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_NO_PLAYER_TRADE placeholder - adjust this value - string desc = pDescTab.GetWideString(2003); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NO_PLAYER_TRADE); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_DISAPEAR: " + (m_iProcType & (int)ProcType.PROC_DISAPEAR)); if ((m_iProcType & (int)ProcType.PROC_DISAPEAR) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_LEAVE_SCENE_DISAPEAR placeholder - adjust this value - string desc = pDescTab.GetWideString(2004); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_LEAVE_SCENE_DISAPEAR); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_USE: " + (m_iProcType & (int)ProcType.PROC_USE)); if ((m_iProcType & (int)ProcType.PROC_USE) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_USE_AFTER_PICK_UP placeholder - adjust this value - string desc = pDescTab.GetWideString(2005); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_USE_AFTER_PICK_UP); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_DEADDROP: " + (m_iProcType & (int)ProcType.PROC_DEADDROP)); if ((m_iProcType & (int)ProcType.PROC_DEADDROP) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_DROP_WHEN_DEAD placeholder - adjust this value - string desc = pDescTab.GetWideString(2006); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_DROP_WHEN_DEAD); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_OFFLINE: " + (m_iProcType & (int)ProcType.PROC_OFFLINE)); if ((m_iProcType & (int)ProcType.PROC_OFFLINE) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_DROP_WHEN_OFFLINE placeholder - adjust this value - string desc = pDescTab.GetWideString(2007); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_DROP_WHEN_OFFLINE); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_UNREPAIRABLE: " + (m_iProcType & (int)ProcType.PROC_UNREPAIRABLE)); if ((m_iProcType & (int)ProcType.PROC_UNREPAIRABLE) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_UNREPAIRABLE placeholder - adjust this value - string desc = pDescTab.GetWideString(2008); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_UNREPAIRABLE); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } + Debug.Log("m_iProcType: " + m_iProcType); + Debug.Log("m_iProcType & (int)ProcType.PROC_NO_USER_TRASH: " + (m_iProcType & (int)ProcType.PROC_NO_USER_TRASH)); if ((m_iProcType & (int)ProcType.PROC_NO_USER_TRASH) != 0) { m_strDesc += "\\r"; if (pDescTab != null && pDescTab.IsInitialized()) { - // ITEMDESC_NO_USER_TRASH placeholder - adjust this value - string desc = pDescTab.GetWideString(2009); // Placeholder ID + string desc = pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NO_USER_TRASH); if (!string.IsNullOrEmpty(desc)) m_strDesc += desc; } + Debug.Log("m_strDesc: " + m_strDesc); } } else { + Debug.Log("m_iCID == (int)InventoryClassId.ICID_GOBLIN"); TrimLastReturn(); } } @@ -1516,7 +1716,7 @@ namespace BrewMonster.Scripts.Managers str = iPrice.ToString(); } - protected int GetColorStrID(int tid) + public virtual int GetColorStrID(int templateId) { // Placeholder: color index lookup; return -1 (white) by default. return -1; diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrItem.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrItem.cs.meta new file mode 100644 index 0000000000..a258db67cc --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrItem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 566fc2d24eefe48e7bd10ed67d15563f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrLookInfoItem.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrLookInfoItem.cs new file mode 100644 index 0000000000..4ea2355ccf --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrLookInfoItem.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrLookInfoItem : EC_IvtrItem + { + public EC_IvtrLookInfoItem(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrLookInfoItem(EC_IvtrLookInfoItem other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrLookInfoItem.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrLookInfoItem.cs.meta new file mode 100644 index 0000000000..adeb476543 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrLookInfoItem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 384fce986646f438698912f0c15b9ba8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMaterial.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMaterial.cs new file mode 100644 index 0000000000..9880098373 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMaterial.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrMaterial : EC_IvtrItem + { + public EC_IvtrMaterial(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrMaterial(EC_IvtrMaterial other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMaterial.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMaterial.cs.meta new file mode 100644 index 0000000000..bc18aa001d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMaterial.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e681cc9149ec5499fa6584a02a3916e1 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMedicine.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMedicine.cs new file mode 100644 index 0000000000..43bcfd2d13 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMedicine.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrMedicine : EC_IvtrItem + { + public EC_IvtrMedicine(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrMedicine(EC_IvtrMedicine other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMedicine.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMedicine.cs.meta new file mode 100644 index 0000000000..961e1f6544 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMedicine.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ed110c7e41c6f437791bdf92da68019c \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMoneyConvertible.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMoneyConvertible.cs new file mode 100644 index 0000000000..0706daf572 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMoneyConvertible.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrMoneyConvertible : EC_IvtrItem + { + public EC_IvtrMoneyConvertible(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrMoneyConvertible(EC_IvtrMoneyConvertible other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMoneyConvertible.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMoneyConvertible.cs.meta new file mode 100644 index 0000000000..b05aa11779 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMoneyConvertible.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6b6e854a6db4c4d87aaaeba867d72bae \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMonsterSpirit.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMonsterSpirit.cs new file mode 100644 index 0000000000..e214eee652 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMonsterSpirit.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrMonsterSpirit : EC_IvtrItem + { + public EC_IvtrMonsterSpirit(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrMonsterSpirit(EC_IvtrMonsterSpirit other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMonsterSpirit.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMonsterSpirit.cs.meta new file mode 100644 index 0000000000..e4c2cb4dd4 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrMonsterSpirit.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b3ec2fe733bae45c982969aed8b8eae0 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetEgg.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetEgg.cs new file mode 100644 index 0000000000..df0cbbd059 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetEgg.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrPetEgg : EC_IvtrItem + { + public EC_IvtrPetEgg(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrPetEgg(EC_IvtrPetEgg other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetEgg.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetEgg.cs.meta new file mode 100644 index 0000000000..e65af61f2c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetEgg.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 31d39c5195d7e45fa91082d7db9b3204 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFaceTicket.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFaceTicket.cs new file mode 100644 index 0000000000..61f0e12023 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFaceTicket.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrPetFaceTicket : EC_IvtrItem + { + public EC_IvtrPetFaceTicket(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrPetFaceTicket(EC_IvtrPetFaceTicket other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFaceTicket.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFaceTicket.cs.meta new file mode 100644 index 0000000000..230d4c038c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFaceTicket.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7c61b694d841e4db5ac2811b04531e7f \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFood.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFood.cs new file mode 100644 index 0000000000..8a52b6b14e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFood.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrPetFood : EC_IvtrItem + { + public EC_IvtrPetFood(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrPetFood(EC_IvtrPetFood other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFood.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFood.cs.meta new file mode 100644 index 0000000000..fe60acf730 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrPetFood.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5d8c5f936052f4ed0b63e061797eefbb \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRecipe.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRecipe.cs new file mode 100644 index 0000000000..f03d3efb62 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRecipe.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrRecipe : EC_IvtrItem + { + public EC_IvtrRecipe(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrRecipe(EC_IvtrRecipe other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRecipe.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRecipe.cs.meta new file mode 100644 index 0000000000..7554ac322d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRecipe.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8aa46bf1a8e2045fcb18711081dcfe56 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRefineTicket.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRefineTicket.cs new file mode 100644 index 0000000000..054a81b253 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRefineTicket.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrRefineTicket : EC_IvtrItem + { + public EC_IvtrRefineTicket(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrRefineTicket(EC_IvtrRefineTicket other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRefineTicket.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRefineTicket.cs.meta new file mode 100644 index 0000000000..416637606a --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRefineTicket.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4b2d8c8d5a4104436b97dfb062ddea9e \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRevScroll.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRevScroll.cs new file mode 100644 index 0000000000..d3a8b51c1e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRevScroll.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrRevScroll : EC_IvtrItem + { + public EC_IvtrRevScroll(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrRevScroll(EC_IvtrRevScroll other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRevScroll.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRevScroll.cs.meta new file mode 100644 index 0000000000..4bafc16c29 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrRevScroll.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 372c6fa94e6ba473a89724868d182446 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSharpener.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSharpener.cs new file mode 100644 index 0000000000..3cb60d730e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSharpener.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrSharpener : EC_IvtrItem + { + public EC_IvtrSharpener(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrSharpener(EC_IvtrSharpener other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSharpener.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSharpener.cs.meta new file mode 100644 index 0000000000..9630e67b8b --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSharpener.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3745d3b71429d4e70bd85ff957d53edd \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrShopToken.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrShopToken.cs new file mode 100644 index 0000000000..df78933a96 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrShopToken.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrShopToken : EC_IvtrItem + { + public EC_IvtrShopToken(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrShopToken(EC_IvtrShopToken other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrShopToken.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrShopToken.cs.meta new file mode 100644 index 0000000000..73579be3f6 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrShopToken.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: cbc68d3b08ef143159eed39309cbb601 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkillMat.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkillMat.cs new file mode 100644 index 0000000000..70163c6aec --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkillMat.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrSkillMat : EC_IvtrItem + { + public EC_IvtrSkillMat(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrSkillMat(EC_IvtrSkillMat other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkillMat.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkillMat.cs.meta new file mode 100644 index 0000000000..d709477560 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkillMat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8345b2a53fffb4e638d9712b6e9e49fa \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkilltome.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkilltome.cs new file mode 100644 index 0000000000..4198416cce --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkilltome.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrSkilltome : EC_IvtrItem + { + public EC_IvtrSkilltome(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrSkilltome(EC_IvtrSkilltome other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkilltome.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkilltome.cs.meta new file mode 100644 index 0000000000..247c268e85 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSkilltome.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0c332a9a7de2647368ec4fbfd1864bfe \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSpeaker.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSpeaker.cs new file mode 100644 index 0000000000..ecfb1b0ed9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSpeaker.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrSpeaker : EC_IvtrItem + { + public EC_IvtrSpeaker(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrSpeaker(EC_IvtrSpeaker other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSpeaker.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSpeaker.cs.meta new file mode 100644 index 0000000000..83cd26436e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrSpeaker.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f9c5f08a7605b4065bf7ec878319726b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrStone.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrStone.cs new file mode 100644 index 0000000000..f8347605b2 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrStone.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrStone : EC_IvtrItem + { + public EC_IvtrStone(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrStone(EC_IvtrStone other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrStone.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrStone.cs.meta new file mode 100644 index 0000000000..bbd09076b1 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrStone.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: f63e461e231d0493a91f04c79939de2d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTargetItem.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTargetItem.cs new file mode 100644 index 0000000000..a050b3d567 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTargetItem.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrTargetItem : EC_IvtrItem + { + public EC_IvtrTargetItem(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrTargetItem(EC_IvtrTargetItem other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTargetItem.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTargetItem.cs.meta new file mode 100644 index 0000000000..883a60b911 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTargetItem.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5d398d1de827b4c00a343b156823daab \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskDice.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskDice.cs new file mode 100644 index 0000000000..8640b0f0f8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskDice.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrTaskDice : EC_IvtrItem + { + public EC_IvtrTaskDice(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrTaskDice(EC_IvtrTaskDice other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskDice.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskDice.cs.meta new file mode 100644 index 0000000000..3f9092596f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskDice.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fbb2d62b01d4147cfa0ab3a7b7dac6aa \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskNmMatter.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskNmMatter.cs new file mode 100644 index 0000000000..beacce0272 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskNmMatter.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrTaskNmMatter : EC_IvtrItem + { + public EC_IvtrTaskNmMatter(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrTaskNmMatter(EC_IvtrTaskNmMatter other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskNmMatter.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskNmMatter.cs.meta new file mode 100644 index 0000000000..72e0db075c --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskNmMatter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 60f885de6744b42d6845b850338569e0 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskmatter.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskmatter.cs new file mode 100644 index 0000000000..4a47bd6643 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskmatter.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrTaskmatter : EC_IvtrItem + { + public EC_IvtrTaskmatter(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrTaskmatter(EC_IvtrTaskmatter other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskmatter.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskmatter.cs.meta new file mode 100644 index 0000000000..a1f695d266 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTaskmatter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ee5181c9a0786409fb452d21d947eab7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTossMat.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTossMat.cs new file mode 100644 index 0000000000..3d2f7480c3 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTossMat.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrTossMat : EC_IvtrItem + { + public EC_IvtrTossMat(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrTossMat(EC_IvtrTossMat other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTossMat.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTossMat.cs.meta new file mode 100644 index 0000000000..5465cc5143 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTossMat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d0862d72a75a24b049b47750d294ceb9 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTownscroll.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTownscroll.cs new file mode 100644 index 0000000000..8067c0d98e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTownscroll.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrTownscroll : EC_IvtrItem + { + public EC_IvtrTownscroll(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrTownscroll(EC_IvtrTownscroll other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTownscroll.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTownscroll.cs.meta new file mode 100644 index 0000000000..fb8bf7f071 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTownscroll.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c230794db6d284141bc37798ecdc3a19 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTransmitScroll.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTransmitScroll.cs new file mode 100644 index 0000000000..1d06d9a69f --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTransmitScroll.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrTransmitScroll : EC_IvtrItem + { + public EC_IvtrTransmitScroll(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrTransmitScroll(EC_IvtrTransmitScroll other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTransmitScroll.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTransmitScroll.cs.meta new file mode 100644 index 0000000000..f1acff0994 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrTransmitScroll.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bf880e0f7632c4c5aa8f6121e4bc6ce8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrType.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrType.cs similarity index 89% rename from Assets/PerfectWorld/Scripts/Managers/EC_IvtrType.cs rename to Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrType.cs index d95633329b..9b8c404d10 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrType.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrType.cs @@ -93,17 +93,28 @@ namespace BrewMonster.Scripts.Managers // int iWeaponReqLow; // int iWeaponReqHigh; }; - public struct IVTR_ESSENCE_DECORATION { - // TODO : implement data later - // int damage; - // int magic_damage; - // int defense; - // int armor; - // int resistance[NUM_MAGICCLASS]; + int damage; + int magic_damage; + int defense; + int armor; + int[] resistance; + public IVTR_ESSENCE_DECORATION(byte[] data) + { + Debug.Log("IVTR_ESSENCE_DECORATION: data.Length: " + data.Length); + CECDataReader dr = new (data, data.Length); + damage = dr.ReadInt(); + magic_damage = dr.ReadInt(); + defense = dr.ReadInt(); + armor = dr.ReadInt(); + resistance = new int[InventoryConst.NUM_MAGICCLASS]; + for(int i = 0; i < InventoryConst.NUM_MAGICCLASS; i++) + { + resistance[i] = dr.ReadInt(); + } + } }; - public struct IVTR_ESSENCE_ARMOR { // TODO : implement data later @@ -127,7 +138,6 @@ namespace BrewMonster.Scripts.Managers } } }; - public struct IVTR_ESSENCE_FASHION { // TODO : implement data later @@ -135,7 +145,6 @@ namespace BrewMonster.Scripts.Managers // unsigned short color; // unsigned short gender; }; - public struct IVTR_ESSENCE_FLYSWORD { // TODO : implement data later @@ -149,7 +158,6 @@ namespace BrewMonster.Scripts.Managers // float speed_increase; // float speed_increase2; }; - public struct IVTR_ESSENCE_WING { // TODO : implement data later @@ -158,21 +166,18 @@ namespace BrewMonster.Scripts.Managers // size_t mp_per_second; // float speed_increase; }; - public struct IVTR_ESSENCE_AUTOHP { // TODO : implement data later // int hp_left; // float trigger; }; - public struct IVTR_ESSENCE_AUTOMP { // TODO : implement data later // int mp_left; // float trigger; }; - public struct IVTR_ESSENCE_PETEGG { // TODO : implement data later @@ -191,13 +196,11 @@ namespace BrewMonster.Scripts.Managers // unsigned short skill_count; // wchar_t name[8]; }; - public struct IVTR_ESSENCE_DESTROYING { // TODO : implement data later // int tid; }; - public struct IVTR_ESSENCE_GOBLIN { struct _GOBLIN_DATA @@ -222,7 +225,6 @@ namespace BrewMonster.Scripts.Managers // int equip_cnt; // int skill_cnt; }; - public struct IVTR_ESSENCE_WEDDING_BOOKCARD { // TODO : implement data later @@ -230,7 +232,6 @@ namespace BrewMonster.Scripts.Managers // int month; // int day; }; - public struct IVTR_ESSENCE_WEDDING_INVITECARD { // TODO : implement data later @@ -241,7 +242,6 @@ namespace BrewMonster.Scripts.Managers // int scene; // int invitee; }; - public struct IVTR_ESSENCE_FORCE_TOKEN { // TODO : implement data later @@ -249,7 +249,6 @@ namespace BrewMonster.Scripts.Managers // int repu_total; // int repu_inc_ratio; }; - public struct IVTR_ESSENCE_MONSTERSPIRIT { // TODO : implement data later @@ -257,7 +256,6 @@ namespace BrewMonster.Scripts.Managers // int type; // int power; }; - public struct IVTR_ESSENCE_GENERALCARD { // TODO : implement data later @@ -271,10 +269,51 @@ namespace BrewMonster.Scripts.Managers // int rebirth_times; }; #pragma pack() + #endregion public static class EC_IvtrType { - + #region Equipment Mask 64 Bit Constants + public const long EQUIP_MASK64_WEAPON = 0x0000000000000001; + public const long EQUIP_MASK64_HEAD = 0x0000000000000002; + public const long EQUIP_MASK64_NECK = 0x0000000000000004; + public const long EQUIP_MASK64_SHOULDER = 0x0000000000000008; + public const long EQUIP_MASK64_BODY = 0x0000000000000010; + public const long EQUIP_MASK64_WAIST = 0x0000000000000020; + public const long EQUIP_MASK64_LEG = 0x0000000000000040; + public const long EQUIP_MASK64_FOOT = 0x0000000000000080; + public const long EQUIP_MASK64_WRIST = 0x0000000000000100; + public const long EQUIP_MASK64_FINGER1 = 0x0000000000000200; + public const long EQUIP_MASK64_FINGER2 = 0x0000000000000400; + public const long EQUIP_MASK64_PROJECTILE = 0x0000000000000800; + public const long EQUIP_MASK64_FLYSWORD = 0x0000000000001000; + public const long EQUIP_MASK64_FASHION_BODY = 0x0000000000002000; + public const long EQUIP_MASK64_FASHION_LEG = 0x0000000000004000; + public const long EQUIP_MASK64_FASHION_FOOT = 0x0000000000008000; + public const long EQUIP_MASK64_FASHION_WRIST = 0x0000000000010000; + public const long EQUIP_MASK64_RUNE = 0x0000000000020000; + public const long EQUIP_MASK64_BIBLE = 0x0000000000040000; + public const long EQUIP_MASK64_SPEAKER = 0x0000000000080000; + public const long EQUIP_MASK64_AUTOHP = 0x0000000000100000; + public const long EQUIP_MASK64_AUTOMP = 0x0000000000200000; + public const long EQUIP_MASK64_POCKET = 0x0000000000400000; + public const long EQUIP_MASK64_GOBLIN = 0x0000000000800000; + public const long EQUIP_MASK64_CERTIFICATE = 0x0000000001000000; + public const long EQUIP_MASK64_FASHION_HEAD = 0x0000000002000000; + public const long EQUIP_MASK64_FORCE_TICKET = 0x0000000004000000; + public const long EQUIP_MASK64_DYNSKILLEQUIP1 = 0x0000000008000000; + public const long EQUIP_MASK64_DYNSKILLEQUIP2 = 0x0000000010000000; + public const long EQUIP_MASK64_FASHION_WEAPON = 0x0000000020000000; + public const long EQUIP_MASK64_USED1 = 0x0000000040000000; + public const long EQUIP_MASK64_USED2 = 0x0000000080000000; + public const long EQUIP_MASK64_GENERALCARD1 = 0x0000000100000000; + public const long EQUIP_MASK64_GENERALCARD2 = 0x0000000200000000; + public const long EQUIP_MASK64_GENERALCARD3 = 0x0000000400000000; + public const long EQUIP_MASK64_GENERALCARD4 = 0x0000000800000000; + public const long EQUIP_MASK64_GENERALCARD5 = 0x0000001000000000; + public const long EQUIP_MASK64_GENERALCARD6 = 0x0000002000000000; + public const long EQUIP_MASK64_ALL = 0x0000003f3fffffff; + #endregion public static byte GetEquipLocationForItem(int templateId) { try diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrType.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrType.cs.meta new file mode 100644 index 0000000000..f3b1b3f25d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrType.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0d6b0a75085cc42469ae53d5f9a73deb \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnionscroll.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnionscroll.cs new file mode 100644 index 0000000000..bfbd189bc8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnionscroll.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrUnionscroll : EC_IvtrItem + { + public EC_IvtrUnionscroll(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrUnionscroll(EC_IvtrUnionscroll other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnionscroll.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnionscroll.cs.meta new file mode 100644 index 0000000000..db55422520 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnionscroll.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 32a4322d6b8154a7a916851714b261bc \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUniversalToken.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUniversalToken.cs new file mode 100644 index 0000000000..b92d7dc6d9 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUniversalToken.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrUniversalToken : EC_IvtrItem + { + public EC_IvtrUniversalToken(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrUniversalToken(EC_IvtrUniversalToken other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUniversalToken.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUniversalToken.cs.meta new file mode 100644 index 0000000000..09897c9502 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUniversalToken.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 339e47e7d10564c33ba1c024da3560e8 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnknown.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnknown.cs new file mode 100644 index 0000000000..9a11faf95d --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnknown.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrUnknown : EC_IvtrItem + { + public EC_IvtrUnknown(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrUnknown(EC_IvtrUnknown other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnknown.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnknown.cs.meta new file mode 100644 index 0000000000..39c294cdae --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrUnknown.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: aa277165d27084e1f88617516f495697 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWarTankCallin.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWarTankCallin.cs new file mode 100644 index 0000000000..b64255cb43 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWarTankCallin.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrWarTankCallin : EC_IvtrItem + { + public EC_IvtrWarTankCallin(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrWarTankCallin(EC_IvtrWarTankCallin other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWarTankCallin.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWarTankCallin.cs.meta new file mode 100644 index 0000000000..22a4b23913 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWarTankCallin.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b61a51beb0c3e4e7f936069474a9549d \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrWeapon.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeapon.cs similarity index 99% rename from Assets/PerfectWorld/Scripts/Managers/EC_IvtrWeapon.cs rename to Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeapon.cs index 6613a03129..e790fb4139 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrWeapon.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeapon.cs @@ -77,7 +77,7 @@ namespace PerfectWorld.Scripts.Managers public EC_IvtrWeapon(int tid, int expire_date) : base(tid, expire_date) { - m_iCID = ICID_WEAPON; + m_iCID = (int)InventoryClassId.ICID_WEAPON; elementdataman pDB = ElementDataManProvider.GetElementDataMan(); DATA_TYPE DataType = DATA_TYPE.DT_INVALID; m_pDBEssence = (WEAPON_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType); @@ -86,7 +86,7 @@ namespace PerfectWorld.Scripts.Managers m_iPileLimit = m_pDBEssence.pile_num_max; m_iPrice = m_pDBEssence.price; m_iShopPrice = m_pDBEssence.shop_price; - m_i64EquipMask = EC_IvtrEquip.ICID_WEAPON; + m_i64EquipMask = (long)EC_IvtrType.EQUIP_MASK64_WEAPON; m_iProcType = (int)m_pDBEssence.proc_type; FixProps = m_pDBEssence.fixed_props; diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeapon.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeapon.cs.meta new file mode 100644 index 0000000000..60ddf96e84 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeapon.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1cf2e151fb8e443f7a7bbae40715b41b \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingBookCard.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingBookCard.cs new file mode 100644 index 0000000000..3830a3dc63 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingBookCard.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrWeddingBookCard : EC_IvtrEquip + { + public EC_IvtrWeddingBookCard(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrWeddingBookCard(EC_IvtrWeddingBookCard other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingBookCard.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingBookCard.cs.meta new file mode 100644 index 0000000000..f28abbbcfa --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingBookCard.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 666c3ae30ba534a02992c0427e5a0e6a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingInviteCard.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingInviteCard.cs new file mode 100644 index 0000000000..df35857e6e --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingInviteCard.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrWeddingInviteCard : EC_IvtrEquip + { + public EC_IvtrWeddingInviteCard(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrWeddingInviteCard(EC_IvtrWeddingInviteCard other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingInviteCard.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingInviteCard.cs.meta new file mode 100644 index 0000000000..5c4612c4ec --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWeddingInviteCard.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 58cbf5818304d4f98a1e7361ced6f2c7 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWing.cs b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWing.cs new file mode 100644 index 0000000000..a5569ff068 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWing.cs @@ -0,0 +1,15 @@ +using BrewMonster.Scripts.Managers; +namespace PerfectWorld.Scripts.Managers +{ + public class EC_IvtrWing : EC_IvtrEquip + { + public EC_IvtrWing(int tid, int expire_date) : base(tid, expire_date) + { + } + + public EC_IvtrWing(EC_IvtrWing other) : base(other) + { + } + } +} + diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWing.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWing.cs.meta new file mode 100644 index 0000000000..36cc95f281 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrItem/EC_IvtrWing.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7f778acb7758b46a4bb1585e72478993 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrType.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrType.cs.meta deleted file mode 100644 index 23d9a53190..0000000000 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrType.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 5e2d99e48520e824c9a27badd6c75625 \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrWeapon.cs.meta b/Assets/PerfectWorld/Scripts/Managers/EC_IvtrWeapon.cs.meta deleted file mode 100644 index 0d5674d09d..0000000000 --- a/Assets/PerfectWorld/Scripts/Managers/EC_IvtrWeapon.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 6a4959477dd834d3089fcc85d831669a \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs b/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs index eb87632482..8324928321 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs @@ -509,6 +509,7 @@ namespace PerfectWorld.Scripts.Managers if (pHost != null && pHost.GetSelectedTarget() == cid) pHost.SelectTarget(0); + UnityGameSession.Instance.GetC2SCmdCache().RemovePlayerBaseInfo(cid); // Release player resource if (pPlayer != null) { @@ -522,49 +523,6 @@ namespace PerfectWorld.Scripts.Managers } } - //private cmd_object_move ConvertToStruct(byte[] bytes) - //{ - // if (bytes.Length < Marshal.SizeOf()) - // { - // return default; - // } - - // cmd_object_move result = new cmd_object_move(); - // int preLenghtData = 0; - // int lenghtDataType = Marshal.SizeOf(); - // byte[] arrByteData = GetBytes(bytes, lenghtDataType, preLenghtData); - // result.id = BitConverter.ToInt32(arrByteData); - - // preLenghtData += lenghtDataType; - // lenghtDataType = Marshal.SizeOf(); - // arrByteData = GetBytes(bytes, lenghtDataType, preLenghtData); - // result.dest_X = BitConverter.ToSingle(arrByteData); - - // preLenghtData += lenghtDataType; - // lenghtDataType = Marshal.SizeOf(); - // arrByteData = GetBytes(bytes, lenghtDataType, preLenghtData); - // result.dest_Y = BitConverter.ToSingle(arrByteData); - - // preLenghtData += lenghtDataType; - // lenghtDataType = Marshal.SizeOf(); - // arrByteData = GetBytes(bytes, lenghtDataType, preLenghtData); - // result.dest_Z = BitConverter.ToSingle(arrByteData); - - // preLenghtData += lenghtDataType; - // lenghtDataType = Marshal.SizeOf(); - // arrByteData = GetBytes(bytes, lenghtDataType, preLenghtData); - // result.use_time = BitConverter.ToUInt16(arrByteData); - - // preLenghtData += lenghtDataType; - // lenghtDataType = Marshal.SizeOf(); - // arrByteData = GetBytes(bytes, lenghtDataType, preLenghtData); - // result.sSpeed = BitConverter.ToInt16(arrByteData); - - // preLenghtData += lenghtDataType; - // result.move_mode = bytes[preLenghtData + 1]; - // return result; - //} - private byte[] GetBytes(byte[] bytes, int length, int index) { byte[] arrByteData = new byte[length]; @@ -596,7 +554,7 @@ namespace PerfectWorld.Scripts.Managers case long value when value == EC_MsgDef.MSG_PM_PLAYERBASEINFO: cid = (int)((playerbaseinfo_re)Msg.dwParam1).Player.id; // Xoá khỏi cache - //g_pGame.GetGameSession().GetC2SCmdCache().RemovePlayerBaseInfo(cid); + UnityGameSession.Instance.GetC2SCmdCache().RemovePlayerBaseInfo(cid); break; /*case long value when value == EC_MsgDef.MSG_PM_PLAYERCUSTOM: diff --git a/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs b/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs index 3c0b71b11b..04b76b0d7e 100644 --- a/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs +++ b/Assets/PerfectWorld/Scripts/Move/CECPlayer.cs @@ -94,7 +94,7 @@ namespace BrewMonster public MOVECONST m_MoveConst; // Const used when moving control public Move_Mode m_MoveMode; - public MOVECONST[] aMoveConsts = new MOVECONST[PROFESSION.NUM_PROFESSION * GENDER.NUM_GENDER] + public MOVECONST[] aMoveConsts = new MOVECONST[(int)PROFESSION.NUM_PROFESSION * GENDER.NUM_GENDER] { // ÎäÏÀ // fStepHei fMinAirHei fMinWaterHei fShoreDepth fWaterSurf @@ -135,7 +135,7 @@ namespace BrewMonster new MOVECONST(0.8f, 1.6f, 0.3f, 1.5f, 0.55f), }; - public A3DVECTOR3[] aExts = new A3DVECTOR3[PROFESSION.NUM_PROFESSION * GENDER.NUM_GENDER] + public A3DVECTOR3[] aExts = new A3DVECTOR3[(int)PROFESSION.NUM_PROFESSION * GENDER.NUM_GENDER] { new A3DVECTOR3(0.4f, 0.9f, 0.4f), // ÎäÏÀ new A3DVECTOR3(0.3f, 0.85f, 0.3f), @@ -1210,10 +1210,10 @@ namespace BrewMonster // 空中动作 / Air action string szActionMiddleName = null; if ((m_wingType == enumWingType.WINGTYPE_WING && IsFlying()) || - (m_iProfession == PROFESSION.PROF_ANGEL) || - (m_iProfession == PROFESSION.PROF_ARCHOR) || - (m_iProfession == PROFESSION.PROF_MONK) || - (m_iProfession == PROFESSION.PROF_GHOST)) + (m_iProfession == (int)PROFESSION.PROF_ANGEL) || + (m_iProfession == (int)PROFESSION.PROF_ARCHOR) || + (m_iProfession == (int)PROFESSION.PROF_MONK) || + (m_iProfession == (int)PROFESSION.PROF_GHOST)) { szActionMiddleName = "_空中翅膀"; // Air with wings / 空中翅膀 } diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs index 306badbcb8..d44e949500 100644 --- a/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommand.cs @@ -1453,6 +1453,13 @@ namespace CSNetwork.S2CCommand public int idTask; } + public struct NPCSevMakeItemCONTENT + { + public int idSkill; + public int idItem; + public uint dwCount; + } + [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SevLearnSkillCONTENT { @@ -1494,6 +1501,75 @@ namespace CSNetwork.S2CCommand public ushort index; public int item_id; }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_player_give_present + { + public int roleid; //ÔùÓè¶ÔÏóµÄroleid + public int mail_id; //Ë÷È¡ÎïÆ·ÓʼþµÄË÷Òý£¬Ã»ÓеĻ°Îª-1 + public int goods_id; //ÔùÓèÎïÆ·µÄid + public int goods_index; //ÔùÓèÎïÆ·ÔÚÉ̳ÇÖеÄË÷Òý + public int goods_slot; //ÔùÓèÎïÆ·µÄÏúÊÛÐÅÏ¢Ë÷Òý + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_enter_sanctuary + { + public int id; // self id or pet id. + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_enter_instance + { + public int iTransIndex; + public int idInst; + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_active_rush_fly + { + public int is_active; + }; + + /* Categories of pet_cmd: + pet_cmd = 1 Attack the specified target, requires a valid target. + Parameter: char, pvp mask for attack protection status. + + pet_cmd = 2 Change pet follow behavior, target is ignored. + Parameter: int + 0 = follow the player (default) + 1 = stay at current position + When this command is issued, it attempts to interrupt the pet’s current action + and perform the newly assigned follow behavior. + + pet_cmd = 3 Change pet combat behavior, target is ignored. + Parameter: int + 0 = Defensive mode — counterattack when hit, and counterattack when the owner is hit + (currently not implemented) + 1 = Aggressive mode — automatically attacks enemies within range + 2 = Passive mode — will not react unless commanded by the player + + pet_cmd = 4 Request pet to use a skill; target represents the skill’s target. + Parameter: int — ID of the skill to use + Parameter: char — pvp mask for attack protection status + + pet_cmd = 5 Request pet to auto-cast a skill, target ignored. + Parameter: int — ID of the skill to auto-cast + if the skill ID is 0, auto-casting is disabled. + */ + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_pet_ctrl + { + public int target; // The target of the operation. If no target is required, set the command’s target to 0. + public int pet_cmd; // Control commands for the pet + //char buf[]; // Parameters of the pet control commands + }; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_query_faction_pvp_info + { + public int faction_id; + }; } // Player and NPC state \ 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 index 65734bd3f7..705cfde58e 100644 --- a/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommandFactory.cs +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/C2SCommand/C2SCommandFactory.cs @@ -268,29 +268,7 @@ namespace CSNetwork.C2SCommand }; return SerializeCommand(CommandID.STOP_MOVE, cmd); } - public static Octets CreatePlayerCastSkill(int idSkill, byte byPVPMask, int iNumTarget, int aTargets) - { - var cmd = new CMD_CastSkill - { - skillId = idSkill, - pvpMask = byPVPMask, - targetCount = (byte)iNumTarget, - targets = null - }; - if (iNumTarget > 0) - { - if (iNumTarget > 0) - { - cmd.targets = new int[iNumTarget]; - cmd.targets[0] = aTargets; - } - } - - var cmdBuf = SerializeCommand(CommandID.CAST_SKILL, cmd); - return cmdBuf; - } - - public static Octets CreatePlayerCastInstantSkill(int idSkill, byte byPVPMask, int iNumTarget, int aTargets) + public static Octets CreatePlayerCastSkill(int idSkill, byte byPVPMask, int iNumTarget, int[] aTargets) { var cmd = new CMD_CastSkill { @@ -302,7 +280,32 @@ namespace CSNetwork.C2SCommand if (iNumTarget > 0) { cmd.targets = new int[iNumTarget]; - cmd.targets[0] = aTargets; + for (int i = 0; i < iNumTarget; i++) + { + cmd.targets[i] = aTargets[i]; + } + } + + var cmdBuf = SerializeCommand(CommandID.CAST_SKILL, cmd); + return cmdBuf; + } + + public static Octets CreatePlayerCastInstantSkill(int idSkill, byte byPVPMask, int iNumTarget, int[] aTargets) + { + var cmd = new CMD_CastSkill + { + skillId = idSkill, + pvpMask = byPVPMask, + targetCount = (byte)iNumTarget, + targets = null + }; + if (iNumTarget > 0) + { + cmd.targets = new int[iNumTarget]; + for(int i = 0; i < iNumTarget; i++) + { + cmd.targets[i] = aTargets[i]; + } } var cmdBuf = SerializeCommand(CommandID.CAST_INSTANT_SKILL, cmd); @@ -366,7 +369,7 @@ namespace CSNetwork.C2SCommand }; return SerializeCommand(CommandID.PICKUP, cmd); } - public static Octets CreateCheckSecurityPassWd(string password) + public static Octets c2s_SendCmdOpenFashionTrash(string password) { // Calculate password length (similar to C++ strlen) uint passwdSize = 0; @@ -391,11 +394,11 @@ namespace CSNetwork.C2SCommand return octets; } - public static Octets CreateQueryPlayerCash() + public static Octets c2s_SendCmdQueryCashInfo() { return SerializeCommand(CommandID.QUERY_CASH_INFO); } - public static Octets CreateEquipItem(byte iIvtrIdx, byte iEquipIdx) + public static Octets c2s_SendCmdEquipItem(byte iIvtrIdx, byte iEquipIdx) { var cmd = new CMD_EquipItem { @@ -405,7 +408,7 @@ namespace CSNetwork.C2SCommand return SerializeCommand(CommandID.EQUIP_ITEM, cmd); } - public static Octets CreateGetInventoryDetail(byte byPackage) + public static Octets c2s_SendCmdGetIvtrDetailData(byte byPackage) { var cmd = new CMD_GetInventoryDetail { @@ -414,7 +417,7 @@ namespace CSNetwork.C2SCommand return SerializeCommand(CommandID.GET_IVTR_DETAIL, cmd); } - public static Octets CreateReviveBase(int param) + public static Octets c2s_SendCmdReviveVillage(int param) { var cmd = new cmd_revive { @@ -422,7 +425,7 @@ namespace CSNetwork.C2SCommand }; return SerializeCommand(CommandID.REVIVE_VILLAGE, cmd); } - public static Octets CreateReviveItem(int param) + public static Octets c2s_SendCmdReviveItem(int param) { var cmd = new cmd_revive { @@ -700,6 +703,25 @@ namespace CSNetwork.C2SCommand return octets; } + + public static Octets CreateNPCSevMakeItemCmd(int idSkill, int idItem, uint dwCount) + { + var cmd = new cmd_sevnpc_serve + { + service_type = NPC_service_type.GP_NPCSEV_MAKEITEM, + len = (uint)Marshal.SizeOf() + }; + + NPCSevMakeItemCONTENT content = new NPCSevMakeItemCONTENT() + { + idSkill = idSkill, + idItem = idItem, + dwCount = dwCount + }; + + return SerializeCommand(CommandID.SEVNPC_SERVE, cmd, content); + } + public static Octets CreateEmoteActionCmd(int wPose) { cmd_emote_action pCmd = new cmd_emote_action() @@ -758,7 +780,7 @@ namespace CSNetwork.C2SCommand return SerializeCommand(CommandID.AUTO_TEAM_SET_GOAL, pCmd); } - public static Octets c2s_CmdGatherMaterial(int idMatter, int iToolPack, int iToolIdx, int idTool, int idTask) + public static Octets c2s_SendCmdGatherMaterial(int idMatter, int iToolPack, int iToolIdx, int idTool, int idTask) { var cmd = new cmd_gather_material { @@ -802,5 +824,55 @@ namespace CSNetwork.C2SCommand pCmd.byCount = byCount; return SerializeCommand(CommandID.USE_ITEM, pCmd); } + + public static Octets CreateGivePresentCmd(int roleid, int mail_id, int goods_id, int goods_index, int goods_slot) + { + cmd_player_give_present pCmd = new cmd_player_give_present(); + pCmd.roleid = roleid; + pCmd.mail_id = mail_id; + pCmd.goods_id = goods_id; + pCmd.goods_index = goods_index; + pCmd.goods_slot = goods_slot; + return SerializeCommand(CommandID.PLAYER_GIVE_PRESENT, pCmd); + } + + public static Octets CreateEnterSanctuaryCmd(int id) + { + cmd_enter_sanctuary pCmd = new cmd_enter_sanctuary(); + pCmd.id = id; + return SerializeCommand(CommandID.ENTER_SANCTUARY, pCmd); + } + + public static Octets CreateEnterInstanceCmd(int iTransIdx, int idInst) + { + cmd_enter_instance pCmd = new cmd_enter_instance(); + pCmd.iTransIndex = iTransIdx; + pCmd.idInst = idInst; + return SerializeCommand(CommandID.ENTER_INSTANCE, pCmd); + } + + public static Octets CreateActiveRushFlyCmd(bool bActive) + { + cmd_active_rush_fly pCmd = new cmd_active_rush_fly(); + pCmd.is_active = bActive ? 1 : 0; + return SerializeCommand(CommandID.ACTIVE_RUSH_FLY, pCmd); + } + + public static Octets CreatePetCtrlCmd(int idTarget, int cmd, byte[] pParamBuf, int iParamLen) + { + cmd_pet_ctrl pCmd = new cmd_pet_ctrl(); + pCmd.target = idTarget; + pCmd.pet_cmd = cmd; + var tempOctets = SerializeCommand(CommandID.PET_CTRL, pCmd); + tempOctets.Insert(tempOctets.Size + 1, pParamBuf); + return tempOctets; + } + + public static Octets CreateQueryFactionPVPInfo(int faction_id) + { + cmd_query_faction_pvp_info pCmd = new cmd_query_faction_pvp_info(); + pCmd.faction_id = faction_id; + return SerializeCommand(CommandID.QUERY_MAFIA_PVP_INFO, pCmd); + } } } diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs index ca80c04f61..61b616ef62 100644 --- a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GPDataType.cs @@ -1369,6 +1369,30 @@ namespace CSNetwork.GPDataType public byte byPackage; public byte bySlot; } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_produce_start + { + public ushort use_time; + public ushort count; + public int type; + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_produce_once + { + public int type; + public uint amount; + public uint slot_amount; + public byte where; // Which package: 0 standard, 2 trash, 1 equip + public byte index; // Which slot in that package + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct cmd_produce_null + { + public int type; + } [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct info_matter { diff --git a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs index f1a05e4146..adef4669ff 100644 --- a/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/GameSession.cs @@ -1,1462 +1,1521 @@ -using BrewMonster; -using BrewMonster.Managers; -using BrewMonster.Network; -using BrewMonster.Scripts.Skills; -using BrewMonster.UI; -using CSNetwork.C2SCommand; -using CSNetwork.GPDataType; -using CSNetwork.Protocols; -using CSNetwork.Protocols.RPCData; -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using UnityEngine; -using CommandID = CSNetwork.GPDataType.CommandID; - -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; - private int m_idLastSelTarget = 0; // ID of selected item last time - - CECStringTab m_ErrorMsgs; - - // 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 static SynchronizationContext Context; - -#if UNITY_EDITOR - public bool isDebug; - public bool IsDebug - { - get => isDebug; - set => isDebug = value; - } -#endif - - - 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 RoleInfo GetRoleInfo() - { - return _selectedRole; - } - - 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 RequestQueryPlayerCash() - { - gamedatasend gamedatasendRequest = new gamedatasend(); - gamedatasendRequest.Data = C2SCommandFactory.CreateQueryPlayerCash(); - SendProtocol(gamedatasendRequest); - } - - 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 RequestReviveBase(int param = 0) - { - gamedatasend gamedatasendRequest = new gamedatasend(); - gamedatasendRequest.Data = C2SCommandFactory.CreateReviveBase(param); - SendProtocol(gamedatasendRequest); - } - public void RequestReviveItem(int param = 0) - { - gamedatasend gamedatasendRequest = new gamedatasend(); - gamedatasendRequest.Data = C2SCommandFactory.CreateReviveBase(param); - SendProtocol(gamedatasendRequest); - } - public void RequestReviveByPlayer(int param = 0) - { - gamedatasend gamedatasendRequest = new gamedatasend(); - gamedatasendRequest.Data = C2SCommandFactory.CreateReviveBase(param); - SendProtocol(gamedatasendRequest); - } - - - public void RequestMallShopping(uint count, CMD_MallShopping.goods[] goodsArray) - { - gamedatasend gamedatasendRequest = new gamedatasend(); - gamedatasendRequest.Data = CSNetwork.C2SCommand.C2SCommandFactory.CreateGetMallShopping(count, goodsArray); - SendProtocol(gamedatasendRequest); - } - public void c2s_CmdGatherMaterial(int idMatter, int iToolPack, int idToolIndex, int idTool, int idTask) - { - gamedatasend gamedatasendRequest = new gamedatasend(); - gamedatasendRequest.Data = CSNetwork.C2SCommand.C2SCommandFactory.c2s_CmdGatherMaterial(idMatter, iToolPack, idToolIndex, idTool, idTask); - SendProtocol(gamedatasendRequest); - } - - 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; - case ProtocolType.PROTOCOL_PLAYERBASEINFO_RE: - OnPrtcPlayerBaseInfoRe(protocol); - break; - case ProtocolType.PROTOCOL_GETUICONFIG_RE: OnPrtcGetConfigRe(protocol); break; - - case ProtocolType.PROTOCOL_AUTOTEAMSETGOAL_RE: - { - // CECAutoTeam pAutoTeam = CECGameRun.Instance.GetHostPlayer().GetAutoTeam(); - // if( pAutoTeam !=null) - // pAutoTeam.OnPrtcAutoTeamSetGoalRe((AutoTeamSetGoal_Re)protocol); - } - break; - - default: - _logger.Log(LogType.Warning, $"Received unhandled protocol type: {protocol.GetPType()}"); - break; - } - } - - private void HandleServerDataSend(gamedatasend protocol) - { - 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); - //sss -#if UNITY_EDITOR - if (isDebug) - { - BMLogger.LogError($"### GameDataSend: CMDID {pCmdHeader}"); - } -#endif - 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: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERINFO, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, - pCmdHeader, iHostID); - 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)) - { - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCMOVE, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf, - pCmdHeader); - } - - break; - case CommandID.OBJECT_STOP_MOVE: - { - int id1 = GPDataTypeHelper.FromBytes(pDataBuf); - - if (ISPLAYERID(id1)) - { - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERSTOPMOVE, (int)MANAGER_INDEX.MAN_PLAYER, -1, - pDataBuf, pCmdHeader); - } - else if (ISNPCID(id1)) - { - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCSTOPMOVE, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf, - pCmdHeader); - } - - break; - } - case CommandID.OBJECT_LEAVE_SLICE: - { - int id = GPDataTypeHelper.FromBytes(pDataBuf); - if (ISPLAYERID(id)) - { - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERRUNOUT, (int)MANAGER_INDEX.MAN_PLAYER, -1, - pDataBuf, pCmdHeader); - } - else if (ISNPCID(id)) - { - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCRUNOUT, (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: - 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: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ITEMOPERATION, (int)MANAGER_INDEX.MAN_PLAYER, 0, - pDataBuf, pCmdHeader); - break; - case CommandID.PLAYER_CASH: - { - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_IVTRINFO, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, - pCmdHeader, iHostID); - 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: - case CommandID.HOST_OBTAIN_ITEM: - // case CommandID.PRODUCE_ONCE: - case CommandID.TASK_DELIVER_ITEM: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_PICKUPITEM, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, - pCmdHeader); - break; - case CommandID.MATTER_PICKUP: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PICKUPMATTER, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - break; - case CommandID.PICKUP_MONEY: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_PICKUPMONEY, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, - pCmdHeader); - break; - case CommandID.HOST_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.PLAYER_DIED: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERDIED, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - break; - case CommandID.HOST_DIED: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_DIED, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.PLAYER_REVIVE: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERREVIVE, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - break; - case CommandID.NOTIFY_HOSTPOS: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_GOTO, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - 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: - 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.BE_HURT: - case CommandID.HURT_RESULT: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_HURTRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, - pCmdHeader); - break; - case CommandID.OBJECT_ATTACK_RESULT: - //int id = GPDataTypeHelper.FromBytes(pDataBuf); - cmd_object_atk_result pCmdAtk = GPDataTypeHelper.FromBytes(pDataBuf); - //BMLogger.LogError($"OBJECT_ATTACK_RESULT: npc ? " + ISNPCID(id)); - - if (ISPLAYERID(pCmdAtk.attacker_id)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERATKRESULT, MANAGER_INDEX.MAN_PLAYER, -1, - pDataBuf, pCmdHeader); - else if (ISNPCID(pCmdAtk.attacker_id)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCATKRESULT, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); - break; - case CommandID.HOST_ATTACKRESULT: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ATKRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, - pCmdHeader); - break; - case CommandID.HOST_ATTACKED: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ATTACKED, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, - pCmdHeader); - break; - - case CommandID.ERROR_MESSAGE: - { - int errRaw = BitConverter.ToInt32(pDataBuf, 0); - // Note: _logger may be configured as a file logger via SetLogPath(), so also log to console for visibility. - _logger.Info($"### GameDataSend: ERROR_MESSAGE: {errRaw}"); -#if UNITY_EDITOR - BMLogger.LogError($"### GameDataSend: ERROR_MESSAGE: {errRaw}"); -#endif - cmd_error_msg pCmd = GPDataTypeHelper.FromBytes(pDataBuf); -#if UNITY_EDITOR - BMLogger.LogError($"### GameDataSend: ERROR_MESSAGE parsed iMessage={pCmd.iMessage}"); -#endif - - if (pCmd.iMessage != 0) - { - // string szMsg = m_ErrorMsgs.GetWideString(pCmd.iMessage); - // if (string.IsNullOrEmpty(szMsg)) - // BMLogger.LogError("SERVER - unknown error !"); - //else if (pCmd.iMessage != 2) - //g_pGame.GetGameRun().AddChatMessage(szMsg, GP_CHAT_MISC); - } - - if (pCmd.iMessage == 2) - { - // Attack target is too far - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_TARGETISFAR, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - } - else if (pCmd.iMessage == 20) - { - // Failed to cast skill - //pGameRun.PostMessage(MSG_PM_CASTSKILL, MAN_PLAYER, 0, (DWORD)pDataBuf, pCmdHeader.cmd); - } - else if (pCmd.iMessage == 133 || pCmd.iMessage == 134) - { - // deal failed - //pGameRun.PostMessage(MSG_HST_BUY_SELL_FAIL, MAN_PLAYER, 0, (DWORD)pDataBuf, pCmdHeader.cmd); - } - else if (pCmd.iMessage == 158) - { - // µ±Ç°»ãÂʲ»¶Ô£¬ÖØÐÂÈ¡»ãÂÊ - //c2s_CmdGetCashMoneyRate(); - } - else if (pCmd.iMessage == 108 /*&& pGameRun.GetHostPlayer().IsInKingService()*/) - { - /* CECGameUIMan* pGameUI = pGameRun.GetUIManager().GetInGameUIMan(); - if (pGameUI) - pGameUI.EndNPCService();*/ - } - else if - (pCmd.iMessage == 108 /*&& pGameRun.GetHostPlayer().GetOfflineShopCtrl().GetNPCSevFlag() != COfflineShopCtrl::NPCSEV_NULL*/ - ) - { - /* CECGameUIMan* pGameUI = pGameRun.GetUIManager().GetInGameUIMan(); - if (pGameUI) - pGameUI.EndNPCService();*/ - } - else if (pCmd.iMessage == 175) - { - //c2s_CmdQueryParallelWorld(); - } - else if (pCmd.iMessage == 6) - { - //AP_ActionEvent(AP_EVENT_CANNOTPICKUP); - } - - break; - } - case CommandID.SELECT_TARGET: - case CommandID.UNSELECT: - - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_SELTARGET, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, - pCmdHeader); - break; - case CommandID.NPC_DIED: - case CommandID.NPC_DIED2: - - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCDIED, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); - break; - case CommandID.OBJECT_DISAPPEAR: - { - int lenghtDataType1 = Marshal.SizeOf(); - byte[] arrByteData1 = GetBytes(pDataBuf, lenghtDataType1, 0); - int objectId = BitConverter.ToInt32(arrByteData1); - if (ISPLAYERID(objectId)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERDISAPPEAR, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - else if (ISNPCID(objectId)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCDISAPPEAR, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); - else if (ISMATTERID(objectId)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_MM_MATTERDISAPPEAR, MANAGER_INDEX.MAN_MATTER, 0, pDataBuf, pCmdHeader); - - break; - } - case CommandID.SELF_INFO_00: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_INFO00, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, - pCmdHeader); - break; - case CommandID.NPC_GREETING: - { - // If this greeting is from the skill-learn NPC, record it (C++ skill dialog relies on this). - try - { - cmd_npc_greeting greet = GPDataTypeHelper.FromBytes(pDataBuf); - CECHostSkillModel.Instance.OnNpcGreeting(greet.idObject); - } - catch (Exception ex) - { - _logger.Log(LogType.Warning, $"Failed to parse NPC_GREETING payload: {ex.Message}"); - } - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_NPCGREETING, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - } - case CommandID.ACTIVATE_WAYPOINT: - case CommandID.WAYPOINT_LIST: - - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_WAYPOINT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.SERVER_TIME: - { - cmd_server_time pcmd_server_time = GPDataTypeHelper.FromBytes(pDataBuf); - EC_ManMessage.PostMessage(EC_MsgDef.MSG_SERVERTIME, -1, 0, pcmd_server_time.time, pcmd_server_time.timebias); - break; - } - case CommandID.SCENE_SERVICE_NPC_LIST: - { - CECHostSkillModel.Instance.RecvNPCServiceList(protocol.Data); - break; - } - case CommandID.SKILL_DATA: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_SKILLDATA, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.OBJECT_CAST_SKILL: - case CommandID.OBJECT_CAST_INSTANT_SKILL: - case CommandID.OBJECT_CAST_POS_SKILL: - { - cmd_object_cast_skill pCmd2 = GPDataTypeHelper.FromBytes(pDataBuf,true); - if (ISPLAYERID(pCmd2.caster)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_CASTSKILL, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - else if (ISNPCID(pCmd2.caster)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCCASTSKILL, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); - - break; - } - case CommandID.LEVEL_UP: - { - cmd_level_up pCmdLevelUp = GPDataTypeHelper.FromBytes(pDataBuf); ; - if (ISPLAYERID(pCmdLevelUp.id)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERLEVELUP, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - else if (ISNPCID(pCmdLevelUp.id)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCLEVELUP, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); - break; - } - case CommandID.HOST_START_ATTACK: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_STARTATTACK, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); - break; - case CommandID.HOST_STOPATTACK: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_STOPATTACK, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); - break; - case CommandID.HOST_SKILL_ATTACK_RESULT: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_SKILLRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.CHANGE_FACE_START: - case CommandID.CHANGE_FACE_END: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_CHANGEFACE, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); - break; - case CommandID.ENCHANT_RESULT: - cmd_enchant_result pCmd3 = GPDataTypeHelper.FromBytes(pDataBuf); - if (ISPLAYERID(pCmd3.caster)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_ENCHANTRESULT, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - else if (ISNPCID(pCmd3.caster)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_ENCHANTRESULT, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); - break; - case CommandID.SKILL_PERFORM: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_CASTSKILL, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.SET_COOLDOWN: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_SETCOOLTIME, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.COMBO_SKILL_PREPARE: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_COMBO_SKILL_PREPARE, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); - break; - case CommandID.PLAYER_EXT_PROP_BASE: - case CommandID.PLAYER_EXT_PROP_MOVE: - case CommandID.PLAYER_EXT_PROP_ATK: - case CommandID.PLAYER_EXT_PROP_DEF: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYEREXTPROP, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - break; - case CommandID.OWN_EXT_PROP: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_OWNEXTPROP, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.OBJECT_DO_EMOTE: - case CommandID.OBJECT_EMOTE_RESTORE: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERDOEMOTE, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - break; - case CommandID.OUT_OF_SIGHT_LIST: - { - cmd_out_of_sight_list pCmd5 = default; - pCmd5.uCount = GPDataTypeHelper.FromBytes(pDataBuf); - int offset2 = sizeof(uint); - pCmd5.idList = new int[pCmd5.uCount]; - for (int i = 0; i < pCmd5.uCount; i++) - { - pCmd5.idList[i] = GPDataTypeHelper.FromBytes(pDataBuf, offset2); - offset2 += 4;//sizeof int; - } - - for (uint n = 0; n < pCmd5.uCount; n++) - { - if (ISPLAYERID(pCmd5.idList[n])) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYEROUTOFVIEW, MANAGER_INDEX.MAN_PLAYER, -1, pCmd5.idList[n], pCmdHeader); - else if (ISNPCID(pCmd5.idList[n])) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCOUTOFVIEW, MANAGER_INDEX.MAN_NPC, 0, pCmd5.idList[n], pCmdHeader); - else if (ISMATTERID(pCmd5.idList[n])) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_MM_MATTEROUTOFVIEW, MANAGER_INDEX.MAN_MATTER, 0, pCmd5.idList[n], pCmdHeader); - } - - break; - } - case CommandID.PLAYER_GATHER_START: - case CommandID.PLAYER_GATHER_STOP: - case CommandID.MINE_GATHERED: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERGATHER, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - break; - case CommandID.COOLTIME_DATA: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_COOLTIMEDATA, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.OBJECT_TAKEOFF: - { - cmd_object_takeoff pCmdTakeOff = GPDataTypeHelper.FromBytes((byte[])pDataBuf); - if (ISPLAYERID(pCmdTakeOff.object_id)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERFLY, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - break; - } - case CommandID.OBJECT_LANDING: - { - cmd_object_landing pCmdLanding = GPDataTypeHelper.FromBytes((byte[])pDataBuf); - if (ISPLAYERID(pCmdLanding.object_id)) - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERFLY, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); - break; - } - case CommandID.HOST_RUSH_FLY: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERFLY, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - case CommandID.FLYSWORD_TIME: - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_FLYSWORDTIME, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - - case CommandID.LEARN_SKILL: - BMLogger.LogError("### GameDataSend: LEARN_SKILL"); - EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_LEARNSKILL, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); - break; - default: -#if UNITY_EDITOR - if (isDebug) - { - BMLogger.LogError($"### GameDataSend: Unhandled CMDID {pCmdHeader} (payloadBytes={pDataBuf?.Length ?? 0})"); - } -#endif - break; - } - } - - - 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 & 0x80000000) != 0) && ((id & 0x40000000) == 0); - public bool ISMATTERID(int id) => ((id) & 0xC0000000) == 0xC0000000; - 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_CmdCastSkill(int idSkill, byte byPVPMask, int iNumTarget, int aTargets) - { - gamedatasend gamedatasend = new gamedatasend(); - - gamedatasend.Data = - C2SCommandFactory.CreatePlayerCastSkill(idSkill, byPVPMask, iNumTarget, aTargets); - - SendProtocol(gamedatasend); - } - - public void c2s_CmdCastInstantSkill(int idSkill, byte byPVPMask, int iNumTarget, int aTargets) - { - gamedatasend gamedatasend = new gamedatasend(); - - gamedatasend.Data = - C2SCommandFactory.CreatePlayerCastInstantSkill(idSkill, byPVPMask, iNumTarget, aTargets); - - SendProtocol(gamedatasend); - } - - public void c2s_CmdCastPosSkill(int idSkill, Vector3 vDest, byte byPVPMask, int iNumTarget, int aTargets) - { - gamedatasend gamedatasend = new gamedatasend(); - - gamedatasend.Data = - C2SCommandFactory.CreatePlayerCastPosSkill(idSkill, vDest, byPVPMask, iNumTarget, aTargets); - - SendProtocol(gamedatasend); - } - public void c2s_SendCmdContinueAction() - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.CONTINUE_ACTION); - 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 c2s_CmdSendEnterPKPrecinctint() - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.ENTER_PK_PROTECTED); - 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); - } - public void LoadConfigData() - { - getuiconfig p = new getuiconfig(); - p.Roleid = m_iCharID; - SendProtocol(p); - } - 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 OnPrtcGetConfigRe(Protocol pProtocol) - { - getuiconfig_re p = (getuiconfig_re)pProtocol; - if (p.Result != (int)ErrCode.ERR_SUCCESS) - BMLogger.LogError("CECGameSession::OnPrtcGetConfigRe, link return error code of " + p.Result); - else - { - if (!CECGameRun.Instance.LoadConfigsFromServer(p.UiConfig.RawBuffer, p.UiConfig.Size)) - { - // if load failed then use current setting directly - //TODO : fix later - EC_Game.GetConfigs().ApplyUserSetting(); - } - - // Now, Get config data request is sent after all host initial data ready. - // so when we receive this reply, we can do some last work before game - // really starts. Maybe it's not the best place to do these work, but - // now we do it here. - // Enalbe game UI - CECGameUIMan pGameUI = (CECGameUIMan)EC_Game.GetGameRun().GetUIManager().GetInGameUIMan(); - if (pGameUI != null) - { - pGameUI.EnableUI(true); - - // Get referral name for adding friend or other display - //TODO: a Hung lam phan select role info di - /* RoleInfo info = EC_Game.GetGameRun().GetSelectedRoleInfo(); - if (info.referrer_role > 0) - GetPlayerBriefInfo(1, info.referrer_role, 2);*/ - } - - CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer(); - pHost.OnAllInitDataReady(); - - /* if (pHost.IsGM()) - { - CDlgCountryMap pDlgCountryMap = (CDlgCountryMap)pGameUI.GetDialog("Win_CountryMap"); - pDlgCountryMap.GetConfig(); - } - - g_pGame.GetConfigs().ApplyOptimizeSetting(); - - if (g_pGame.GetConfigs().IsMiniClient()) - CECMCDownload::GetInstance().SendGetDownloadOK();*/ - } - } - private void OnPrtcPlayerBaseInfoRe(Protocol pProtocol) - { - playerbaseinfo_re p = (playerbaseinfo_re)pProtocol; - BMLogger.Log($"OnPrtcPlayerBaseInfoRe: {p.Roleid} {p.Player.cls} {p.Player.gender}"); - EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERBASEINFO, MANAGER_INDEX.MAN_PLAYER, -1, p); - } - - public void c2s_CmdNPCSevAcceptTask(int idTask, int idStorage, int idRefreshItem) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateCmdNPCSevAcceptTask(idTask, idStorage, idRefreshItem); - SendProtocol(gamedatasend); - } - - 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); - } - - public void c2s_SendCmdNPCSevHello(int nid) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNPCSevHelloDataCommand(nid); - SendProtocol(gamedatasend); - } - - public void c2s_CmdNormalAttack(byte byPVPMask) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNormalAttackDataCmd(byPVPMask); - SendProtocol(gamedatasend); - } - - public void c2s_CmdCancelAction() - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(CSNetwork.C2SCommand.CommandID.CANCEL_ACTION); - SendProtocol(gamedatasend); - } - - public void c2s_CmdUnselect() - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(CSNetwork.C2SCommand.CommandID.UNSELECT); - SendProtocol(gamedatasend); - } - - public void c2s_CmdSelectTarget(int idTarget) - { - // Set selection first before server returns, so as to reduce the player waiting time. - CECHostPlayer pHost = EC_ManMessageMono.Instance.GetECManPlayer.GetHostPlayer(); - pHost.SetSelectedTarget(idTarget); - - if (m_idLastSelTarget != idTarget) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateSelectTarget(idTarget); - SendProtocol(gamedatasend); - m_idLastSelTarget = idTarget; - } - } - - public void c2s_SendCmdNPCSevWaypoint() - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNPCSevWaypointCmd(NPC_service_type.GP_NPCSEV_WAYPOINT, 0); - SendProtocol(gamedatasend); - } - public void GetRoleBaseInfo(int iNumRole, List aRoleIDs) - { - int iNumLimit = 128; - playerbaseinfo p = null; - int iCount = 0; - - while (iCount < iNumRole) - { - p = new(); - p.Roleid = _selectedRole.roleid; - - int iNumSend = iNumLimit; - if (iCount + iNumLimit > iNumRole) - iNumSend = iNumRole - iCount; - - if (iNumSend > 0) - { - p.playerList = new(); - for (int i = 0; i < iNumSend; i++) - p.playerList.Add(aRoleIDs[iCount + i]); - - SendProtocol(p); - } - - - iCount += iNumSend; - } - } - - public void c2s_SendCmdGetOtherEquip(int iNumID, List aIDs) - { - // int iNumLimit = 250; - // int iCount = 0; - - // while (iCount < iNumID) - // { - // int iNumSend = iNumLimit; - // if (iCount + iNumLimit > iNumID) - // iNumSend = iNumID - iCount; - - // if (iNumSend > 0) - // { - // } - // } - } - - public void c2s_SendCmdNPCSevAcceptTask(int idTask, int idStorage, int idRefreshItem) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateCmdNPCSevAcceptTask( - idTask, - idStorage, - idRefreshItem); - SendProtocol(gamedatasend); - } - - public void c2s_SendCmdNPCSevReturnTask(int idTask, int iChoice) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNPCSevReturnTaskCmd( - idTask, - iChoice); - SendProtocol(gamedatasend); - } - - public void c2s_SendCmdNPCSevTaskMatter(int idTask) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNPCSevTaskMatterCmd(idTask); - SendProtocol(gamedatasend); - } - - public void c2s_SendCmdNPCSevLearnSkill(int idSkill) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNPCSevLearnSkillCmd(idSkill); - BMLogger.LogError("HoangDev : c2s_SendCmdNPCSevLearnSkill gamedatasend.Data : " + gamedatasend.Data.Size); - BMLogger.LogError("HoangDev : c2s_SendCmdNPCSevLearnSkill idSkill : " + idSkill); - SendProtocol(gamedatasend); - } - - public void c2s_SendCmdNPCSevBuy(int itemNum, C2SCommand.npc_trade_item[] items) - { - if (itemNum <= 0 || items == null || items.Length < itemNum) - return; - - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNPCSevBuyCmd(itemNum, items); - SendProtocol(gamedatasend); - } - - public void c2s_SendCmdNPCSevSell(int itemNum, C2SCommand.npc_sell_item[] items) - { - if (itemNum <= 0 || items == null || items.Length < itemNum) - return; - - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNPCSevSellCmd(itemNum, items); - SendProtocol(gamedatasend); - } - - public void GetRoleCustomizeData(int iNumRole, List aRoleIDs) - { - if (iNumRole <= 0 || aRoleIDs == null || aRoleIDs.Count == 0) return; - - int iNumLimit = 240; - int iCount = 0; - - while (iCount < iNumRole) - { - getcustomdata p = new(); - p.Roleid = _selectedRole.roleid; - - int iNumSend = iNumLimit; - if (iCount + iNumLimit > iNumRole) - iNumSend = iNumRole - iCount; - - for (int i = 0; i < iNumSend; i++) - p.playerlist.Add(aRoleIDs[iCount + i]); - - SendProtocol(p); - - iCount += iNumSend; - } - } - public void c2s_SendCmdEmoteAction(uint wPose) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateEmoteActionCmd((int)wPose); - SendProtocol(gamedatasend); - } - public void c2s_SendCmdTaskNotify(byte[] pData, uint dwDataSize) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateTaskNotifyCmd( pData, dwDataSize); - BMLogger.Log($"[MH Task] c2s_SendCmdTaskNotify Command ID : {pData[0]} Size: {dwDataSize}"); - SendProtocol(gamedatasend); - } - - public void c2s_SendCmdStandUp() - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.STAND_UP); - SendProtocol(gamedatasend); - } - - public void c2s_SendCmdAutoTeamSetGoal(int type, int goal_id, int op) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateAutoTeamSetGoalCommand(type,goal_id, op); - SendProtocol(gamedatasend); - } - - public void c2s_CmdGoto(float x, float y, float z) - { - c2s_SendCmdGoto(x, y, z); - } - - // Send C2S::GOTO command data - void c2s_SendCmdGoto(float x, float y, float z) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateGoToCommed( x, y, z); - SendProtocol(gamedatasend); - } - - public void c2s_SendCmdUseItem(byte byPackage, byte bySlot, int tid, byte byCount) - { - gamedatasend gamedatasend = new gamedatasend(); - gamedatasend.Data = C2SCommandFactory.CreateUseItemCmd(byPackage, bySlot, tid, byCount); - SendProtocol(gamedatasend); - } - } +using BrewMonster; +using BrewMonster.Common; +using BrewMonster.Managers; +using BrewMonster.Network; +using BrewMonster.Scripts.Skills; +using BrewMonster.UI; +using CSNetwork.C2SCommand; +using CSNetwork.GPDataType; +using CSNetwork.Protocols; +using CSNetwork.Protocols.RPCData; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using UnityEngine; +using CommandID = CSNetwork.GPDataType.CommandID; + +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; + private int m_idLastSelTarget = 0; // ID of selected item last time + + CECStringTab m_ErrorMsgs; + + // 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 static SynchronizationContext Context; + private CECC2SCmdCache m_CmdCache; // C2S command cache +#if UNITY_EDITOR + public bool isDebug; + public bool IsDebug + { + get => isDebug; + set => isDebug = value; + } +#endif + public CECC2SCmdCache CmdCache { get => m_CmdCache; } + + + public GameSession() + { + _networkManager = new NetworkManager(); + m_CmdCache = new CECC2SCmdCache(); + _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 RoleInfo GetRoleInfo() + { + return _selectedRole; + } + + 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 c2s_SendCmdGetIvtrDetailData(byte byPackage, Action callback) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = CSNetwork.C2SCommand.C2SCommandFactory.c2s_SendCmdGetIvtrDetailData(byPackage); + SendProtocol(gamedatasendRequest, callback); + } + + public void c2s_SendCmdQueryCashInfo() + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.c2s_SendCmdQueryCashInfo(); + SendProtocol(gamedatasendRequest); + } + + public void c2s_SendCmdOpenFashionTrash(string password) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.c2s_SendCmdOpenFashionTrash(password); + SendProtocol(gamedatasendRequest); + } + + public void c2s_SendCmdEquipItem(byte iIvtrIdx, byte iEquipIdx, Action callback) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = CSNetwork.C2SCommand.C2SCommandFactory.c2s_SendCmdEquipItem(iIvtrIdx, iEquipIdx); + SendProtocol(gamedatasendRequest, callback); + } + + public void c2s_SendCmdReviveVillage(int param = 0) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.c2s_SendCmdReviveVillage(param); + SendProtocol(gamedatasendRequest); + } + public void c2s_SendCmdReviveItem(int param = 0) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.c2s_SendCmdReviveVillage(param); + SendProtocol(gamedatasendRequest); + } + public void RequestReviveByPlayer(int param = 0) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = C2SCommandFactory.c2s_SendCmdReviveVillage(param); + SendProtocol(gamedatasendRequest); + } + + + public void c2s_SendCmdMallShopping(uint count, CMD_MallShopping.goods[] goodsArray) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = CSNetwork.C2SCommand.C2SCommandFactory.CreateGetMallShopping(count, goodsArray); + SendProtocol(gamedatasendRequest); + } + public void c2s_SendCmdGatherMaterial(int idMatter, int iToolPack, int idToolIndex, int idTool, int idTask) + { + gamedatasend gamedatasendRequest = new gamedatasend(); + gamedatasendRequest.Data = CSNetwork.C2SCommand.C2SCommandFactory.c2s_SendCmdGatherMaterial(idMatter, iToolPack, idToolIndex, idTool, idTask); + SendProtocol(gamedatasendRequest); + } + + 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; + case ProtocolType.PROTOCOL_PLAYERBASEINFO_RE: + OnPrtcPlayerBaseInfoRe(protocol); + break; + case ProtocolType.PROTOCOL_GETUICONFIG_RE: OnPrtcGetConfigRe(protocol); break; + + case ProtocolType.PROTOCOL_AUTOTEAMSETGOAL_RE: + { + // CECAutoTeam pAutoTeam = CECGameRun.Instance.GetHostPlayer().GetAutoTeam(); + // if( pAutoTeam !=null) + // pAutoTeam.OnPrtcAutoTeamSetGoalRe((AutoTeamSetGoal_Re)protocol); + } + break; + + default: + _logger.Log(LogType.Warning, $"Received unhandled protocol type: {protocol.GetPType()}"); + break; + } + } + + private void HandleServerDataSend(gamedatasend protocol) + { + 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); + //sss +#if UNITY_EDITOR + if (isDebug) + { + BMLogger.LogError($"### GameDataSend: CMDID {pCmdHeader}"); + } +#endif + 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: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERINFO, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, + pCmdHeader, iHostID); + 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)) + { + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCMOVE, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf, + pCmdHeader); + } + + break; + case CommandID.OBJECT_STOP_MOVE: + { + int id1 = GPDataTypeHelper.FromBytes(pDataBuf); + + if (ISPLAYERID(id1)) + { + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERSTOPMOVE, (int)MANAGER_INDEX.MAN_PLAYER, -1, + pDataBuf, pCmdHeader); + } + else if (ISNPCID(id1)) + { + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCSTOPMOVE, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf, + pCmdHeader); + } + + break; + } + case CommandID.OBJECT_LEAVE_SLICE: + { + int id = GPDataTypeHelper.FromBytes(pDataBuf); + if (ISPLAYERID(id)) + { + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERRUNOUT, (int)MANAGER_INDEX.MAN_PLAYER, -1, + pDataBuf, pCmdHeader); + } + else if (ISNPCID(id)) + { + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCRUNOUT, (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: + 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: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ITEMOPERATION, (int)MANAGER_INDEX.MAN_PLAYER, 0, + pDataBuf, pCmdHeader); + break; + case CommandID.PLAYER_CASH: + { + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_IVTRINFO, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, + pCmdHeader, iHostID); + 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: + case CommandID.HOST_OBTAIN_ITEM: + case CommandID.PRODUCE_ONCE: + case CommandID.TASK_DELIVER_ITEM: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_PICKUPITEM, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, + pCmdHeader); + break; + case CommandID.MATTER_PICKUP: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PICKUPMATTER, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + break; + case CommandID.PICKUP_MONEY: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_PICKUPMONEY, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, + pCmdHeader); + break; + case CommandID.HOST_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.PLAYER_DIED: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERDIED, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + break; + case CommandID.HOST_DIED: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_DIED, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.PLAYER_REVIVE: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERREVIVE, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + break; + case CommandID.NOTIFY_HOSTPOS: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_GOTO, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + 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: + 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.BE_HURT: + case CommandID.HURT_RESULT: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_HURTRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, + pCmdHeader); + break; + case CommandID.OBJECT_ATTACK_RESULT: + //int id = GPDataTypeHelper.FromBytes(pDataBuf); + cmd_object_atk_result pCmdAtk = GPDataTypeHelper.FromBytes(pDataBuf); + //BMLogger.LogError($"OBJECT_ATTACK_RESULT: npc ? " + ISNPCID(id)); + + if (ISPLAYERID(pCmdAtk.attacker_id)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERATKRESULT, MANAGER_INDEX.MAN_PLAYER, -1, + pDataBuf, pCmdHeader); + else if (ISNPCID(pCmdAtk.attacker_id)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCATKRESULT, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); + break; + case CommandID.HOST_ATTACKRESULT: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ATKRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, + pCmdHeader); + break; + case CommandID.HOST_ATTACKED: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ATTACKED, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, + pCmdHeader); + break; + + case CommandID.ERROR_MESSAGE: + { + int errRaw = BitConverter.ToInt32(pDataBuf, 0); + // Note: _logger may be configured as a file logger via SetLogPath(), so also log to console for visibility. + _logger.Info($"### GameDataSend: ERROR_MESSAGE: {errRaw}"); +#if UNITY_EDITOR + BMLogger.LogError($"### GameDataSend: ERROR_MESSAGE: {errRaw}"); +#endif + cmd_error_msg pCmd = GPDataTypeHelper.FromBytes(pDataBuf); +#if UNITY_EDITOR + BMLogger.LogError($"### GameDataSend: ERROR_MESSAGE parsed iMessage={pCmd.iMessage}"); +#endif + + if (pCmd.iMessage != 0) + { + // string szMsg = m_ErrorMsgs.GetWideString(pCmd.iMessage); + // if (string.IsNullOrEmpty(szMsg)) + // BMLogger.LogError("SERVER - unknown error !"); + //else if (pCmd.iMessage != 2) + //g_pGame.GetGameRun().AddChatMessage(szMsg, GP_CHAT_MISC); + } + + if (pCmd.iMessage == 2) + { + // Attack target is too far + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_TARGETISFAR, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + } + else if (pCmd.iMessage == 20) + { + // Failed to cast skill + //pGameRun.PostMessage(MSG_PM_CASTSKILL, MAN_PLAYER, 0, (DWORD)pDataBuf, pCmdHeader.cmd); + } + else if (pCmd.iMessage == 133 || pCmd.iMessage == 134) + { + // deal failed + //pGameRun.PostMessage(MSG_HST_BUY_SELL_FAIL, MAN_PLAYER, 0, (DWORD)pDataBuf, pCmdHeader.cmd); + } + else if (pCmd.iMessage == 158) + { + // µ±Ç°»ãÂʲ»¶Ô£¬ÖØÐÂÈ¡»ãÂÊ + //c2s_CmdGetCashMoneyRate(); + } + else if (pCmd.iMessage == 108 /*&& pGameRun.GetHostPlayer().IsInKingService()*/) + { + /* CECGameUIMan* pGameUI = pGameRun.GetUIManager().GetInGameUIMan(); + if (pGameUI) + pGameUI.EndNPCService();*/ + } + else if + (pCmd.iMessage == 108 /*&& pGameRun.GetHostPlayer().GetOfflineShopCtrl().GetNPCSevFlag() != COfflineShopCtrl::NPCSEV_NULL*/ + ) + { + /* CECGameUIMan* pGameUI = pGameRun.GetUIManager().GetInGameUIMan(); + if (pGameUI) + pGameUI.EndNPCService();*/ + } + else if (pCmd.iMessage == 175) + { + //c2s_CmdQueryParallelWorld(); + } + else if (pCmd.iMessage == 6) + { + //AP_ActionEvent(AP_EVENT_CANNOTPICKUP); + } + + break; + } + case CommandID.SELECT_TARGET: + case CommandID.UNSELECT: + + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_SELTARGET, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, + pCmdHeader); + break; + case CommandID.NPC_DIED: + case CommandID.NPC_DIED2: + + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCDIED, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); + break; + case CommandID.OBJECT_DISAPPEAR: + { + int lenghtDataType1 = Marshal.SizeOf(); + byte[] arrByteData1 = GetBytes(pDataBuf, lenghtDataType1, 0); + int objectId = BitConverter.ToInt32(arrByteData1); + if (ISPLAYERID(objectId)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERDISAPPEAR, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + else if (ISNPCID(objectId)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCDISAPPEAR, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); + else if (ISMATTERID(objectId)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_MM_MATTERDISAPPEAR, MANAGER_INDEX.MAN_MATTER, 0, pDataBuf, pCmdHeader); + + break; + } + case CommandID.SELF_INFO_00: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_INFO00, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, + pCmdHeader); + break; + case CommandID.NPC_GREETING: + { + // If this greeting is from the skill-learn NPC, record it (C++ skill dialog relies on this). + try + { + cmd_npc_greeting greet = GPDataTypeHelper.FromBytes(pDataBuf); + CECHostSkillModel.Instance.OnNpcGreeting(greet.idObject); + } + catch (Exception ex) + { + _logger.Log(LogType.Warning, $"Failed to parse NPC_GREETING payload: {ex.Message}"); + } + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_NPCGREETING, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + } + case CommandID.ACTIVATE_WAYPOINT: + case CommandID.WAYPOINT_LIST: + + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_WAYPOINT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.SERVER_TIME: + { + cmd_server_time pcmd_server_time = GPDataTypeHelper.FromBytes(pDataBuf); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_SERVERTIME, -1, 0, pcmd_server_time.time, pcmd_server_time.timebias); + break; + } + case CommandID.SCENE_SERVICE_NPC_LIST: + { + CECHostSkillModel.Instance.RecvNPCServiceList(protocol.Data); + break; + } + case CommandID.SKILL_DATA: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_SKILLDATA, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.OBJECT_CAST_SKILL: + case CommandID.OBJECT_CAST_INSTANT_SKILL: + case CommandID.OBJECT_CAST_POS_SKILL: + { + cmd_object_cast_skill pCmd2 = GPDataTypeHelper.FromBytes(pDataBuf,true); + if (ISPLAYERID(pCmd2.caster)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_CASTSKILL, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + else if (ISNPCID(pCmd2.caster)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCCASTSKILL, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); + + break; + } + case CommandID.LEVEL_UP: + { + cmd_level_up pCmdLevelUp = GPDataTypeHelper.FromBytes(pDataBuf); ; + if (ISPLAYERID(pCmdLevelUp.id)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERLEVELUP, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + else if (ISNPCID(pCmdLevelUp.id)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCLEVELUP, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); + break; + } + case CommandID.HOST_START_ATTACK: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_STARTATTACK, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); + break; + case CommandID.HOST_STOPATTACK: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_STOPATTACK, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); + break; + case CommandID.HOST_SKILL_ATTACK_RESULT: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_SKILLRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.CHANGE_FACE_START: + case CommandID.CHANGE_FACE_END: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_CHANGEFACE, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); + break; + case CommandID.ENCHANT_RESULT: + cmd_enchant_result pCmd3 = GPDataTypeHelper.FromBytes(pDataBuf); + if (ISPLAYERID(pCmd3.caster)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_ENCHANTRESULT, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + else if (ISNPCID(pCmd3.caster)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_ENCHANTRESULT, MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader); + break; + case CommandID.SKILL_PERFORM: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_CASTSKILL, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.SET_COOLDOWN: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_SETCOOLTIME, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.COMBO_SKILL_PREPARE: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_COMBO_SKILL_PREPARE, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize); + break; + case CommandID.PLAYER_EXT_PROP_BASE: + case CommandID.PLAYER_EXT_PROP_MOVE: + case CommandID.PLAYER_EXT_PROP_ATK: + case CommandID.PLAYER_EXT_PROP_DEF: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYEREXTPROP, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + break; + case CommandID.OWN_EXT_PROP: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_OWNEXTPROP, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.OBJECT_DO_EMOTE: + case CommandID.OBJECT_EMOTE_RESTORE: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERDOEMOTE, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + break; + case CommandID.OUT_OF_SIGHT_LIST: + { + cmd_out_of_sight_list pCmd5 = default; + pCmd5.uCount = GPDataTypeHelper.FromBytes(pDataBuf); + int offset2 = sizeof(uint); + pCmd5.idList = new int[pCmd5.uCount]; + for (int i = 0; i < pCmd5.uCount; i++) + { + pCmd5.idList[i] = GPDataTypeHelper.FromBytes(pDataBuf, offset2); + offset2 += 4;//sizeof int; + } + + for (uint n = 0; n < pCmd5.uCount; n++) + { + if (ISPLAYERID(pCmd5.idList[n])) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYEROUTOFVIEW, MANAGER_INDEX.MAN_PLAYER, -1, pCmd5.idList[n], pCmdHeader); + else if (ISNPCID(pCmd5.idList[n])) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCOUTOFVIEW, MANAGER_INDEX.MAN_NPC, 0, pCmd5.idList[n], pCmdHeader); + else if (ISMATTERID(pCmd5.idList[n])) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_MM_MATTEROUTOFVIEW, MANAGER_INDEX.MAN_MATTER, 0, pCmd5.idList[n], pCmdHeader); + } + + break; + } + case CommandID.PLAYER_GATHER_START: + case CommandID.PLAYER_GATHER_STOP: + case CommandID.MINE_GATHERED: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERGATHER, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + break; + case CommandID.COOLTIME_DATA: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_COOLTIMEDATA, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.OBJECT_TAKEOFF: + { + cmd_object_takeoff pCmdTakeOff = GPDataTypeHelper.FromBytes((byte[])pDataBuf); + if (ISPLAYERID(pCmdTakeOff.object_id)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERFLY, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + break; + } + case CommandID.OBJECT_LANDING: + { + cmd_object_landing pCmdLanding = GPDataTypeHelper.FromBytes((byte[])pDataBuf); + if (ISPLAYERID(pCmdLanding.object_id)) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERFLY, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader); + break; + } + case CommandID.HOST_RUSH_FLY: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERFLY, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.FLYSWORD_TIME: + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_FLYSWORDTIME, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + case CommandID.PRODUCE_START: + case CommandID.PRODUCE_END: + case CommandID.PRODUCE_NULL: + // Post MSG_HST_PRODUCEITEM message with command ID as parameter (matches C++ behavior) + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_PRODUCEITEM, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + + + case CommandID.LEARN_SKILL: + BMLogger.LogError("### GameDataSend: LEARN_SKILL"); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_LEARNSKILL, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader); + break; + default: +#if UNITY_EDITOR + if (isDebug) + { + BMLogger.LogError($"### GameDataSend: Unhandled CMDID {pCmdHeader} (payloadBytes={pDataBuf?.Length ?? 0})"); + } +#endif + break; + } + } + + + 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"); + // Clear command cache + m_CmdCache.RemoveAllCmds(); + } + + // --- 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 & 0x80000000) != 0) && ((id & 0x40000000) == 0); + public bool ISMATTERID(int id) => ((id) & 0xC0000000) == 0xC0000000; + 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_SendCmdCastSkill(int idSkill, byte byPVPMask, int iNumTarget, int[] aTargets) + { + gamedatasend gamedatasend = new gamedatasend(); + + gamedatasend.Data = + C2SCommandFactory.CreatePlayerCastSkill(idSkill, byPVPMask, iNumTarget, aTargets); + + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdCastInstantSkill(int idSkill, byte byPVPMask, int iNumTarget, int[] aTargets) + { + gamedatasend gamedatasend = new gamedatasend(); + + gamedatasend.Data = + C2SCommandFactory.CreatePlayerCastInstantSkill(idSkill, byPVPMask, iNumTarget, aTargets); + + SendProtocol(gamedatasend); + } + + public void c2s_CmdCastPosSkill(int idSkill, Vector3 vDest, byte byPVPMask, int iNumTarget, int aTargets) + { + gamedatasend gamedatasend = new gamedatasend(); + + gamedatasend.Data = + C2SCommandFactory.CreatePlayerCastPosSkill(idSkill, vDest, byPVPMask, iNumTarget, aTargets); + + SendProtocol(gamedatasend); + } + public void c2s_SendCmdContinueAction() + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.CONTINUE_ACTION); + 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 c2s_CmdSendEnterPKPrecinctint() + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.ENTER_PK_PROTECTED); + 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); + } + public void LoadConfigData() + { + getuiconfig p = new getuiconfig(); + p.Roleid = m_iCharID; + SendProtocol(p); + } + 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 OnPrtcGetConfigRe(Protocol pProtocol) + { + getuiconfig_re p = (getuiconfig_re)pProtocol; + if (p.Result != (int)ErrCode.ERR_SUCCESS) + BMLogger.LogError("CECGameSession::OnPrtcGetConfigRe, link return error code of " + p.Result); + else + { + if (!CECGameRun.Instance.LoadConfigsFromServer(p.UiConfig.RawBuffer, p.UiConfig.Size)) + { + // if load failed then use current setting directly + //TODO : fix later + EC_Game.GetConfigs().ApplyUserSetting(); + } + + // Now, Get config data request is sent after all host initial data ready. + // so when we receive this reply, we can do some last work before game + // really starts. Maybe it's not the best place to do these work, but + // now we do it here. + // Enalbe game UI + CECGameUIMan pGameUI = (CECGameUIMan)EC_Game.GetGameRun().GetUIManager().GetInGameUIMan(); + if (pGameUI != null) + { + pGameUI.EnableUI(true); + + // Get referral name for adding friend or other display + //TODO: a Hung lam phan select role info di + /* RoleInfo info = EC_Game.GetGameRun().GetSelectedRoleInfo(); + if (info.referrer_role > 0) + GetPlayerBriefInfo(1, info.referrer_role, 2);*/ + } + + CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer(); + pHost.OnAllInitDataReady(); + + /* if (pHost.IsGM()) + { + CDlgCountryMap pDlgCountryMap = (CDlgCountryMap)pGameUI.GetDialog("Win_CountryMap"); + pDlgCountryMap.GetConfig(); + } + + g_pGame.GetConfigs().ApplyOptimizeSetting(); + + if (g_pGame.GetConfigs().IsMiniClient()) + CECMCDownload::GetInstance().SendGetDownloadOK();*/ + } + } + private void OnPrtcPlayerBaseInfoRe(Protocol pProtocol) + { + playerbaseinfo_re p = (playerbaseinfo_re)pProtocol; + BMLogger.Log($"OnPrtcPlayerBaseInfoRe: {p.Roleid} {p.Player.cls} {p.Player.gender}"); + EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERBASEINFO, MANAGER_INDEX.MAN_PLAYER, -1, p); + } + + public void c2s_CmdNPCSevAcceptTask(int idTask, int idStorage, int idRefreshItem) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateCmdNPCSevAcceptTask(idTask, idStorage, idRefreshItem); + SendProtocol(gamedatasend); + } + + 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); + } + + public void c2s_SendCmdNPCSevHello(int nid) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNPCSevHelloDataCommand(nid); + SendProtocol(gamedatasend); + } + + public void c2s_CmdNormalAttack(byte byPVPMask) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNormalAttackDataCmd(byPVPMask); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdCancelAction() + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(CSNetwork.C2SCommand.CommandID.CANCEL_ACTION); + SendProtocol(gamedatasend); + } + + public void c2s_CmdUnselect() + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(CSNetwork.C2SCommand.CommandID.UNSELECT); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdSelectTarget(int idTarget) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateSelectTarget(idTarget); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdNPCSevWaypoint() + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNPCSevWaypointCmd(NPC_service_type.GP_NPCSEV_WAYPOINT, 0); + SendProtocol(gamedatasend); + } + public void c2s_SendCmdNPCSevMakeItem(int idSkill, int idItem, uint dwCount) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNPCSevMakeItemCmd(idSkill, idItem, dwCount); + SendProtocol(gamedatasend); + } + public void GetRoleBaseInfo(int iNumRole, List aRoleIDs) + { + int iNumLimit = 128; + playerbaseinfo p = null; + int iCount = 0; + + while (iCount < iNumRole) + { + p = new(); + p.Roleid = _selectedRole.roleid; + + int iNumSend = iNumLimit; + if (iCount + iNumLimit > iNumRole) + iNumSend = iNumRole - iCount; + + if (iNumSend > 0) + { + p.playerList = new(); + for (int i = 0; i < iNumSend; i++) + p.playerList.Add(aRoleIDs[iCount + i]); + + SendProtocol(p); + } + + + iCount += iNumSend; + } + } + + public void c2s_SendCmdGetOtherEquip(int iNumID, List aIDs) + { + // int iNumLimit = 250; + // int iCount = 0; + + // while (iCount < iNumID) + // { + // int iNumSend = iNumLimit; + // if (iCount + iNumLimit > iNumID) + // iNumSend = iNumID - iCount; + + // if (iNumSend > 0) + // { + // } + // } + } + + public void c2s_SendCmdNPCSevAcceptTask(int idTask, int idStorage, int idRefreshItem) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateCmdNPCSevAcceptTask( + idTask, + idStorage, + idRefreshItem); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdNPCSevReturnTask(int idTask, int iChoice) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNPCSevReturnTaskCmd( + idTask, + iChoice); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdNPCSevTaskMatter(int idTask) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNPCSevTaskMatterCmd(idTask); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdNPCSevLearnSkill(int idSkill) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNPCSevLearnSkillCmd(idSkill); + BMLogger.LogError("HoangDev : c2s_SendCmdNPCSevLearnSkill gamedatasend.Data : " + gamedatasend.Data.Size); + BMLogger.LogError("HoangDev : c2s_SendCmdNPCSevLearnSkill idSkill : " + idSkill); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdNPCSevBuy(int itemNum, C2SCommand.npc_trade_item[] items) + { + if (itemNum <= 0 || items == null || items.Length < itemNum) + return; + + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNPCSevBuyCmd(itemNum, items); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdNPCSevSell(int itemNum, C2SCommand.npc_sell_item[] items) + { + if (itemNum <= 0 || items == null || items.Length < itemNum) + return; + + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNPCSevSellCmd(itemNum, items); + SendProtocol(gamedatasend); + } + + public void GetRoleCustomizeData(int iNumRole, List aRoleIDs) + { + if (iNumRole <= 0 || aRoleIDs == null || aRoleIDs.Count == 0) return; + + int iNumLimit = 240; + int iCount = 0; + + while (iCount < iNumRole) + { + getcustomdata p = new(); + p.Roleid = _selectedRole.roleid; + + int iNumSend = iNumLimit; + if (iCount + iNumLimit > iNumRole) + iNumSend = iNumRole - iCount; + + for (int i = 0; i < iNumSend; i++) + p.playerlist.Add(aRoleIDs[iCount + i]); + + SendProtocol(p); + + iCount += iNumSend; + } + } + public void c2s_SendCmdEmoteAction(uint wPose) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateEmoteActionCmd((int)wPose); + SendProtocol(gamedatasend); + } + public void c2s_SendCmdTaskNotify(byte[] pData, uint dwDataSize) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateTaskNotifyCmd( pData, dwDataSize); + BMLogger.Log($"[MH Task] c2s_SendCmdTaskNotify Command ID : {pData[0]} Size: {dwDataSize}"); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdStandUp() + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.STAND_UP); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdAutoTeamSetGoal(int type, int goal_id, int op) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateAutoTeamSetGoalCommand(type,goal_id, op); + SendProtocol(gamedatasend); + } + + public void c2s_CmdGoto(float x, float y, float z) + { + c2s_SendCmdGoto(x, y, z); + } + + // Send C2S::GOTO command data + void c2s_SendCmdGoto(float x, float y, float z) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateGoToCommed( x, y, z); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdUseItem(byte byPackage, byte bySlot, int tid, byte byCount) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateUseItemCmd(byPackage, bySlot, tid, byCount); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdGetExtProps() + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.GET_EXT_PROP); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdGivePresent(int roleid, int mail_id, int goods_id, int goods_index, int goods_slot) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateGivePresentCmd(roleid, mail_id, goods_id, goods_index, goods_slot); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdEnterSanctuary(int id) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateEnterSanctuaryCmd(id); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdEnterInstance(int iTransIdx, int idInst) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateEnterInstanceCmd(iTransIdx, idInst); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdActiveRushFly(bool bActive) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateActiveRushFlyCmd(bActive); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdPetCtrl(int idTarget, int cmd, byte[] pParamBuf, int iParamLen) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreatePetCtrlCmd(idTarget, cmd, pParamBuf, iParamLen); + SendProtocol(gamedatasend); + } + + public void c2s_SendCmdQueryFactionPVPInfo(int faction_id) + { + gamedatasend gamedatasend = new gamedatasend(); + gamedatasend.Data = C2SCommandFactory.CreateQueryFactionPVPInfo(faction_id); + SendProtocol(gamedatasend); + } + } } \ 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 index 7e3e343026..dc384847ad 100644 --- a/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerbriefinfo.cs +++ b/Assets/PerfectWorld/Scripts/Network/CSNetwork/Protocols/getplayerbriefinfo.cs @@ -8,7 +8,7 @@ namespace CSNetwork.Protocols public int Roleid { get; set; } public int Localsid { get; set; } public byte Reason { get; set; } - + public List Playerlist { get; set; } public getplayerbriefinfo() : base(ProtocolType.PROTOCOL_GETPLAYERBRIEFINFO) { @@ -18,7 +18,8 @@ namespace CSNetwork.Protocols { Roleid = Roleid, Localsid = Localsid, - Reason = Reason + Reason = Reason, + Playerlist = Playerlist }; public override void Marshal(OctetsStream os) @@ -26,6 +27,7 @@ namespace CSNetwork.Protocols os.Write(Roleid); os.Write(Localsid); os.Write(Reason); + os.WriteListInt(Playerlist); } public override void Unmarshal(OctetsStream os) @@ -33,6 +35,7 @@ namespace CSNetwork.Protocols Roleid = os.ReadInt32(); Localsid = os.ReadInt32(); Reason = os.ReadByte(); + os.ReadListInt(Playerlist); } public override int PriorPolicy() => 1; diff --git a/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs b/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs index c9d71546ef..04382a78c6 100644 --- a/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs +++ b/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs @@ -33,13 +33,16 @@ namespace BrewMonster.Network private string _password = ""; CECStubbornFactionInfoSender m_stubbornFactionInfoSender; - + public GameSession GameSession { get => _gameSession; } + public CECC2SCmdCache GetC2SCmdCache() { return _gameSession.CmdCache; } #if UNITY_EDITOR public bool isDebg; private bool lastDebug; + + public void OnValidate() { - if (isDebg != lastDebug) + if (_gameSession != null && isDebg != lastDebug) { _gameSession.IsDebug = isDebg; lastDebug = isDebg; @@ -79,14 +82,14 @@ namespace BrewMonster.Network Instance._ip = ip; Instance._port = port; } - public static void c2s_CmdCastSkill(int idSkill, byte byPVPMask, int iNumTarget, int aTargets) + public static void c2s_CmdCastSkill(int idSkill, byte byPVPMask, int iNumTarget, int[] aTargets) { - Instance._gameSession.c2s_CmdCastSkill(idSkill, byPVPMask, iNumTarget, aTargets); + Instance._gameSession.CmdCache.SendCmdCastSkill(idSkill, byPVPMask, iNumTarget, aTargets); } - public static void c2s_CmdCastInstantSkill(int idSkill, byte byPVPMask, int iNumTarget, int aTargets) + public static void c2s_CmdCastInstantSkill(int idSkill, byte byPVPMask, int iNumTarget, int[] aTargets) { - Instance._gameSession.c2s_CmdCastInstantSkill(idSkill, byPVPMask, iNumTarget, aTargets); + Instance._gameSession.CmdCache.SendCmdCastInstantSkill(idSkill, byPVPMask, iNumTarget, aTargets); } public static void c2s_CmdCastPosSkill(int idSkill, Vector3 vDest, byte byPVPMask, int iNumTarget, int aTargets) @@ -180,11 +183,11 @@ namespace BrewMonster.Network } public static void RequestInventoryAsync(byte byPackage, Action callback = null) { - Instance._gameSession.RequestInventoryAsync(byPackage, callback); + Instance._gameSession.c2s_SendCmdGetIvtrDetailData(byPackage, callback); } public static void RequesrQueryPlayerCash() { - Instance._gameSession.RequestQueryPlayerCash(); + Instance._gameSession.c2s_SendCmdQueryCashInfo(); } public static void RequestDropEquipItem(byte index) { @@ -192,11 +195,11 @@ namespace BrewMonster.Network } public static void RequestEquipItemAsync(byte iIvtrIdx, byte iEquipIdx, Action callback = null) { - Instance._gameSession.RequestEquipItem(iIvtrIdx, iEquipIdx, callback); + Instance._gameSession.c2s_SendCmdEquipItem(iIvtrIdx, iEquipIdx, callback); } public static void RequestPickupItem(int idItem, int tid) { - Instance._gameSession.RequestPickupItem(idItem, tid); + Instance._gameSession.CmdCache.SendCmdPickUp(idItem, tid); } public static void RequestDropIvrtItem(byte index, int amount) { @@ -208,19 +211,19 @@ namespace BrewMonster.Network } public static void RequestCheckSecurityPassWd(string password) { - Instance._gameSession.RequestCheckSecurityPassWd(password); + Instance._gameSession.c2s_SendCmdOpenFashionTrash(password); } public static void c2s_SendCmdContinueAction() { Instance._gameSession.c2s_SendCmdContinueAction(); } - public static void RequestReviveBase() + public static void c2s_CmdReviveVillage() { - Instance._gameSession.RequestReviveBase(); + Instance._gameSession.CmdCache.SendCmdReviveVillage(); } - public static void RequestReviveItem() + public static void c2s_CmdReviveItem() { - Instance._gameSession.RequestReviveItem(); + Instance._gameSession.CmdCache.SendCmdReviveItem(); } public static void RequestReviveByPlayer() { @@ -238,7 +241,7 @@ namespace BrewMonster.Network goods_pos = good_pos } }; - Instance._gameSession.RequestMallShopping(count, goods); + Instance._gameSession.c2s_SendCmdMallShopping(count, goods); } public static void RequestAllInventoriesAsync(Action callback = null, params byte[] packages) { @@ -269,7 +272,7 @@ namespace BrewMonster.Network } public static void c2s_CmdNPCSevHello(int nid) { - Instance._gameSession.c2s_SendCmdNPCSevHello(nid); + Instance._gameSession.CmdCache.SendCmdNPCSevHello(nid); } public static void c2s_CmdNormalAttack(byte byPVPMask) @@ -279,7 +282,7 @@ namespace BrewMonster.Network public static void c2s_CmdCancelAction() { - Instance._gameSession.c2s_CmdCancelAction(); + Instance._gameSession.CmdCache.SendCmdCancelAction(); } public static void c2s_CmdUnselect() @@ -289,13 +292,18 @@ namespace BrewMonster.Network public static void c2s_CmdSelectTarget(int idTarget) { - Instance._gameSession.c2s_CmdSelectTarget(idTarget); + Instance._gameSession.CmdCache.SendCmdSelectTarget(idTarget); } public static void c2s_CmdNPCSevWaypoint() { Instance._gameSession.c2s_SendCmdNPCSevWaypoint(); } + public static void c2s_CmdNPCSevMakeItem(int idSkill, int idItem, uint dwCount) + { + Instance._gameSession.c2s_SendCmdNPCSevMakeItem(idSkill, idItem, dwCount); + } + public void GetFactionInfo(int iNumFaction, int[] aFactinoIDs) { m_stubbornFactionInfoSender.Add(iNumFaction, aFactinoIDs); @@ -366,7 +374,7 @@ namespace BrewMonster.Network } public static void c2s_CmdGatherMaterial(int idMatter, int iToolPack, int idToolIndex, int idTool, int idTask) { - Instance._gameSession.c2s_CmdGatherMaterial(idMatter, iToolPack, idToolIndex, idTool, idTask); + Instance._gameSession.c2s_SendCmdGatherMaterial(idMatter, iToolPack, idToolIndex, idTool, idTask); } #endregion @@ -400,22 +408,38 @@ namespace BrewMonster.Network } actDone?.Invoke(true); } + void OnDestroy() { _gameSession.Disconnect(); _gameSession.Dispose(); CECNPC.ReleaseStaticRes(); } - - + public static void c2s_CmdGoto(float x, float y, float z) { Instance._gameSession.c2s_CmdGoto(x, y, z); } - public static void c2s_CmdUseItem(byte byPackage, byte bySlot, int tid, byte byCount) + public static void c2s_SendCmdUseItem(byte byPackage, byte bySlot, int tid, byte byCount) { - Instance._gameSession.c2s_SendCmdUseItem(byPackage, bySlot, tid, byCount); + Instance._gameSession.CmdCache.SendCmdUseItem(byPackage, bySlot, tid, byCount); + } + + // Send C2S::GET_EXT_PROP commadn data + public static void c2s_SendCmdGetExtProps() + { + Instance._gameSession.CmdCache.SendCmdExtProps(); + } + + public static void c2s_SendCmdGivePresent(int roleid, int mail_id, int goods_id, int goods_index, int goods_slot) + { + Instance._gameSession.c2s_SendCmdGivePresent(roleid, mail_id, goods_id, goods_index, goods_slot); + } + + public void Update() + { + _gameSession?.CmdCache?.Tick(Time.deltaTime); } } } \ No newline at end of file diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs index db0b980284..0012c24bae 100644 --- a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgNPC.cs @@ -763,27 +763,245 @@ namespace BrewMonster.UI else if (DataType == DATA_TYPE.DT_NPC_MAKE_SERVICE) { NPC_MAKE_SERVICE pService = (NPC_MAKE_SERVICE)pData; - m_pLst_Main.AddString(strText + Encoding.Unicode.GetString(MemoryMarshal.AsBytes(pService.name))); + string serviceName = Encoding.Unicode.GetString(MemoryMarshal.AsBytes(pService.name)); + m_pLst_Main.AddString(strText + serviceName); + + // Log NPC_MAKE_SERVICE data + BMLogger.Log($"NPC_MAKE_SERVICE detected - ServiceID: {a_uiService[i]}, MakeServiceID: {pService.id}, Name: {serviceName}, MakeSkillID: {pService.id_make_skill}, ProduceType: {pService.produce_type}"); + + // Log pages data + if (pService.pages != null) + { + for (int pageIdx = 0; pageIdx < pService.pages.Length; pageIdx++) + { + var page = pService.pages[pageIdx]; + string pageTitle = Encoding.Unicode.GetString(MemoryMarshal.AsBytes(page.page_title)); + // Trim null characters and whitespace from page title + pageTitle = pageTitle?.TrimEnd('\0', ' ', '\t', '\r', '\n') ?? ""; + + // Collect all non-zero goods IDs with their names + // Note: id_goods contains RECIPE IDs, not item IDs + List goodsInfo = new List(); + if (page.id_goods != null) + { + for (int goodsIdx = 0; goodsIdx < page.id_goods.Length; goodsIdx++) + { + uint recipeId = page.id_goods[goodsIdx]; + if (recipeId != 0) + { + // Get recipe data, output item, and materials + string outputItemInfo = ""; + List materialInfo = new List(); + try + { + var edm = ElementDataManProvider.GetElementDataMan(); + if (edm == null) + { + // ElementDataMan is null, skip + } + else + { + // Try recipe space first + DATA_TYPE dt = DATA_TYPE.DT_INVALID; + object recipeData = edm.get_data_ptr(recipeId, ID_SPACE.ID_SPACE_RECIPE, ref dt); + + // Check if we got recipe data - sometimes dt is DT_INVALID but data is still RECIPE_ESSENCE + RECIPE_ESSENCE? recipe = null; + if (recipeData != null && recipeData is RECIPE_ESSENCE) + { + recipe = (RECIPE_ESSENCE)recipeData; + } + else if (recipeData != null && dt == DATA_TYPE.DT_RECIPE_ESSENCE) + { + recipe = (RECIPE_ESSENCE)recipeData; + } + + if (recipe.HasValue) + { + RECIPE_ESSENCE recipeValue = recipe.Value; + + // Get output item from first target (main output) + if (recipeValue.targets != null && recipeValue.targets.Length > 0) + { + if (recipeValue.targets[0].id_to_make != 0) + { + uint outputItemId = recipeValue.targets[0].id_to_make; + try + { + EC_IvtrItem pItem = EC_IvtrItem.CreateItem((int)outputItemId, 0, 1); + if (pItem != null) + { + string outputName = pItem.GetName(); + outputItemInfo = $"{outputItemId} ({outputName})"; + } + else + { + outputItemInfo = $"{outputItemId} (unknown)"; + } + } + catch (Exception ex2) + { + outputItemInfo = $"{outputItemId} (error: {ex2.Message})"; + } + } + else + { + BMLogger.LogWarning($" Recipe {recipeId}: First target id_to_make is 0"); + } + } + else + { + BMLogger.LogWarning($" Recipe {recipeId}: targets is null or empty"); + } + + // Get all materials + if (recipeValue.materials != null) + { + for (int matIdx = 0; matIdx < recipeValue.materials.Length; matIdx++) + { + var material = recipeValue.materials[matIdx]; + if (material.id != 0 && material.num > 0) + { + string materialName = ""; + try + { + EC_IvtrItem matItem = EC_IvtrItem.CreateItem((int)material.id, 0, 1); + if (matItem != null) + { + materialName = matItem.GetName(); + } + } + catch (Exception ex2) + { + materialName = $"error: {ex2.Message}"; + } + + string matEntry = !string.IsNullOrEmpty(materialName) + ? $"{material.id} ({materialName}) x{material.num}" + : $"{material.id} (unknown) x{material.num}"; + materialInfo.Add(matEntry); + } + } + } + else + { + BMLogger.LogWarning($" Recipe {recipeId}: materials is null"); + } + } + } + } + catch (Exception ex) + { + BMLogger.LogWarning($" Failed to get data for recipe ID {recipeId}: {ex.Message}\n{ex.StackTrace}"); + } + + // Format: "RecipeID -> Output: ID (Name) | Materials: ID (Name) xCount, ..." + string goodsEntry = $"Recipe {recipeId}"; + if (!string.IsNullOrEmpty(outputItemInfo)) + { + goodsEntry += $" -> Output: {outputItemInfo}"; + } + else + { + goodsEntry += " -> Output: (none)"; + } + if (materialInfo.Count > 0) + { + goodsEntry += $" | Materials: {string.Join(", ", materialInfo)}"; + } + else + { + goodsEntry += " | Materials: (none)"; + } + goodsInfo.Add(goodsEntry); + } + } + } + + // Log page if it has a title or has goods + if (!string.IsNullOrEmpty(pageTitle) || goodsInfo.Count > 0) + { + string goodsList = goodsInfo.Count > 0 ? string.Join(", ", goodsInfo) : ""; + BMLogger.Log($" Page[{pageIdx}]: Title=\"{pageTitle}\", Goods=[{goodsList}], GoodsCount={goodsInfo.Count}"); + } + } + } } else if (DataType == DATA_TYPE.DT_NPC_DECOMPOSE_SERVICE) { - //NPC_DECOMPOSE_SERVICE pService = (NPC_DECOMPOSE_SERVICE)pData; - //CECHostPlayer pHost = GetHostPlayer(); - //CECSkill pSkill; - //int j = 0; - //for (j = 0; j < pHost.GetPassiveSkillNum(); j++) - //{ - // pSkill = pHost.GetPassiveSkillByIndex(j); - // if ((pSkill.GetType() == CECSkill::TYPE_LIVE || - // pSkill.GetType() == CECSkill::TYPE_PRODUCE) && - // (int)pService.id_decompose_skill == pSkill.GetSkillID()) - // { - // m_pLst_Main.AddString(strText + pService.name); - // break; - // } - //} - //if (j == pHost.GetPassiveSkillNum()) - // continue; + NPC_DECOMPOSE_SERVICE pService = (NPC_DECOMPOSE_SERVICE)pData; + string serviceName = Encoding.Unicode.GetString(MemoryMarshal.AsBytes(pService.name)); + + // Log NPC_DECOMPOSE_SERVICE data + BMLogger.Log($"NPC_DECOMPOSE_SERVICE detected - ServiceID: {a_uiService[i]}, DecomposeServiceID: {pService.id}, Name: {serviceName}, DecomposeSkillID: {pService.id_decompose_skill}"); + + CECHostPlayer hostPlayer = GetHostPlayer(); + bool hasRequiredSkill = false; + + // TODO: Implement proper skill check when GetPassiveSkillNum() and GetPassiveSkillByIndex() are available + // For now, we'll use reflection to access private GetPassiveSkillByID method or implement a workaround + // The C++ code checks if player has the required decompose skill (TYPE_LIVE or TYPE_PRODUCE) + try + { + // Try using reflection to access private GetPassiveSkillByID method + var method = typeof(CECHostPlayer).GetMethod("GetPassiveSkillByID", + System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + + if (method != null) + { + var pSkill = method.Invoke(hostPlayer, new object[] { (int)pService.id_decompose_skill, false }) as CECSkill; + if (pSkill != null) + { + int skillType = pSkill.GetType(); + int skillID = pSkill.GetSkillID(); + + BMLogger.Log($" Found skill by ID (via reflection): ID={skillID}, Type={skillType}"); + + // Check if this is the required decompose skill with correct type + if ((skillType == (int)CECSkill.SkillType.TYPE_LIVE || + skillType == (int)CECSkill.SkillType.TYPE_PRODUCE) && + (int)pService.id_decompose_skill == skillID) + { + hasRequiredSkill = true; + BMLogger.Log($" Skill check PASSED - Player has required decompose skill (ID: {pService.id_decompose_skill}, Type: {skillType})"); + m_pLst_Main.AddString(strText + serviceName); + m_pLst_Main.SetItemData(m_pLst_Main.GetCount() - 1, a_uiService[i]); + m_pLst_Main.SetItemDataPtr(m_pLst_Main.GetCount() - 1, pData); + } + else + { + BMLogger.Log($" Skill found but type mismatch - Expected TYPE_LIVE or TYPE_PRODUCE, got {skillType}"); + } + } + else + { + BMLogger.Log($" Skill check FAILED - Player does not have required decompose skill (ID: {pService.id_decompose_skill})"); + } + } + else + { + BMLogger.LogWarning($" GetPassiveSkillByID method not found via reflection - skill check cannot be performed"); + // For now, show the service anyway for logging/debugging purposes + // TODO: Remove this when proper skill check is implemented + hasRequiredSkill = true; + m_pLst_Main.AddString(strText + serviceName); + m_pLst_Main.SetItemData(m_pLst_Main.GetCount() - 1, a_uiService[i]); + m_pLst_Main.SetItemDataPtr(m_pLst_Main.GetCount() - 1, pData); + } + } + catch (Exception ex) + { + BMLogger.LogError($"Error checking decompose skill: {ex.Message}"); + BMLogger.LogError($"Stack trace: {ex.StackTrace}"); + // For debugging: show service anyway + hasRequiredSkill = true; + m_pLst_Main.AddString(strText + serviceName); + m_pLst_Main.SetItemData(m_pLst_Main.GetCount() - 1, a_uiService[i]); + m_pLst_Main.SetItemDataPtr(m_pLst_Main.GetCount() - 1, pData); + } + + if (!hasRequiredSkill) + continue; } else if (DataType == DATA_TYPE.DT_NPC_IDENTIFY_SERVICE) { @@ -3024,11 +3242,22 @@ namespace BrewMonster.UI else if (DataType == DATA_TYPE.DT_NPC_MAKE_SERVICE) { NPC_MAKE_SERVICE pService = (NPC_MAKE_SERVICE)pData; + string serviceName = Encoding.Unicode.GetString(MemoryMarshal.AsBytes(pService.name)); + + // Log NPC_MAKE_SERVICE data when selected + BMLogger.Log($"SelectListItem - NPC_MAKE_SERVICE selected - ServiceID: {iService}, MakeServiceID: {pService.id}, Name: {serviceName}, MakeSkillID: {pService.id_make_skill}, ProduceType: {pService.produce_type}"); + idFunction = (int)SERVICE_TYPE.NPC_MAKE; } else if (DataType == DATA_TYPE.DT_NPC_DECOMPOSE_SERVICE) { NPC_DECOMPOSE_SERVICE pService = (NPC_DECOMPOSE_SERVICE)pData; + string serviceName = Encoding.Unicode.GetString(MemoryMarshal.AsBytes(pService.name)); + + // Log NPC_DECOMPOSE_SERVICE data when selected + BMLogger.Log($"SelectListItem - NPC_DECOMPOSE_SERVICE selected - ServiceID: {iService}, DecomposeServiceID: {pService.id}, Name: {serviceName}, DecomposeSkillID: {pService.id_decompose_skill}"); + BMLogger.Log($" Note: This decompose service is being treated as idFunction={SERVICE_TYPE.NPC_DECOMPOSE}"); + idFunction = (int)SERVICE_TYPE.NPC_DECOMPOSE; } else if (DataType == DATA_TYPE.DT_NPC_IDENTIFY_SERVICE) @@ -3215,38 +3444,106 @@ namespace BrewMonster.UI } else if (idFunction == (int)SERVICE_TYPE.NPC_MAKE) { - // C++ - //NPC_MAKE_SERVICE pMake = (NPC_MAKE_SERVICE)pData; - //if (pMake.produce_type == 2) - // pShow1 = m_pAUIManager.GetDialog("Win_Produce1"); - //else - // pShow1 = m_pAUIManager.GetDialog("Win_Produce"); - //GetGameUIMan().m_pDlgProduce = (CDlgProduce*)pShow1; - //GetHostPlayer().PrepareNPCService(iService); - //pShow1.SetDataPtr(pMake, "ptr_NPC_MAKE_SERVICE"); - //if (pMake.produce_type == 1 || - // pMake.produce_type == 3 || - // pMake.produce_type == 4 || - // pMake.produce_type == 5) - // GetGameUIMan().m_pDlgProduce.ClearMaterial(); - //pShow2 = m_pAUIManager.GetDialog("Win_Inventory"); - //GetGameUIMan().m_pDlgProduce.UpdateProduce(1, 0); + NPC_MAKE_SERVICE pMake = (NPC_MAKE_SERVICE)pData; - // NPC_MAKE_SERVICE pMake = (NPC_MAKE_SERVICE)pData; - // if (pMake.produce_type == 2) - // pShow1 = m_pAUIManager.GetDialog("Win_Produce1"); - // else - // pShow1 = m_pAUIManager.GetDialog("Win_Produce"); - // GetGameUIMan().m_pDlgProduce = (CDlgProduce*)pShow1; - // GetHostPlayer().PrepareNPCService(iService); - // pShow1.SetDataPtr(pMake, "ptr_NPC_MAKE_SERVICE"); - // if (pMake.produce_type == 1 || - // pMake.produce_type == 3 || - // pMake.produce_type == 4 || - // pMake.produce_type == 5) - // GetGameUIMan().m_pDlgProduce.ClearMaterial(); - // pShow2 = m_pAUIManager.GetDialog("Win_Inventory"); - // GetGameUIMan().m_pDlgProduce.UpdateProduce(1, 0); + BMLogger.Log($"PopupCorrespondingServiceDialog - NPC_MAKE: produce_type={pMake.produce_type}, MakeSkillID={pMake.id_make_skill}"); + + // Dialog loading commented out - Win_Produce dialog not yet implemented + // Determine which dialog to use based on produce_type + //string dialogName = (pMake.produce_type == 2) ? "Win_Produce1" : "Win_Produce"; + //pShow1 = m_pAUIManager.GetDialog(dialogName); + + //if (pShow1 == null) + //{ + // BMLogger.LogError($"NPC_MAKE: Dialog '{dialogName}' not found! Service may not work correctly."); + // // Try alternative dialog name or create placeholder + // // For now, just log the error and continue + //} + //else + //{ + // // Get or set DlgProduce reference (if it exists) + // // GetGameUIMan().m_pDlgProduce = (CDlgProduce*)pShow1; + // + // // Prepare NPC service + // try + // { + // GetHostPlayer().PrepareNPCService(iService); + // } + // catch (Exception ex) + // { + // BMLogger.LogError($"NPC_MAKE: Error calling PrepareNPCService: {ex.Message}"); + // } + // + // // Set data pointer + // try + // { + // pShow1.SetDataPtr(pMake, "ptr_NPC_MAKE_SERVICE"); + // } + // catch (Exception ex) + // { + // BMLogger.LogError($"NPC_MAKE: Error setting data pointer: {ex.Message}"); + // } + // + // // Clear material for certain produce types + // if (pMake.produce_type == 1 || + // pMake.produce_type == 3 || + // pMake.produce_type == 4 || + // pMake.produce_type == 5) + // { + // try + // { + // // GetGameUIMan().m_pDlgProduce.ClearMaterial(); + // // Note: ClearMaterial() will be called when DlgProduce is implemented + // BMLogger.Log($"NPC_MAKE: Should clear material for produce_type={pMake.produce_type}"); + // } + // catch (Exception ex) + // { + // BMLogger.LogError($"NPC_MAKE: Error clearing material: {ex.Message}"); + // } + // } + // + // // Get inventory dialog + // pShow2 = m_pAUIManager.GetDialog("Win_Inventory"); + // + // // Update produce dialog + // try + // { + // // GetGameUIMan().m_pDlgProduce.UpdateProduce(1, 0); + // // Note: UpdateProduce() will be called when DlgProduce is implemented + // BMLogger.Log($"NPC_MAKE: Should call UpdateProduce(1, 0)"); + // } + // catch (Exception ex) + // { + // BMLogger.LogError($"NPC_MAKE: Error updating produce: {ex.Message}"); + // } + //} + + uint npcID = pCurNPCEssence.HasValue ? pCurNPCEssence.Value.id : 0; + + AUIDialog dlg = m_pAUIManager.GetDialog("Win_Produce"); + DlgProduce dlgProduce = dlg as DlgProduce; + if (dlgProduce == null) + { + CECGameUIMan gameUIMan = GetGameUIMan(); + DialogScriptTableObject dialogResource = gameUIMan.GetDialogResource(); + Canvas canvas = gameUIMan.GetCanvas(); + + if(dlgProduce != null && canvas != null) + { + GameObject ob = dialogResource.GetPrefabDialog("Win_Produce"); + if (ob != null) + { + dlgProduce = GameObject.Instantiate(ob, canvas.transform).GetComponent(); + } + } + } + + if(dlgProduce != null) + { + dlgProduce.Show(true); + dlgProduce.OpenProduce(npcID); + } + } else if (idFunction == (int)SERVICE_TYPE.NPC_DECOMPOSE) { @@ -3534,10 +3831,10 @@ namespace BrewMonster.UI else { EC_IvtrItem pItem = EC_IvtrItem.CreateItem((int)pService.storage_open_item, 0, 1); - string szMsg; // cannot open storage task m_pLst_Main.ResetContent(); - //m_pTxt_Content.SetText(bTaskNPC ? pCurNPCEssence.Value.hello_msg : szMsg.Format(GetStringFromTable(984), pItem.GetName())); + //string szMsg = string.Format(GetStringFromTable(984), pItem.GetName()); + //m_pTxt_Content.SetText(bTaskNPC ? Encoding.Unicode.GetString(MemoryMarshal.AsBytes(pCurNPCEssence.Value.hello_msg)) : szMsg); //SetData(NPC_DIALOG.NPC_DIALOG_TASK_LIST, ""); } } diff --git a/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgProduce.cs b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgProduce.cs new file mode 100644 index 0000000000..c10f7c9cb8 --- /dev/null +++ b/Assets/PerfectWorld/Scripts/UI/Dialogs/DlgProduce.cs @@ -0,0 +1,742 @@ +using BrewMonster.Network; +using BrewMonster.Scripts.Managers; +using BrewMonster.Scripts.Task; +using BrewMonster.UI; +using ModelRenderer.Scripts.Common; +using PerfectWorld.Scripts.Managers; +using PerfectWorld.Scripts.Task; +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using CSNetwork; +using System.Text; +using TMPro; + +namespace BrewMonster +{ + public class DlgProduce : AUIDialog + { + [Header("Produce Tabs")] + [SerializeField] private Transform tabBtnContainer; + [SerializeField] private GameObject tabBtnPb; + [SerializeField] private string tabButtonTextComponentName = "Text"; + + [Header("Produce Detail")] + [SerializeField] private Transform itemContainer; + [SerializeField] private GameObject itemPb; + + [Header("Quantity")] + [SerializeField] private List quantityText; + [SerializeField] private Button quantityIncreaseBtn; + [SerializeField] private Button quantityDecreaseBtn; + [SerializeField] private Button quantityMaxBtn; + + private int currentQuantity = 1; + + private int produceRemainCount = 0; + private bool isProducing = false; + + [Header("Material Slots")] + [SerializeField] private List materialSlots = new List(); + + [Header("Result Slot")] + [SerializeField] private Transform itemResult; + + [Header("Item Info Panel")] + public Transform itemInfoRoot; + public TextMeshProUGUI infoNameText; + public TextMeshProUGUI infoDescText; + public TextMeshProUGUI infoExtraText; + + private NPC_MAKE_SERVICE? cachedMakeService = null; + private int currentTabIndex = 0; + private uint selectedRecipeId = 0; // Track the currently selected recipe + + static readonly Color COLOR_NOT_ENOUGH = new Color32(145, 145, 145, 255); + static readonly Color COLOR_ENOUGH = Color.white; + + [SerializeField] private Button startProduceBtn; + [SerializeField] private Button cancelProduceBtn; + + public override void Start() + { + quantityText[0].text = currentQuantity.ToString(); + quantityText[1].text = currentQuantity.ToString(); + quantityDecreaseBtn.onClick.AddListener(OnClickDecreaseBtn); + quantityIncreaseBtn.onClick.AddListener(OnClickIncreaseBtn); + + if(quantityMaxBtn != null) + { + quantityMaxBtn.onClick.AddListener(OnClickMaxBtn); + } + } + + public void OpenProduce(uint npcId) + { + if (!LoadMakeService(npcId)) + { + Debug.LogError("[DlgProduce] LoadMakeService failed"); + return; + } + + selectedRecipeId = 0; // Reset selected recipe + SetupButtonHandlers(); + CreateTabs(); + OnTabSelected(0); + } + + void SetupButtonHandlers() + { + if (startProduceBtn != null) + { + startProduceBtn.onClick.RemoveAllListeners(); + startProduceBtn.onClick.AddListener(OnStartProduceClicked); + } + + if (cancelProduceBtn != null) + { + cancelProduceBtn.onClick.RemoveAllListeners(); + cancelProduceBtn.onClick.AddListener(OnCancelProduceClicked); + } + } + + bool LoadMakeService(uint npcId) + { + var edm = ElementDataManProvider.GetElementDataMan(); + if (edm == null) + return false; + + DATA_TYPE dt = DATA_TYPE.DT_INVALID; + object npcData = edm.get_data_ptr(npcId, ID_SPACE.ID_SPACE_ESSENCE, ref dt); + + if (dt != DATA_TYPE.DT_NPC_ESSENCE || npcData == null) + return false; + + NPC_ESSENCE npc = (NPC_ESSENCE)npcData; + if (npc.id_make_service == 0) + return false; + + DATA_TYPE serviceDt = DATA_TYPE.DT_INVALID; + object serviceData = edm.get_data_ptr( + npc.id_make_service, + ID_SPACE.ID_SPACE_ESSENCE, + ref serviceDt + ); + + if (serviceDt != DATA_TYPE.DT_NPC_MAKE_SERVICE || serviceData == null) + return false; + + cachedMakeService = (NPC_MAKE_SERVICE)serviceData; + return true; + } + + void CreateTabs() + { + ClearContainer(tabBtnContainer); + + if (!cachedMakeService.HasValue || cachedMakeService.Value.pages == null) + return; + + var makeService = cachedMakeService.Value; + + for (int pageIndex = 0; pageIndex < makeService.pages.Length; pageIndex++) + { + var page = makeService.pages[pageIndex]; + bool hasRecipes = false; + if (page.id_goods != null) + { + foreach (uint recipeId in page.id_goods) + { + if (recipeId != 0) + { + hasRecipes = true; + break; + } + } + } + + if (!hasRecipes) + continue; + + GameObject tabObj = Instantiate(tabBtnPb, tabBtnContainer); + tabObj.name = $"ProduceTab_Page_{pageIndex}"; + tabObj.SetActive(true); + + string pageTitle = ByteToStringUtils.UshortArrayToUnicodeString(page.page_title); + if (string.IsNullOrWhiteSpace(pageTitle)) + pageTitle = $"Page {pageIndex + 1}"; + + TMPro.TextMeshProUGUI tabTMP = null; + TextMeshProUGUI tabText = null; + + Transform textTf = tabObj.transform.Find(tabButtonTextComponentName); + if (textTf != null) + { + tabTMP = textTf.GetComponent(); + if (tabTMP == null) + { + tabText = textTf.GetComponent(); + } + } + + if (tabTMP == null && tabText == null) + { + tabTMP = tabObj.GetComponentInChildren(); + if(tabTMP == null) + { + tabText = tabObj.GetComponentInChildren(); + } + } + + if(tabTMP != null) + tabTMP.text = pageTitle; + else if(tabText != null) + tabText.text = pageTitle; + + Button btn = tabObj.GetComponent