1 min read

NetHack邮件集成:打通游戏沉浸与外部通讯的无缝桥梁

NetHack游戏内置的邮件通知功能,通过监视用户指定的mbox文件来触发,当检测到新邮件时,会生成一个“邮件卷轴”供玩家阅读。原生的mbox格式与现代邮件客户端(如mu4e)常用的maildir格式不兼容。

为解决此问题,采用Python脚本定期将maildir格式的新邮件(近5分钟内收到的)转换为mbox格式,并更新mbox文件的修改时间(mtime),以满足NetHack的触发条件。同时,使用`emacsclient`命令结合特定Emacs Lisp函数,在检测到新邮件时,无缝启动mu4e并跳转到未读邮件视图,实现不中断游戏沉浸感地处理邮件。

My other email client is a daemon
I have a slight problem wherein every time I start up a game of NetHack, I completely loose touch with my surroundings for hours on end. Thankfully The DevTeam Thinks Of Everything and there’s a solution that allows communication with the outside world without breaking immersion: the mail daemon!If compiled with -DMAIL and OPTIONS=mail is set in your runtime configuration (the default on Linux), NetHack will periodically check a user specified mbox file (MAIL) for new mail, and upon receiving an email a mail daemon will spawn in and deliver a scroll of mail to the player.
订阅情报