提交聊天

This commit is contained in:
PC-20230316NUNE\Administrator 2023-11-14 18:52:25 +08:00
parent 5a43eb197b
commit 93ae85e88b
33 changed files with 2047 additions and 4757 deletions

View File

@ -1,186 +0,0 @@
const path = require("path");
const child_process = require("child_process");
const fs = require("fs");
/**
* @typedef {Object} proto_list
* @property {string | undefined} namespace_s 命名空间
* @property {string[]} proto_ss 协议文件(生成为脚本的协议文件)
* @property {string} ts_output_path_s ts 输出路径(带脚本名)
* @property {string} dts_output_path_s d.ts 输出路径(带脚本名)
* @property {string[] | undefined} pbjs_parameters_ss pbjs 生成时参数(可用于裁剪代码, 命令行`npx pbjs`查看具体参数)
*/
module.exports = {
/**
* 协议列表
* @type {proto_list[]}
*/
proto_list: [],
/**
自动构建开关
- true: 递归监听 dir_path_ss 内的文件添加/删除/修改并触发构建指令
- false需要手动点击 `protobuf/构建` 才会触发构建菜单
*/
automatic_build_b: false,
/** 自动构建延迟(秒),防止短时间内频繁触发构建 */
automatic_build_delay_s_n: 2,
/**
* 构建函数
* @param {proto_list} config_ proto 配置
* @returns {boolean} 成功状态
*/
async build_f(config_) {
// 生成消息头
child_process.execSync("npx ts-node ./protobuf/main.ts", {
"cwd": "./tool"
})
/** ts 输出路径 */
let ts_output_path_s = config_.ts_output_path_s[0] !== "." ? config_.ts_output_path_s : path.join(__dirname, config_.ts_output_path_s);
/** js 输出路径 */
let js_output_path_s = path.join(path.dirname(ts_output_path_s), path.basename(ts_output_path_s, path.extname(ts_output_path_s)) + ".js");
/** 声明文件路径 */
let dts_path_s = config_.dts_output_path_s[0] !== "." ? config_.dts_output_path_s : path.join(__dirname, config_.dts_output_path_s);
// 确保文件夹存在
{
if (!fs.existsSync(path.dirname(ts_output_path_s))) {
fs.mkdirSync(path.dirname(ts_output_path_s));
}
if (!fs.existsSync(path.dirname(dts_path_s))) {
fs.mkdirSync(path.dirname(dts_path_s));
}
}
let result = await Promise.resolve()
// 生成 js 文件
.then(() => {
return new Promise((resolve_f, reject_t) => {
// 使用 es6 的生成类型
child_process.exec(
`npx pbjs -t static-module -w es6 -l eslint-disable --es6 --keep-case ${!config_.pbjs_parameters_ss ? "" : config_.pbjs_parameters_ss.join(" ")
} ${!config_.namespace_s ? "" : `--root ${config_.namespace_s}`} -o ${js_output_path_s} ${config_.proto_ss.join(" ")}`,
{
cwd: __dirname,
},
(error, stdout, stderr) => {
if (stderr) {
reject_t(stderr);
return;
}
resolve_f();
}
);
});
})
// 生成 d.ts 文件
.then(() => {
// 生成 d.ts
return new Promise((resolve_f, reject_t) => {
child_process.exec(
`npx pbts -m ${config_.namespace_s ? `--root ${config_.namespace_s}` : ""} -o ${dts_path_s} ${js_output_path_s}`,
{
cwd: __dirname,
},
(error, stdout, stderr) => {
if (stderr) {
reject_t(stderr);
return;
}
resolve_f();
}
);
});
})
// js 后处理
.then(() => {
let file_s = fs.readFileSync(js_output_path_s, "utf-8");
file_s = file_s
// 替换 import
.replace('import * as $protobuf from "protobufjs/minimal";', 'import $protobuf from "protobufjs/minimal.js";')
// 替换 root
.replace(/const \$root = ([^]+?);/, "const $root = {};");
// 存在命名空间
if (config_.namespace_s) {
file_s = file_s.replace(/export const /g, "const ");
}
// 更新协议文件
fs.writeFileSync(js_output_path_s, file_s);
})
// d.ts 文件后处理
.then(() => {
let file_s = fs.readFileSync(dts_path_s, "utf-8");
if (config_.namespace_s) {
file_s = `export namespace ${config_.namespace_s} {\n${file_s}\n}`;
}
// 添加类型声明
file_s = `import type { Long } from "protobufjs";\n` + file_s;
// 后处理
file_s = file_s.replace(/\$protobuf/g, "protobuf");
// 更新协议文件
fs.writeFileSync(dts_path_s, file_s);
})
// 将 js 协议脚本转换为 ts
.then(() => {
let js_file_s = fs.readFileSync(js_output_path_s, "utf-8");
/** ts 文件路径 */
let ts_script_path_s = path.join(
path.dirname(ts_output_path_s),
path.basename(ts_output_path_s, path.extname(ts_output_path_s)) + ".ts"
);
/** d.ts 相对路径 */
let dts_relative_path_s = path.relative(path.dirname(ts_output_path_s), path.dirname(dts_path_s)).replace(/\\/g, "/");
/** d.ts 导入路径 */
let dts_import_path_s = (dts_relative_path_s || "./") + path.basename(dts_path_s, ".ts");
// 后处理
js_file_s = js_file_s
// 对象类型const $root: typeof import("./test.d").pb
.replace(
"const $root = ",
`const $root: typeof import("${dts_import_path_s}")${config_.namespace_s ? `.${config_.namespace_s}` : ""} = `
)
// 修复对象类型错误
.replace(
/export const ([^ ]+?) = ([^ ]+?) =/g,
function (...args_as) {
return `export const ${args_as[1]}: typeof ${args_as[2]} = ${args_as[2]} =`;
}
);
if (config_.namespace_s) {
js_file_s = js_file_s
// module.exports
.replace(
"export { $root as default }",
`export ${config_.namespace_s ? `const ${config_.namespace_s} = ` : ""}{ ...$root }`);
}
fs.writeFileSync(js_output_path_s, "// @ts-nocheck\n" + js_file_s);
fs.renameSync(js_output_path_s, ts_script_path_s);
})
// 捕获错误
.catch((error) => {
console.error("生成错误:", error);
return false;
})
// 任务完成
.then((v) => {
return v ?? true;
});
return result;
},
};

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "5592da29-bb83-47c5-9d95-27f5c71ae7b6",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,146 @@
[
{
"__type__": "cc.Prefab",
"_name": "MainChatItem",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "MainChatItem",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 6
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 1512.0000000000005,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 335.53125,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3251Mcv39NZJJvhmqkWsTm"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_string": "ScrollView content01",
"_horizontalAlign": 0,
"_verticalAlign": 1,
"_actualFontSize": 36,
"_fontSize": 36,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7ahEvd3z5N4ruHsPPLIdmV"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b4aPDEneNHC4OYnY3k7ypP",
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "da561b68-57fb-462b-b799-da2ba6658534",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "MainChatItem"
}
}

