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

Method getUserPack

plugin/mcfish/main.go:431–451  ·  view source on GitHub ↗

*********************************************************/ ************************背包相关函数***********************/ *********************************************************/ 获取用户背包信息

(uid int64)

Source from the content-addressed store, hash-verified

429
430// 获取用户背包信息
431func (sql *fishdb) getUserPack(uid int64) (thingInfos []article, err error) {
432 sql.Lock()
433 defer sql.Unlock()
434 userInfo := article{}
435 err = sql.db.Create(strconv.FormatInt(uid, 10)+"Pack", &userInfo)
436 if err != nil {
437 return
438 }
439 count, err := sql.db.Count(strconv.FormatInt(uid, 10) + "Pack")
440 if err != nil {
441 return
442 }
443 if count == 0 {
444 return
445 }
446 err = sql.db.FindFor(strconv.FormatInt(uid, 10)+"Pack", &userInfo, "ORDER by Type, Name, Other ASC", func() error {
447 thingInfos = append(thingInfos, userInfo)
448 return nil
449 })
450 return
451}
452
453// 获取用户物品信息
454func (sql *fishdb) getUserThingInfo(uid int64, thing string) (thingInfos []article, err error) {

Callers 1

initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected