mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
rework netcafe course activation
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user