package call import ( "server/common" "server/pb" "strconv" "strings" "github.com/liangdas/mqant/log" ) func GetModuleName(id int) string { if id == 1000 { return "hall" } if id == 1100 { return "common" } if id == 1101 { return "matching" } return common.GetGameModuleName(id) } func GetModuleID(name string) int { if name == "hall" { return int(pb.ServerType_ServerTypeGate) } if name == "common" { return int(pb.ServerType_ServerTypeCommon) } name = strings.ReplaceAll(name, common.GameModulePrefix, "") id, err := strconv.Atoi(name) if err != nil { log.Error("err:%v", err) } return id }