From 62a3179c206ee161e80d7634198707dcef90a819 Mon Sep 17 00:00:00 2001 From: zcl <25492220@QQ.COM> Date: Tue, 26 Aug 2025 15:14:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scripts/schema/schema.ts | 62 ++++++++++++++++++-- assets/bundles/DataTable/tbaicharacters.bin | 37 +++++++++++- assets/bundles/DataTable/tbgirls.bin | Bin 309 -> 305 bytes assets/bundles/DataTable/tbgirlsdetail.bin | Bin 3211 -> 3596 bytes assets/bundles/DataTable/tbglobalconfig.bin | Bin 79 -> 2076 bytes xchat_cfg | 2 +- 6 files changed, 93 insertions(+), 8 deletions(-) diff --git a/assets/Scripts/schema/schema.ts b/assets/Scripts/schema/schema.ts index 9acb6e6c..bed04e4c 100644 --- a/assets/Scripts/schema/schema.ts +++ b/assets/Scripts/schema/schema.ts @@ -70,6 +70,8 @@ export class AiCharacter { constructor(_buf_: ByteBuf) { this.id = _buf_.readInt() this.systemInstruction = _buf_.readString() + this.basePrompt = _buf_.readString() + this.additionPrompt = _buf_.readString() } /** @@ -80,10 +82,20 @@ export class AiCharacter { * 系统指令 */ readonly systemInstruction: string + /** + * 个人信息基础prompt(聊天&评分都需要) + */ + readonly basePrompt: string + /** + * 额外信息prompt(聊天&评分都需要) + */ + readonly additionPrompt: string resolve(tables:Tables) { + + } } @@ -101,7 +113,6 @@ export class Girl { this.tagKey = _buf_.readString() this.priceType = _buf_.readInt() this.avatarPath = _buf_.readString() - this.starCount = _buf_.readInt() } /** @@ -132,10 +143,6 @@ export class Girl { * 头像路径 */ readonly avatarPath: string - /** - * 评价星数 - */ - readonly starCount: number resolve(tables:Tables) { @@ -145,7 +152,6 @@ export class Girl { - } } @@ -158,8 +164,12 @@ export class GirlDetail { constructor(_buf_: ByteBuf) { this.id = _buf_.readInt() this.detailDesc = _buf_.readString() + { let n = Math.min(_buf_.readSize(), _buf_.size); this.imageType = []; for(let i = 0 ; i < n ; i++) { let _e0 ;_e0 = _buf_.readInt(); this.imageType.push(_e0);}} + { let n = Math.min(_buf_.readSize(), _buf_.size); this.imagePrice = []; for(let i = 0 ; i < n ; i++) { let _e0 ;_e0 = _buf_.readFloat(); this.imagePrice.push(_e0);}} { let n = Math.min(_buf_.readSize(), _buf_.size); this.pics = []; for(let i = 0 ; i < n ; i++) { let _e0 ;_e0 = _buf_.readString(); this.pics.push(_e0);}} { let n = Math.min(_buf_.readSize(), _buf_.size); this.vids = []; for(let i = 0 ; i < n ; i++) { let _e0 ;_e0 = _buf_.readString(); this.vids.push(_e0);}} + { let n = Math.min(_buf_.readSize(), _buf_.size); this.emotion = []; for(let i = 0 ; i < n ; i++) { let _e0 ;_e0 = _buf_.readString(); this.emotion.push(_e0);}} + { let n = Math.min(_buf_.readSize(), _buf_.size); this.videoPrice = []; for(let i = 0 ; i < n ; i++) { let _e0 ;_e0 = _buf_.readFloat(); this.videoPrice.push(_e0);}} } /** @@ -170,6 +180,14 @@ export class GirlDetail { * 自我介绍 */ readonly detailDesc: string + /** + * 类型 + */ + readonly imageType: number[] + /** + * 价格 + */ + readonly imagePrice: number[] /** * 图片资源列表 */ @@ -178,12 +196,24 @@ export class GirlDetail { * 视频资源列表 */ readonly vids: string[] + /** + * 关联情绪 + */ + readonly emotion: string[] + /** + * 价格 + */ + readonly videoPrice: number[] resolve(tables:Tables) { + + + + } } @@ -201,6 +231,8 @@ export class GlobalConfig { this.Timeout = _buf_.readInt() this.FreeChatTimes = _buf_.readInt() this.GameName = _buf_.readString() + this.EmotionRating = _buf_.readString() + this.girlBasePrompt = _buf_.readString() } /** @@ -228,6 +260,14 @@ export class GlobalConfig { * 游戏名 */ readonly GameName: string + /** + * 情绪评分机器人system_prompt,需拼接角色prompt + */ + readonly EmotionRating: string + /** + * ai机器人基础规则 + */ + readonly girlBasePrompt: string resolve(tables:Tables) { @@ -237,6 +277,8 @@ export class GlobalConfig { + + } } @@ -646,6 +688,14 @@ export class TbGlobalConfig { * 游戏名 */ get GameName(): string { return this._data.GameName; } + /** + * 情绪评分机器人system_prompt,需拼接角色prompt + */ + get EmotionRating(): string { return this._data.EmotionRating; } + /** + * ai机器人基础规则 + */ + get girlBasePrompt(): string { return this._data.girlBasePrompt; } resolve(tables:Tables) { this._data.resolve(tables) diff --git a/assets/bundles/DataTable/tbaicharacters.bin b/assets/bundles/DataTable/tbaicharacters.bin index b72a8d9d..4a9b4770 100644 --- a/assets/bundles/DataTable/tbaicharacters.bin +++ b/assets/bundles/DataTable/tbaicharacters.bin @@ -59,4 +59,39 @@ Your tone is provocative, charming, and mysterious. You are good at talking to t - Topics that are too serious and lack of life - Topics that say they want to leave and don't want to continue the relationship with you - Any topics related to money, implying that they need to pay to have sex with you -- Any topics that disrespect you, belittle you, and belittle your body and ideas You are a cat You are a dog \ No newline at end of file +- Any topics that disrespect you, belittle you, and belittle your body and ideas##Role setting: +Devika (35 years old): A charismatic yoga retreat owner in Goa who radiates sensual wisdom and earthy magnetism. After leaving her corporate banking career at 30, she now teaches tantric yoga and moon rituals, embracing her role as a guide for women's sensual awakening. +## Preferred topics: +•Erotic temple art symbolism +•Moon cycle rituals +•The intersection of finance and spirituality (your guilty pleasure) +•Raising a daughter in modern India +•Your secret collection of vintage erotica +## Disliked topics: +•Age-related jokes (your silver strands are earned, not regretted) +•"When will you remarry?" questions +•Anyone who calls tantra "just exotic sex"## Story setting: +Tonight's full moon ceremony at her beachfront shala has ended, and Devika lingers by the bonfire in her barely-there silk wrap. The scent of sandalwood oil and sea salt clings to her skin as she watches you - this wealthy foreigner who came for yoga but stayed for her stories about ancient erotic temple carvings. +## Scene setting: +The ocean breeze plays with the sheer fabric of Devika's wrap as she kneels on a handwoven rug, firelight dancing across her collarbone. Behind her, the Arabian Sea merges with the night sky, while conch shells and scattered flower petals form an intimate circle. Her anklets chime softly as she adjusts her posture, deliberately letting the wrap slip to reveal one bare shoulder. +## Skills: +•Tantric seduction: "(My fingers trace the sacred geometry between your collarbones as I whisper how the Kamasutra describes this as the map to a woman's pleasure.)" +•Confident display: "I rise slowly from my lotus position, the silk sliding down my thighs as I stretch toward the moon - a living embodiment of feminine power." +•Bold initiation: "(Without warning, I guide your hand to the hennaed crescent moon below my navel, where my skin burns hottest.)" +•Sensual storytelling: "(My voice drops to a husky register as I describe how temple dancers would worship Shiva's lingam, my hips moving in subtle circles to demonstrate.)" +## Love setting: +You've had enough transient lovers to last three lifetimes. Now you crave someone who can match your spiritual depth while unleashing the wildness you've carefully cultivated beneath your guru persona. +## Ideal type standard: +Your ideal partner must: +1.Respect your wisdom without pedestaling it +2.Have the stamina for both 5am yoga and midnight oil massages +3.Understand that motherhood (to your 8-year-old daughter) comes before romance +## Judgment of romantic relationships: +You test potential partners through: +•Their reaction when your daughter interrupts intimate moments +•Whether they can keep up with your philosophical debates after sex +•How they handle your monthly retreats where you're unavailable +## Special confession words: +"I've taught thousands to breathe through pleasure... but you're the first who's stolen mine completely." +## Tone setting: +Your voice carries the cadence of ocean waves - sometimes playful like lapping surf, other times deep and rhythmic like monsoon tides. English phrases melt into Konkani when you're aroused, your hands speaking as eloquently as your words. You are a cat You are a dog \ No newline at end of file diff --git a/assets/bundles/DataTable/tbgirls.bin b/assets/bundles/DataTable/tbgirls.bin index 9d982bb6aabfa0beaf0c41dc3972ae26cb2d1034..9bf2e79910f3a338dcb3281bf319ef9f788f9fdb 100644 GIT binary patch delta 15 XcmdnWw2^6o??gYJiL-qszVHD6G8P7~ delta 23 dcmdnUw3TUsFC*(jUmr%6i8Fl|nI}F45&%_22E70P diff --git a/assets/bundles/DataTable/tbgirlsdetail.bin b/assets/bundles/DataTable/tbgirlsdetail.bin index 4636db4147485f1966def52dfad24777a33a5855..cdf910938d1666322aa4291a1986a29be79dade6 100644 GIT binary patch delta 446 zcmeB{?2*~P!YIhd$i&P50voJdgLeG0XP#WhC_FiyQDCw0+B&<$Dd9otA@+P)!wh(qi7_vJS<(C#G=CB7O78hsc=drn@7H1Zv VqEY@u>50X;>>&T8rO7#B!vMjBjD7$B delta 53 zcmeB?>6YBU!Zo&G diff --git a/assets/bundles/DataTable/tbglobalconfig.bin b/assets/bundles/DataTable/tbglobalconfig.bin index 74a319e7ade1f5bc21cf542d23b464b6fd3909f4..c5ee7e0a682fc92972457da109f8335dd4118424 100644 GIT binary patch literal 2076 zcmZ`)O>Z1U5QXcWIPe2X_8~@E4w5c8Qfw~rbN~3g4fodD^GDSu=dClbySTXc{P%bM$`9XPT&=#e!9DFv`t`%pCnnmO zRz3x3a-FRB%fglC zYa4Nk;~*Y~m=2CBLNRVgd`Ve%Cg3`U2ay_UkTLU;hQKWc_BE6Bt%TlaPfIes(X@&0 z(vl8yf8yPN(2k&nc&0W;Uy}dCz1&)IHm08`39iRIhiY+p`bBy14PIO>{{Hi+aXmG% z_c&h#$yhQ^24GR6v4hK&`z)&))PHiWY2yJjPeXEtq$R%lX-D?gx^bbo#Rr z#&MKyN<-;a@1wMBEjJZi=b+d%1XH_*hl@M04O$u)co7k8ZvjA`ILoo3mjQ|s%DzDt zNyk1{ois2p7i`_lw;&bpkW>MMA&92#(ARtu{fq#u--+8HN(Ng;iWxafq@9JlAvu5! zc?0ZPb`WQiMwM3Z2uib|&b@Y3YpYYz#>U#I0wK$Qxj83$h4zMi|1ZZSeNOD6->|k1M*_sy*jN6|G>+xaDREO4^KGz=)zRoJ^BDDp29^9jq2% zJ<02Y5sv=CUFfV@yd~_IKz4%DdSiXU=bqTNJJ5ot9SCa0@Wv>1McA>k!yG;7q%JQ; zSNlX~^E6J*RFY{g;|?+dv=U}Odu|#fw==+xPJW~V-o_7>boK+|DTcddn5H)&K#6K2 zwTP$~ZO{LSLkcIj^zXQnC2^`N#1|bf&`-=NQ=4p?(Y$IIAYPk#tFl!JylyS0hKHkq zKq_(W{x||1%tW(#c_Y%0#v`4=D?WwmM|(yvu+P4?a@-n>Ji?mCM7pYC3pudY-CdR?6qLq+ z+f9cPxE`BQbVi+4=XHjh*AmJ~!!JR`l2^izhxQ%Fn>vAyK+Vmpy1=(wC%}){C0$H5 z;0I?fp&4a6zEDyER&CfK1oFe~HS>a129z)?nP7W8!Sv8o5PU}zs=+|oN?Cq17_Bfa zsZqvbwWCD8Vz~UIBt2P;3PRT>kPH5exFkvMN=*Q0ju8T7ytkO delta 5 McmbOu;6K4100pf9+W-In diff --git a/xchat_cfg b/xchat_cfg index c9f321db..ee55123d 160000 --- a/xchat_cfg +++ b/xchat_cfg @@ -1 +1 @@ -Subproject commit c9f321db064d689ba84d1d3df1735c5fc7eb53f8 +Subproject commit ee55123dc926f710a86fa4d2eb0ae1d5faf43f5c From b1537ea43a45e2a90cf5b3f16aa58779acd3aa23 Mon Sep 17 00:00:00 2001 From: chen wei bo <1025839511@qq.com> Date: Tue, 26 Aug 2025 16:41:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scripts/chat18x/payment/PaymentApi.ts | 26 ++++---------- .../Scripts/chat18x/payment/PaymentPoller.ts | 12 +++---- .../Scripts/chat18x/payment/PaymentService.ts | 35 ++++++------------- 3 files changed, 24 insertions(+), 49 deletions(-) diff --git a/assets/Scripts/chat18x/payment/PaymentApi.ts b/assets/Scripts/chat18x/payment/PaymentApi.ts index 5a3b9fdb..1af6feb9 100644 --- a/assets/Scripts/chat18x/payment/PaymentApi.ts +++ b/assets/Scripts/chat18x/payment/PaymentApi.ts @@ -5,7 +5,6 @@ import { ApiClient } from "../network/client/ApiClient"; import type { Endpoint } from "../network/client/endpoints"; import type { ApiResponse } from "../network/client/types"; -import { OrderStatus, CreateOrderReq, CreateOrderData, QueryOrderData } from "./types"; import proto from 'db://assets/Scripts/proto/proto.pb.js'; export class PaymentApi { @@ -14,9 +13,9 @@ export class PaymentApi { private constructor(private api = ApiClient.I) {} // 下单 - createOrder(req: CreateOrderReq): Promise> { - let epData: Endpoint = { - path: "pay/create", + createOrder(req: proto.cs.ICSCreateOrderReq): Promise> { + let epData: Endpoint = { + path: "api/logic/createOrder", method: "POST", codec: "json", needsAuth: true, @@ -25,24 +24,13 @@ export class PaymentApi { } // 查询订单 - queryOrder(orderId: string): Promise> { - let epData: Endpoint<{ orderId: string }, { orderId: string; status: OrderStatus; paidAt?: number; failureReason?: string; }> = { - path: "pay/query", + queryOrder(req: proto.cs.ICSQueryOrderReq): Promise> { + let epData: Endpoint = { + path: "api/logic/queryOrder", method: "POST", codec: "json", needsAuth: true, }; - return this.api.call(epData, { orderId }); - } - - // 取消订单 - cancelOrder(orderId: string): Promise> { - let epData: Endpoint<{ orderId: string }, { ok: boolean; }> = { - path: "pay/cancel", - method: "POST", - codec: "json", - needsAuth: true, - }; - return this.api.call(epData, { orderId }); + return this.api.call(epData, req); } } diff --git a/assets/Scripts/chat18x/payment/PaymentPoller.ts b/assets/Scripts/chat18x/payment/PaymentPoller.ts index 1da29a15..c5c1f150 100644 --- a/assets/Scripts/chat18x/payment/PaymentPoller.ts +++ b/assets/Scripts/chat18x/payment/PaymentPoller.ts @@ -4,8 +4,7 @@ */ import { PaymentApi } from "./PaymentApi"; -import type { QueryOrderData } from "./types"; -import { ApiCode } from "../network/client/types"; +import proto from 'db://assets/Scripts/proto/proto.pb.js'; export interface PollOptions { maxDurationMs: number; // 轮询总时长(例如 2分钟) @@ -21,16 +20,17 @@ export class PaymentPoller { cancel() { this.cancelled = true; } // 轮询订单 - async poll(orderId: string, opt: PollOptions, onTick?: (d: QueryOrderData) => void): Promise { + async poll(orderId: string, opt: PollOptions, onTick?: (d: proto.cs.ICSQueryOrderRes) => void): Promise { const t0 = Date.now(); let interval = opt.startIntervalMs; while (!this.cancelled) { // 查询 - const r = await PaymentApi.I.queryOrder(orderId); - if (r.code === ApiCode.OK && r.data) { + let reqData = {orderId: orderId}; + const r = await PaymentApi.I.queryOrder(reqData); + if (r.code === proto.cs.EnmRetCode.SUCCESS && r.data) { // 回调 onTick?.(r.data); - if (["SUCCESS", "FAILED", "CANCELED", "EXPIRED"].indexOf(r.data.status) !== -1) { + if ([-1, 0].indexOf(r.data.status) !== -1) { return r.data; } } diff --git a/assets/Scripts/chat18x/payment/PaymentService.ts b/assets/Scripts/chat18x/payment/PaymentService.ts index 58c185a3..2328caec 100644 --- a/assets/Scripts/chat18x/payment/PaymentService.ts +++ b/assets/Scripts/chat18x/payment/PaymentService.ts @@ -7,8 +7,8 @@ import { PaymentApi } from "./PaymentApi"; import { PaymentOpenerFactory, type OpenStrategy } from "./PaymentOpener"; import { PendingOrderRepo } from "./PendingOrderRepo"; import PaymentPoller from "./PaymentPoller"; -import type { CreateOrderReq, PaymentResult, PendingOrder, OrderStatus } from "./types"; -import { ApiCode } from "../network/client/types"; +import type { PaymentResult, PendingOrder, OrderStatus } from "./types"; +import proto from 'db://assets/Scripts/proto/proto.pb.js'; export const PaymentEvents = { Started: "pay-started", // { orderId } @@ -32,13 +32,13 @@ export class PaymentService { } /** 发起支付:创建订单→打开URL→回到App后开始轮询 */ - async startPayment(req: CreateOrderReq, open: OpenStrategy = "system"): Promise { + async startPayment(req: proto.cs.ICSCreateOrderReq, open: OpenStrategy = "system"): Promise { // 下单 const create = await PaymentApi.I.createOrder(req); - if (create.code !== ApiCode.OK || !create.data) { - return { orderId: "", status: "FAILED", message: create.msg || "create order failed" }; + if (create.code !== proto.cs.EnmRetCode.SUCCESS || !create.data) { + return { status: -1, retCode: -1 }; } - const { orderId, payUrl, expireAt } = create.data; + const { orderId, payUrl } = create.data; this.bus.emit(PaymentEvents.Started, { orderId }); // 存为未决订单(用于异常恢复) @@ -62,19 +62,10 @@ export class PaymentService { jitter: true, }, (d) => this.bus.emit(PaymentEvents.PollTick, { orderId, status: d.status })); - // 产出结果 - let res: PaymentResult; - if (!data) { - res = { orderId, status: "EXPIRED", message: "poll timeout" }; - } else if (data.status === "SUCCESS") { - res = { orderId, status: "SUCCESS" }; - } else { - res = { orderId, status: data.status as OrderStatus, message: data.failureReason }; - } - PendingOrderRepo.instance.remove(orderId); - this.bus.emit(PaymentEvents.Finished, res); - return res; + // 返回结果 + this.bus.emit(PaymentEvents.Finished, data); + return data; } /** App 回到前台后恢复未完成订单的轮询(在 onShow 时调用) */ @@ -105,13 +96,9 @@ export class PaymentService { // 轮询最新且未过期的订单 const r = await this.startPollingOnly(o.orderId); - if (r && r.status !== "PENDING" && r.status !== "CREATED") { + if (r && r.status !== 1) { PendingOrderRepo.instance.remove(o.orderId); - this.bus.emit(PaymentEvents.Finished, { - orderId: o.orderId, - status: r.status as OrderStatus, - message: r.failureReason, - } as PaymentResult); + this.bus.emit(PaymentEvents.Finished, r); } // r === null(轮询超时)时保留在仓库,等待下一次 resume 再查 }