Example #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()
}
Example #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()
}
Example #3
0
func main() {
	defer func() {
		if x := recover(); x != nil {
			ERR("caught panic in main()", x)
		}
	}()

	// 获取监听端口
	getPort()

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

	//连接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)

	//启动WorldServer
	worldProxyErr := worldProxy.InitServer(world_port)
	checkError(worldProxyErr)

	//开启下线用户处理
	module.User.StartDealOfflineUser()

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

	// 获取端口号
	getPort()

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

	//开启LocalServer监听
	startLocalServer()

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

	// 获取监听端口
	getPort()

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

	//开启TransferServer
	err := transferProxy.InitServer(transfer_port)
	checkError(err)

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

	//获取监听端口
	getPort()

	//启动
	global.Startup(global.ServerName, "log_log", stopLogServer)

	//启动LogProxy
	err := logProxy.InitServer(log_port)
	checkError(err)

	//保持进程
	global.Run()
}
Example #7
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()
}
Example #8
0
func main() {
	defer func() {
		if x := recover(); x != nil {
			ERR("caught panic in main()", x)
		}
	}()

	// 获取监听端口
	getPort()

	//启动
	global.Startup(global.ServerName, "db_log", stopDBServer)

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

	//开启DBServer监听
	err := dbProxy.InitServer(db_port)
	checkError(err)

	//保持进程
	global.Run()
}
Example #9
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,由GateServer充当中转服务器
	err := transferProxy.InitServer(transfer_port)
	checkError(err)
	INFO("Starting TransferServer")

	//开启GateServer监听
	startGateway()

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