View File

@ -20,15 +20,15 @@ import { SpriteFrame } from "cc";
import Loading from "../../extensions/ngame/assets/ngame/util/Loading";
import { Tables } from "../resources/config/data/schema";
import { JsonAsset } from "cc";
import { GAction } from "./consts/GActionEnum";
import { GAction } from "./consts/GAction";
import { StorageData, StorageEnum } from "./consts/GData";
import { JAPI, JAPIConfig } from "../../extensions/ngame/assets/ngame/util/JAPI";
import { AppData } from "./AppData";
// let APIPath = `http://localhost:8080`
// let WsPath = `ws://localhost:8080/websocket`
let APIPath = `https://api.pet.jisol.cn`
let WsPath = `wss://api.pet.jisol.cn/websocket`
let APIPath = `http://localhost:8080`
let WsPath = `ws://localhost:8080/websocket`
// let APIPath = `https://api.pet.jisol.cn`
// let WsPath = `wss://api.pet.jisol.cn/websocket`
//重写UI
class JNGLayer extends JNLayer{

View File

@ -1,6 +1,7 @@
import SystemBase from "../../extensions/ngame/assets/ngame/system/SystemBase";
import { app } from "./App";
import BaseData from "./data/BaseData";
import ChatData from "./data/ChatData";
import PlayerData from "./data/PlayerData";
import PlayerPetData from "./data/PlayerPetData";
@ -12,6 +13,7 @@ export class AppData extends SystemBase{
loadings:BaseData[] = [
PlayerData.getIns(), //玩家信息
PlayerPetData.getIns(), //玩家宠物信息
ChatData.getIns(), //聊天
];
async onInit(): Promise<any> {

View File

@ -0,0 +1,9 @@
export enum GAction {
TOKEN_EXPIRED = 1001, //Token过期
//聊天
CHAT_MESSAGE = 2001, //发送聊天消息
CHAT_RECEIVE_MESSAGE = 2002, //接受聊天消息
}

View File

@ -2,7 +2,7 @@
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "ed7dee3c-9396-4f08-bd29-deb690ca6cf8",
"uuid": "a70276f1-e218-427c-ba96-791133341363",
"files": [],
"subMetas": {},
"userData": {}

View File

@ -1,6 +0,0 @@
export enum GAction {
TOKEN_EXPIRED = 1001, //Token过期
NOT_CREATE_PLAYER_INFO = 2001, //没有玩家信息 - 前往引导页面
}

View File

@ -0,0 +1,9 @@
export interface GUIChatMessage{
message:string;
}
export enum GActionType {
GUIChatMessage = "GUIChatMessage",//聊天信息
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "d3e60765-b4ca-4c63-9dd8-20befd658457",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,3 @@
export enum GAction {
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "772c2168-9685-4567-92b0-93cb00b8d679",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,46 @@
import Singleton from "../../../extensions/ngame/assets/ngame/util/Singleton";
import { app } from "../App";
import { GAction } from "../consts/GAction";
import { GActionType, GUIChatMessage } from "../consts/GActionType";
import BaseData from "./BaseData";
//聊天数据
export default class ChatData extends BaseData{
//世界消息列表
datas:string[] = [];
//接受消息事件
receives:Function[] = [];
onInit() {
//监听聊天消息
app.socket.on(GAction.CHAT_RECEIVE_MESSAGE,this.onChatReceiveMessage,this,GActionType.GUIChatMessage);
}
//接受聊天消息
onChatReceiveMessage(info:GUIChatMessage){
console.log(`ChatData - onChatReceiveMessage`,info.message);
this.datas.push(info.message);
this.receives.forEach(fun => fun(info))
}
//发送消息
onSend(message:GUIChatMessage){
app.socket.Send(GAction.CHAT_MESSAGE,message,GActionType.GUIChatMessage);
}
//监听接受消息
on(receive:Function){
this.receives.push(receive);
}
//取消
off(receive:Function){
let index = this.receives.indexOf(receive);
if(index != -1)
this.receives.splice(index,1);
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "37e2c6bd-5072-431f-a9c4-ec7fda53b41f",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "2c2f02a8-a17c-4c79-81c6-df08eff53759",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -1,8 +1,8 @@
import Singleton from "../../../../extensions/ngame/assets/ngame/util/Singleton";
import { app } from "../../App";
import PlayerData from "../../data/PlayerData";
import PlayerPetData from "../../data/PlayerPetData";
import { GUI } from "../UIConfig";
import Singleton from "../../../extensions/ngame/assets/ngame/util/Singleton";
import { app } from "../App";
import PlayerData from "../data/PlayerData";
import PlayerPetData from "../data/PlayerPetData";
import { GUI } from "../ui/UIConfig";
export default class NoviceManager extends Singleton{

View File

@ -2,7 +2,7 @@
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "8b5cc1e0-3fa2-4ee3-b93b-2da9878f9c8c",
"uuid": "ef14d8c5-9f53-4f42-baeb-1c663be5f283",
"files": [],
"subMetas": {},
"userData": {}

View File

@ -1,9 +1,83 @@
import { _decorator, Component, Node } from 'cc';
import { JNGLayerBase } from '../../../App';
import { app, JNGLayerBase } from '../../../App';
import { Prefab } from 'cc';
import ChatData from '../../../data/ChatData';
import { instantiate } from 'cc';
import { Label } from 'cc';
import { EditBox } from 'cc';
import { GUI } from '../../UIConfig';
import { GUIChatMessage } from '../../../consts/GActionType';
import { Widget } from 'cc';
import JScrollExceedHide from '../../../../../extensions/ngame/assets/ngame/util/components/JScrollExceedHide';
const { ccclass, property } = _decorator;
@ccclass('MainChatView')
export class MainChatView extends JNGLayerBase {
@property(Node)
content:Node; //聊天内容
@property(Prefab)
chatPrefab:Prefab; //聊天预制体
@property(EditBox)
inputMessage:EditBox; //聊天输入框
onJNLoad(data?: any): void {
super.onJNLoad(data);
this.onInitUpdate();
//监听消息
ChatData.getIns().on(this.onMessage.bind(this));
}
onJNClose(): void {
super.onJNClose();
ChatData.getIns().off(this.onMessage.bind(this));
}
//初始化聊天显示
onInitUpdate(){
this.content.destroyAllChildren();
let messages = ChatData.getIns().datas;
messages.forEach(message => {
let node = instantiate(this.chatPrefab);
node.getComponent(Label).string = message;
this.content.addChild(node);
})
}
//发送消息
onClickSendMessage(){
if(!this.inputMessage.string){
app.layer.Open(GUI.Tips,{text:"请输入内容"})
return;
}
ChatData.getIns().onSend({
message:this.inputMessage.string
});
}
//接受到消息
onMessage(info:GUIChatMessage){
//插入数据
let node = instantiate(this.chatPrefab);
node.getComponent(Label).string = info.message;
this.content.addChild(node);
this.scheduleOnce(() => {
this.getComponentInChildren(JScrollExceedHide).onUpdate();
})
}
}

View File

@ -1,6 +1,8 @@
import { _decorator, Component, Label, Node } from 'cc';
import { app, JNGLayerBase } from '../../App';
import { GUI } from '../UIConfig';
import ChatData from '../../data/ChatData';
import PlayerData from '../../data/PlayerData';
const { ccclass, property } = _decorator;
@ccclass('MainView')
@ -8,6 +10,12 @@ export class MainView extends JNGLayerBase {
onJNLoad(data?: any): void {
//发送消息
ChatData.getIns().onSend({
message:`${PlayerData.getIns().data.playerId} 加入游戏`
});
}
//打开聊天页面

View File

@ -3,9 +3,7 @@ import { _decorator } from "cc";
import { JNGLayerBase, app } from "../../App";
import { Label } from "cc";
import { GUI } from "../UIConfig";
import { API } from "../../consts/API";
import { GAction } from "../../consts/GActionEnum";
import NoviceManager from "../Novice/NoviceManager";
import NoviceManager from "../../manager/NoviceManager";
const { ccclass, property } = _decorator;
@ccclass('LoadingView')

@ -1 +1 @@
Subproject commit bcaff67650a01e8ebea3a5c8a86f8879f3ce39f4
Subproject commit c5432ebb220d354a6790fa96348c70620cb16dcc

View File

@ -6,9 +6,31 @@
"": {
"name": "JisolGameCocos",
"dependencies": {
"protobufjs": "^7.2.5"
"protobufjs": "^7.2.5",
"protobufjs-cli": "^1.1.2"
}
},
"node_modules/@babel/parser": {
"version": "7.23.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.3.tgz",
"integrity": "sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw==",
"bin": {
"parser": "bin/babel-parser.js"
},
"devDependencies": {}
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jsdoc/salty": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.6.tgz",
"integrity": "sha512-aA+awb5yoml8TQ3CzI5Ue7sM3VMRC4l1zJJW4fgZ8OCL1wshJZhNzaf0PL85DSnOUw6QuFgeHGD/eq/xwwAF2g==",
"dependencies": {
"lodash": "^4.17.21"
},
"engines": {
"node": ">=v12.0.0"
}
},
"node_modules/@protobufjs/aspromise": {
"version": "1.1.2",
@ -64,6 +86,25 @@
"resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
},
"node_modules/@types/linkify-it": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.5.tgz",
"integrity": "sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw=="
},
"node_modules/@types/markdown-it": {
"version": "12.2.3",
"resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz",
"integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==",
"dependencies": {
"@types/linkify-it": "*",
"@types/mdurl": "*"
}
},
"node_modules/@types/mdurl": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.5.tgz",
"integrity": "sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA=="
},
"node_modules/@types/node": {
"version": "20.9.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
@ -72,11 +113,464 @@
"undici-types": "~5.26.4"
}
},
"node_modules/acorn": {
"version": "8.11.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
"integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
"bin": {
"acorn": "bin/acorn"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/acorn-jsx": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"peerDependencies": {
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"node_modules/bluebird": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
},
"node_modules/brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/catharsis": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz",
"integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==",
"dependencies": {
"lodash": "^4.17.15"
},
"engines": {
"node": ">= 10"
}
},
"node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dependencies": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"node_modules/deep-is": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
},
"node_modules/entities": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz",
"integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==",
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/escape-string-regexp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
"engines": {
"node": ">=8"
}
},
"node_modules/escodegen": {
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
"integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
"dependencies": {
"esprima": "^4.0.1",
"estraverse": "^4.2.0",
"esutils": "^2.0.2",
"optionator": "^0.8.1"
},
"bin": {
"escodegen": "bin/escodegen.js",
"esgenerate": "bin/esgenerate.js"
},
"engines": {
"node": ">=4.0"
},
"optionalDependencies": {
"source-map": "~0.6.1"
}
},
"node_modules/escodegen/node_modules/estraverse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
"engines": {
"node": ">=4.0"
}
},
"node_modules/eslint-visitor-keys": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
"integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
}
},
"node_modules/espree": {
"version": "9.6.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
"integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
"dependencies": {
"acorn": "^8.9.0",
"acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^3.4.1"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
}
},
"node_modules/esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"bin": {
"esparse": "bin/esparse.js",
"esvalidate": "bin/esvalidate.js"
},
"engines": {
"node": ">=4"
}
},
"node_modules/estraverse": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
"engines": {
"node": ">=4.0"
}
},
"node_modules/esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
},
"node_modules/glob": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
"integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^5.0.1",
"once": "^1.3.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
},
"node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"engines": {
"node": ">=8"
}
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/js2xmlparser": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz",
"integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==",
"dependencies": {
"xmlcreate": "^2.0.4"
}
},
"node_modules/jsdoc": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.2.tgz",
"integrity": "sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg==",
"dependencies": {
"@babel/parser": "^7.20.15",
"@jsdoc/salty": "^0.2.1",
"@types/markdown-it": "^12.2.3",
"bluebird": "^3.7.2",
"catharsis": "^0.9.0",
"escape-string-regexp": "^2.0.0",
"js2xmlparser": "^4.0.2",
"klaw": "^3.0.0",
"markdown-it": "^12.3.2",
"markdown-it-anchor": "^8.4.1",
"marked": "^4.0.10",
"mkdirp": "^1.0.4",
"requizzle": "^0.2.3",
"strip-json-comments": "^3.1.0",
"underscore": "~1.13.2"
},
"bin": {
"jsdoc": "jsdoc.js"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/klaw": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz",
"integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==",
"dependencies": {
"graceful-fs": "^4.1.9"
}
},
"node_modules/levn": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
"integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==",
"dependencies": {
"prelude-ls": "~1.1.2",
"type-check": "~0.3.2"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/linkify-it": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz",
"integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==",
"dependencies": {
"uc.micro": "^1.0.1"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/long": {
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
"integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
},
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/markdown-it": {
"version": "12.3.2",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz",
"integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==",
"dependencies": {
"argparse": "^2.0.1",
"entities": "~2.1.0",
"linkify-it": "^3.0.1",
"mdurl": "^1.0.1",
"uc.micro": "^1.0.5"
},
"bin": {
"markdown-it": "bin/markdown-it.js"
}
},
"node_modules/markdown-it-anchor": {
"version": "8.6.7",
"resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz",
"integrity": "sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==",
"peerDependencies": {
"@types/markdown-it": "*",
"markdown-it": "*"
}
},
"node_modules/marked": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz",
"integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
"bin": {
"marked": "bin/marked.js"
},
"engines": {
"node": ">= 12"
}
},
"node_modules/mdurl": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
"integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g=="
},
"node_modules/minimatch": {
"version": "5.1.6",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
"dependencies": {
"brace-expansion": "^2.0.1"
},
"engines": {
"node": ">=10"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/mkdirp": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"bin": {
"mkdirp": "bin/cmd.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/optionator": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
"integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
"dependencies": {
"deep-is": "~0.1.3",
"fast-levenshtein": "~2.0.6",
"levn": "~0.3.0",
"prelude-ls": "~1.1.2",
"type-check": "~0.3.2",
"word-wrap": "~1.2.3"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/prelude-ls": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
"integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==",
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/protobufjs": {
"version": "7.2.5",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.5.tgz",
@ -100,10 +594,209 @@
"node": ">=12.0.0"
}
},
"node_modules/protobufjs-cli": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.1.2.tgz",
"integrity": "sha512-8ivXWxT39gZN4mm4ArQyJrRgnIwZqffBWoLDsE21TmMcKI3XwJMV4lEF2WU02C4JAtgYYc2SfJIltelD8to35g==",
"dependencies": {
"chalk": "^4.0.0",
"escodegen": "^1.13.0",
"espree": "^9.0.0",
"estraverse": "^5.1.0",
"glob": "^8.0.0",
"jsdoc": "^4.0.0",
"minimist": "^1.2.0",
"semver": "^7.1.2",
"tmp": "^0.2.1",
"uglify-js": "^3.7.7"
},
"bin": {
"pbjs": "bin/pbjs",
"pbts": "bin/pbts"
},
"engines": {
"node": ">=12.0.0"
},
"peerDependencies": {
"protobufjs": "^7.0.0"
}
},
"node_modules/requizzle": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz",
"integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==",
"dependencies": {
"lodash": "^4.17.21"
}
},
"node_modules/rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
"dependencies": {
"glob": "^7.1.3"
},
"bin": {
"rimraf": "bin.js"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf/node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/rimraf/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf/node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"optional": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/tmp": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz",
"integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==",
"dependencies": {
"rimraf": "^3.0.0"
},
"engines": {
"node": ">=8.17.0"
}
},
"node_modules/type-check": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
"integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==",
"dependencies": {
"prelude-ls": "~1.1.2"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/uc.micro": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
},
"node_modules/uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
"bin": {
"uglifyjs": "bin/uglifyjs"
},
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/underscore": {
"version": "1.13.6",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz",
"integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A=="
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
},
"node_modules/word-wrap": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
"integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
"node_modules/xmlcreate": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz",
"integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg=="
},
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
}

