lt 1 месяц назад
Родитель
Сommit
af868a1a32

+ 3 - 3
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role.go

@@ -3713,10 +3713,10 @@ func (this *Role) PayInfoGet(goodsType, goodsId, count int32, rushStage, rushRou
 		if name == "" {
 			name = "Player"
 		}
-		nid := service.GetServiceConfig().Node.XiaoQiAndroid
+		//nid := service.GetServiceConfig().Node.XiaoQiAndroid
 		payKey := "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCfYd3FqSaWqCpWLSktBSSgAelt0F6T+tO4C25YKR/6X/sPacDBbX662/0fW+H+YbXigHWFB/yangkhiZTpD/VmiOo5lISX6L0/m+13ti9b8jzTZcfVngfLsP+Ztbk81N1Jk0gWF4bndZxREJ3IxcEDHnIrwXgLGA2GJ89kdgudwIDAQAB"
 		if this.platform == "IOS_X7" {
-			nid = service.GetServiceConfig().Node.XiaoQiIos
+			//nid = service.GetServiceConfig().Node.XiaoQiIos
 			payKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdP+3oq+95l5CvsqmZvzgTdueiIWur64OePQkKeNUaKTAR3ar4NU9laEvgI+pkN6q+7BoPpprTB/aBqoU5eLNFnPt/6T0Dq5245e+HGij4qUYiORsU12O+pex5jxWg/knnW1g5F8SrLtAr9lwJbOc4lNPFKi+U+1fdayC64qxmjQIDAQAB"
 		}
 		ordeinfo := OrderRequest{
@@ -3728,7 +3728,7 @@ func (this *Role) PayInfoGet(goodsType, goodsId, count int32, rushStage, rushRou
 			GameRoleId:        strconv.Itoa(int(this.GetUUid())),
 			GameRoleName:      name,
 			GameGuid:          guid,
-			NotifyId:          nid,
+			NotifyId:          "-1",
 			Subject:           price + " Pack",
 			GameAccessVersion: "2507",
 		}

+ 42 - 61
RO_Server_Trunk-branch_0.1.39/transfor/main.go

@@ -1,6 +1,8 @@
 package main
 
 import (
+	"bytes"
+	"io"
 	"log"
 	"net/http"
 	"net/http/httputil"
@@ -59,90 +61,62 @@ var serverPortMap = map[int]int{
 func proxyHandler(w http.ResponseWriter, r *http.Request) {
 	start := time.Now()
 
-	// 先解析 form,无论是 GET 还是 POST 都能取到
-	r.ParseForm()
-	serverIDStr := r.FormValue("server")
-
-	if serverIDStr == "" {
-		http.Error(w, "Missing serverId parameter", http.StatusBadRequest)
-		return
-	}
-
-	serverID, err := strconv.Atoi(serverIDStr)
+	// 读取原始 body
+	bodyBytes, err := io.ReadAll(r.Body)
 	if err != nil {
-		http.Error(w, "Invalid serverId", http.StatusBadRequest)
-		return
-	}
-
-	port, ok := serverPortMap[serverID]
-	if !ok {
-		http.Error(w, "Unknown serverId", http.StatusBadRequest)
+		log.Printf("[ERROR] Failed to read body: %v", err)
+		http.Error(w, "Failed to read request body", http.StatusBadRequest)
 		return
 	}
 
-	targetURL, _ := url.Parse("http://127.0.0.1:" + strconv.Itoa(port))
-	proxy := httputil.NewSingleHostReverseProxy(targetURL)
+	// 恢复 body 以便 ParseForm 使用
+	r.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
 
-	// 修改请求信息
-	originalDirector := proxy.Director
-	proxy.Director = func(req *http.Request) {
-		originalDirector(req)
-		req.Host = targetURL.Host
-	}
-
-	proxy.ModifyResponse = func(resp *http.Response) error {
-		duration := time.Since(start)
-		log.Printf("[OK] %s | method=%s | serverId=%d -> %d | %s | status=%d | %.2fms\n",
-			start.Format("2006-01-02 15:04:05"),
-			r.Method,
-			serverID,
-			port,
-			r.URL.RequestURI(),
-			resp.StatusCode,
-			float64(duration.Milliseconds()))
-		return nil
+	// 解析表单数据(application/x-www-form-urlencoded)
+	if err := r.ParseForm(); err != nil {
+		log.Printf("[ERROR] Failed to parse form: %v", err)
+		http.Error(w, "Invalid form data", http.StatusBadRequest)
+		return
 	}
 
-	log.Printf("[REQ] %s | method=%s | serverId=%d -> %d | %s\n",
-		start.Format("2006-01-02 15:04:05"),
-		r.Method,
-		serverID, port, r.URL.RequestURI())
-
-	proxy.ServeHTTP(w, r)
-}
-
-func proxyCreateOrderHandler(w http.ResponseWriter, r *http.Request) {
-	start := time.Now()
-
-	// 先解析 form,无论是 GET 还是 POST 都能取到
-	r.ParseForm()
-	serverIDStr := r.FormValue("serverId")
-
+	// 获取 game_area 参数
+	serverIDStr := r.FormValue("game_area")
 	if serverIDStr == "" {
-		http.Error(w, "Missing serverId parameter", http.StatusBadRequest)
+		http.Error(w, "Missing game_area parameter", http.StatusBadRequest)
 		return
 	}
 
 	serverID, err := strconv.Atoi(serverIDStr)
 	if err != nil {
-		http.Error(w, "Invalid serverId", http.StatusBadRequest)
+		http.Error(w, "Invalid game_area", http.StatusBadRequest)
 		return
 	}
 
 	port, ok := serverPortMap[serverID]
 	if !ok {
-		http.Error(w, "Unknown serverId", http.StatusBadRequest)
+		http.Error(w, "Unknown game_area", http.StatusBadRequest)
 		return
 	}
 
 	targetURL, _ := url.Parse("http://127.0.0.1:" + strconv.Itoa(port))
 	proxy := httputil.NewSingleHostReverseProxy(targetURL)
 
-	// 修改请求信息
+	// 自定义 Director,恢复原始 body
 	originalDirector := proxy.Director
 	proxy.Director = func(req *http.Request) {
 		originalDirector(req)
 		req.Host = targetURL.Host
+
+		// 恢复 body 和 Content-Length
+		if len(bodyBytes) > 0 {
+			req.Body = io.NopCloser(bytes.NewBuffer(bodyBytes))
+			req.ContentLength = int64(len(bodyBytes))
+		}
+
+		// 确保 Content-Type 正确
+		if req.Header.Get("Content-Type") == "" {
+			req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+		}
 	}
 
 	proxy.ModifyResponse = func(resp *http.Response) error {
@@ -158,18 +132,25 @@ func proxyCreateOrderHandler(w http.ResponseWriter, r *http.Request) {
 		return nil
 	}
 
-	log.Printf("[REQ] %s | method=%s | serverId=%d -> %d | %s\n",
+	// 错误处理
+	proxy.ErrorHandler = func(w http.ResponseWriter, req *http.Request, err error) {
+		log.Printf("[ERROR] Proxy error: %v", err)
+		http.Error(w, "Proxy error: "+err.Error(), http.StatusBadGateway)
+	}
+
+	log.Printf("[REQ] %s | method=%s | serverId=%d -> %d | %s | body_size=%d\n",
 		start.Format("2006-01-02 15:04:05"),
 		r.Method,
-		serverID, port, r.URL.RequestURI())
+		serverID,
+		port,
+		r.URL.RequestURI(),
+		len(bodyBytes))
 
 	proxy.ServeHTTP(w, r)
 }
 
 func main() {
 	log.Println("Reverse proxy started on :8155 ...")
-	http.HandleFunc("/v1/pay/hwDn", proxyHandler)
-	http.HandleFunc("/v1/pay/hwDn2", proxyHandler)
-	http.HandleFunc("/v1/create-order", proxyHandler)
+	http.HandleFunc("/v1/pay/xiaoqi", proxyHandler)
 	log.Fatal(http.ListenAndServe(":8155", nil))
 }

+ 44 - 0
操作命令/mongo操作命令.txt

@@ -390,3 +390,47 @@ db.user.find({ _id: 10004545 }).forEach(function(doc) {
   }
 });
 
+//解决异端之战未重置问题将times-1重新触发重置
+db.user.updateOne(
+    { _id: 10006675 },
+    { 
+        $set: { 
+            "mapManager.trialInfo.times": 23,
+        } 
+    }
+);
+
+//刷新梦魇
+db.user.updateOne(
+    { _id: 10006675 },
+    { 
+        $set: { 
+            "playerManager.startMinskBattleFlag": 0
+        } 
+    }
+)
+//查询某段时间内的总充值
+db.pay.aggregate([
+  {
+    $match: {
+      callbaktime: { $exists: true, $ne: null },
+      callbaktime: {
+        $gte: "1774972810",  // 2026-03-01 00:00:00
+        $lt: "1777564810"     // 2026-04-01 00:00:00
+      }
+    }
+  },
+  {
+    $group: {
+      _id: null,
+      totalMoney: { $sum: "$money" },
+      count: { $sum: 1 }
+    }
+  }
+])
+
+db.user_info.updateOne(
+  { "_id": 10000007 },
+  { "$set": { "openId": "11112" } }
+)
+

+ 2 - 0
操作命令/仙境服务器2.txt

@@ -12,6 +12,8 @@ jenkins启动命令:nohup /www/server/java/jdk-17.0.8/bin/java -jar jenkins.war
 
 关闭注册:hset server:reg registerclose 1
 
+sh open_server.sh -s 2 -p 3 -r 3
+
 
 gm
 http://152.32.220.85:81/ht/gm/gm.php