This commit is contained in:
shoopea 2020-01-02 23:53:54 +08:00
parent 52ff68fb1f
commit daa659e7a4
2 changed files with 10 additions and 2 deletions

8
obj.go
View File

@ -29,28 +29,36 @@ var (
func initCache() { func initCache() {
var err error var err error
log.Println("Caching obj_type ..")
err = loadObjType() err = loadObjType()
logOnError(err, "initCache : caching obj_type") logOnError(err, "initCache : caching obj_type")
log.Println("Caching obj_sub_type ..")
err = loadObjSubType() err = loadObjSubType()
logOnError(err, "initCache : caching obj_sub_type") logOnError(err, "initCache : caching obj_sub_type")
log.Println("Filling message parsing rules...")
resetMsgParsingRules() resetMsgParsingRules()
msgParsingRules, err = loadMsgParsingRules() msgParsingRules, err = loadMsgParsingRules()
logOnError(err, "initCache : message parsing rules") logOnError(err, "initCache : message parsing rules")
log.Println("Caching castles ..")
err = loadObjCastle() err = loadObjCastle()
logOnError(err, "initCache : caching castles") logOnError(err, "initCache : caching castles")
log.Println("Caching guilds ..")
err = loadObjGuild() err = loadObjGuild()
logOnError(err, "initCache : caching guilds") logOnError(err, "initCache : caching guilds")
log.Println("Caching users ..")
err = loadObjUser() err = loadObjUser()
logOnError(err, "initCache : caching user") logOnError(err, "initCache : caching user")
log.Println("Caching items ..")
err = loadObjItem() err = loadObjItem()
logOnError(err, "initCache : caching items") logOnError(err, "initCache : caching items")
log.Println("Caching messages ..")
err = loadObjMsg() err = loadObjMsg()
logOnError(err, "initCache : caching msgs") logOnError(err, "initCache : caching msgs")

View File

@ -2,7 +2,7 @@ package main
import ( import (
"encoding/json" "encoding/json"
"fmt" "log"
"regexp" "regexp"
) )
@ -66,7 +66,7 @@ func resetMsgParsingRules() error {
} }
fmt.Printf("resetMsgParsingRules : %d rules loaded.\n", count) log.Printf("%d rules loaded.\n", count)
return nil return nil