So I was thinking of writing a irc bot/bot extension that lets users play certain text based games by starting the game,
sending parts of certain lines they enter(regexp match for game signal if not in bots channel ex. rbot gamename enter the forest . sends "enter the forest) to std in of game,
while standard out of game is cached by bot and the piped to the channel (ex. "let us rejoice for the duck has been defeated" gets read into a line cache inside the bot and then the bot sends it to the appropriate channel as
gamename: let us rejoice for
gamename: the duck has been defeated" )
But I'm sort of worried about the tricky things people on irc might do, would stripping all non printable characters be enough safety? If a program quits (say they enter the quit command for the game) what happens when you try writing to the file descriptor for that programs std in(error)? Any other potential problems? Note I'm going to run this on linux or *bsd so I don't need to worry about windows specific things.