Skip to content

Commit

Permalink
feat: add env to close ld_preload
Browse files Browse the repository at this point in the history
  • Loading branch information
1995chen committed Jan 16, 2022
1 parent f1eb772 commit ef7812f
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ GM_LANDER_VERSION
DNF_DB_ROOT_PASSWORD
# DNF数据库game密码(必须8位)
DNF_DB_GAME_PASSWORD
# 采用LD_PRELOAD优化CPU使用[模式为false]
PRELOAD_LD
```
Windows高版本用户无法进入频道,需要添加hosts
PUBLIC_IP(你的服务器IP) start.dnf.tw
Expand Down
1 change: 1 addition & 0 deletions build/Centos6-DNF/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MAINTAINER 1995chen

# 定义默认环境变量
ENV AUTO_PUBLIC_IP=false
ENV PRELOAD_LD=false
ENV PUBLIC_IP=127.0.0.1
ENV GM_ACCOUNT=gm_user
ENV GM_PASSWORD=gm_pass
Expand Down
2 changes: 1 addition & 1 deletion build/Centos6-DNF/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if $AUTO_PUBLIC_IP;
then
PUBLIC_IP=`curl -s http://pv.sohu.com/cityjson?ie=utf-8|awk -F\" '{print $4}'`
echo "public ip: $PUBLIC_IP"
sleep 1
sleep 5
fi

chmod +x /TeaEncrypt
Expand Down
15 changes: 12 additions & 3 deletions build/Centos6-DNF/root/run
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,16 @@ cd /home/neople/game
chmod 777 *
rm -rf /home/neople/game/log/*
sleep 2
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco11 start &
sleep 2
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco52 start &

if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco11 start &
echo "start game use LD_PRELOAD mode"
sleep 2
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco52 start &
else
./df_game_r siroco11 start &
echo "start game use normal mode"
sleep 2
./df_game_r siroco52 start &
fi
tail -f /dev/null
1 change: 1 addition & 0 deletions build/Centos7-DNF/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MAINTAINER 1995chen

# 定义默认环境变量
ENV AUTO_PUBLIC_IP=false
ENV PRELOAD_LD=false
ENV PUBLIC_IP=127.0.0.1
ENV GM_ACCOUNT=gm_user
ENV GM_PASSWORD=gm_pass
Expand Down
2 changes: 1 addition & 1 deletion build/Centos7-DNF/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if $AUTO_PUBLIC_IP;
then
PUBLIC_IP=`curl -s http://pv.sohu.com/cityjson?ie=utf-8|awk -F\" '{print $4}'`
echo "public ip: $PUBLIC_IP"
sleep 1
sleep 5
fi

chmod +x /TeaEncrypt
Expand Down
15 changes: 12 additions & 3 deletions build/Centos7-DNF/root/run
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,16 @@ cd /home/neople/game
chmod 777 *
rm -rf /home/neople/game/log/*
sleep 2
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco11 start &
sleep 2
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco52 start &

if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco11 start &
echo "start game use LD_PRELOAD mode"
sleep 2
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco52 start &
else
./df_game_r siroco11 start &
echo "start game use normal mode"
sleep 2
./df_game_r siroco52 start &
fi
tail -f /dev/null

0 comments on commit ef7812f

Please sign in to comment.