Merge remote-tracking branch 'origin/dev' into dev

pull/310/head
ffdfgdfg 2019-12-17 00:07:21 +08:00
commit 4899bbd9d5
5 changed files with 27 additions and 51 deletions

View File

@ -18,7 +18,8 @@
* [功能](feature.md)
* [说明](description.md)
* [web api](api.md)
* [sdk](npc_sdk.md)
git
* 其他
* [贡献](contribute.md)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 1.4 KiB

23
docs/npc_sdk.md Normal file
View File

@ -0,0 +1,23 @@
# npc sdk文档
```
命令行模式启动客户端
p0->连接地址
p1->vkey
p2->连接类型tcp or udp
p3->连接代理
extern GoInt StartClientByVerifyKey(char* p0, char* p1, char* p2, char* p3);
查看当前启动的客户端状态在线为1离线为0
extern GoInt GetClientStatus();
关闭客户端
extern void CloseClient();
获取当前客户端版本
extern char* Version();
获取日志,实时更新
extern char* Logs();
```

View File

@ -18,6 +18,8 @@
- 停止:`npc.exe stop`
- 如果需要更换命令内容需要先卸载`npc.exe -service=uninstall`,再重新注册
注册到服务后日志文件windows位于当前目录下linux和darwin位于/var/log/npc.log
## 客户端更新
首先进入到对于的客户端二进制文件目录

View File

@ -1,50 +0,0 @@
#/bash/sh
echo "start upgrading to the latest version"
if [ $1 == "latest" ]
then
version=`wget -qO- -t1 -T2 "https://api.github.com/repos/cnlh/nps/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g'`
else
version=$1
fi
echo "the current latest version is "$version""
download_base_url=https://github.com/cnlh/nps/releases/download/$version/
if [ $4 ]
then
filename=""$2"_"$3"_v"$4"_"server".tar.gz"
else
filename=""$2"_"$3"_"server".tar.gz"
fi
complete_download_url=""$download_base_url""$filename""
echo "start download file from "$complete_download_url""
dir_name=`echo $RANDOM`
mkdir $dir_name && cd $dir_name
wget $complete_download_url >/dev/null 2>&1
if [ ! -f "$filename" ]; then
echo "download file failed!"
rm -rf $dir_name
exit
fi
echo "start extracting files"
mkdir nps
tar -xvf $filename -C ./nps >/dev/null 2>&1
cd nps
if [ -f "../../nps" ]; then
echo "replace "../../nps"!"
cp -rf nps ../../
fi
usr_dir=`which nps`
if [ -f "$usr_dir" ]; then
echo "replace "$usr_dir"!"
cp -rf nps $usr_dir
fi
cd ../../ && rm -rf $dir_name
echo "update complete!"
echo -e "\033[32m please restart nps \033[0m"