Просмотр исходного кода

Merge branch 'Thailand' of https://gitee.com/wangwenfan/congkong into Thailand

flowerpig 1 год назад
Родитель
Сommit
480aea9dd6
40 измененных файлов с 653 добавлено и 162 удалено
  1. 1 0
      docs/config.txt
  2. 20 0
      docs/hot.sh
  3. 6 1
      docs/readme.md
  4. 60 16
      docs/srv_install.sh
  5. 26 0
      docs/start.sh
  6. 42 0
      docs/th_mapserver.sh
  7. 69 0
      docs/timed_task.sh
  8. 42 0
      docs/update_server.sh
  9. 18 0
      docs/开服流程.txt
  10. 2 2
      script/common/CommonDB.lua
  11. 10 1
      script/core/RoleDel.lua
  12. 3 0
      script/module/absAct/Abs365CardLogic.lua
  13. 20 3
      script/module/absAct/AbsActLogic.lua
  14. 1 1
      script/module/absAct/AbsJifenDrawLogic.lua
  15. 10 10
      script/module/absAct/DoubleChargeLogic.lua
  16. 1 1
      script/module/absAct/DrumBlastingLogic.lua
  17. 9 6
      script/module/absAct/HeroGrowUp.lua
  18. 2 1
      script/module/absAct/Proto.lua
  19. 3 3
      script/module/absAct/RechargeBackLogic.lua
  20. 36 27
      script/module/absAct/SpecialCustomLogic.lua
  21. 35 8
      script/module/battle/BattleLogic.lua
  22. 2 0
      script/module/battle/Proto.lua
  23. 30 2
      script/module/chat/Gm.lua
  24. 16 4
      script/module/chengjiu/ChengjiuLogic.lua
  25. 12 5
      script/module/hecheng/EquipHechengLogic.lua
  26. 20 18
      script/module/lostTemple/Proto.lua
  27. 54 12
      script/module/lostTemple/lostTempleLogic.lua
  28. 19 5
      script/module/mozhu/MoZhuLogic.lua
  29. 30 5
      script/module/mozhu/MoZhuMiddleLogic.lua
  30. 1 1
      script/module/scene/Handler.lua
  31. 4 0
      script/module/skin/SkinLogic.lua
  32. 2 1
      script/module/warReport/WarReportLogic.lua
  33. 2 1
      webServer/src/config/sdk.sql
  34. 14 3
      webServer/src/controller/ApiController.ts
  35. 3 2
      webServer/src/json/notice.json
  36. 2 2
      webServer/src/json/th_notice.json
  37. 3 2
      webServer/src/json/xky_notice.json
  38. 4 2
      webServer/src/model/ServerModel.ts
  39. 2 0
      webServer/src/router/index.ts
  40. 17 17
      webServer/src/utils/task.ts

+ 1 - 0
docs/config.txt

@@ -0,0 +1 @@
+zone_start_id=1

+ 20 - 0
docs/hot.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+#用于热更配置表使用
+path='/data/server/'
+count=1
+for i in $(find . -maxdepth 1 -type d -name "bin*" -exec basename {} \;) 
+do
+    
+    cd "$path$i/script"
+    echo "enter ${path}${i}/script"
+    if test -e "${path}${i}/script/Main.lua" 
+    then
+        count=$count+1
+        touch Main.lua
+    else
+        echo "Main.lua not exist"
+    fi
+    
+done
+
+echo "hotfix serverList finish , count is ${count}"

+ 6 - 1
docs/readme.md

@@ -1,4 +1,9 @@
 
 - 配置 crontab 每5分钟执行一次 auto_open_new.sh
 - tpl目录为代码模版,每次从这个目录复制
-- srv_install.sh 为安装和启动服务
+- srv_install.sh 为安装和启动服务
+- hot.sh 热更新配置表使用
+- start.sh 用于维护后开启所有服务器
+
+- 常见问题:
+    - syntax error: unexpected end of file (由于在win下编写,导致结尾符号不一致 使用:set ff=unix 保存即可)

+ 60 - 16
docs/srv_install.sh

@@ -1,28 +1,72 @@
-#!/bin/bash
-
+#! /bin/bash
+# 用于开新区 
 if [[ -z "$1" || ! "$1" =~ ^[0-9]+$ ]]; then
   echo "错误: 请输入有效的 zone_id (正整数)。"
   exit 1
 fi
 
+serverPath=/data/server #能否获取当前路径作为服务器路径
 zone_id=$1
 echo -e "获取服务器id: ${zone_id} \n"
 
-### 下面xxx修改为需要的路径
-to_dir=/xxx/data/server_${zone_id}
-
-cp -rf /xxx/tpl/server ${to_dir}
-
-port=$((8190 + zone_id))
-
-# 替换配置文件
-sed -i "24c\PORT_CLIENT = ${port}" ${to_dir}/script/Config.lua
-sed -i "28c\DB_NAME = \"ckwy_${zone_id}\"" ${to_dir}/script/Config.lua
-sed -i "31c\SVR_INDEX = ${zone_id}" ${to_dir}/script/Config.lua
-sed -i "32c\SVR_NAME = \"s${zone_id}\"" ${to_dir}/script/Config.lua
+##################################
+index1=寻宝
+index2=服
+server_name=
+mapserver() {
+  server_name=$index1$1$index2
+  echo $server_name
+}
+##################################
 
+### 下面xxx修改为需要的路径
+to_dir=${serverPath}/bin${zone_id}
+if [ ! -d "$to_dir" ]; then
+    # 目录不存在,创建目录
+    mkdir -p "$to_dir"
+    cd $to_dir
+    # 目录不存在,创建目录
+    mkdir -p "log"
+    ## 复制 Config ,Main,AdminLogic 三个文件 创建common core excel module 四个软链接
+    cp -r ${serverPath}/bin/script ${to_dir}
+    cp -r ${serverPath}/bin/lua51.dll ${to_dir}
+    cp -r ${serverPath}/bin/logic.exe ${to_dir}
+    cp -r ${serverPath}/bin/logic ${to_dir}
+    cp -r ${serverPath}/bin/libgcc_s_dw2-1.dll ${to_dir}
+    
+     chmod 777 logic
+    
+    rm -rf ${to_dir}/script/common
+    rm -rf ${to_dir}/script/excel
+    rm -rf ${to_dir}/script/module
+    
+    
+    #cp ${serverPath}/bin/script/Config.lua     ${serverPath}/bin${zone_id}/script/Config.lua
+    #cp ${serverPath}/bin/script/Main.lua       ${serverPath}/bin${zone_id}/script/Main.lua
+    #cp ${serverPath}/bin/script/AdminLogic.lua ${serverPath}/bin${zone_id}/script/AdminLogic.lua
+    
+    ln -s ${serverPath}/bin/script/common ${serverPath}/bin${zone_id}/script/common 
+    #ln -s ${serverPath}/bin/script/core ${serverPath}/bin${zone_id}/script/core 
+    ln -s ${serverPath}/bin/script/excel ${serverPath}/bin${zone_id}/script/excel 
+    ln -s ${serverPath}/bin/script/module ${serverPath}/bin${zone_id}/script/module 
+    
+    port=$((8191 + zone_id))
+    port_admin=$((10000 + zone_id))
+    database_idx=$((350001 + zone_id))
+    svr_idx=$((810537 + zone_id))
+    svrName_idx=$((zone_id - 1))
+    
+    # 替换配置文件
+    sed -i "25c\PORT_CLIENT = ${port}" ${to_dir}/script/Config.lua
+    sed -i "26c\PORT_ADMIN = ${port_admin}" ${to_dir}/script/Config.lua
+    sed -i "29c\DB_NAME = \"ckwy_fy_S${database_idx}\"" ${to_dir}/script/Config.lua
+    sed -i "32c\SVR_INDEX = ${svr_idx}" ${to_dir}/script/Config.lua
+    mapserver $zone_id
+    echo $server_name
+    sed -i "33c\SVR_NAME = \"${server_name}\"" ${to_dir}/script/Config.lua
+    
+fi
 
 #启动服务
 echo -e "开始启动服务:${zone_id}\n"
-cd /data/zone/server_${zone_id} && ./logic
-
+cd $to_dir && ./logic

+ 26 - 0
docs/start.sh

