MCPcopy Index your code
hub / github.com/FloatTech/ZeroBot-Plugin / checkEquipFor

Method checkEquipFor

plugin/mcfish/main.go:313–332  ·  view source on GitHub ↗

*********************************************************/ ************************装备相关函数***********************/ *********************************************************/

(uid int64)

Source from the content-addressed store, hash-verified

311/*********************************************************/
312
313func (sql *fishdb) checkEquipFor(uid int64) (ok bool, err error) {
314 sql.Lock()
315 defer sql.Unlock()
316 userInfo := fishState{ID: uid}
317 err = sql.db.Create("fishState", &userInfo)
318 if err != nil {
319 return false, err
320 }
321 if !sql.db.CanFind("fishState", "WHERE ID = ?", uid) {
322 return true, nil
323 }
324 err = sql.db.Find("fishState", &userInfo, "WHERE ID = ?", uid)
325 if err != nil {
326 return false, err
327 }
328 if userInfo.Equip > 3 {
329 return false, nil
330 }
331 return true, nil
332}
333
334func (sql *fishdb) setEquipFor(uid int64) (err error) {
335 sql.Lock()

Callers 1

initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected