Ejemplo n.º 1
0
func (this *GameManager) Init(buildtime string) bool {
	var bVal bool = false
	var err error

	//config loading
	bVal = config.GetServerConfig().InitConfig()
	if bVal {
		Log.Info(">>ServerConfig.InitConfig Success!")
	} else {
		Log.Info(">>ServerConfig.InitConfig failed please check serverconfig.xml")
		return false
	}

	//sql init

	//
	server := GetGameServerInst()
	Log.Info(">>GameServer Initing...")
	err = server.InitServer(server, server, "gameserver", config.GetServerConfig().GetXmlConf().Server.Ip, config.GetServerConfig().GetXmlConf().Server.Port)
	if err != nil {
		Log.Info(">>GameServer Init error,", err)
		return false
	}
	Log.Info(">>GameServer Init success!")

	Log.Info(">>Init game modules...")

	return true
}
Ejemplo n.º 2
0
func (this *LoginHandler) loginReq(pack *packet.Packet, conn netio.ConnInf) {
	//TODO
	if conn.GetBindObj() != nil {
		//登录后在发登录请求,这是不对的。应该剔除
		Log.Error("第一次消息请求时,应该没有已经绑定的对象,说明用户已经有绑定的对象了,是个错误的请求")
		return
	}
	if pack.DecodePacket() == false {

	}

	var loginReq p_login.PlayerLoginReq
	loginReq.Packet = pack
	if false == loginReq.DecodePacket() {
		Log.Error("解析包错误,应该断开连接")
		conn.Close()
		return
	}

	var uid uint64
	var account string
	var superpwd string
	uid = loginReq.UserID
	account = loginReq.UserName
	superpwd = loginReq.UserPwd

	if config.GetServerConfig().GetXmlConf().Server.AccessPtMode == 1 {
		//平台接入模式,要查看平台登录信息
	} else {
		//非平台接入模式,只要查看自己的登录信息即可
	}

}