| 37 | } |
| 38 | |
| 39 | public void Start2(String wsUrl) throws Exception { |
| 40 | var config = Config.load("client.xml"); |
| 41 | createZeze(config); |
| 42 | createService(); |
| 43 | createModules(); |
| 44 | Zeze.start(); // 启动数据库 |
| 45 | startModules(); // 启动模块,装载配置什么的。 |
| 46 | startService(); // 启动网络 |
| 47 | |
| 48 | loginQueueClient.setLoginToken((loginToken) -> { |
| 49 | var url = "ws://" + loginToken.getLinkIp() |
| 50 | + ":" + (loginToken.getLinkPort() + 10000) + "/websocket"; |
| 51 | Connector = new Connector(true, url); |
| 52 | System.out.println("wsUrl =========== " + url); |
| 53 | ClientService.getConfig().addConnector(Connector); |
| 54 | Connector.start(); |
| 55 | Connector.WaitReady(); |
| 56 | onLinkConnectedFuture.setResult(loginToken); |
| 57 | }); |
| 58 | loginQueueClient.connect("127.0.0.1", 5020); |
| 59 | } |
| 60 | |
| 61 | public void Stop() throws Exception { |
| 62 | stopService(); // 关闭网络 |