
Security News
/Company News
Socket Is Sponsoring Composer and Packagist
Socket has joined the new Composer and Packagist sponsorship program as a launch sponsor, supporting the team that keeps PHP's package ecosystem secure.
雀魂客户端组件
完成了雀魂底层protobuf数据的解析,只需要调用接口传入json数据,就能收到返回的json数据
能处理所有请求、响应和事件(对局暂未实现)
可以登陆国服日服美服,自动重新连接
接口和数据类型定义在liqi.json中,也可以查看API
Install with npm:
$ npm i mjsoul
Example:
const MJSoul = require("mjsoul")
const mjsoul = new MJSoul()
// set option
// const mjsoul = new MJSoul({
// "wsOption": {
// "proxy": ..., //参考websockets/ws中的proxy用法
// ...
// },
// "url": "wss://mj-srv-6.majsoul.com:4501",
// })
// wss://mj-srv-6.majsoul.com:4501 国服海外
// wss://mjjpgs.mahjongsoul.com:4501 日服
// wss://mjusgs.mahjongsoul.com:4501 美服
let onOpen = ()=>{
// call api
mjsoul.send("fetchConnectionInfo", (data)=>{
console.log(data)
})
// login
mjsoul.send("login", {account: "account", password: mjsoul.hash("password")}, (data)=>{
console.log(data)
// call api
mjsoul.send("fetchFriendList", (data)=>{
console.log(data)
})
})
}
// bind event
mjsoul.on("NotifyAnotherLogin", (data)=>{
console.log("logout", data)
})
mjsoul.on("NotifyAccountLogout", onOpen)
mjsoul.open(onOpen)
////////////////////////////////////////////////////
//大会室后台:
const dhs = new MJSoul.DHS()
dhs.open(()=>{
// 后台数据定义文件dhs.json
dhs.send("loginContestManager", (data)=>{
console.log(data)
}, {account: "account", password: dhs.hash("password")})
})
///////////////////////////////////////////////////
//解析牌谱
MJSoul.record.parseById("your game uuid", (data)=>{
console.log(data)
})
v2.0修改(不兼容旧版本)
v2.0.2
const MJSoul = require("mjsoul")
const mjsoul = new MJSoul()
let onOpen = async()=>{
let data = await mjsoul.sendAsync(
"login",
{account: "account", password: mjsoul.hash("password")}
)
console.log(data)
}
mjsoul.open(onOpen)
FAQs
majsoul client tool
The npm package mjsoul receives a total of 92 weekly downloads. As such, mjsoul popularity was classified as not popular.
We found that mjsoul demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Company News
Socket has joined the new Composer and Packagist sponsorship program as a launch sponsor, supporting the team that keeps PHP's package ecosystem secure.

Research
/Security News
Benign-looking npm packages split malicious functionality across a dependency chain that deploys a cross-platform RAT targeting Alibaba developers.

Research
/Security News
Two Joyfill npm beta releases contain an import-time implant that uses blockchain transactions to retrieve a remote-access trojan.