View File

@ -9,6 +9,7 @@
"build-proto:pbts": "pbts --main --out ./extensions/ngame/assets/ngame/message/proto.d.ts ./extensions/ngame/assets/ngame/message/proto.js"
},
"dependencies": {
"protobufjs": "^7.2.5"
"protobufjs": "^7.2.5",
"protobufjs-cli": "^1.1.2"
}
}

View File

@ -1,2 +1,5 @@
pause
npm run build-proto:pbjs
npm run build-proto:pbts
pause
npm run build-proto:pbts
pause

View File

@ -4,5 +4,5 @@ option java_package = "cn.jisol.ngame.proto";
//
message GUIChatMessage {
repeated string message = 1; //
string message = 1; //
}

View File

@ -4,4 +4,8 @@ public interface GActionEnum {
int TOKEN_EXPIRED = 1001; //Token过期
/*************** 聊天 *********************/
int CHAT_MESSAGE = 2001; //发送聊天消息
int CHAT_RECEIVE_MESSAGE = 2002; //接受聊天消息
}

View File

@ -0,0 +1,21 @@
package cn.jisol.game.actions;
import cn.jisol.game.network.client.GClient;
import cn.jisol.game.proto.GUIMessage;
import cn.jisol.ngame.actions.core.NAction;
import cn.jisol.ngame.actions.core.NActionMethod;
import java.util.Map;
@NAction
public class GChatAction {
//发送消息
@NActionMethod(GActionEnum.CHAT_MESSAGE)
public static void onChatMessage(GUIMessage.GUIChatMessage message, Map<String, GClient> clients){
clients.values().forEach(client -> {
client.invoke(GActionEnum.CHAT_RECEIVE_MESSAGE,message);
});
}
}

