Jessecar96 / SteamBot

Automated bot software for interacting with Steam Trade
http://scrap.tf
MIT License
1.33k stars 911 forks source link

Ignore all Steam messages coming from people who are not on our friends list #702

Open scholtzm opened 9 years ago

scholtzm commented 9 years ago

This has been bothering me for a while now.

SteamBot does not ignore Steam messages coming from people who are not on our friends list. This way, you can even do a trade. Regular Steam client (partially) ignores these messages.

We already have this so the fix should be fairly straight forward.

cc @BlueRaja @WildCard65 @FrozenHaxor

Bottswana commented 9 years ago

Hmm. Can you actually initiate a trade with a bot not on your friends list, though?

scholtzm commented 9 years ago

Yes you can. You can initiate it and go through the trade just like with any other person on your friends list.

Bottswana commented 9 years ago

That’s a pain. But as you say, it should just be a cause of altering the message handler to not pass steam chats or trade requests on from non friends.

I’m surprised there’s not some form of check on the steam network itself for trading with non friends. Hmm.

From: Michael Scholtz [mailto:notifications@github.com] Sent: 28 January 2015 09:54 To: Jessecar96/SteamBot Cc: Bottswana Subject: Re: [SteamBot] Ignore all Steam messages coming from people who are not on our friends list (#702)

Yes you can.

— Reply to this email directly or view it on GitHub https://github.com/Jessecar96/SteamBot/issues/702#issuecomment-71807770 . https://github.com/notifications/beacon/AGlmRGu02jbiIInkqEC_Nmg28KY5mHSNks5nmKlSgaJpZM4DYPNL.gif

FrozenHaxor commented 9 years ago

Also somehow blocked people count as friends. For example if you block someone and remove them, this won't decrease, which is extremely annoying. I assume this is just another example of the stated above... the wonders of Steam.

WildCard65 commented 9 years ago

@FrozenHaxor I think that issue would be more useful if reported to the SteamKit repo

scholtzm commented 9 years ago

That's actually not an issue, but that's how Steam works. People on your block list are part of your "global" friends list. You need to check relationship between you and the person. Another example is someone who adds you - this person automatically becomes part of your friends list with EFriendRelationship.RequestRecipient.

Bottswana commented 9 years ago

Yeah I wouldn't say this is SteamKit's fault. It's just doing it's job passing on the messages it receives from the network; I mean, if it's anyones fault it's the steam network itself.

BlueRaja commented 9 years ago

You need to check relationship between you and the person.

I wrote that code, I wasn't aware of this. How do we 'check relationship'?

doktokto commented 9 years ago

Wow, I don't ever thought that it's bug, I just used

if (Bot.SteamFriends.GetFriendRelationship(OtherSID) == EFriendRelationship.Friend)
{
...
}
scholtzm commented 9 years ago

@BlueRaja Which code is "that code"? :smile: You can check the relationship the way @doktokto described.