[Fix] Add Bazaar BulkSendTrader Limit for RoF2 #4590
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
RoF2 has a client limit of 600 traders. Currently, this is not checked server side and therefore if there are more than 600 traders (reached with THJ large player base), the client would crash upon receiving the BulkSendTrader list packet.
This packet populates the bazaar search window dropdown list of traders and is required for the window to function.
With this fix, I have created a constant for RoF2 for this limitation allow for this to be easily modified as newer clients are added. This will allow the server operator to have more than 600 traders, and limit the packet to 600 max. The client allows for 'all traders' (the 600 limit) and 'local traders' (the players current zone). I have therefore created the packet to include all the traders from the players local zone and then augment to the 600 max with traders from outside the local zone. This will allow players to search 'up to' 600 traders, and always have access to the local traders (which on THJ is set to 200).
Type of change
Please delete options that are not relevant.
Testing
This was tested with a trader table of 1000 traders, with 12 in instance 34 and the remaining 988 in instance 35. The client was able to login without crashing, zone without crashing and retrieve 12 traders with local trader searching, and 600 for all traders, which included the 12.
Clients tested:
RoF2
Checklist