Jump to content

Packet Size Increase for mmo_charstatus


nitrous

Recommended Posts


  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

If you've added to the max limits of storage, inventory, cartinventory, skill, or basically any #define that's used in mmo_charstatus, updating your rAthena to the newest hash might have caused some errors.

 

This is because with the addition to Random Options, the size of the item data structure increased. Therefore, you either need to trim the size of mmo_charstatus (which can be up to 65510 bytes big), or change the packet structure of the packets that transfer mmo_charstatus between the map and char server.

 

I did the latter.

 

Here's the diff.

 

Note - I logged in and stored about 1500 items in the storage, logged off, restarted the server, logged back in, and all my items were there. Didn't test the max, but I assume it's around 32000 (the max of a short).

 

If you use this diff and your server crashes or items are lost, please don't blame me. This is supposed to be used for people who want to use random options AND have already increased their storage size. I don't know the reason for some of the values the rAthena devs chose for these #defines, so I could be changing something I shouldn't be.

 

EDIT: This is now a WIP, as I tried to increase the max storage to 5000 and the mapserver disconnected, even though (in theory) it should have worked. Once I fix I'll post again.

 

EDIT 2: I've seem to found the reason for the error. FIFOSIZE_SERVERLINK must be set high enough for the biggest packet size you're using (which is this packet). The diff has been updated to reflect this. If you need even more space, increase that value. This should now work, and thus no longer a WIP.

Edited by Nitrous
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  623
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

Thank you so much, I'll try.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  5
  • Reputation:   0
  • Joined:  08/15/16
  • Last Seen:  

Could you upload your files of the scr folder to overwrite on my server and test if going working good? Thanks for you help ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  5
  • Reputation:   0
  • Joined:  08/15/16
  • Last Seen:  

If you've added to the max limits of storage, inventory, cartinventory, skill, or basically any #define that's used in mmo_charstatus, updating your rAthena to the newest hash might have caused some errors.

 

This is because with the addition to Random Options, the size of the item data structure increased. Therefore, you either need to trim the size of mmo_charstatus (which can be up to 65510 bytes big), or change the packet structure of the packets that transfer mmo_charstatus between the map and char server.

 

I did the latter.

 

Here's the diff.

 

Note - I logged in and stored about 1500 items in the storage, logged off, restarted the server, logged back in, and all my items were there. Didn't test the max, but I assume it's around 32000 (the max of a short).

 

If you use this diff and your server crashes or items are lost, please don't blame me. This is supposed to be used for people who want to use random options AND have already increased their storage size. I don't know the reason for some of the values the rAthena devs chose for these #defines, so I could be changing something I shouldn't be.

 

EDIT: This is now a WIP, as I tried to increase the max storage to 5000 and the mapserver disconnected, even though (in theory) it should have worked. Once I fix I'll post again.

 

EDIT 2: I've seem to found the reason for the error. FIFOSIZE_SERVERLINK must be set high enough for the biggest packet size you're using (which is this packet). The diff has been updated to reflect this. If you need even more space, increase that value. This should now work, and thus no longer a WIP.

 

Excelent work my friend.

 

I rewrote the files that you shared and I had tested on my local server with MAX_STORAGE 2000, MAX_INVENTORY 250 and MAX_CART 300 and run great.

 

This is src files update 

 

http://www.mediafire.com/download/w5onbs3efbbfqg8/src.rar

 

Thank you so much.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

looks very dangerous, is not it? Can you please make a pr to rathena, and get attention from other dev's to issue? Because many of us using a lot of custom mods inside rAthena, and mmo_charstatus size limit a big pain in ass for us. Sure, we can minimize memory usage by changing variables to use less amout of bytes, but it's not good idea...

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

I doubt the people in charge of rAthena would try to merge this, since if you're using stock rAthena there's no issue with the mmo_charstatus size.

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  192
  • Reputation:   43
  • Joined:  12/13/11
  • Last Seen:  

mmo_charstatus is currently extremly limited.
 

I was forced to:
- Remove extra storage
- Revert Max Party members back to official
- Revert Max Friends back to official

YET I'M STILL HAVING ISSUES!!!

There's really NOT much i've increased.
Maybe guild members, and yet i'm still getting disconnected!!!!!!

 

If rAthena Devs are not willing to help in this situation, they should remove ALL possibilities of those "now" useless settings.

In case it's possible to be implemented.

 

If not, they should still remove all useless settings.

 

 

 

This is a big piece of ********
I would prefer to dump those new ******** features instead.
 

Edited by Everade
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

 

Hi, take a look for this information: https://github.com/rathena/rathena/pull/1524#issuecomment-242977796

This table in my comment telling where a reason of the problem, and why this problem happened.

As you see problem related ONLY for increased size in struct item.

So, solution can be another and easy:

1. You should define structure in item structure ONLY if you enable it.

2. Then, when you will compile server and will use it, your item structure will back to normal (like it was before of implementation this random option feature).

What do you need todo?

A lot of changes man... really a lot..

1. open src/config/core.h and add extra lines like:

At this point you making defining option related only to feature (which you will disable by default for your server)

// Random Option Feature
// Minimal client required for feature is 20150315
// This feature increase item structure usage, so you will be limited in item strorage, cart, etc structures
// Can cause a lot of problems on servers with custom changes and not default values for storage, cart, etc.
// #define RANDOM_OPTION_FEATURE

2. Then, with your favorite text editor you should to find all mentions in code related to MAX_ITEM_RDM_OPT + you need manually watch each file with ITEM_RDM and replace

#if PACKETVER >= 20150226

to

#if RANDOM_OPTION_FEATURE

+ many parts of code in files which you will edit WILL NOT have this string define, so you should with search option in your text editor find them manually.

 

3. Then, recompile, and you will get stable mmo_charstatus with normal size like it should to be, because your struct item will not have random option structure inside item structure, you you should to have next code :

struct item {
	int id;
	unsigned short nameid;
	short amount;
	unsigned int equip; // location(s) where item is equipped (using enum equip_pos for bitmasking)
	char identify;
	char refine;
	char attribute;
	unsigned short card[MAX_SLOTS];
#if RANDOM_OPTION_FEATURE
	struct {
		short id;
		short value;
		char param;
	} option[MAX_ITEM_RDM_OPT];		// max of 5 random options can be supported.
#endif
	unsigned int expire_time;
	char bound;
	uint64 unique_id;
};

4. sure i don't talk about extra code edits like checking if your #define RANDOM_OPTION_FEATURE has enabled in mmo.h #packet_ver > 20150315, but it's not really important for now.

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  192
  • Reputation:   43
  • Joined:  12/13/11
  • Last Seen:  

I appreciate your help.

The thing is that this, sooner or later, is going to cause issues.
Issues related to rAthena code or more likely client updates.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...