♻️ refactor(playbook): streamline agents and refresh tsl docs
This commit is contained in:
@@ -33,59 +33,23 @@
|
||||
|
||||
范例 http模式代理登陆
|
||||
|
||||
```text
|
||||
cTS:=ConnectServer("tsl.tinysoft.com.cn",443,array("Address":"192.168.0.250","Port":808,"AuthMode":0));
|
||||
|
||||
|
||||
lg:=LoginServer("TSUser","UserPass",msg);
|
||||
|
||||
|
||||
if lg=0 then
|
||||
|
||||
|
||||
begin
|
||||
|
||||
|
||||
echo "登陆成功!";
|
||||
|
||||
|
||||
Script:='program TS_testFunc;
|
||||
|
||||
|
||||
Begin
|
||||
|
||||
|
||||
r:=1->5;
|
||||
|
||||
|
||||
Return r;
|
||||
|
||||
|
||||
End.';
|
||||
|
||||
|
||||
if SendExecuteAndWait(Script,getSysParams(),Result,ErrMsg)=0 then //Execute Success
|
||||
|
||||
|
||||
echo tostn(Result),'\r\n';
|
||||
|
||||
|
||||
else
|
||||
|
||||
|
||||
echo '远端执行失败!\r\n';
|
||||
|
||||
|
||||
DisconnectServer();
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
else
|
||||
|
||||
|
||||
echo "登陆失败,报错:(",cTS,",",msg,")\r\n";
|
||||
```tsl
|
||||
cTS := ConnectServer("tsl.tinysoft.com.cn", 443, array("Address":"192.168.0.250", "Port":808, "AuthMode":0));
|
||||
lg := LoginServer("TSUser", "UserPass", msg);
|
||||
if lg = 0 then
|
||||
begin
|
||||
echo "登陆成功!";
|
||||
Script := 'program TS_testFunc;
|
||||
begin
|
||||
r := 1 - > 5;
|
||||
return r;
|
||||
end.';
|
||||
if SendExecuteAndWait(Script, getSysParams(), Result, ErrMsg) = 0 then//Execute Success
|
||||
echo tostn(Result), '\r\n';
|
||||
else echo '远端执行失败!\r\n';
|
||||
DisconnectServer();
|
||||
end
|
||||
else echo "登陆失败,报错:(", cTS, ",", msg, ")\r\n";
|
||||
```
|
||||
|
||||
打印"登陆成功!"则说明连接成功。参考DefaultConnectAndLogin LoginServer
|
||||
@@ -109,53 +73,30 @@ Files\Tinysoft\Analyse.NET\Plugin
|
||||
|
||||
第二步:在tslclient.ini添加以下内容:
|
||||
|
||||
```text
|
||||
```ini
|
||||
[TSLClient Config]
|
||||
|
||||
;调用是登陆的别名
|
||||
|
||||
[test]
|
||||
|
||||
;本地许可
|
||||
|
||||
Permit=local
|
||||
|
||||
;用户名
|
||||
|
||||
LoginName=
|
||||
|
||||
;密码
|
||||
|
||||
LoginPass=
|
||||
|
||||
;服务器 地址
|
||||
|
||||
Address=tsl.tinysoft.com.cn
|
||||
|
||||
;端口
|
||||
|
||||
Port=443
|
||||
|
||||
;---以下为代理服务器
|
||||
|
||||
;代理服务器端口
|
||||
|
||||
ProxyPort=
|
||||
|
||||
;代理服务器地址
|
||||
|
||||
ProxyAddress=
|
||||
|
||||
;代理身份验证用户名
|
||||
|
||||
ProxyUser=
|
||||
|
||||
;验证密码
|
||||
|
||||
ProxyPass=
|
||||
|
||||
;代理模式 http模式设置为0, SOCKS5模式设置为5
|
||||
|
||||
ProxyAuthMode=
|
||||
```
|
||||
|
||||
@@ -181,50 +122,24 @@ ProxyAuthMode=
|
||||
|
||||
#### 异步回调函数以及实时订阅系统参数说明
|
||||
|
||||
<table><tbody><tr><td>
|
||||
系统参数名</td><td>
|
||||
类型</td><td>
|
||||
说明</td></tr><tr><td>
|
||||
channel</td><td>
|
||||
整数</td><td>
|
||||
通道ID,和SendExecute返回值一致</td></tr><tr><td>
|
||||
recvtype</td><td>
|
||||
整数</td><td>
|
||||
参阅:<a href="http://www.tinysoft.com.cn/tsdn/helpdoc/display.tsl?id=22122">服务器返回信息类型</a></td></tr><tr><td>
|
||||
errno</td><td>
|
||||
整数</td><td>
|
||||
错误号,非0错误</td></tr><tr><td>
|
||||
errmsg</td><td>
|
||||
字符串</td><td>
|
||||
错误信息</td></tr><tr><td>
|
||||
result</td><td>
|
||||
订阅为数组类型</td><td>
|
||||
结果集,订阅为推送类型</td></tr></tbody></table>
|
||||
| 系统参数名 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| channel | 整数 | 通道ID,和SendExecute返回值一致 |
|
||||
| recvtype | 整数 | 参阅:服务器返回信息类型 |
|
||||
| errno | 整数 | 错误号,非0错误 |
|
||||
| errmsg | 字符串 | 错误信息 |
|
||||
| result | 订阅为数组类型 | 结果集,订阅为推送类型 |
|
||||
|
||||
#### 服务器返回信息类型
|
||||
|
||||
<table><tbody><tr><td>
|
||||
返回类型</td><td>
|
||||
值</td><td>
|
||||
说明</td></tr><tr><td>
|
||||
执行函数返回</td><td>
|
||||
0x0201</td><td>
|
||||
</td></tr><tr><td>
|
||||
执行委托函数返回</td><td>
|
||||
0x0301</td><td>
|
||||
</td></tr><tr><td>
|
||||
ECHO返回</td><td>
|
||||
0x0401</td><td>
|
||||
</td></tr><tr><td>
|
||||
客户请求返回</td><td>
|
||||
0x0402</td><td>
|
||||
</td></tr><tr><td>
|
||||
实时订阅返回</td><td>
|
||||
0x0501</td><td>
|
||||
</td></tr><tr><td>
|
||||
错误信息返回</td><td>
|
||||
0</td><td>
|
||||
</td></tr></tbody></table>
|
||||
| 返回类型 | 值 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| 执行函数返回 | 0x0201 | |
|
||||
| 执行委托函数返回 | 0x0301 | |
|
||||
| ECHO返回 | 0x0401 | |
|
||||
| 客户请求返回 | 0x0402 | |
|
||||
| 实时订阅返回 | 0x0501 | |
|
||||
| 错误信息返回 | 0 | |
|
||||
|
||||
#### EndExecute
|
||||
|
||||
@@ -238,31 +153,21 @@ ECHO返回</td><td>
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
```tsl
|
||||
####python交互范例,python代码
|
||||
|
||||
import sys
|
||||
|
||||
sys.path.append('D:\\tinysoft\\Analyse.NET\\')
|
||||
|
||||
import TSLPy3 as ts
|
||||
|
||||
data=ts.DefaultConnectAndLogin("test")
|
||||
|
||||
data := ts.DefaultConnectAndLogin("test")
|
||||
print(ts.Logined())
|
||||
|
||||
print("远程登录地址",ts.RemoteAddress())
|
||||
|
||||
print("服务器设置:",ts.GetService())
|
||||
|
||||
print("远程登录地址", ts.RemoteAddress())
|
||||
print("服务器设置:", ts.GetService())
|
||||
ts.SetComputeBitsOption(64) #设置计算单位
|
||||
|
||||
print("计算位数设置:",ts.GetComputeBitsOption())
|
||||
|
||||
print("计算位数设置:", ts.GetComputeBitsOption())
|
||||
ts.Disconnect() #断开连接
|
||||
```
|
||||
|
||||
//结果
|
||||
结果
|
||||
|
||||
#### RemotePort
|
||||
|
||||
@@ -295,13 +200,11 @@ ts.Disconnect() #断开连接
|
||||
|
||||
范例
|
||||
|
||||
```text
|
||||
rdo2 TSTaskAdmin("oa",CmdReturn,BroadCastMsg,ErrMsg,3000,1000);
|
||||
|
||||
```tsl
|
||||
rdo2 TSTaskAdmin("oa", CmdReturn, BroadCastMsg, ErrMsg, 3000, 1000);
|
||||
return CmdReturn;
|
||||
```
|
||||
|
||||
返回结果:
|
||||
|
||||
#### SetComputeService
|
||||
|
||||
|
||||
Reference in New Issue
Block a user