func main() {
g_run_as = AS_ROUTER
g_local_ip = get_local_ip()
/*为磁盘创建bbw文件夹*/
/*选择服务器启动类型*/
inputReader := bufio.NewReader(os.Stdin)
fmt.Println("Please enter your choice:")
fmt.Println("Input 1 to Run server router")
fmt.Println("Input 2 to Run server pos ")
fmt.Println("Input 3 to Run server msg ")
fmt.Println("Input 4 to Run server set ")
fmt.Println("Input 5 to Run server login")
fmt.Println("Input 6 to Run test")
input, err := inputReader.ReadString('\n')
if err != nil {
fmt.Println("There were errors reading, exiting program.")
return
}
//fmt.Printf("Your Input is %s", input)
switch input {
case "1\n":
g_run_as = AS_ROUTER
router()
case "2\n":
g_run_as = AS_POS
pos()
case "3\n":
g_run_as = AS_MSG
msg()
case "4\n":
g_run_as = AS_SET
set()
case "5\n":
g_run_as = AS_LOGIN
login()
case "6\n":
//g_run_as = AS_LOGIN
test()
}
}
有疑问加站长微信联系(非本文作者)