"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[6803],{7776:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>i,contentTitle:()=>s,default:()=>u,frontMatter:()=>l,metadata:()=>c,toc:()=>a});const c=JSON.parse('{"id":"XXTLanControl.lua/core/connect","title":"\u8fde\u63a5\u4e2d\u63a7\u5e76\u521d\u59cb\u5316 (LCC.connect)","description":"\u58f0\u660e","source":"@site/docs/XXTLanControl.lua/core/connect.md","sourceDirName":"XXTLanControl.lua/core","slug":"/XXTLanControl.lua/core/connect","permalink":"/docs/XXTLanControl.lua/core/connect","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":40,"frontMatter":{"sidebar_position":40},"sidebar":"tutorialSidebar","previous":{"title":"\u8bbe\u7f6e\u65e5\u5fd7\u5217\u522b\u540d (LCC.set_log_aliases)","permalink":"/docs/XXTLanControl.lua/core/set_log_aliases"},"next":{"title":"\u83b7\u53d6\u811a\u672c UI \u914d\u7f6e (LCC.get_ui_config)","permalink":"/docs/XXTLanControl.lua/core/get_ui_config"}}');var r=o(4848),t=o(8453);const l={sidebar_position:40},s="\u8fde\u63a5\u4e2d\u63a7\u5e76\u521d\u59cb\u5316 (LCC.connect)",i={},a=[{value:"\u58f0\u660e",id:"\u58f0\u660e",level:2},{value:"\u53c2\u6570",id:"\u53c2\u6570",level:2},{value:"\u8fd4\u56de\u503c",id:"\u8fd4\u56de\u503c",level:2},{value:"\u8bf4\u660e",id:"\u8bf4\u660e",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",level:2}];function d(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"\u8fde\u63a5\u4e2d\u63a7\u5e76\u521d\u59cb\u5316-lccconnect",children:"\u8fde\u63a5\u4e2d\u63a7\u5e76\u521d\u59cb\u5316 (LCC.connect)"})}),"\n",(0,r.jsx)(n.h2,{id:"\u58f0\u660e",children:"\u58f0\u660e"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-lua",children:"ok = LCC.connect()\n"})}),"\n",(0,r.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"\u65e0"}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"\u8fd4\u56de\u503c",children:"\u8fd4\u56de\u503c"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["ok",(0,r.jsx)(n.br,{}),"\n","\u5e03\u5c14\u578b\uff0c\u8fde\u63a5\u548c\u7248\u672c\u6821\u9a8c\u6210\u529f\u8fd4\u56de ",(0,r.jsx)(n.code,{children:"true"}),"\uff0c\u5931\u8d25\u8fd4\u56de ",(0,r.jsx)(n.code,{children:"false"})]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"\u8bf4\u660e",children:"\u8bf4\u660e"}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["\u8bfb\u53d6\u914d\u7f6e\u5e76\u5b8c\u6210\u521d\u59cb\u5316\uff0c\u540c\u65f6\u5411\u4e2d\u63a7\u4e0a\u62a5\u8fd0\u884c\u72b6\u6001\u3002",(0,r.jsx)(n.br,{}),"\n","\u5982\u679c\u68c0\u6d4b\u5230\u6a21\u5757\u7248\u672c\u4e0d\u5339\u914d\uff0c\u4f1a\u5c1d\u8bd5\u4ece\u4e2d\u63a7\u81ea\u52a8\u4e0b\u8f7d\u65b0\u7248 ",(0,r.jsx)(n.code,{children:"XXTLanControl.lua"})," \u5e76\u70ed\u66f4\u65b0\u3002",(0,r.jsx)(n.br,{}),"\n","\u8fde\u63a5\u6210\u529f\u540e\u4f1a\u7f13\u5b58\u914d\u7f6e\u5e76\u6ce8\u518c\u9000\u51fa\u56de\u8c03\uff0c\u786e\u4fdd\u811a\u672c\u7ed3\u675f\u65f6\u4e0a\u62a5 ",(0,r.jsx)(n.code,{children:"is_running = false"}),"\u3002",(0,r.jsx)(n.br,{}),"\n","\u5982\u679c\u5c1a\u672a\u901a\u8fc7 ",(0,r.jsx)(n.code,{children:"LCC.set_api_url()"})," \u6307\u5b9a\u5730\u5740\uff0c\u4e14\u811a\u672c\u4e0d\u662f\u7531\u4e2d\u63a7\u542f\u52a8\u7684\uff0c\u51fd\u6570\u4f1a\u76f4\u63a5\u8fd4\u56de ",(0,r.jsx)(n.code,{children:"false"}),"\u3002"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-lua",children:'if not LCC.connect() then\n    error("\u65e0\u6cd5\u8fde\u63a5\u5230\u4e2d\u63a7")\nend\n'})})]})}function u(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,n,o)=>{o.d(n,{R:()=>l,x:()=>s});var c=o(6540);const r={},t=c.createContext(r);function l(e){const n=c.useContext(t);return c.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),c.createElement(t.Provider,{value:n},e.children)}}}]);