添加会话
(gid, uid int64, dataPath string)
| 87 | |
| 88 | // 添加会话 |
| 89 | func addSession(gid, uid int64, dataPath string) { |
| 90 | cls := Session{} |
| 91 | cls.GroupID = gid |
| 92 | cls.Creator = uid |
| 93 | cls.Users = append(cls.Users, uid) |
| 94 | cls.IsValid = false |
| 95 | cls.Max = 3 |
| 96 | cls.Cartridges = cls.rotateRoulette() |
| 97 | cls.ExpireTime = 300 |
| 98 | cls.CreateTime = time.Now().Unix() |
| 99 | |
| 100 | saveItem(dataPath, cls) |
| 101 | } |
| 102 | |
| 103 | // 获取参与人数 |
| 104 | func (cls Session) countUser() int { |
no test coverage detected