Browse Source

合服相关改动

lt 5 ngày trước cách đây
mục cha
commit
34b69ae6a1

+ 47 - 12
RO_Server_Trunk-branch_0.1.39/roserver/gmweb/msg/web_gmmsg.go

@@ -400,15 +400,19 @@ func WebGmProcessGetUserInfo(c *gin.Context) {
 		//获取简介信息
 		//获取简介信息
 		bfInfoList := make([]*Role, 0)
 		bfInfoList := make([]*Role, 0)
 		if len(service.GetMysqlPay()) > 0 {
 		if len(service.GetMysqlPay()) > 0 {
-			for _, v := range service.GetMysqlPay() {
-				var bfInfo *WebBriefInfo = nil
+			for i, v := range service.GetMysqlPay() {
+				//1-18服
+				if i != 0 && i < 18 {
+					continue
+				}
+				var bfInfoList2 []*WebBriefInfo = nil
 				v.Operate(func(rawClient interface{}) interface{} {
 				v.Operate(func(rawClient interface{}) interface{} {
 					wrapper := mysql.NewWrapper(rawClient.(*sql.DB))
 					wrapper := mysql.NewWrapper(rawClient.(*sql.DB))
 
 
 					wrapper.Query("select uid,nick_name,base_level,create_date,last_login_date,ban_date,map_level,fight_power,active_code,open_id,serverid from role where open_id=?", openIdStr).Each(func(wrapper2 *mysql.Wrapper) bool {
 					wrapper.Query("select uid,nick_name,base_level,create_date,last_login_date,ban_date,map_level,fight_power,active_code,open_id,serverid from role where open_id=?", openIdStr).Each(func(wrapper2 *mysql.Wrapper) bool {
-						bfInfo = parseUserInfo(wrapper2)
-
-						return true
+						bfInfo := parseUserInfo(wrapper2)
+						bfInfoList2 = append(bfInfoList2, bfInfo)
+						return true // 继续遍历
 					})
 					})
 
 
 					if wrapper.Err != nil {
 					if wrapper.Err != nil {
@@ -416,16 +420,19 @@ func WebGmProcessGetUserInfo(c *gin.Context) {
 					}
 					}
 					return nil
 					return nil
 				})
 				})
-				if bfInfo == nil {
+				if len(bfInfoList2) == 0 {
 					continue
 					continue
 				}
 				}
-				serverId := strconv.Itoa(bfInfo.Serverid / 2)
-				level := strconv.Itoa(int(bfInfo.BaseLevel))
-				name := "Novice"
-				if bfInfo.NickName != "" {
-					name = bfInfo.NickName
+				for _, bfInfo := range bfInfoList2 {
+					// 处理每条数据
+					serverId := strconv.Itoa(bfInfo.Serverid / 2)
+					level := strconv.Itoa(int(bfInfo.BaseLevel))
+					name := "Novice"
+					if bfInfo.NickName != "" {
+						name = bfInfo.NickName
+					}
+					bfInfoList = append(bfInfoList, &Role{RoleId: strconv.FormatUint(bfInfo.Uid, 10), ServerId: serverId, RoleName: name, ServerName: "SEA-S" + serverId, Level: level})
 				}
 				}
-				bfInfoList = append(bfInfoList, &Role{RoleId: strconv.FormatUint(bfInfo.Uid, 10), ServerId: serverId, RoleName: name, ServerName: "SEA-S" + serverId, Level: level})
 			}
 			}
 		}
 		}
 		c.JSON(http.StatusOK, RoleLists{Code: 0, RoleList: bfInfoList})
 		c.JSON(http.StatusOK, RoleLists{Code: 0, RoleList: bfInfoList})
@@ -440,6 +447,34 @@ func WebGmProcessGetUserInfo(c *gin.Context) {
 		bfInfoList := make([]*Role, 0)
 		bfInfoList := make([]*Role, 0)
 		if len(service.GetMysqlPay()) > 0 {
 		if len(service.GetMysqlPay()) > 0 {
 			for i, v := range service.GetMysqlPay() {
 			for i, v := range service.GetMysqlPay() {
+				if i == 0 && server < 18 {
+					var bfInfo *WebBriefInfo
+					v.Operate(func(rawClient interface{}) interface{} {
+						wrapper := mysql.NewWrapper(rawClient.(*sql.DB))
+
+						wrapper.Query("select uid,nick_name,base_level,create_date,last_login_date,ban_date,map_level,fight_power,active_code,open_id,serverid from role where open_id=? and serverid=?", openIdStr, server*2).Each(func(wrapper2 *mysql.Wrapper) bool {
+							bfInfo = parseUserInfo(wrapper2)
+
+							return true
+						})
+
+						if wrapper.Err != nil {
+							util.ErrorF("uid=%v WebGmProcessUserGet err=%v", openIdStr, wrapper.Err)
+						}
+						return nil
+					})
+					if bfInfo == nil {
+						continue
+					}
+					serverId := strconv.Itoa(bfInfo.Serverid / 2)
+					level := strconv.Itoa(int(bfInfo.BaseLevel))
+					name := "Novice"
+					if bfInfo.NickName != "" {
+						name = bfInfo.NickName
+					}
+					bfInfoList = append(bfInfoList, &Role{RoleId: strconv.FormatUint(bfInfo.Uid, 10), ServerId: serverId, RoleName: name, ServerName: "SEA-S" + serverId, Level: level})
+					break
+				}
 				if i+1 != server {
 				if i+1 != server {
 					continue
 					continue
 				}
 				}

+ 17 - 17
RO_Server_Trunk-branch_0.1.39/transfor/main.go

@@ -12,23 +12,23 @@ import (
 // serverId -> port 对应表
 // serverId -> port 对应表
 var serverPortMap = map[int]int{
 var serverPortMap = map[int]int{
 	1:  8086,
 	1:  8086,
-	2:  8003,
-	3:  8005,
-	4:  8007,
-	5:  8009,
-	6:  8011,
-	7:  8013,
-	8:  8015,
-	9:  8017,
-	10: 8019,
-	11: 8021,
-	12: 8023,
-	13: 8025,
-	14: 8027,
-	15: 8029,
-	16: 8031,
-	17: 8033,
-	18: 8035,
+	2:  8086,
+	3:  8086,
+	4:  8086,
+	5:  8086,
+	6:  8086,
+	7:  8086,
+	8:  8086,
+	9:  8086,
+	10: 8086,
+	11: 8086,
+	12: 8086,
+	13: 8086,
+	14: 8086,
+	15: 8086,
+	16: 8086,
+	17: 8086,
+	18: 8086,
 	19: 8037,
 	19: 8037,
 	20: 8039,
 	20: 8039,
 	21: 8041,
 	21: 8041,

BIN
RO_Server_Trunk-branch_0.1.39/transfor/transfor