This commit is contained in:
shoopea 2019-06-28 14:43:32 +08:00
parent 81347ee093
commit 15a4f2f5a0
2 changed files with 6 additions and 5 deletions

10
obj.go
View File

@ -631,7 +631,7 @@ func silentGetObjItemID(code string, name string) int64 {
if len(code) > 0 {
if v, ok := cacheObjItem.Load(code); ok {
item := v.(ChatWarsItem)
log.Printf("Matching item code %s with %s.\n", code, item.Code)
// log.Printf("Matching item code %s with %s.\n", code, item.Code)
return item.ObjID64
}
if ok, _ := regexp.MatchString(`^u[0-9]+`, code); !ok {
@ -651,7 +651,7 @@ func silentGetObjItemID(code string, name string) int64 {
basename := r.ReplaceAllString(name, "${BaseName}")
if v, ok := cacheObjItem.Load(basename); ok && len(basename) > 0 {
item := v.(ChatWarsItem)
log.Printf("Matching item full basename %s with %s.\n", basename, item.Name)
// log.Printf("Matching item full basename %s with %s.\n", basename, item.Name)
return item.ObjID64
}
item := ChatWarsItem{
@ -664,19 +664,19 @@ func silentGetObjItemID(code string, name string) int64 {
}
m := fmt.Sprintf("^((%s.*)|(.*%s))$", regexp.QuoteMeta(item.Name), regexp.QuoteMeta(item.Name))
if ok, _ := regexp.MatchString(m, basename); ok {
log.Printf("Matching item modified basename %s with %s. (1)\n", basename, item.Name)
// log.Printf("Matching item modified basename %s with %s. (1)\n", basename, item.Name)
return false
} else {
item = ChatWarsItem{
ObjID64: 0,
}
log.Printf("Not matching item modified basename %s with %s.\n", basename, item.Name)
// log.Printf("Not matching item modified basename %s with %s.\n", basename, item.Name)
return true
}
})
if item.ObjID64 != 0 {
log.Printf("Matching item modified basename %s with %s. (2)\n", basename, item.Name)
// log.Printf("Matching item modified basename %s with %s. (2)\n", basename, item.Name)
return item.ObjID64
} else {
fmt.Printf("silentGetObjItemID : Modifier : `%s`\n", r.ReplaceAllString(name, "${Modifier}"))

View File

@ -363,6 +363,7 @@ func MQKeepAliveWorker() {
time.Sleep(15 * time.Second)
err = s.Open()
}
log.Printf("MQKeepAliveWorker : Connected to RabbitMQ")
/*
m, err := s.MQChannel.Consume(
s.MQQueue.Name, // queue