找回密码
 register

QQ登录

只需一步,快速开始

查看: 84|回复: 0

[游戏教程] 一个带进度条、ServerTest日志记录、自动开启虚拟内容、开启关闭热更新的run.sh

[复制链接]

[游戏教程] 一个带进度条、ServerTest日志记录、自动开启虚拟内容、开启关闭热更新的run.sh

[复制链接]
  • 打卡等级:热心大叔
  • 打卡总天数:94
  • 打卡月天数:17
  • 打卡总奖励:94
  • 最近打卡:2025-01-18 01:28:20
Waylee

主题

0

回帖

1万

积分

仙帝

积分
12364
Waylee 2023-5-9 02:17 | 显示全部楼层 |阅读模式

马上注册,查看网站隐藏内容!!

您需要 登录 才可以下载或查看,没有账号?register

×
文章编辑人员:雪舞
内容测试时间:2023-5-9 02:16:53
测试环境:CentOS 7.6
测试版本:新武侠世界
游客,本帖隐藏的内容需要积分高于 500 才可浏览,您当前积分为 0



最近修改版本:
#!/bin/bash

ulimit -n 65535

# 删除已有的计划任务
sed -i '/listenServer.sh/d' /var/spool/cron/root

echo '__  ___   _ _______        ___   _       _             _   
\ \/ / | | | ____\ \      / / | | |  ___| |_ __ _ _ __| |_ 
 \  /| | | |  _|  \ \ /\ / /| | | | / __| __/ _  | |__| __|
 /  \| |_| | |___  \ V  V / | |_| | \__ \ || (_| | |  | |_ 
/_/\_\\___/|_____|  \_/\_/   \___/  |___/\__\__,_|_|   \__|'

if ps aux | grep -w "./ShareMemory" | grep -v grep >/dev/null 2>&1; then
  echo " ShareMemory is running !!!!!!"
else
  ###### start ShareMemory ######
  cd /home/tlbb/Server/
  ./shm clear >/dev/null 2>&1
  rm -rf exit.cmd quitserver.cmd
  ./shm start >/dev/null 2>&1
  echo " start ShareMemory ......"
  
# 输出进度条
for i in {1..30}; do
     equals=$(printf "%0.s=" $(seq 1 $((i*2))))
     spaces=$(printf "%0.s " $(seq 1 $((60-i*2))))
     printf "[%s>%s] %d%%\r" "$equals" "$spaces" "$((i*100/30))"
     sleep 1
done

echo -e "\n ShareMemory started completely !!!!!!"

###### start World ######
cd /home/tlbb/Server/
./World >/dev/null 2>&1 &
echo " start World ......"

# 输出进度条
for i in {1..5}; do
     equals=$(printf "%0.s=" $(seq 1 $((i*4))))
     spaces=$(printf "%0.s " $(seq 1 $((20-i*4))))
     printf "[%s>%s] %d%%\r" "$equals" "$spaces" "$((i*100/5))"
     sleep 1
done

echo -e "\n World started completely !!!!!!" 

###### start Login ######
./Login >/dev/null 2>&1 &
echo " start Login ......"
sleep 1
echo -e " Login started completely !!!!!!"

###### start ServerTest  ######
cd /home/tlbb/Server/

if [[ "$1" == "-r" ]]; then
    nohup ./ServerTest  &> /dev/null  &
else
    nohup ./ServerTest -loadscriptonce &> /dev/null  &
fi
echo " start Server ......"

# 输出进度条
  
for i in {1..60}; do
   equals=$(printf "%0.s=" $(seq 1 $((i*2))))
   spaces=$(printf "%0.s " $(seq 1 $((120-i*2))))
   printf "[%s>%s] %d%%\r" "$equals" "$spaces" "$((i*100/60))"
   sleep 1
done
        
  
if [[ "$1" == "-r" ]]; then
  echo -e "\n Server started completely !!!!!!
+----------------------------------------------------------------------
| TLBB Server 热更新已开启
+----------------------------------------------------------------------"  
else
  echo -e "\n Server started completely !!!!!!
+----------------------------------------------------------------------
| TLBB Server 热更新已关闭 若想开启请加启动参数 ./run -r
+----------------------------------------------------------------------"  
fi
  
  # 创建监听计划任务
  sh /home/tlbb/listenServer.sh
  echo " ------------listenServer started------------"
fi


您需要登录后才可以回帖 登录 | register

本版积分规则

雪舞知识库 | 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 |天天打卡

GMT+8, 2025-1-19 23:20 , Processed in 0.099839 second(s), 8 queries , Redis On.

Powered by XueWu Licensed

Copyright © Tencent Cloud.

快速回复 返回顶部 返回列表