Original Summary

盘点L站的徽章 长期更新!(2026.2.17 更新) 文档共建 盘点 L 站的徽章长期更新!(2026.2.17 更新!!!!!!!!) 学习学习 [!warning] 注意!!!!!!!! 做 Wiki 编辑的徽章就做,别把整个教程帖子内容覆盖成无意义的内容!!! [!caution] 注意、注意、注意 由于服务器有延迟,可能会存在达成了徽章获取条件但没有拿到徽章的情况,请坐和放宽,至多到第二天的凌晨四点就会刷新徽章获取情况。如果还是没有… 徽章参考此处 cdk在进行社区分数计数统计时会使用如下代码 func (u User) CalculateUserScore(badges []Badge, badgeScores map[int]int) int { var totalScore int for _, badge := range badges { if score, exists := badgeScores[badge.ID]; exists { totalScore += score } } return totalScore - int(config.Config.ProjectApp.DeductionPerOffense)int(u.ViolationCount) } Score = \sum_{b \in \text{用户已得徽章}} \text{badgeScores}[b.ID] - \text{DeductionPerOffense} \times \text{ViolationCount} 其中 DeductionPerOffense 在 config.example.yaml 里默认 5 ,即每被记一次违规扣 5 分。 ViolationCount 是佬在 CDK 系统内的违规次数,由chen佬侧记录,跟 Linuxdo 无关。 然后钳位到[-100,100],这里也回答一下这个问题的答案w https://linux.do/t/topic/3009680?u=4242 func (u User) SetScore(tx gorm.DB, newScore int) error { if newScore < MinUserScore { // -100 u.Score = MinUserScore } else if newScore > MaxUserScore { // 100 u.Score = MaxUserScore } else { u.Score = int8(newScore) } return tx.Model(u).Update("score", u.Score).Error } 不过不知道是不是新版的原因,42没找到 score … 1 个帖子 - 1 位参与者 阅读完整话题


  • 情报分类:服务器与云资源
  • 分类依据:内容涉及服务器、云资源或网络线路
  • 信息来源:服务器 / LINUX DO - 最新话题
  • 发布时间:2026/10/12 17:57:34