Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AS3 client cant receive more then 100 buddies #58

Open
Bale001 opened this issue Aug 15, 2020 · 7 comments
Open

AS3 client cant receive more then 100 buddies #58

Bale001 opened this issue Aug 15, 2020 · 7 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@Bale001
Copy link
Contributor

Bale001 commented Aug 15, 2020

If a user has more than 100 buddies the client will break. Here is a screenshot of the bug happening (from a player in newcp)
image
image

To fix the bug, send the first 100 buddies in response to b#gb, the client will see you didnt send all their buddies and will send a u#rpfi packet. Send the rest of the users buddies in response to that (in a gb packet like before). Also, you still cannot send more then 100 buddies in response to the rpfi packet, so if the user has 230 buddies, send another 100 buddies in response to rpfi, and the client will keep sending an rpfi packet until all buddies are received.

@ben-pearce
Copy link
Member

ben-pearce commented Sep 27, 2020

Hi, first of all, thank you for your detailed explanation and research into this bug, and apologies for my delayed response.

Unfortunately I am unable to replicate what you're experiencing.

I sent 110 buddies in the b#gb packet response but all 110 buddies show up.

Replaced line 88 with

await p.send_xt('gb', *buddies, *[f'{i}|P{i}|0' for i in range(110)])

In buddies.py.

And the result:
Screenshot from 2020-09-27 23-05-51

Also, your explanation doesn't really make sense since, my buddies API has no handler for rpfi. It is mentioned in the original client but it leads nowhere, it has no client-side handlers. So I guess I don't really understand how that is solving the issue!

// airtower.as
var REFRESH_PLAYER_FRIEND_INFORMATION = "rpfi";
// shell.as
function sendRefreshPlayerFriendInfo()
{
   AIRTOWER.send(AIRTOWER.PLAY_EXT,AIRTOWER.PLAYER_HANDLER + "#" + AIRTOWER.REFRESH_PLAYER_FRIEND_INFORMATION,[],"str",getCurrentServerRoomId());
}

To confirm this, I sent half the buddies with b#gb and the rest with u#rpfi.

await p.send_xt('gb', *buddies, *[f'{i}|P{i}|0' for i in range(50)])
await p.send_xt('rpfi', *[f'{i}|P{i}|0' for i in range(50, 110)])

And I only got the first 50 buddies (sent in the gb (get buddy) handler):

Screenshot from 2020-09-27 23-11-44

To push this further, I tried with 1000 buddies, and they still all showed up.

@ben-pearce ben-pearce self-assigned this Sep 27, 2020
@ben-pearce ben-pearce added the help wanted Extra attention is needed label Sep 27, 2020
@Bale001
Copy link
Contributor Author

Bale001 commented Sep 28, 2020

First of all, I said to send the rest of the buddies in response to the rpfi packet, as in the client sends the rpfi packet, and I respond to it with a gb packet. I'm not really sure why yours works fine... i'll try recreating the bug later

@AllinolCP
Copy link
Member

maybe this issue isn't caused by the dependency/packet itself, maybe its caused by the db throttled or something?

@sky-is-winning
Copy link
Contributor

maybe this issue isn't caused by the dependency/packet itself, maybe its caused by the db throttled or something?

Surely if the db was throttled from getting buddies the same thing would happen with items, powercards, furniture and anything else that gets a load of entries from the db at the same time though?

@AllinolCP
Copy link
Member

AllinolCP commented Aug 19, 2021

Yes but both of them doesn't use db_transaction

maybe this issue isn't caused by the dependency/packet itself, maybe its caused by the db throttled or something?

Surely if the db was throttled from getting buddies the same thing would happen with items, powercards, furniture and anything else that gets a load of entries from the db at the same time though?

Yes but items, powercards, furniture doesn't use db_transaction NVM they did

@AllinolCP
Copy link
Member

I sent 230 buddies and the buddy list refuses to work at all, so i guess there's another lead on this story

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants
@ben-pearce @Bale001 @AllinolCP @sky-is-winning and others