You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
629 B
38 lines
629 B
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 |
|
}
|
|
|