|
|
发表于 2025-11-13 18:52:35
|
显示全部楼层
foggy大佬好~
我先搬运一下11月11日discord上@test234_大佬发布的大背包修复资料(ExpandedItem 11.Nov.2025)。然后还有些问题想请教。
在先前foggy大佬一楼已经分享的修改基础上,11月11日的版本里做了如下更新:
原本ijl15里的codecaves.h有这段代码:
- // Edit Foggy Set the isItemSlotIDover96 to ture if ID is over 96
- DWORD getItemSlotRectNewRtn = 0x0081E2CD;
- __declspec(naked) void getItemSlotRectNew()
- {
- __asm {
- push ebp
- mov ebp, esp
- push ecx
- push ecx
- pushad
- pushfd
- mov eax, [ebp + 8]
- cmp eax, 60h
- setg byte ptr[isItemSlotIDover96]
- jle skip_sub
- sub eax, 60h
- mov[ebp + 8], eax
- skip_sub :
- popfd
- popad
- jmp getItemSlotRectNewRtn
- }
- }
复制代码
现在修改为:
- // Edit Foggy Set the isItemSlotIDover96 to ture if ID is over 96
- DWORD getItemSlotRectNewRtn = 0x0081E2CD;
- __declspec(naked) void getItemSlotRectNew()
- {
- __asm {
- push ebp
- mov ebp, esp
- push ecx
- push ecx
- pushad
- pushfd
- mov [isItemSlotIDover96], 0
- cmp [ecx+604h], 0
- jz skip_sub
- mov eax, [ebp + 8]
- cmp eax, 60h
- setg byte ptr[isItemSlotIDover96]
- jle skip_sub
- sub eax, 60h
- mov[ebp + 8], eax
- skip_sub :
- popfd
- popad
- jmp getItemSlotRectNewRtn
- }
- }
复制代码
除此之外,没有观察到对ijl15更改时的差异。
值得一提的是,@test234_大佬11月11日的版本里其实整合了不少对于服务端的更新,但他声明里表明,那些更新只适配Cosmic,以下是他ExpandedItem 11.Nov.2025服务端部分的原文:
- // SERVER CODE PART
- // As for server part, different servers have different code. Thus I will mark which server do these modifcations come from for reference. Mainly [Beidou] and [Cosmic]
- // [Beidou] Server/StorageInventory.java [Beidou]
- public class StorageInventory{
- private final byte slotLimit; // Change to -> private final short slotLimit;
-
- public StorageInventory(){
- this.slotLimit = (byte) toSort.size(); // Change to -> this.slotLimit = (short) toSort.size();
- }
- private byte getSlotLimit() { // Change to -> private short getSlotLimit()
- }
- }
- // [Beidou] Client/Character.java
- private Character(){
- for (InventoryType type : InventoryType.values()) {
- byte b = 24; // Change to -> short b = 24;
- if (type == InventoryType.CASH) {
- b = 96; // Change to -> b = 192;
- }
- }
- }
- public byte getSlots(int type) { // Change to -> public short getSlots(int type) {
- return type == InventoryType.CASH.getType() ? 96 : inventory[type].getSlotLimit(); // Change the 96 into 192
- }
- public boolean canGainSlots (int type, int slots){
- return slots <= 96; // Change to -> return slots <= 192;
- }
- // [Beidou] Client/inventory/Inventory.java
- public class Inventory implements Iterable<Item> {
- protected byte slotLimit; // Change to -> protected short slotLimit;
- public Inventory(Character mc, InventoryType type, byte slotLimit) { // Change the byte into short
- public byte getSlotLimit() { // Change the byte into short
- slotLimit = (byte) newLimit; // Change the byte into short
- }
- }
- // [Beidou] util/PacketCreator.java
- protected static void addItemInfo(final OutPacket p, Item item, boolean zeroPosition) {
- if (equip != null) {
- if (pos < 0) {
- pos *= -1;
- }
- p.writeShort(pos > 100 ? pos - 100 : pos);
- } else {
- p.writeByte(pos);
- }
- // Change the whole part above into the part below
- if (equip != null) {
- if (pos < 0) {
- pos *= -1;
- p.writeShort(pos > 100 ? pos - 100 : pos);
- }
- else{
- p.writeShort(pos);
- }
- } else {
- p.writeByte(pos);
- }
- }
- public static Packet modifyInventory(boolean updateTick, final List<ModifyInventory> mods) {
- p.writeByte(mods.size()); // Change the writeByte into writeShort
- }
- // [Cosmic] Character.java
- // Thanks to @Yone and @Axel
- ret.getInventory(InventoryType.EQUIP).setSlotLimit(rs.getByte("equipslots"));
- ret.getInventory(InventoryType.USE).setSlotLimit(rs.getByte("useslots"));
- ret.getInventory(InventoryType.SETUP).setSlotLimit(rs.getByte("setupslots"));
- ret.getInventory(InventoryType.ETC).setSlotLimit(rs.getByte("etcslots"));
- ret.getInventory(InventoryType.CASH).setSlotLimit((short) 192);
- // [Cosmic] SpawnPetProcessor.java
- // byte change to short, thanks to @Dynamight
- public static void processSpawnPet(Client c, byte slot, boolean lead)
- // [Cosmic] SpawnPetHandler.java
- // byte slot change short , but Packet using readByte(), can direct replace with readShort() ? , thanks to @Dynamight
- byte slot = p.readByte();
- // [Cosmic] WeddingHandler.java
- // byte change short, thanks to @Dynamight
- Item item = chrInv.getItem((byte) slot);
- // [Cosmic] SpawnPetProcessor.java
- // byte change short, thanks to @Dynamight
- byte slot = (byte) p.readShort();
-
- // [Cosmic] SpawnPetHandler.java
- // Thansk to Axel
- package net.server.channel.handlers;
- import client.Client;
- import client.processor.action.SpawnPetProcessor;
- import net.AbstractPacketHandler;
- import net.packet.InPacket;
- public final class SpawnPetHandler extends AbstractPacketHandler {
- @Override
- public final void handlePacket(InPacket p, Client c) {
- p.readInt();
- short slot = p.readShort();
- boolean lead = p.readByte() == 1;
- SpawnPetProcessor.processSpawnPet(c, slot, lead);
- }
- }
复制代码
我已经对比了其中[Beidou]的部分,和先前foggy大佬分享时是一致的,没有任何变化。
按照我的理解,[Cosmic]的部分是基本不能给北斗用的(想请教:是否有值得借鉴的地方?),这次修复对于北斗来说,好像没什么修复。
我在用大背包时发现一个问题:对于被放在常规96格之后的装备,是没办法丢商店的。想请教一下这个问题修复的思路。 |
|