View File

@ -1,11 +1,10 @@
package cn.jisol.game.network;
import cn.jisol.game.actions.GActionEnum;
import cn.jisol.game.data.Cache;
import cn.jisol.game.controller.game.GPlayerController;
import cn.jisol.game.network.client.GClient;
import cn.jisol.ngame.actions.core.NActionEnum;
import cn.jisol.ngame.client.NClient;
import cn.jisol.ngame.network.JNetwork;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.websocket.OnClose;
@ -24,20 +23,30 @@ import java.util.concurrent.ConcurrentHashMap;
@Controller
public class WebSocket {
public static final Map<String, NClient> CLIENTS = new ConcurrentHashMap<>();
static GPlayerController playerController;
@Autowired
private void setPlayerController(GPlayerController playerController){
WebSocket.playerController = playerController;
}
public static final Map<String, GClient> CLIENTS = new ConcurrentHashMap<>();
@OnOpen
public void onOpen(Session session){
String token = session.getPathParameters().get("token");
NClient client = new GClient(session);
if(Objects.isNull(Cache.TOKEN.get(token))){
GClient client = new GClient(token,session);
if(Objects.isNull(client.user)){
//发送Token过期请求
client.invoke(GActionEnum.TOKEN_EXPIRED);
//关闭连接
client.Close();
return;
}
client.player = playerController.getPlayerInfo(client.user).data;
CLIENTS.put(session.getId(),client);
System.out.printf("[WebSocket] %s 连接成功.\n",session.getId());
@ -45,7 +54,8 @@ public class WebSocket {
@OnMessage
public void onMessage(Session session, InputStream inputStream){
JNetwork.onMessage(inputStream,CLIENTS.get(session.getId()),CLIENTS);
GClient client = CLIENTS.get(session.getId());
JNetwork.onMessage(inputStream,client,CLIENTS,client.user,client.player);
}
@OnClose

View File

@ -1,5 +1,8 @@
package cn.jisol.game.network.client;
import cn.jisol.game.data.Cache;
import cn.jisol.game.entity.User;
import cn.jisol.game.entity.game.Player;
import cn.jisol.ngame.client.QueueNClient;
import javax.websocket.EncodeException;
@ -10,9 +13,14 @@ public class GClient extends QueueNClient {
public Session session;
public GClient(Session session){
public User user;
public Player player;
public GClient(String token,Session session){
super(session.getId());
this.session = session;
this.user = Cache.TOKEN.get(token);
}
@Override
@ -32,4 +40,5 @@ public class GClient extends QueueNClient {
} catch (IOException ignored) {}
}
}
}

View File

@ -23,41 +23,20 @@ public final class GUIMessage {
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @return A list containing the message.
* <code>string message = 1;</code>
* @return The message.
*/
java.util.List<java.lang.String>
getMessageList();
java.lang.String getMessage();
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @return The count of message.
*/
int getMessageCount();
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param index The index of the element to return.
* @return The message at the given index.
*/
java.lang.String getMessage(int index);
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param index The index of the value to return.
* @return The bytes of the message at the given index.
* <code>string message = 1;</code>
* @return The bytes for message.
*/
com.google.protobuf.ByteString
getMessageBytes(int index);
getMessageBytes();
}
/**
* <pre>
@ -76,7 +55,7 @@ public final class GUIMessage {
super(builder);
}
private GUIChatMessage() {
message_ = com.google.protobuf.LazyStringArrayList.EMPTY;
message_ = "";
}
@java.lang.Override
@ -99,7 +78,6 @@ public final class GUIMessage {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
@ -112,11 +90,8 @@ public final class GUIMessage {
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
message_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
message_.add(s);
message_ = s;
break;
}
default: {
@ -136,9 +111,6 @@ public final class GUIMessage {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
message_ = message_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
@ -157,54 +129,49 @@ public final class GUIMessage {
}
public static final int MESSAGE_FIELD_NUMBER = 1;
private com.google.protobuf.LazyStringList message_;
private volatile java.lang.Object message_;
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @return A list containing the message.
* <code>string message = 1;</code>
* @return The message.
*/
public com.google.protobuf.ProtocolStringList
getMessageList() {
return message_;
@java.lang.Override
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
message_ = s;
return s;
}
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @return The count of message.
*/
public int getMessageCount() {
return message_.size();
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param index The index of the element to return.
* @return The message at the given index.
*/
public java.lang.String getMessage(int index) {
return message_.get(index);
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param index The index of the value to return.
* @return The bytes of the message at the given index.
* <code>string message = 1;</code>
* @return The bytes for message.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getMessageBytes(int index) {
return message_.getByteString(index);
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@ -221,8 +188,8 @@ public final class GUIMessage {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < message_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_.getRaw(i));
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_);
}
unknownFields.writeTo(output);
}
@ -233,13 +200,8 @@ public final class GUIMessage {
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < message_.size(); i++) {
dataSize += computeStringSizeNoTag(message_.getRaw(i));
}
size += dataSize;
size += 1 * getMessageList().size();
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
@ -256,8 +218,8 @@ public final class GUIMessage {
}
GUIMessage.GUIChatMessage other = (GUIMessage.GUIChatMessage) obj;
if (!getMessageList()
.equals(other.getMessageList())) return false;
if (!getMessage()
.equals(other.getMessage())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@ -269,10 +231,8 @@ public final class GUIMessage {
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getMessageCount() > 0) {
hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
hash = (53 * hash) + getMessageList().hashCode();
}
hash = (37 * hash) + MESSAGE_FIELD_NUMBER;
hash = (53 * hash) + getMessage().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@ -410,8 +370,8 @@ public final class GUIMessage {
@java.lang.Override
public Builder clear() {
super.clear();
message_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
message_ = "";
return this;
}
@ -438,11 +398,6 @@ public final class GUIMessage {
@java.lang.Override
public GUIMessage.GUIChatMessage buildPartial() {
GUIMessage.GUIChatMessage result = new GUIMessage.GUIChatMessage(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) != 0)) {
message_ = message_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.message_ = message_;
onBuilt();
return result;
@ -492,14 +447,8 @@ public final class GUIMessage {
public Builder mergeFrom(GUIMessage.GUIChatMessage other) {
if (other == GUIMessage.GUIChatMessage.getDefaultInstance()) return this;
if (!other.message_.isEmpty()) {
if (message_.isEmpty()) {
message_ = other.message_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureMessageIsMutable();
message_.addAll(other.message_);
}
if (!other.getMessage().isEmpty()) {
message_ = other.message_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
@ -530,99 +479,65 @@ public final class GUIMessage {
}
return this;
}
private int bitField0_;
private com.google.protobuf.LazyStringList message_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureMessageIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
message_ = new com.google.protobuf.LazyStringArrayList(message_);
bitField0_ |= 0x00000001;
}
}
private java.lang.Object message_ = "";
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @return A list containing the message.
* <code>string message = 1;</code>
* @return The message.
*/
public com.google.protobuf.ProtocolStringList
getMessageList() {
return message_.getUnmodifiableView();
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
message_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @return The count of message.
*/
public int getMessageCount() {
return message_.size();
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param index The index of the element to return.
* @return The message at the given index.
*/
public java.lang.String getMessage(int index) {
return message_.get(index);
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param index The index of the value to return.
* @return The bytes of the message at the given index.
* <code>string message = 1;</code>
* @return The bytes for message.
*/
public com.google.protobuf.ByteString
getMessageBytes(int index) {
return message_.getByteString(index);
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param index The index to set the value at.
* <code>string message = 1;</code>
* @param value The message to set.
* @return This builder for chaining.
*/
public Builder setMessage(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureMessageIsMutable();
message_.set(index, value);
onChanged();
return this;
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param value The message to add.
* @return This builder for chaining.
*/
public Builder addMessage(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureMessageIsMutable();
message_.add(value);
message_ = value;
onChanged();
return this;
}
@ -631,29 +546,12 @@ public final class GUIMessage {
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param values The message to add.
* @return This builder for chaining.
*/
public Builder addAllMessage(
java.lang.Iterable<java.lang.String> values) {
ensureMessageIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, message_);
onChanged();
return this;
}
/**
* <pre>
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* <code>string message = 1;</code>
* @return This builder for chaining.
*/
public Builder clearMessage() {
message_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
message_ = getDefaultInstance().getMessage();
onChanged();
return this;
}
@ -662,18 +560,18 @@ public final class GUIMessage {
*聊天内容
* </pre>
*
* <code>repeated string message = 1;</code>
* @param value The bytes of the message to add.
* <code>string message = 1;</code>
* @param value The bytes for message to set.
* @return This builder for chaining.
*/
public Builder addMessageBytes(
public Builder setMessageBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureMessageIsMutable();
message_.add(value);
message_ = value;
onChanged();
return this;
}
@ -745,7 +643,7 @@ public final class GUIMessage {
static {
java.lang.String[] descriptorData = {
"\n\020GUIMessage.proto\"!\n\016GUIChatMessage\022\017\n\007" +
"message\030\001 \003(\tB\026\n\024cn.jisol.ngame.protob\006p" +
"message\030\001 \001(\tB\026\n\024cn.jisol.ngame.protob\006p" +
"roto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor

View File

@ -4,5 +4,5 @@ option java_package = "cn.jisol.ngame.proto";
//
message GUIChatMessage {
repeated string message = 1; //
string message = 1; //
}