@@ -0,0 +1,26 @@
+#!/bin/bash
+## 用于维护,修改完代码之后使用
+# 停止所有区服
+pkill -f ./logic
+# 等待两秒用于端口断开
+echo 等待两秒 用于端口断开连接
+sleep 2
+
+path='/data/server/'
+count=1
+for i in $(find . -maxdepth 1 -type d -name "bin*" -exec basename {} \;) 
+do
+    
+    cd "$path$i"
+    echo "enter ${path}${i}/logic"
+    if test -e "${path}${i}/logic" 
+    then
+        count=$count+1
+        ./logic
+    else
+        echo "./logic not exist"
+    fi
+    
+done
+
+echo "launch serverList finish , launch count is ${count}"

+ 42 - 0
docs/th_mapserver.sh

@@ -0,0 +1,42 @@
+#!bin/sh
+zone_id_start=$1
+zone_id_end=$2
+
+index1=寻宝
+index2=服
+server_name=
+mapserver(){
+ server_name=$index1$1$index2
+ echo $server_name
+}
+
+server_path=/data/server/bin
+zone_server_config=
+server_item_path=/script/Config.lua
+zone_index=$zone_id_start
+cur_dir_path=
+number=0
+for ((;zone_index<=zone_id_end;zone_index++)) do
+   #echo $zone_index
+   cur_dir_path=$server_path$zone_index
+   #echo $cur_dir_path
+   if [ -d $cur_dir_path ]; then
+	   #echo "Dir exist"
+	   zone_server_config=$server_path$zone_index$server_item_path
+      if [ -f $zone_server_config ]; then
+	      #echo "File exist"
+         mapserver $zone_index
+	      sed -i "33c\SVR_NAME = \"${server_name}\"" ${zone_server_config}
+         echo ${zone_server_config}
+         ((number++))
+      else
+	      echo "${zone_server_config} is not exist"
+	   fi
+   else
+	   echo "${cur_dir_path} is not exist"
+   fi
+ done
+
+ echo "update Config.lua number:${number}"
+
+

+ 69 - 0
docs/timed_task.sh

