I'd guess that anything that makes you interesting or entertaining will make you friends, of a sort, and having friends makes you less vulnerable to any random guy who's bored and unhappy and looking for someone to feel stronger than.
If folks are sufficiently hard up for entertainment that they're willing to pay a dollar (more than you'd think, in prison) for a game of chess, they're gonna value that game and its provider.