Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
I added a lot of equipment to element. data, but found that when the equipment ID was greater than 65535, the characters could not see each other's equipment, that is to say, the equipment could only be seen by themselves. How to solve this problem?
It doesn't seem to be due to tools. I used sELedit to modify the ID of a device, and used Ultra Compare to make hexadecimal comparisons, and found no problem.
In v496 and previous versions, the ID will not be greater than 60,000, so if the ID of a piece of equipment or fashion is greater than 65,535, there will never be conflict.
this is a problem with the way packets are sent to and from the game to the server, anything greater then 65535 will not be seen by other players because of the way packets are sent, this is an intentional hard cap to the game
probably the only way to fix it would be to learn intel x86 assembly and edit the client, and certain parts of the server to remove this limitation. good luck
probably the only way to fix it would be to learn intel x86 assembly and edit the client, and certain parts of the server to remove this limitation. good luck
problem is i only know one person that has the source code, and he is not sharing. so that only leaves decompiling the binary. and the game.exe has several protections in it to prevent that. Gothic i would send you this in pm but sadly we have that silly 1 msg every 30minutes limit, i'll just say you are still on my steam friend list, look for Mirarora.
Okay. I am going to teach all of you how to increase the MAX_ITEM_INDEX to a number greater than 65535.
If you have IDA Pro, this is very easy to do -- even if you do not have a working knowledge of ASM.
Place the 'gs' into x86 Ida and let it disassemble, this may take some time.
We are looking for two functions:
Code:
static inline void SetCashItem(size_t citem_id)
{
ASSERT(citem_id < MAX_ITEM_INDEX);
_cash_item_flag[citem_id] = 1;
}
static inline bool IsCashItem(size_t item_id)
{
if(item_id >= MAX_ITEM_INDEX) return false;
return _cash_item_flag[item_id];
}
and lastly the constructor for the item_manager class, which will not be returned in our imm search.
These functions are right on top of one another in the game server.
So... to do this really easily, do as follows:
In the IDA View-A window. Press ALT I ..
Enter 0xFFFE and check the "Final all occurrences" option.
The result will look like:
81 7D 08 FE FF 00 00 76 09 C7 45 FC 00 00 00 00
and change it to:
81 7D 08 9F 86 01 00 76 09 C7 45 FC 00 00 00 00
After you have made the changes, return to the edit menu -> Patch Program -> Apply Patches to input file. Click "Create backup" just in case.
Now copy the patched 'gs' to your Linux system.
Congratulations .. you can now have items in the server side elements.data that are greater than the default of 65535... as in it will not segfault when loading.
Now, as for why other players cannot see equipment or fashion with an Id above 65535, is exactly the reason stated above.
The value of ItemId in the two packets that need modification are unsigned shorts, which have their limit at 65535... changing to unsigned int is a much bigger job. It is not as simple as changing the two structures in the change to unsigned int .. there are more functions in the 'gs' that require modification.
Basically the same - not sure if Ghidra has Patch file, but I would get the file offset, and use a hex editor to make the modification. Let me know if you have any troubles.
I've followed your steps to make changes, but there may be something wrong, GS can't start after being packed.GS is about 100M after compression. Can you share your modified GS file?
I know what the problem is. I tried to use your tool on the v458 GS file, which caused some exceptions. I realized that there might be a difference between v458 and v496, so I tried again with the v496 GS file and it worked. V458 is a version circulated by Chinese players. I compare the GS files, and the difference of their last modification time is one day.
@Fyyre
It seems that this problem has nothing to do with the server. I tested using your method to modify gs. The GS modification was successful, but found that this method can not solve this problem. The client still can't see the equipment and time with ID greater than 65535. There is no big problem for the server to use items with ID greater than 65535, and attributes are normally added to the role. This seems to be a client problem.
After reverse engineering the client source code that was leaked by loko awhile back for version 000480x this problem lies within SMElementClient Network Protocol gamedatasend under this code here
if you can successfully hex edit the game.exe client file to allow this to be higher (havent done it myself yet, only identified it)
you can in theory fix this, this network protocol is what reads the elements.data ID's and other data, setting this to value 99999 would fix the problem entirely, just make sure the gs binary is also the same to prevent further issues
for same sex marriage you must identify this code here
and disable the gender check in this file under TaskPremise, i have made the modifications to the server side and with developer client this works as the gender check is ignored with dev client