Code Monkey home page Code Monkey logo

lgtbot's Introduction

Anurag's GitHub stats

Okami

lgtbot's People

Contributors

darkvana avatar dvacheng avatar jeffxzy avatar slontia avatar tiedangh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lgtbot's Issues

允许游戏外玩家参与互动

游戏进行中时,场外旁观的玩家可以通过一些方式与bot互动。例如,Nerduel、wordle等游戏中,场外玩家如果提前猜到某个玩家的目标,可以向裁判场外提交。
期望实现方式:框架提供游戏进行中场外玩家向bot私聊或@发送信息时的回调接口。

Timer逻辑上移至match层

目前在game层做timer逻辑,如果time up导致game over,会出现内存释放冲突的问题。将timer上调至match层还有个好处是可以将逻辑和request的逻辑统一,这样可以简化锁逻辑等

记录试玩游戏结果到数据库中

试玩游戏依然不应当对分数造成任何影响,同时不应当影响等级分变动的幅度

可以考虑将试玩游戏的记录放到单独一张表中

更新游戏不重启机器人

重新载入动态库,不重启机器人

需要调研在有游戏正在进行的情况下,释放动态库,会不会引发内存问题

支持倍率设置

  • 每个游戏可以设置自己的默认倍率
  • 倍率为 0 表示试玩
  • 调整倍率视为配置变更,会清掉所有玩家
  • 快速命令:#新游戏 xxx 试玩
  • 调高倍率,需要保证所有参赛玩家零和分大于或等于倍率 * 1000,且头名分大于或等于倍率 * 10(可以暂不支持)
  • 倍率同时对零和分和头名分生效

排行榜动态更新

对于零和分与头名分,取最近 6 个月或最近 1000 次比赛的分数;对于等级分,最近 3 个月没有参加过游戏的玩家不计入排行

有机器人在场时,当所有用户都被淘汰后,游戏无法结束

如果所有用户都被淘汰,且有机器人在场,此时计时器会重新计时,但是玩家已经无法执行操作了,导致要等很久,游戏才会结束。

几种解决方案:

  1. 最后一名玩家被淘汰时,游戏随即结束。此时有两种选择
    • 立刻算分——对游戏编写者要求比较高,不能等到主阶段结束前再统计分数
    • 游戏作废——和全员强制退出逻辑保持一致,但这未必合理
  2. 游戏自动推进。此时也有几种选择
    • 持续输出中间过程——会造成刷屏,有风控危险
    • 仅给出最终分数——可能会让玩家一头雾水
    • 每 30s 输出一回合的结果

避免恶意解散游戏

几种方法:

  1. 创建的新游戏有冷却时间,一段时间内禁止被解散
  2. 修改指令为 #新游戏 <游戏名称> 强制
  3. 解散一次游戏后,只有参加过一次游戏,才可再实行解散的权利

数据落盘

初步考虑core暴露数据接口,将RocksDB嵌入到lgtbot-coolq,lgtbot-coolq将数据写入到RocksDB
RocksDB是嵌入式数据库,灵活度更高,但是在windows环境下编译很恶心

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.