diff --git a/docs/_sidebar.md b/docs/_sidebar.md index cfb58fa..2474ab7 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -12,6 +12,7 @@ * [基本使用](use.md) * [增强功能](npc_extend.md) + * [sdk](npc_sdk.md) * 扩展 diff --git a/docs/npc_sdk.md b/docs/npc_sdk.md new file mode 100644 index 0000000..db70772 --- /dev/null +++ b/docs/npc_sdk.md @@ -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(); +``` diff --git a/docs/use.md b/docs/use.md index deeda30..5ac6cce 100644 --- a/docs/use.md +++ b/docs/use.md @@ -18,6 +18,8 @@ - 停止:`npc.exe stop` - 如果需要更换命令内容需要先卸载`npc.exe -service=uninstall`,再重新注册 +注册到服务后,日志文件windows位于当前目录下,linux和darwin位于/var/log/npc.log + ## 客户端更新 首先进入到对于的客户端二进制文件目录 diff --git a/update.sh b/update.sh deleted file mode 100644 index 3e0bfe3..0000000 --- a/update.sh +++ /dev/null @@ -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"