parent
911e4d08a8
commit
75cc1df4d1
10
obj.go
10
obj.go
@ -631,7 +631,7 @@ func silentGetObjItemID(code string, name string) int64 {
|
|||||||
if len(code) > 0 {
|
if len(code) > 0 {
|
||||||
if v, ok := cacheObjItem.Load(code); ok {
|
if v, ok := cacheObjItem.Load(code); ok {
|
||||||
item := v.(ChatWarsItem)
|
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
|
return item.ObjID64
|
||||||
}
|
}
|
||||||
if ok, _ := regexp.MatchString(`^u[0-9]+`, code); !ok {
|
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}")
|
basename := r.ReplaceAllString(name, "${BaseName}")
|
||||||
if v, ok := cacheObjItem.Load(basename); ok && len(basename) > 0 {
|
if v, ok := cacheObjItem.Load(basename); ok && len(basename) > 0 {
|
||||||
item := v.(ChatWarsItem)
|
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
|
return item.ObjID64
|
||||||
}
|
}
|
||||||
item := ChatWarsItem{
|
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))
|
m := fmt.Sprintf("^((%s.*)|(.*%s))$", regexp.QuoteMeta(item.Name), regexp.QuoteMeta(item.Name))
|
||||||
if ok, _ := regexp.MatchString(m, basename); ok {
|
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
|
return false
|
||||||
} else {
|
} else {
|
||||||
item = ChatWarsItem{
|
item = ChatWarsItem{
|
||||||
ObjID64: 0,
|
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
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
if item.ObjID64 != 0 {
|
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
|
return item.ObjID64
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("silentGetObjItemID : Modifier : `%s`\n", r.ReplaceAllString(name, "${Modifier}"))
|
fmt.Printf("silentGetObjItemID : Modifier : `%s`\n", r.ReplaceAllString(name, "${Modifier}"))
|
||||||
|
@ -363,7 +363,6 @@ func MQKeepAliveWorker() {
|
|||||||
time.Sleep(15 * time.Second)
|
time.Sleep(15 * time.Second)
|
||||||
err = s.Open()
|
err = s.Open()
|
||||||
}
|
}
|
||||||
log.Printf("MQKeepAliveWorker : Connected to RabbitMQ")
|
|
||||||
/*
|
/*
|
||||||
m, err := s.MQChannel.Consume(
|
m, err := s.MQChannel.Consume(
|
||||||
s.MQQueue.Name, // queue
|
s.MQQueue.Name, // queue
|
||||||
|
Loading…
Reference in New Issue
Block a user