Skip to content

Commit

Permalink
inventory packet base
Browse files Browse the repository at this point in the history
  • Loading branch information
shnok committed Jul 25, 2024
1 parent 7c2f56c commit e2f76c6
Show file tree
Hide file tree
Showing 17 changed files with 342 additions and 137 deletions.
162 changes: 81 additions & 81 deletions l2-unity/Assets/Scenes/Menu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 0.245
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 1061591418}
m_IndirectSpecularColor: {r: 0.063133255, g: 0.093109384, b: 0.10891574, a: 0.245}
m_IndirectSpecularColor: {r: 0.056544498, g: 0.088350356, b: 0.10549344, a: 0.245}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down Expand Up @@ -123,75 +123,6 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!21 &197917878
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Override
m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _DirectionalFalloff: 2
- _DirectionalIntensity: 1
- _FarDistanceHeight: 0
- _FarDistanceOffset: 0
- _FogAxisMode: 1
- _FogCameraMode: 0
- _FogCat: 1
- _FogColorDuo: 1
- _FogDistanceEnd: 100
- _FogDistanceFalloff: 2
- _FogDistanceStart: 0
- _FogHeightEnd: 100
- _FogHeightFalloff: 2
- _FogHeightStart: 0
- _FogIntensity: 1
- _FogLayersMode: 0
- _IsHeightFogPreset: 1
- _IsHeightFogShader: 1
- _JitterIntensity: 1
- _NoiseCat: 1
- _NoiseDistanceEnd: 50
- _NoiseIntensity: 1
- _NoiseMax: 1
- _NoiseMin: 0
- _NoiseModeBlend: 1
- _NoiseScale: 30
- _SkyboxCat: 1
- _SkyboxFogBottom: 0
- _SkyboxFogFalloff: 1
- _SkyboxFogFill: 1
- _SkyboxFogHeight: 1
- _SkyboxFogIntensity: 1
- _SkyboxFogOffset: 0
m_Colors:
- _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1}
- _DirectionalDir: {r: 0, g: 0, b: 0, a: 0}
- _FogAxisOption: {r: 0, g: 0, b: 0, a: 0}
- _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1}
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
--- !u!1 &413261805
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -291,19 +222,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.size
value: 4
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.data[0]
value: 17_25
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.data[1]
value: 16_24
value: 17_25
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.data[2]
value: 17_24
value: 17_25
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.data[3]
Expand Down Expand Up @@ -512,6 +443,41 @@ MonoBehaviour:
_entityMask:
serializedVersion: 2
m_Bits: 64
--- !u!21 &968757019
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
--- !u!1001 &1001879169
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -868,7 +834,7 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3}
--- !u!21 &1446991640
--- !u!21 &1237903006
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -937,23 +903,23 @@ Material:
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
--- !u!21 &1487777543
--- !u!21 &1446991640
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Name: Override
m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
Expand All @@ -965,12 +931,46 @@ Material:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _DirectionalFalloff: 2
- _DirectionalIntensity: 1
- _FarDistanceHeight: 0
- _FarDistanceOffset: 0
- _FogAxisMode: 1
- _FogCameraMode: 0
- _FogCat: 1
- _HeightFogGlobal: 1
- _FogColorDuo: 1
- _FogDistanceEnd: 100
- _FogDistanceFalloff: 2
- _FogDistanceStart: 0
- _FogHeightEnd: 100
- _FogHeightFalloff: 2
- _FogHeightStart: 0
- _FogIntensity: 1
- _FogLayersMode: 0
- _IsHeightFogPreset: 1
- _IsHeightFogShader: 1
- _JitterIntensity: 1
- _NoiseCat: 1
- _NoiseDistanceEnd: 50
- _NoiseIntensity: 1
- _NoiseMax: 1
- _NoiseMin: 0
- _NoiseModeBlend: 1
- _NoiseScale: 30
- _SkyboxCat: 1
m_Colors: []
- _SkyboxFogBottom: 0
- _SkyboxFogFalloff: 1
- _SkyboxFogFill: 1
- _SkyboxFogHeight: 1
- _SkyboxFogIntensity: 1
- _SkyboxFogOffset: 0
m_Colors:
- _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1}
- _DirectionalDir: {r: 0, g: 0, b: 0, a: 0}
- _FogAxisOption: {r: 0, g: 0, b: 0, a: 0}
- _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1}
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
--- !u!1 &1592191233
GameObject:
Expand Down Expand Up @@ -1455,4 +1455,4 @@ SceneRoots:
- {fileID: 803395388}
- {fileID: 1093616925}
- {fileID: 413261807}
- {fileID: 2895990127247051527}
- {fileID: 2895990127247051527}
12 changes: 11 additions & 1 deletion l2-unity/Assets/Scripts/Game/Item/ItemInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class ItemInstance
[SerializeField] private ItemCategory _category;
[SerializeField] private bool _equipped;
[SerializeField] private ItemSlot _bodyPart;
[SerializeField] private int _enchantLevel;
[SerializeField] private long _remainingTime;

public AbstractItem ItemData { get { return _itemData; } }
Expand All @@ -24,9 +25,10 @@ public class ItemInstance
public int Count { get { return _count; } }
public ItemCategory Category { get { return _category; } }
public ItemSlot BodyPart { get { return _bodyPart; } }
public int EnchantLevel { get { return _enchantLevel; } }
public long RemainingTime { get { return _remainingTime; } }

public ItemInstance(int objectId, int itemId, ItemLocation location, int slot, int count, ItemCategory category, bool equipped, ItemSlot bodyPart, long remainingTime) {
public ItemInstance(int objectId, int itemId, ItemLocation location, int slot, int count, ItemCategory category, bool equipped, ItemSlot bodyPart, int enchantLevel, long remainingTime) {
_objectId = objectId;
_itemId = itemId;
_location = location;
Expand All @@ -36,6 +38,7 @@ public ItemInstance(int objectId, int itemId, ItemLocation location, int slot, i
_equipped = equipped;
_bodyPart = bodyPart;
_remainingTime = remainingTime;
_enchantLevel = enchantLevel;

if (_category == ItemCategory.Weapon) {
_itemData = ItemTable.Instance.GetWeapon(_itemId);
Expand All @@ -48,6 +51,13 @@ public ItemInstance(int objectId, int itemId, ItemLocation location, int slot, i
} else {
_itemData = ItemTable.Instance.GetEtcItem(_itemId);
}

Debug.Log(this.ToString());
}

public override string ToString() {
return $"New item: ServerId:{_objectId} ItemId:{_itemId} Location:{_location} Slot:{_slot} Count:{_count} " +
$"Cat:{_category} Equipped:{_equipped} Bodypart:{_bodyPart}";
}

// Packet data
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RequestInventoryOpenPacket : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RequestInventoryUpdateOrderPacket : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ public enum GameClientPacketType : byte
RequestMoveDirection = 0x09,
RequestSetTarget = 0x0A,
RequestAutoAttack = 0x0B,
RequestCharSelect = 0x0C
RequestCharSelect = 0x0C,
RequestInventoryOpen = 0x0D,
RequestInventoryUpdateOrder = 0x0E
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ public enum GameServerPacketType : byte
ActionFailed = 0x14,
ServerClose=0x15,
StatusUpdate = 0x16,
ActionAllowed = 0x17
ActionAllowed = 0x17,
InventoryItemList = 0x18,
InventoryUpdate = 0x19
}
Loading

0 comments on commit e2f76c6

Please sign in to comment.