mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 14:30:10 +08:00
🐛 fix setdata&getdata
This commit is contained in:
parent
7dd81525e4
commit
c12c48dea6
@ -215,7 +215,7 @@ func (m *Control) GetData(gid int64) int64 {
|
|||||||
err = db.Find(m.service, &c, "WHERE gid = "+strconv.FormatInt(gid, 10))
|
err = db.Find(m.service, &c, "WHERE gid = "+strconv.FormatInt(gid, 10))
|
||||||
m.RUnlock()
|
m.RUnlock()
|
||||||
if err == nil && gid == c.GroupID {
|
if err == nil && gid == c.GroupID {
|
||||||
log.Debugf("[control] plugin %s of grp %d : %x", m.service, c.GroupID, c.Disable>>1)
|
log.Debugf("[control] plugin %s of grp %d : 0x%x", m.service, c.GroupID, c.Disable>>1)
|
||||||
return c.Disable >> 1
|
return c.Disable >> 1
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
@ -233,8 +233,9 @@ func (m *Control) SetData(groupID int64, data int64) error {
|
|||||||
c.Disable = 1
|
c.Disable = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
c.Disable &= 1
|
||||||
c.Disable |= data << 1
|
c.Disable |= data << 1
|
||||||
log.Debugf("[control] set plugin %s of all : %x", m.service, data)
|
log.Debugf("[control] set plugin %s of grp %d : 0x%x", m.service, c.GroupID, data)
|
||||||
m.Lock()
|
m.Lock()
|
||||||
err = db.Insert(m.service, &c)
|
err = db.Insert(m.service, &c)
|
||||||
m.Unlock()
|
m.Unlock()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user