示例#1
0
func main() {
	defer func() {
		if x := recover(); x != nil {
			ERR("caught panic in main()", x)
		}
	}()

	// 获取监听端口
	getPort()

	//启动
	global.Startup(global.ServerName, "login_log", nil)

	//连接TransferServer
	err := transferProxy.InitClient(cfg.GetValue("transfer_ip"), cfg.GetValue("transfer_port"))
	checkError(err)

	//连接DB
	dbProxyErr := dbProxy.InitClient(cfg.GetValue("db_ip"), cfg.GetValue("db_port"))
	checkError(dbProxyErr)

	//连接Redis
	redisProxyErr := redisProxy.InitClient(cfg.GetValue("redis_ip"), cfg.GetValue("redis_port"))
	checkError(redisProxyErr)

	//保持进程
	global.Run()
}
示例#2
0
func main() {
	defer func() {
		if x := recover(); x != nil {
			ERR("caught panic in main()", x)
		}
	}()

	// 获取监听端口
	getPort()

	//启动
	global.Startup(global.ServerName, "game_log", nil)

	//连接TransferServer
	err := transferProxy.InitClient(cfg.GetValue("transfer_ip"), cfg.GetValue("transfer_port"))
	checkError(err)

	//连接WorldServer
	worldProxyErr := worldProxy.InitClient(cfg.GetValue("world_ip"), cfg.GetValue("world_port"))
	checkError(worldProxyErr)

	//连接Redis
	redisProxyErr := redisProxy.InitClient(cfg.GetValue("redis_ip"), cfg.GetValue("redis_port"), cfg.GetValue("redis_pwd"))
	checkError(redisProxyErr)

	//连接LogServer
	logProxyErr := logProxy.InitClient(cfg.GetValue("log_ip"), cfg.GetValue("log_port"))
	checkError(logProxyErr)

	//保持进程
	global.Run()
}
示例#3
0
func main() {
	defer func() {
		if x := recover(); x != nil {
			ERR("caught panic in main()", x)
		}
	}()

	// 获取端口号
	getPort()

	//启动
	global.Startup(global.ServerName, "gateway_log", nil)

	//连接TransferServer
	err := transferProxy.InitClient(cfg.GetValue("transfer_ip"), cfg.GetValue("transfer_port"))
	checkError(err)

	//开启GateServer监听
	startGateway()

	//保持进程
	global.Run()
}