@@ -0,0 +1,69 @@
+#!bin/bash
+
+echo "start"
+
+serverPath=/data/server/server
+task_log_path=${serverPath}/timed_task.log
+
+#zone_id=$(awk '{print $1}' ${serverPath}/config.txt)
+zone_id=$(awk 'NR==1{split($0,a,"=");print a[2]}' ${serverPath}/config.txt)
+echo $zone_id
+
+cur_time=$(date "+%Y-%m-%d %H:%M:%S")
+echo "当前执行开服:${zone_id}区开始时间为:${cur_time}" >> $task_log_path
+
+#1:execute install
+sh ${serverPath}/srv_install.sh $zone_id
+cur_time=$(date "+%Y-%m-%d %H:%M:%S")
+echo "${cur_time}=>srv_install.sh ${zone_id}" >> $task_log_path
+
+#4:update 
+db_user="root"
+db_password="wch123.com"
+db_name="sdk"
+table_name="game_server"
+
+# SQL 查询语句
+select_sql="SELECT name FROM game_server where id=1"
+
+# 获取查询结果
+RESULT=($(mysql -u $db_user -p$db_password $db_name -e "${select_sql}"))
+
+if [ ${#RESULT[@]} -eq 0 ]; then
+    cur_time=$(date "+%Y-%m-%d %H:%M:%S")
+    echo "${cur_time}=>not data found in the database" >> $task_log_path
+    exit 1
+fi
+
+TH_ZONE_NAME=
+for (( i = 0;i<${#RESULT[@]}; i+=1)); do
+    ZONE_NAME="${RESULT[1]%% *}"
+    TH_ZONE_NAME=$ZONE_NAME
+    echo 'th:'${TH_ZONE_NAME}
+    break
+done
+
+mongodb_name=$((350001 + zone_id))
+port=$((8191 + zone_id))
+
+update_sql="insert into game_server(id,name,status,ip,port,tag,tips,white_list,db_name) values(${zone_id},'${TH_ZONE_NAME} ${zone_id}', 1,'110.234.192.112',${port},'default','','','ckwy_fy_S${mongodb_name}');"
+mysql -u $db_user -p$db_password $db_name -e "$update_sql"
+
+cur_time=$(date "+%Y-%m-%d %H:%M:%S")
+echo "${cur_time}=>update sql:${update_sql}" >> $task_log_path
+
+#5:add 1
+((zone_id++))
+cur_time=$(date "+%Y-%m-%d %H:%M:%S")
+echo "${cur_time}=>zone_id++ ${zone_id}" >> $task_log_path
+
+#6:save id
+sed -i "1c\zone_start_id=${zone_id}" ${serverPath}/config.txt
+sed -i "2c\port=${port}" ${serverPath}/config.txt
+cur_time=$(date "+%Y-%m-%d %H:%M:%S")
+echo "${cur_time}=>zone_id++ ${zone_id}" >> $task_log_path
+
+cur_time=$(date "+%Y-%m-%d %H:%M:%S")
+echo "当前执行开服:${zone_id}区结束时间为:${cur_time}" >> $task_log_path
+
+echo $zone_id

+ 42 - 0
docs/update_server.sh

@@ -0,0 +1,42 @@
+#! /bin/bash
+
+region=$1 # 区域类型,决定切换哪个分支 thailand 或者test360
+source=/server/source # 服务器资源 用于更新最新的git代码地址
+serverBasePath=/data/server/server/bin1 # 服务器base地址,需要手动更换
+#git账号和密码
+usename="mf527" 
+password="Cdw19930527"
+
+echo enter source path
+if [ ! -d "$source" ]; 
+then
+    mkdir -p "$source"
+fi
+cd $source
+
+if [ ! -d "congkong" ]; 
+then 
+    git clone -b ${region} https://${usename}:${password}@gitee.com/wangwenfan/congkong.git
+fi
+
+cd congkong
+#git checkout $region
+
+git pull
+
+# 将主要脚本同步过去
+cp -rf ${source}/congkong/script/common ${serverBasePath}/script/common
+#cp -rf ${source}/congkong/script/excel ${serverBasePath}/script/excel
+cp -rf ${source}/congkong/script/module ${serverBasePath}/script/module
+# 进入source地址 更新git
+
+## -- congkong
+##     -- script
+##       -- common
+##       -- excel
+##       -- module
+##     -- docs
+##     -- gm
+##     -- webServer
+
+## 复制git下面的代码 到 bin中 cp -rf

+ 18 - 0
docs/开服流程.txt

@@ -0,0 +1,18 @@
+登录相关宝塔地址
+360正式服地址: 118.145.139.78 (/server/) 
+泰国正式服地址: 110.234.192.112 (/data/server/)
+
+再游戏服务器路径下有3个shell处理文件:
+srv_install.sh -- 用于新启动一个服务器 传入参数 新服务Id
+update_server.sh -- 用于更新git代码 传入参数 分支名称
+start.sh   -- 一键开服 先关闭所有服务,然后开启所有区服
+
+启动服务器之后 再mysql注册服务(目前如此)
+mysql -u root -D sdk -p
+wch123.com (密码)
+
+game_server表插入新服务器数据
+INSERT INTO `game_server` (`id`, `name`, `status`, `ip`, `port`, `tag`, `tips`,`white_list`) VALUES (1, 'ขอบเขต 1', 3, '110.234.192.112', 8232, 'default', '','');
+
+修改服务状态
+UPDATE game_server set status = 1 where id = xxx

+ 2 - 2
script/common/CommonDB.lua

@@ -117,11 +117,11 @@ function setServerOpenTime(time)
 end
 
 function getServerOpenTime()
-	if  db.serverStartTime then 
+	if not db.serverStartTime then 
 		local t = Util.getDayStartTime()
 		setServerOpenTime(t)
 	end
-	return  db.serverStartTime
+	return db.serverStartTime
 end
 
 -- 获得当前是开服第几天(如果是开服第一天返回1)

+ 10 - 1
script/core/RoleDel.lua

@@ -98,9 +98,18 @@ function handleMail()
 	LuaMongo.find(DB.db_mail)
 	local compareTime = os.time() - 7 * 24 * 3600 --删除7天以上的邮件
 	while true do
-		local mail = {}
+		--[[local mail = {}
 		if not LuaMongo.next(mail) then
 			break
+		end]]
+		local mail = {}
+		local pret,perr = pcall(LuaMongo.next,mail)
+		if not pret then
+		    print(perr)
+			break
+		end
+		if not next(mail) then 
+			break
 		end
 
         if mail.expireTime then  -- 有指定过期时间

+ 3 - 0
script/module/absAct/Abs365CardLogic.lua

@@ -167,6 +167,9 @@ function abs365Card(human, id, buyConf, isFirst, cnt)
     human.db.absAct[id].active = 1
 
     BagLogic.addItemList(human, buyItemConfig.reward, "abs_365Card")
+
+    -- 刷新
+    getAndSendMsg(human, id, config)
 end
 
 -- 根据权重算索引

+ 20 - 3
script/module/absAct/AbsActLogic.lua

@@ -79,13 +79,22 @@ function onLogin(human)
     end
     -- 是否有新增活动
     for k,v in pairs(absActConfig) do 
-        local ok = isStarted(human,k)
+        local ok,realEndTime = isStarted(human,k)
+        if ok and  human.db.absAct[k] then
+            --- 同步结束时间
+            local nowTime = os.time()
+            local finishTime = human.db.absAct[k].finish or nowTime
+            if  finishTime >= nowTime and  finishTime ~= realEndTime then 
+                human.db.absAct[k].finish = realEndTime
+            end
+        end
         if ok and not human.db.absAct[k] then 
             human.db.absAct[k] = {}
             local f = load("return require(\"" .. v.moduleFn .. "\")")()
             if f and f.genAbsActData then 
                 human.db.absAct[k] = f.genAbsActData()
             end
+            human.db.absAct[k].finish = realEndTime -- 记录活动结束时间
         end
     end
     -- 登录奖励重置
@@ -94,7 +103,7 @@ function onLogin(human)
         if state and id  then 
             if not human.db.absAct[id] then 
                 human.db.absAct[id] = {}
-            end
+            end 
             -- 每日登录领取
             if config.type == AbsActDefine.ABS_LOGIN_REWARD_TYPE_2 then
                 local lastTime = human.db.absAct[id].loginDayGetTime or 0
@@ -176,7 +185,15 @@ function checkAbsActClean(human, id)
     local config = AbsActExcel.absActivity[id]	
     local _,realEndTime = transTime(config)
     local now = os.time()
-    if human.db.absAct[id] and now >= realEndTime then
+    --临时处理积分兑换 下版本删掉
+    if  human.db.absAct[id] and not human.db.absAct[id].finish then 
+        if config.type ==  AbsActDefine.ABS_ACT_TYPE_7  then 
+            human.db.absAct[id] = nil
+        else
+            human.db.absAct[id].finish = realEndTime
+        end
+    end
+    if human.db.absAct[id] and now >= human.db.absAct[id].finish then
         -- 累计达标中的 累计充值到期 需要发送邮件
         if config.type ==  AbsActDefine.ABS_ACT_TYPE_71 then 
             TotalReachLogic.clean(human,id)

+ 1 - 1
script/module/absAct/AbsJifenDrawLogic.lua

@@ -39,7 +39,7 @@ function getAndSendMsg(human, id, config)
         print("not found human.db.absAct")
         return 
     end
-
+    
     local actId = config.actId
     local msgRet = Msg.gc.GC_ABS_ACT_JIFEN_DRAW_QUERY
     local jifenDrawConfig = AbsActExcel.absJifenDraw[actId]

+ 10 - 10
script/module/absAct/DoubleChargeLogic.lua

@@ -1,6 +1,6 @@
 --[[
   human.db.absAct[id] = {
-            [buyID] = cnt       buyID 对应限购次数
+            [buyID] = cnt       buyID 锟斤拷应锟睫癸拷锟斤拷锟斤拷
         }
 
 ]]
@@ -27,7 +27,7 @@ function isActive(human, YYInfo, funcConfig)
 end
 
 
--- 获得剩余双倍次数
+-- 锟斤拷锟绞o拷锟剿�拷锟斤拷锟斤拷锟�
 function getDoubleCnt(human, funcID, buyID)
     local config = AbsActExcel.absActivity[funcID]
     if not config then return 0 end
@@ -45,17 +45,17 @@ function getDoubleCnt(human, funcID, buyID)
 
     local buyItemConfig = BuyExcel.buy[buyID]
 
-    -- 不是充值,则返回
+    -- 锟斤拷锟角筹拷值锟斤拷锟津返伙拷
     if buyItemConfig.cmd ~= "topup" then
         return 0
     end
     
     absAct.buyID = absAct.buyID or {}
-    absAct.buyID[buyID] = absAct.buyID[buyID] or 2
+    absAct.buyID[buyID] = absAct.buyID[buyID] or 4
     return absAct.buyID[buyID]
 end
 
--- 0点重置
+-- 0锟斤拷锟斤拷锟斤拷
 function updateDaily(human, funcID)
     local state, endTime, starTime = AbsActLogic.isStarted(human, funcID)
     if not state then return end
@@ -66,22 +66,22 @@ function updateDaily(human, funcID)
     local doubleConfig = AbsActExcel.doubleCharge[config.actId]
     if not doubleConfig then return 0 end
 
-    -- 过0点则设置为2次双倍
+    -- 锟斤拷0锟斤拷锟斤拷锟斤拷锟斤拷为2锟斤拷双锟斤拷
     AbsActLogic.checkAbsActClean(human, funcID)
     local absAct = human.db.absAct[funcID]
 
     for buyID,_ in pairs(doubleConfig.buyId) do
         absAct.buyID = {}
-        absAct.buyID[buyID] = 2
+        absAct.buyID[buyID] = 4
     end
 end
 
--- 回调
--- 从yunyinglogic 里面调用,故无需判断活动是否开起
+-- 锟截碉拷
+-- 锟斤拷yunyinglogic 锟斤拷锟斤拷锟斤拷茫锟斤拷锟斤拷锟斤拷锟斤拷卸匣疃�拷欠锟斤拷锟�
 -- 
 function buyCall(human,id,buyID)
     local absAct = human.db.absAct[id]
     absAct.buyID = absAct.buyID or {}
-    absAct.buyID[buyID] = absAct.buyID[buyID] or 2
+    absAct.buyID[buyID] = absAct.buyID[buyID] or 4
     absAct.buyID[buyID] = absAct.buyID[buyID] - 1
 end

+ 1 - 1
script/module/absAct/DrumBlastingLogic.lua

@@ -223,7 +223,7 @@ end
 -- ��ֵ
 function onCharge(human, parameter,funcID)
     -- 临时处理 
-    --drumTaskCallBack(human,funcID,4,parameter)
+    drumTaskCallBack(human,funcID,4,parameter)
 end
 
 -- ��������

+ 9 - 6
script/module/absAct/HeroGrowUp.lua

@@ -143,18 +143,21 @@ end
 -- 本期活动开始时间
 function getActStartTime()
     --local id = AbsActLogic.getIDByActID(human, DG_ABS_ACT_ID)
-
-    local absActConfig = AbsActExcel.absActivity[DG_ABS_ACT_ID]
-    if absActConfig.actId and absActConfig.actId ~= 0 then
-        return absActConfig.realStartTime,absActConfig.realEndTime,absActConfig.actId
-    end
+	local absActConfig = AbsActExcel.absActivity[DG_ABS_ACT_ID]
+	local ok, finish,start = AbsActLogic.isStarted(_,DG_ABS_ACT_ID)
+	if absActConfig.actId and absActConfig.actId ~= 0 and ok then
+		return start,finish,absActConfig.actId
+	end	
 end
 
 -- 活动剩余时间
 function getActLeftTime()
     local absActConfig = AbsActExcel.absActivity[DG_ABS_ACT_ID]
     if absActConfig.actId then
-        return absActConfig.realEndTime - os.time()
+		local ok, finish = AbsActLogic.isStarted(_,DG_ABS_ACT_ID)
+		if ok then
+			return finish - os.time()
+		end       
     end
     return 0
 end

+ 2 - 1
script/module/absAct/Proto.lua

@@ -638,7 +638,8 @@ NdCustomNet = {
 }
 
 GC_ABS_ND_CUSTOM_QUERY = {
-    {"giftList",10,NdCustomNet},
+    {"isEnd", 1 , "int"},    --  0表示还有数据,1表示数据已经发送完了
+    {"giftList",5,NdCustomNet},
 }
 
 CG_ABS_ND_CUSTOM_CHOSE_ITEM = {

+ 3 - 3
script/module/absAct/RechargeBackLogic.lua

@@ -57,7 +57,7 @@ function query(human, id)
 
     local list = {}
     for k, config in pairs(AbsActExcel.rechargeBack) do
-        if config and config.actId == absConfig.actId then
+        if config and config.actID == absConfig.actId then
             maxCnt = maxCnt + 1
             list[#list + 1] = k
         end
@@ -123,7 +123,7 @@ function get(human, panelID, id)
     local config = AbsActExcel.rechargeBack[id]
     if not config then return end
 
-    if config.actId ~= absConfig.actId then
+    if config.actID ~= absConfig.actId then
         return
     end
 
@@ -196,7 +196,7 @@ function isRed(human,YYInfo, funcConfig)
     local getDb = absAct.rechargeBackGet or {}
     local rechargeNum = absAct.topupAcount or 0
     for k, config in pairs(AbsActExcel.rechargeBack) do
-        if config.actId == absConfig.actId and rechargeNum >= config.need and not getDb[k] then
+        if config.actID == absConfig.actId and rechargeNum >= config.need and not getDb[k] then
             return true
         end
     end

+ 36 - 27
script/module/absAct/SpecialCustomLogic.lua

@@ -20,8 +20,8 @@ local Msg = require("core.Msg")
 local Grid = require("bag.Grid")
 local BagLogic = require("bag.BagLogic")
 local BuyLogic = require("topup.BuyLogic")
-local ObjHuman = require("core.ObjHuman")
-local Lang  = require("common.Lang")
+local ObjHuman = require("core.ObjHuman")
+local Lang  = require("common.Lang")
 local Broadcast = require("broadcast.Broadcast")
 
 function isOpen(human, YYInfo, funcConfig)
@@ -39,10 +39,10 @@ function isActive(human, YYInfo, funcConfig)
 end
 
 
---发送定制礼包数据
--- id 动id
+--锟斤拷锟酵讹拷锟斤拷锟斤拷锟斤拷锟斤拷锟�
+-- id 锟筋动id
 function getAndSendMsg(human,id,actID)
-    -- 活动未开,返回
+    -- 锟筋动未锟斤拷锟斤拷锟斤拷锟斤拷
     local state, endTime, starTime = AbsActLogic.isStarted(human, id)
     if not state then return end
     local absConfig = AbsActExcel.absActivity[id]
@@ -52,13 +52,20 @@ function getAndSendMsg(human,id,actID)
     if not absAct then
         return
     end
-    -- 初始化custom数据
+    -- 锟斤拷始锟斤拷custom锟斤拷锟斤拷
     absAct.custom = absAct.custom or {}
-    -- 构造数据
+    -- 锟斤拷锟斤拷锟斤拷锟斤拷
     local msgRet = Msg.gc.GC_ABS_ND_CUSTOM_QUERY
     local config = AbsActExcel.custom
     local len = 0
     for k,v in pairs(config) do
+        if len >= 3 then 
+            msgRet.giftList[0] =len
+            msgRet.isEnd = 0
+            Msg.send(msgRet,human.fd)
+            len = 0
+            msgRet = Msg.gc.GC_ABS_ND_CUSTOM_QUERY
+        end
         if v.actId == absConfig.actId then
             len = len + 1
             local net = msgRet.giftList[len]
@@ -108,13 +115,13 @@ function getAndSendMsg(human,id,actID)
                 end
                 net.third[0] = warehouseLen
             end
-            -- 状态为0,表示未选择物品,发送物品库
+            -- 状态为0锟斤拷锟斤拷示未选锟斤拷锟斤拷品锟斤拷锟斤拷锟斤拷锟斤拷品锟斤拷
             if net.state == 0 then
                 net.one[0] = 0
                 net.two[0] = 0
                 net.three[0] = 0
             else
-                -- 状态不为0,表示已卖完或已选择物品,展示已选择物品
+                -- 状态锟斤拷为0锟斤拷锟斤拷示锟斤拷锟斤拷锟斤拷锟斤拷锟窖★拷锟斤拷锟狡凤拷锟秸故撅拷锟窖★拷锟斤拷锟狡�
                 Grid.makeItem(net.one[1],absAct.custom[k].selectItem[1][1],absAct.custom[k].selectItem[1][2])
                 Grid.makeItem(net.two[1],absAct.custom[k].selectItem[2][1],absAct.custom[k].selectItem[2][2])
                 net.one[0] = 1
@@ -127,15 +134,17 @@ function getAndSendMsg(human,id,actID)
             end
         end
     end
-    msgRet.giftList[0] =len
+    msgRet.giftList[0] = len
+    msgRet.isEnd = 1
     Msg.send(msgRet,human.fd)
+    
 end
 
--- 选择物
+-- 选锟斤拷锟斤拷
 function selectItem(human,id,giftId,first,second,third)
     local msgRet = Msg.gc.GC_ABS_ND_CUSTOM_SELECT
     msgRet.ret = 1
-    -- 活动未开,无法选择物
+    -- 锟筋动未锟斤拷锟斤拷锟睫凤拷选锟斤拷锟斤拷
     local state, endTime, starTime = AbsActLogic.isStarted(human, id)
     if not state then 
         msgRet.ret = 0
@@ -157,21 +166,21 @@ function selectItem(human,id,giftId,first,second,third)
         return
     end
     
-    -- 礼包已卖完无法选择物品
+    -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷薹锟窖★拷锟斤拷锟狡�
     if absAct.custom and absAct.custom[giftId] and absAct.custom[giftId].state == 2 then
         msgRet.ret = 0
         Msg.send(msgRet,human.fd)
         return
     end
 
-    -- 初始化数据
+    -- 锟斤拷始锟斤拷锟斤拷锟斤拷
     absAct.custom = absAct.custom or {}
     absAct.custom[giftId] = absAct.custom[giftId] or {}
     absAct.custom[giftId].cnt = absAct.custom[giftId].cnt or 0
     absAct.custom[giftId].state = absAct.custom[giftId].state or 0
     absAct.custom[giftId].selectItem = absAct.custom[giftId].selectItem or {}
     
-    -- 校验物品是否存在
+    -- 校锟斤拷锟斤拷品锟角凤拷锟斤拷锟�
     local config = AbsActExcel.custom[giftId]
     if config == nil 
        or config.first[first] == nil 
@@ -188,7 +197,7 @@ function selectItem(human,id,giftId,first,second,third)
         return
     end
     
-    -- 将已选择物品存入数据库
+    -- 锟斤拷锟斤拷选锟斤拷锟斤拷品锟斤拷锟斤拷锟斤拷锟捷匡拷
     absAct.custom[giftId].selectItem[1] = {}
     absAct.custom[giftId].selectItem[1][1] = config.first[first][1]
     absAct.custom[giftId].selectItem[1][2] = config.first[first][2]
@@ -196,7 +205,7 @@ function selectItem(human,id,giftId,first,second,third)
     absAct.custom[giftId].selectItem[2][1] = config.second[second][1]
     absAct.custom[giftId].selectItem[2][2] = config.second[second][2]
     
-    -- 并非所有礼包都能选择3个物
+    -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟窖★拷锟�3锟斤拷锟斤拷
     if third ~= 0 then
         absAct.custom[giftId].selectItem[3] = {}
         absAct.custom[giftId].selectItem[3][1] = config.third[third][1]
@@ -207,14 +216,14 @@ function selectItem(human,id,giftId,first,second,third)
     absAct.custom[giftId].state = 1
 end
 
--- 购买礼包
+-- 锟斤拷锟斤拷锟斤拷锟�
 
 function custom(human,funcID,conf)
     customBuy(human,conf.args[1],funcID)
 end
 
 function customBuy(human,args,id)
-    -- 活动未开,返回
+    -- 锟筋动未锟斤拷锟斤拷锟斤拷锟斤拷
     local state, endTime, starTime = AbsActLogic.isStarted(human, id)
     if not state then return end
     local absConfig = AbsActExcel.absActivity[id]
@@ -225,23 +234,23 @@ function customBuy(human,args,id)
         return
     end
 
-    -- 购买状态不为可购买,返回
+    -- 锟斤拷锟斤拷状态锟斤拷为锟缴癸拷锟津,凤拷锟斤拷
     if not absAct.custom or not absAct.custom[args] or absAct.custom[args].state ~= 1 then
         return
     end
 
-    -- 未选择物品,返回
+    -- 未选锟斤拷锟斤拷品锟斤拷锟斤拷锟斤拷
     if #absAct.custom[args].selectItem <= 0 then
         return
     end
 
-    -- 已达到限购次数,返回
+    -- 锟窖达到锟睫癸拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
     local config = AbsActExcel.custom[args]
     if absAct.custom[args].cnt >= config.limitCnt then
         return
     end
 
-    -- 钻石价格不为0时,表示钻石购买,则需判断钻石是否足
+    -- 锟斤拷石锟桔革拷为0时锟斤拷锟斤拷示锟斤拷石锟斤拷锟斤拷锟斤拷锟斤拷锟叫讹拷锟斤拷石锟角凤拷锟姐
     if config.price ~= 0 then
 	    if not ObjHuman.checkRMB(human, config.price) then
 	    	return Broadcast.sendErr(human, Lang.COMMON_NO_ZUANSHI)
@@ -249,13 +258,13 @@ function customBuy(human,args,id)
 	    ObjHuman.decZuanshi(human, -config.price, "abs_custom")
     end
 
-    -- 购买次数增加一次
+    -- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟揭伙拷锟�
     absAct.custom[args].cnt = absAct.custom[args].cnt + 1
 
-    -- 状态设置为已卖完,此时,为防止后续报错,导致可无限购买,故先设置为无法继续购买
+    -- 状态锟斤拷锟斤拷为锟斤拷锟斤拷锟疥,锟斤拷时锟斤拷为锟斤拷止锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟铰匡拷锟斤拷锟睫癸拷锟津,癸拷锟斤拷锟斤拷锟斤拷为锟睫凤拷锟斤拷锟斤拷锟斤拷锟斤拷
     absAct.custom[args].state = 2
 
-    -- 统计物品,并发放
+    -- 统锟斤拷锟斤拷品锟斤拷锟斤拷锟斤拷锟斤拷
     local item = {}
     for i = 1, #config.fixed do
         item[#item+1] = {config.fixed[i][1],config.fixed[i][2]}
@@ -265,7 +274,7 @@ function customBuy(human,args,id)
     end
     BagLogic.addItemList(human, item, "abs_custom")   
 
-    -- 判断是否达到限购次数,未达到则将购买状态设为选择物品
+    -- 锟叫讹拷锟角凤拷锏斤拷薰锟斤拷锟斤拷锟斤拷锟轿达拷锏斤拷蚪�锟斤拷锟阶刺�拷锟轿�★拷锟斤拷锟狡�
     if absAct.custom[args].cnt < config.limitCnt then 
         absAct.custom[args].selectItem = {}
         absAct.custom[args].state = 0

+ 35 - 8
script/module/battle/BattleLogic.lua

@@ -673,27 +673,54 @@ function onHookQuery(human)
     local now = os.time()
     local outSec = now - human.db.battleOut.expTs1
     local maxHangTime = getHangMaxTime(human)
-    msgRet.maxTime = maxHangTime
-    if maxHangTime >= outSec then
-        msgRet.time = outSec
-    else
-        msgRet.time = maxHangTime
-    end
+    local idx = 1
+   
     for i = 1, #items do
         Grid.makeItem(msgRet.items[i], items[i].id, items[i].cnt)
     end
-
     local len = #items
     if human.db.battleOut.equip then
         for k, equipGrid in ipairs(human.db.battleOut.equip) do
+            if len >= 10 then 
+                msgRet.items[0] = len
+                msgRet.isEnd = 0
+                msgRet.index = idx
+                msgRet.maxTime = maxHangTime
+                if maxHangTime >= outSec then
+                    msgRet.time = outSec
+                else
+                    msgRet.time = maxHangTime
+                end
+                local minHour = math.floor(msgRet.time / HOUR_SEC)
+                minHour =  (minHour ~= 0) and minHour or 1
+                msgRet.diamond = minHour * DIAMOND_COST_PER_HOUR
+                
+                msgRet.exp = nodeConfig.hangExp
+                msgRet.jinbi = nodeConfig.hangJinbi
+                msgRet.greenExp = nodeConfig.hangGreenExp
+                msgRet.qingbao = nodeConfig.hangQingbao or 0
+                Msg.send(msgRet, human.fd)
+                len = 0
+                idx = idx + 1
+                msgRet = Msg.gc.GC_BATTLE_HANG_QUERY
+            end
             len = len + 1
             Grid.makeItem(msgRet.items[len], equipGrid.id, 1, nil, equipGrid)
         end
     end
+    msgRet.isEnd = 1
+    msgRet.index = idx
+    msgRet.items[0] = len
+    msgRet.maxTime = maxHangTime
+    if maxHangTime >= outSec then
+        msgRet.time = outSec
+    else
+        msgRet.time = maxHangTime
+    end
     local minHour = math.floor(msgRet.time / HOUR_SEC)
     minHour =  (minHour ~= 0) and minHour or 1
     msgRet.diamond = minHour * DIAMOND_COST_PER_HOUR
-    msgRet.items[0] = len
+    
     msgRet.exp = nodeConfig.hangExp
     msgRet.jinbi = nodeConfig.hangJinbi
     msgRet.greenExp = nodeConfig.hangGreenExp

+ 2 - 0
script/module/battle/Proto.lua

@@ -141,6 +141,8 @@ GC_BATTLE_HANG_QUERY = {
 	{"greenExp",	    1,	    "int"},	            --绿魂	
     {"qingbao",         1,      "int"},             --情报
 	{"diamond",         1,      "int"},             -- 钻石消耗数量
+	{"index",           1,      "int"},             -- 序号
+	{"isEnd",           1,      "int"},             -- 是否结束
 }
 
 CG_BATTLE_HANG_GET = {

+ 30 - 2
script/module/chat/Gm.lua

@@ -1804,13 +1804,41 @@ function d3.buyItem(human, value)
    require("shop.ShopLogic").buy(human, 9, 405007, 1, 1)
 end
 
+function d3.testTimeDelay(human,delay)
+	delay = assert(tonumber(delay),"invalid param")
+	Timer.addLater(delay,function(param)
+		print("=======================",param)
+	end,"hello world")
+end
+
+function d3.test2(human,value)
+    print("excute gm command test2")
+    local buyId = tonumber(value)
+     BuyLogic.buy(human,{
+        buyID = buyId,
+        order = "testetstest112",
+        price = 10,
+        account = "test322"
+    })
+end
+
 function d3.test1(human)
 	--require("absAct.MangHeLogic").draw(human, 1)
-	BuyLogic.buy(human,{
+	local oJsonInput = {
+		type=1,
+		id=payParams.id,--商品id
+		cnt=payParams.cnt, --数量
+		money=payParams.money, -- 金额
+		account=payParams.account, --账号
+		order=payParams.order,--订单号
+		region="cn",
+	}
+	local buyRet  = ApiLogic.deliver(oJsonInput,{})
+	--[[BuyLogic.buy(human,{
 		buyID = 91001,
 		price = 6,
 		money = 6
-	})
+	})]]
 end
 
 function d3.zbsj(human,val)

+ 16 - 4
script/module/chengjiu/ChengjiuLogic.lua

@@ -15,6 +15,7 @@ local CombatPosLogic = require("combat.CombatPosLogic")
 local RoleAttr = require("role.RoleAttr")
 local GuideLogic = require("guide.GuideLogic")
 local DB = require("common.DB")
+local Util = require("common.Util")
 local LuaMongo = _G.lua_mongo
 
 --[[
@@ -98,7 +99,11 @@ local function makeChengjiuNet(human,config,net,id)
     local groupConfig = GroupExcel[config.group]
     if config.group <= 4 and human.chengJiuGo and human.chengJiuGo[config.group] and human.chengJiuGo[config.group][id] then
     elseif  config.group <= 4 and net.state == CJ_TASK_STATE_0 and human.db.lv >= groupConfig.lv then
-        net.goDot = 1
+        if net.state == CJ_TASK_STATE_0 then
+            net.goDot = 0
+        else
+            net.goDot = 1
+        end
     end
 end
 
@@ -131,7 +136,8 @@ local function makeChengjiuList(human,config,net,id)
                 end                
                
                 if state == CJ_TASK_STATE_0 then
-                    net.dot = 1
+                    --宝具任务未达成不在红点提示
+                    net.dot = 0
                     break
                 end
             end
@@ -360,9 +366,14 @@ function isDot(human)
             for k, id in ipairs( GroupExcel[i].member) do
                 if human.chengJiuGo and human.chengJiuGo[i] and human.chengJiuGo[i][id] then
                 else
-                    if human.db.chengjiu.task and human.db.chengjiu.task[id] and human.db.chengjiu.task[id] ~= CJ_TASK_STATE_0 then
+                    if (human.db.chengjiu.task and human.db.chengjiu.task[id] and human.db.chengjiu.task[id] ~= CJ_TASK_STATE_0) or
+                        (human.db.chengjiu.task and human.db.chengjiu.task[id] and human.db.chengjiu.task[id] == CJ_TASK_STATE_0) then
                     else
-                        return true
+                        print("1:ChengjiuLogic isDot->"..human.fd.." state:")
+                        if human.db.chengjiu.task and human.db.chengjiu.task[id] and (human.db.chengjiu.task[id] == CJ_TASK_STATE_2 or 
+                            human.db.chengjiu.task[id] == CJ_TASK_STATE_1 ) then
+                           return true
+                        end
                     end
                     
                 end  
@@ -378,6 +389,7 @@ function isDot(human)
             local groupID = ChengjiuExcel[k].group
             local needLv = GroupExcel[groupID].lv
             if v == CJ_TASK_STATE_1 and human.db.lv >= needLv then
+                print("2:ChengjiuLogic isDot->"..human.fd.." state:")
                 return true
             end
         end

+ 12 - 5
script/module/hecheng/EquipHechengLogic.lua

@@ -64,18 +64,25 @@ end
 
 -- 合成装备
 function equipHechengDo(human, id, indexList)
-
-    print("  equipHechengDo    ", id )
-    Util.printTable(indexList)
     local config = EquipExcel.hecheng[id]
-    if not config then return end
+    if not config then    
+        Broadcast.sendErr(human, Util.format(Lang.SKIN_CONF_ERR))
+        return 
+    end
 
     if config.cnt ~= #indexList then
         Broadcast.sendErr(human, Util.format(Lang.EQUIP_HECHENG_ERR_NOITEM,ItemDefine.getValue(needEquipID,"name")))
         return
     end
     -- 检查 装备下标是否正确
-
+    local isExist  = {}
+    for _,idx in pairs(indexList) do 
+        if  isExist[idx] then
+            Broadcast.sendErr(human, Util.format(Lang.DRILL_CHOOSE_MY_ERR_INDEX))
+            return
+        end
+        isExist[idx] =  true
+    end
     for _, index in ipairs(indexList) do
         local grid = human.db.equipBag[index]
         if not grid or grid.id ~= config.needID then

+ 20 - 18
script/module/lostTemple/Proto.lua

@@ -6,9 +6,9 @@ local Attr = require("role.Proto").Attr
 
 LostNode = {
     { "id", 1, "int" },-- id
-    { "name", 1, "string" },-- 名称
-    { "type", 1, "byte" },-- 图标
-    { "desc", 1, "string" },-- 描述
+    { "name", 1, "string" },-- 鍚嶇О
+    { "type", 1, "byte" },-- 鍥炬爣
+    { "desc", 1, "string" },-- 鎻忚堪
     { "x", 1, "byte" },-- id
     { "y", 1, "byte" },-- id
     { "body", 1, "int" },-- id
@@ -24,12 +24,12 @@ LostTree = {
     { "id", 1, "byte" },
     { "icon", 1, "int" },
     { "name", 1, "string" },
-    { "attr", 5, Attr },-- 攻击,血量,护甲
+    { "attr", 5, Attr },-- 鏀诲嚮,琛€閲�,鎶ょ敳
 }
 
 LostBuff = {
     { "name", 1, "string" },-- 
-    { "attr", 1, Attr },  -- 攻击,血量,护甲 
+    { "attr", 1, Attr },  -- 鏀诲嚮,琛€閲�,鎶ょ敳 
 }
 
 LostShop = {
@@ -39,83 +39,85 @@ LostShop = {
     { "discount", 1, "byte" },
 }
 
--- 查询
+-- 鏌ヨ�
 CG_LOST_TEMPLE_QUERY = { }
 GC_LOST_TEMPLE_QUERY = {
     { "list", 20, LostNode },
     { "playerX", 1, "byte" },
     { "playerY", 1, "byte" },
     { "layer", 1, "byte" },
+    { "leftTime", 1, "int"},-- 娲诲姩鍓╀綑鏃堕棿
 }
 
 GC_LOST_TEMPLE_CLOSE = {
 }
 
--- 点击
+-- 鐐瑰嚮
 CG_LOST_TEMPLE_PUT = {
-    { "op", 1, "byte" },-- 0 查询  1 确认操作
+    { "op", 1, "byte" },-- 0 鏌ヨ�  1 纭��鎿嶄綔
     { "x", 1, "byte" },
     { "y", 1, "byte" },
     { "arg", 1, "string" },
 }
 
--- 点击后怪物信息
+-- 鐐瑰嚮鍚庢€�墿淇℃伅
 GC_LOST_TEMPLE_MONSTER = {
     { "gdReward", 10, ItemData },
     { "randomReward", 10, ItemData },
     { "list", 6, HeroSimple },
 }
 
--- 英雄信息
+-- 鑻遍泟淇℃伅
 GC_LOST_TEMPLE_HERO_STATUS = {
     { "list", 30, LostHero },
     { "isEnd", 1, "byte" },
 }
 
--- 召唤神坛信息
+-- 鍙�敜绁炲潧淇℃伅
 GC_LOST_TEMPLE_SUMMON = {
     { "list", 5, HeroSimple },
 }
 
--- 召唤英雄列表
+-- 鍙�敜鑻遍泟鍒楄〃
 CG_LOST_TEMPLE_SUMMON_LIST = { }
 GC_LOST_TEMPLE_SUMMON_LIST = {
     { "list", 15, HeroSimple },
 }
 
--- BUFF属性
+-- BUFF灞炴€�
 GC_LOST_TEMPLE_BUFF = {
     { "list", 5, LostTree },
 }
 
--- 叠加的BUFF属性
+-- 鍙犲姞鐨凚UFF灞炴€�
 CG_LOST_TEMPLE_BUFF_LIST = { }
 GC_LOST_TEMPLE_BUFF_LIST = {
     { "list", 10, LostBuff },
 }
 
--- 商店
+-- 鍟嗗簵
 GC_LOST_TEMPLE_SHOP = {
     { "list", 5, LostShop },
 }
 
 
--- 更新
+-- 鏇存柊
 GC_LOST_TEMPLE_UPDATE = {
     { "list", 20, LostNode },
     { "playerX", 1, "byte" },
     { "playerY", 1, "byte" },
     { "layer", 1, "byte" },
+    { "leftTime", 1, "int"},-- 娲诲姩鍓╀綑鏃堕棿
 }
 
--- 结算
+-- 缁撶畻
 GC_LOST_TEMPLE_FIGHT_END = {
     { "data", 1, CombatFinishData },
     { "gdReward", 10, ItemData },
     { "randomReward", 2, ItemData },
 }
 
--- 随机奖励查询
+-- 闅忔満濂栧姳鏌ヨ�
 CG_LOGT_TEMPLE_RANDOM_BOX = {}
 GC_LOGT_TEMPLE_RANDOM_BOX = {
     { "randomReward", 15, ItemData },

+ 54 - 12
script/module/lostTemple/lostTempleLogic.lua

@@ -34,15 +34,40 @@ START_LAYER = 1     -- ��ʼ����
 OP_QUERY = 0
 OP_CONFIRM = 1
 INIT_HP_MAX = 100
-
+DAY_7s = 604800
+DAY_2s = 172800
+DAY_1s = 86400
 
 function initAfterHot()
 
 end
 
+function getLeftTime()
+    local openDay = CommonDB.getServerOpenDay()
+    if not openDay then
+        return 0
+    end
+    local openTime = CommonDB.getServerOpenTime()
+    local curTime = os.time()
+    if openDay <= 7 and openDay > 0 then
+        local endTime = openTime + DAY_7s
+        return (endTime - curTime)
+    elseif openDay > 7 then
+        if (openDay - 7 + 1)%2 ~= 1 then
+           local endTime = openTime + DAY_7s + (openDay-7)*DAY_1s
+           return (endTime - curTime)
+		end
+        if(openDay - 7 + 1)%2 == 1 then
+            local endTime = openTime + DAY_7s + ((openDay-7)-1)*DAY_2s
+            return (endTime - curTime)
+        end
+    end
+    return 0
+end
+
 --
 local function isOpen(human)
-    --[[local openDay = CommonDB.getServerOpenDay()
+    local openDay = CommonDB.getServerOpenDay()
     if not openDay then
         return 
     end
@@ -54,7 +79,7 @@ local function isOpen(human)
     ---- �Ѿ�����
     if (openDay - 7 + 1) % 2 ~= 1 then
         return 
-    end]]
+    end
     
     if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_1208) then
        return 
@@ -113,16 +138,16 @@ function dbSave(human)
     if not human.lostTemple then return end
     if not human.db then return end
 
-    --[[DB_DATA = { }
+    DB_DATA = { }
     LuaMongo.find(DB.db_lost_temple, QueryByUuid)
     if not LuaMongo.next(DB_DATA) then
         human.lostTemple._id = human.db._id
         LuaMongo.insert(DB.db_lost_temple, human.lostTemple)
         return
-    end]]
+    end
 
     QueryByUuid._id = human.db._id
-    LuaMongo.update(DB.db_lost_temple, QueryByUuid,human.lostTemple,1)
+    LuaMongo.update(DB.db_lost_temple, QueryByUuid, human.lostTemple)
 end
 
 -- db
@@ -598,19 +623,29 @@ local function makeGridNet(human, net)
 end
 
 -- ��ѯ
-function query(human)
-    if not isOpen(human) then return end
+function query(human)  
+    if not isOpen(human) then
+        return
+    end
 
     -- û�й���
     local db = human.db.xingYaoGongMing
-    if not db or not db.defList then return end
+    if not db or not db.defList then
+        return 
+    end
 
     initDB(human)
+
+    local leftTime = getLeftTime()
     local msgRet = Msg.gc.GC_LOST_TEMPLE_QUERY
+    msgRet.leftTime = leftTime
+    
     if not makeGridNet(human, msgRet.list) then return end
     msgRet.playerX = human.lostTemple.x
     msgRet.playerY = human.lostTemple.y
     msgRet.layer = human.lostTemple.layer
+    msgRet.leftTime = leftTime
+
     Msg.send(msgRet, human.fd)
 
     sendHeroStatus(human)
@@ -619,13 +654,20 @@ end
 
 -- ����
 function update(human)
-    if not human.lostTemple then return end
-
+    if not human.lostTemple then 
+        return
+    end
+    
+    if not makeGridNet(human, msgRet.list) then
+        return 
+    end
     local msgRet = Msg.gc.GC_LOST_TEMPLE_UPDATE
-    if not makeGridNet(human, msgRet.list) then return end
+    local leftTime = getLeftTime()
+    msgRet.leftTime = leftTime
     msgRet.playerX = human.lostTemple.x
     msgRet.playerY = human.lostTemple.y
     msgRet.layer = human.lostTemple.layer
+
     Msg.send(msgRet, human.fd)
 end
 

+ 19 - 5
script/module/mozhu/MoZhuLogic.lua

@@ -685,7 +685,7 @@ function updateCombatPosCheck(human)
             if human.db.mozhu.onHero[uuid] then
                 combatHero[pos] = nil
             end
-        end    
+        end
         
         local len = 0
         for pos, uuid in pairs(combatHero) do
@@ -716,6 +716,16 @@ function fight(human, uuid)
     if human.db.mozhu and human.db.mozhu.tzCnt >= MOZHU_TIAOZHAN_CNT then
         return
     end
+
+    --已经阵亡的英雄不能下阵
+    if human.db.mozhu and human.db.mozhu.onHero then
+        for it_uuid, _ in pairs(human.db.mozhu.onHero) do
+            if uuid == it_uuid then
+                Broadcast.sendErr(human, Lang.YJTREASURE_YAOJI_CURE_ERR2)
+                return
+            end
+        end
+    end
     
     local state = updateCombatPosCheck(human)
     if not state then
@@ -989,10 +999,14 @@ function unionRankOver(msg)
         local config = MoZhuExcel.rank[id]
         local union = UnionDBLogic.getUnion(unionUuid)    
         if config and union and union.member then
-            local content = Util.format(mailConfig.content, rank)
-            for uuid in pairs(union.member) do                
-                MailManager.add(MailManager.SYSTEM, uuid, title, content, config.unionReward, senderName)
-            end
+             -- 每个工会随机延迟发放奖励,避免服务器卡顿
+             local r = math.random(60)
+             require("core.Timer").addLater(r,function()
+                 local content = Util.format(mailConfig.content, rank)
+                 for uuid in pairs(union.member) do          
+                     MailManager.add(MailManager.SYSTEM, uuid, title, content, config.unionReward, senderName)
+                 end 
+             end)
         end
     end
 end

+ 30 - 5
script/module/mozhu/MoZhuMiddleLogic.lua

@@ -12,7 +12,10 @@ local MiddleManager = require("middle.MiddleManager")
 
 function onHour(hour)
 
-    if _G.is_middle ~= true then return end
+    if _G.is_middle ~= true then 
+        -- 目前没有跨服,暂时注释
+        --return 
+    end
     local mozhuDB = MoZhuDB.getMoZhu()
 	if not mozhuDB.time then
         MoZhuDB.initMoZhu()
@@ -47,11 +50,33 @@ function onHour(hour)
         local lastGetTime = mozhuDB.lastGetTime or 0
         local now = os.time()
         if now >= endTime and not Util.isSameDay(lastGetTime) then
-            mozhuDB.lastGetTime = now 
+            -- 延后处理 随机十秒
+            local r = math.random(10)
+            require("core.Timer").addLater(r,function()
+                mozhuDB.lastGetTime = now
+                local unionList = {}
+                for rank, unionUuid in ipairs(mozhuDB.unionRank) do
+                    unionList[unionUuid] = rank
+                end
+                MoZhuLogic.actOverRank({
+                    type = 2,
+                    list = unionList
+                })
+                local roleList = {}
+                for rank, uuid in ipairs(mozhuDB.roleRank) do
+                    roleList[uuid] = rank
+                end
+                MoZhuLogic.actOverRank({
+                    type = 1,
+                    list = roleList
+                })
+                MoZhuDB.saveMoZhu()
+            end)
+            
             -- 发放上一日 排名奖励
-            actOverUnion()
-            actOverRole()
-            saveMoZhu()
+            --actOverUnion()
+            --actOverRole()
+            
         end
     end
 end

+ 1 - 1
script/module/scene/Handler.lua

@@ -48,7 +48,7 @@ function CG_TEST_PROTO(fd,msg)
 	elseif param.type == "kickAllUser" then
 		for _,h in pairs(ObjHuman.onlineAccount) do 
 			ObjHuman.doDisconnect(h, CommonDefine.DISCONNECT_KICK_ALL)
-			sendDisconnect(h,CommonDefine.DISCONNECT_KICK_ALL)
+			sendDisconnect(h.fd,CommonDefine.DISCONNECT_KICK_ALL)
 		end
 	end
 end

+ 4 - 0
script/module/skin/SkinLogic.lua

@@ -216,6 +216,10 @@ function initAfterHot()
 			outConf.totalWeight = outConf.totalWeight + v[2]
 		end
 	end
+    SkinExcel = require("excel.skin").skin
+    HeroExcel = require("excel.hero").hero
+    SkillExcel = require("excel.skin").skill
+    ItemExcel = require("excel.item").item
 end
 
 -- 优先使用皮肤的技能,新版本没有默认返回false

+ 2 - 1
script/module/warReport/WarReportLogic.lua

@@ -112,11 +112,12 @@ end
 function initAfterStart()
    -- ���������
    if _G.is_middle ~= true then
-      return
+      --return
    end
 
    -- ���Ӽ�¼����
    local war_count_data = {}
+   local war_count_query = { war = 1 }
    LuaMongo.find(DB.db_war_report, war_count_query)
    if LuaMongo.next(war_count_data) then
       return

+ 2 - 1
webServer/src/config/sdk.sql

@@ -56,7 +56,8 @@ ALTER TABLE game_order ADD token text NOT NULL DEFAULT '';
 ALTER TABLE game_order ADD platform varchar(50) NOT NULL DEFAULT '';
 
 //加区服
- INSERT INTO `game_server` (`id`, `name`, `status`, `ip`, `port`, `tag`, `tips`,`white_list`) VALUES (27, 'ขอบเขต 27', 1, '110.234.192.112', 8218, 'default', '','');
+ INSERT INTO `game_server` (`id`, `name`, `status`, `ip`, `port`, `tag`, `tips`,`white_list`) VALUES (29, 'ขอบเขต 29', 3, '110.234.192.112', 8220, 'default', '','');
+ INSERT INTO `game_server` (`id`, `name`, `status`, `ip`, `port`, `tag`, `tips`,`white_list`) VALUES (35, 'เซิร์ฟเวอร์ 35', 1, '110.234.192.112', 8226, 'default', '','');
 
 // 加白名单
  update game_server set white_list = '171.216.76.130,101.24.120.82' where id =3;

+ 14 - 3
webServer/src/controller/ApiController.ts

@@ -852,7 +852,11 @@ class ApiController {
             case 'quick':
                 var result = await CallPayQuick(ctx)
                 console.log('发货结果', result)
-                ctx.body = result
+                if((result as any).code == 1){
+                    ctx.body = 'SUCCESS'
+                }else{
+                    ctx.body = 'Fail'
+                }
                 break;
             default:
                 ctx.body = {
@@ -974,10 +978,16 @@ class ApiController {
         let data = [];
         let isNewAccount = 1
         let enterServerList = (await Server.getEnterServerListByUid(uid))
+        let ip = ctx.request.ip
+        if (ip.startsWith('::ffff:')) {
+            ip = ip.substring('::ffff:'.length);
+        }
+        logger.info("getLastServerList 区服接口", { "ip": ctx.request.ip })
 
         if (enterServerList.length > 0) {
             isNewAccount = 0
-            const servers = (await Server.getServerList(tag, 1))
+            // const servers = (await Server.getServerList(tag, 1))
+            const servers = (await Server.getAllServerList(tag, ip))
             enterServerList.forEach(function (element) {
                 data.push({
                     "channel": "Thailand", //渠道固定
@@ -995,7 +1005,8 @@ class ApiController {
             });
 
         } else {
-            const servers = (await Server.getServerList(tag, 1))
+            // const servers = (await Server.getServerList(tag, 1))
+            const servers = (await Server.getAllServerList(tag, ip))
             if (servers.length > 0) {
                 const serverInfo = servers[servers.length - 1]
                 data.push({

+ 3 - 2
webServer/src/json/notice.json

@@ -1,6 +1,7 @@
 [
     {
-        "content": "《寻宝之旅》是一款水墨风格的卡牌游戏,突破了传统的框架,游戏中拥有丰富的支线章节,玩家的每一个决策都会对游戏的故事发展产生深远影响,真正实现了高度互动的剧情体验。\n新服【S13】服【9月20日12:00】开启!!\n【礼包码】\n通用礼包:进入游戏直接输入xbzl555、xbzl666、xbzl777\nQQ群礼包:3个礼包。群内不定时会发放礼包。\n社区礼包3个:在tap社区直接领取。\ntaptap签到礼包:总共7个礼包,需要前往taptap签到才能获得。\n领取方式:左上角【人物头像】→【设置】→【礼包码兑换】\n官方QQ交流群:992058780 \n",
-        "status": 1
+        "content": "《寻宝之旅》是一款水墨风格的卡牌游戏,突破了传统的框架,游戏中拥有丰富的支线章节,玩家的每一个决策都会对游戏的故事发展产生深远影响,真正实现了高度互动的剧情体验。\n【礼包码】\n通用礼包:进入游戏直接输入xbzl555、xbzl666、xbzl777\nQQ群礼包:3个礼包。群内不定时会发放礼包。\n社区礼包3个:在tap社区直接领取。\ntaptap签到礼包:总共7个礼包,需要前往taptap签到才能获得。\n领取方式:左上角【人物头像】→【设置】→【礼包码兑换】\n官方QQ交流群:992058780 \n",
+        "status": 1,
+        "content_wh": "9月27日维护内容\n1、新增“国庆七天乐”:\n7天登录:国庆期间任意七天登录可领取奖励\n举国欢庆:每天完成指定任务,形成任务三连可领取礼炮奖励,礼炮累积达到一定次数可领取额外宝箱奖励\n定制礼包:可免费领取1个礼包,可充值购买更多礼包,礼包内容可在自选道具池进行组合\n2、新增“皮肤”功能,通过->活动->星届衣间可进行购买,后续将外放更多的免费和付费皮肤\n3、“英雄兑换”活动开放新一轮的兑换列表\n4、修复了“打赏返利”没有显示内容的问题\n5、修复了“举火焚天”技能没有眩晕效果的问题\n6、重新修复了复活技能只加血的问题\n7、修复了个人信息界面所属服务器没有正常显示的问题\n8、游戏公告增加分页支持维护内容和其他信息显示\n9、修复了“失落神庙”战斗失败后再次挑战卡战斗的问题\n10、货币界面增加详细数量显示\n11、重新修复了“战斗录像”无法收录的问题\n12、优化了“宝具”系统红点提示规则"
     }
 ]

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
webServer/src/json/th_notice.json


+ 3 - 2
webServer/src/json/xky_notice.json

@@ -1,7 +1,8 @@
 [
     {
-        "content": "《侠客游》是一款水墨风格的卡牌游戏,突破了传统的框架,游戏中拥有丰富的支线章节,玩家的每一个决策都会对游戏的故事发展产生深远影响,真正实现了高度互动的剧情体验。\n新服【S10]服【9月14日10:00]开启!!\n【礼包码]\n通用礼包:进入游戏直接输入xbz1555、xbzl666、xbzl777\nQQ群礼包:3个礼包。群内不定时会发放礼包。\n\n领取方式:左上角【人物头像]→【设置]→【礼包码兑换]\n官方QQ交流群:907717555",
-        "status": 1
+        "content": "《侠客游》是一款水墨风格的卡牌游戏,突破了传统的框架,游戏中拥有丰富的支线章节,玩家的每一个决策都会对游戏的故事发展产生深远影响,真正实现了高度互动的剧情体验。\n新服9月29日15:00开启!!\n礼包码兑换领取方式:左上角 [人物头像]→[设置]→[礼包码兑换]",
+        "status": 1,
+        "content_wh": ""
     }
 ]
 

+ 4 - 2
webServer/src/model/ServerModel.ts

@@ -31,7 +31,9 @@ class ServerModel {
                 name: row.name,
                 server: `ws://${row.ip}:${row.port}`,
                 status: status,
-                tips: row.tips
+                tips: row.tips,
+                ip: row.ip,
+                port: row.port
             };
         });
         return resultArray
@@ -42,7 +44,7 @@ class ServerModel {
     }
 
     async getEnterServerListByUid(uid: any) {
-        return await query(`SELECT ges.id, ges.uid, ges.server_id, ges.create_time as last_login_time , gs.ip, gs.port,gs.status,gs.name FROM game_enter_server as ges left join game_server as gs on ges.server_id = gs.id WHERE ges.uid = ? order by ges.create_time desc `, [uid])
+        return await query(`SELECT ges.id, ges.uid, ges.server_id, ges.create_time as last_login_time , gs.ip, gs.port,gs.status,gs.name,gs.tips FROM game_enter_server as ges left join game_server as gs on ges.server_id = gs.id WHERE ges.uid = ? order by ges.create_time desc `, [uid])
     }
 
     //记录进区

+ 2 - 0
webServer/src/router/index.ts

@@ -26,6 +26,8 @@ router.post('/genCDK',ApiController.genCDK)
 
 router.post('/useCDK',ApiController.useCDK)
 
+router.post('/getCDK',ApiController.getCDK)
+
 router.post('/validCDK',ApiController.validCDK)
 
 //进去区服

+ 17 - 17
webServer/src/utils/task.ts

@@ -5,20 +5,20 @@ const schedule = require('node-schedule');
 async function asyncOpenServer() {
     const sql = 'SELECT * FROM game_server where status in (0,3) and open_time > 0';
     return new Promise((resolve, reject) => {
-      query(sql, (error, results, fields) => {
-        if (error) throw error;
-        // 处理查询结果
-        console.log(results);
-        (results as any[]).forEach(row => {
-            const timestamp = new Date().getTime();
-            if (timestamp >= row.open_time) {
-                const updateSql = `update  game_server set status = 1 where id = ${row.id} `;
-                query(updateSql, (error, res, fields) => {
-                    resolve(results)
-                })
-            }
-        })
-    });
+        query(sql, (error, results, fields) => {
+            if (error) throw error;
+            // 处理查询结果
+            console.log(results);
+            (results as any[]).forEach(row => {
+                const timestamp = new Date().getTime();
+                if (timestamp >= row.open_time) {
+                    const updateSql = `update  game_server set status = 1  where id = ${row.id} `;
+                    query(updateSql, (error, res, fields) => {
+                        resolve(results)
+                    })
+                }
+            })
+        });
     });
 }
 
@@ -26,13 +26,13 @@ export default class Task {
     openServer() {
         const rule = new schedule.RecurrenceRule();
         rule.second = [0];
-        const job = schedule.scheduleJob(rule, async function() {
+        const job = schedule.scheduleJob(rule, async function () {
             try {
                 const result = await asyncOpenServer(); // 使用await等待异步任务完成
                 console.log(result);
-              } catch (error) {
+            } catch (error) {
                 console.error('区服任务执行出错:', error);
-              }
+            }
         });
     }
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов