rework netcafe course activation

This commit is contained in:
wish
2023-03-11 16:26:16 +11:00
parent c110082ab5
commit 29cf7add11
3 changed files with 17 additions and 13 deletions

View File

@@ -78,13 +78,18 @@ func updateRights(s *Session) {
s.server.db.QueryRow("SELECT rights FROM users u INNER JOIN characters c ON u.id = c.user_id WHERE c.id = $1", s.charID).Scan(&rightsInt)
s.courses = mhfpacket.GetCourseStruct(rightsInt)
rights := []mhfpacket.ClientRight{{1, 0, 0}}
var netcafeBitSet bool
var normalCafeBitSet, netcafeBitSet bool
for _, course := range s.courses {
if (course.ID == 9 || course.ID == 25 || course.ID == 26) && !netcafeBitSet {
if (course.ID == 9 || course.ID == 26) && !netcafeBitSet {
netcafeBitSet = true
rightsInt += 0x40000000 // set netcafe bit
rightsInt += 0x40000000
rights = append(rights, mhfpacket.ClientRight{ID: 30})
}
if (course.ID == 26) && !normalCafeBitSet {
normalCafeBitSet = true
rightsInt += 0x2000000
rights = append(rights, mhfpacket.ClientRight{ID: 25})
}
rights = append(rights, mhfpacket.ClientRight{ID: course.ID, Timestamp: 0x70DB59F0})
}
update := &mhfpacket.MsgSysUpdateRight{