Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
CodePwn2021 committed Oct 1, 2022
1 parent 6bf3d4e commit 6cbd37b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export type logLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' |
/** 数据包func名称 */
export type packetFuncName =
'echo'
| 'regMCPKt'
| 'regMCPkt'
| 'reg_mc_packet'
| 'query_packet_name'
| 'send_ws_cmd'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "light-omega",
"author": "codepwn",
"description": "Omega ws client in FastBuilder.",
"version": "0.2.2",
"version": "0.2.3",
"publish_time": "2022-10-01",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
Expand Down
9 changes: 8 additions & 1 deletion test/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ async function init() {
// 在这里随便干点什么
const res = await omg.sendPacket('get_players_list', {});
console.log(JSON.stringify(res));
const player = await omg.getPlayerByUUID(omg.bot_name);
const player = await omg.getPlayerByName(omg.bot_name);
console.log(player);
const echo = await omg.sendPacket('echo', {
message: 'hello, light-omega!'
});
console.log(echo);
await omg.sendPacket("regMCPkt", {"pktID": "IDText"});
await omg.execCmd("say wtf");
}

omg.on("omega.mcPkt", (data) => {
if (data.sub !== "IDText") return;
console.log(data)
})
}

init();

0 comments on commit 6cbd37b

Please sign in to comment.