cocos creator 3.3.0 examples

This commit is contained in:
King Wang 2021-09-02 00:27:24 +08:00
parent 4bfe797a89
commit c21445548e
58 changed files with 11943 additions and 0 deletions

View File

@ -0,0 +1,3 @@
node_modules
dist
.DS_STORE

View File

@ -0,0 +1,30 @@
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "mocha current file",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"${file}"
],
"internalConsoleOptions": "openOnSessionStart",
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "ts-node current file",
"protocol": "inspector",
"args": [
"${relativeFile}"
],
"cwd": "${workspaceRoot}",
"runtimeArgs": [
"-r",
"ts-node/register"
],
"internalConsoleOptions": "openOnSessionStart"
}
]
}

View File

@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
}

View File

@ -0,0 +1,35 @@
# TSRPC Server
## Run
### Local Dev Server
```
npm run dev
```
### Build
```
npm run build
```
---
## Files
### Generate ServiceProto
```
npm run proto
```
### Generate API templates
```
npm run api
```
### Sync shared code to client
```
npm run sync
```
> If you chose symlink when using `create-tsrpc-app`, it would re-create the symlink instead of copy files.

View File

@ -0,0 +1,23 @@
{
"name": "chatroom-backend",
"version": "0.1.0",
"main": "index.js",
"private": true,
"scripts": {
"proto": "tsrpc proto -i src/shared/protocols -o src/shared/protocols/serviceProto.ts",
"sync": "tsrpc sync --from src/shared --to ../frontend/assets/scripts/shared",
"api": "tsrpc api -i src/shared/protocols/serviceProto.ts -o src/api",
"dev": "onchange \"src/**/*.ts\" -i -k -- ts-node \"src/index.ts\"",
"build": "tsrpc build"
},
"devDependencies": {
"@types/node": "^15.12.3",
"onchange": "^7.1.0",
"ts-node": "^9.1.1",
"tsrpc-cli": "^2.0.3",
"typescript": "^4.3.4"
},
"dependencies": {
"tsrpc": "^3.0.2"
}
}

View File

@ -0,0 +1,23 @@
import { ApiCall } from "tsrpc";
import { server } from "..";
import { ReqSend, ResSend } from "../shared/protocols/PtlSend";
export async function ApiSend(call: ApiCall<ReqSend, ResSend>) {
// Error
if (call.req.content.length === 0) {
call.error('Content is empty')
return;
}
// Success
let time = new Date();
call.succ({
time: time
});
// Broadcast
server.broadcastMsg('Chat', {
content: call.req.content,
time: time
})
}

View File

@ -0,0 +1,24 @@
import * as path from "path";
import { WsServer } from "tsrpc";
import { serviceProto } from './shared/protocols/serviceProto';
// Create the Server
export const server = new WsServer(serviceProto, {
port: 3000
});
// Entry function
async function main() {
await server.autoImplementApi(path.resolve(__dirname, 'api'));
// TODO
// Prepare something... (e.g. connect the db)
await server.start();
};
main().catch(e => {
// Exit if any error during the startup
server.logger.error(e);
process.exit(-1);
});

View File

@ -0,0 +1,4 @@
export interface MsgChat {
content: string,
time: Date
}

View File

@ -0,0 +1,7 @@
export interface ReqSend {
content: string
}
export interface ResSend {
time: Date
}

View File

@ -0,0 +1,75 @@
import { ServiceProto } from 'tsrpc-proto';
import { MsgChat } from './MsgChat';
import { ReqSend, ResSend } from './PtlSend';
export interface ServiceType {
api: {
"Send": {
req: ReqSend,
res: ResSend
}
},
msg: {
"Chat": MsgChat
}
}
export const serviceProto: ServiceProto<ServiceType> = {
"services": [
{
"id": 0,
"name": "Chat",
"type": "msg"
},
{
"id": 1,
"name": "Send",
"type": "api"
}
],
"types": {
"MsgChat/MsgChat": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "content",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "time",
"type": {
"type": "Date"
}
}
]
},
"PtlSend/ReqSend": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "content",
"type": {
"type": "String"
}
}
]
},
"PtlSend/ResSend": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "time",
"type": {
"type": "Date"
}
}
]
}
}
};

View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"lib": [
"es2018"
],
"module": "commonjs",
"target": "es2018",
"outDir": "dist",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node"
},
"include": [
"src"
]
}

View File

@ -0,0 +1,5 @@
node_modules
library
temp
build
local

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "c6d58550-5301-4b62-b696-31d8f827844d",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "7f656590-e733-47c8-9a29-8fc1efd57cc2",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.30",
"importer": "prefab",
"imported": true,
"uuid": "da99e95a-3939-4ba1-8ce5-c60a6cd41fad",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "ChatBox"
}
}

View File

@ -0,0 +1,105 @@
import { Component, EditBox, instantiate, Label, Prefab, ScrollView, _decorator } from 'cc';
import { MINIGAME } from 'cc/env';
import { BaseWsClient } from 'tsrpc-base-client';
import { WsClient as WsClientBrowser } from 'tsrpc-browser';
import { WsClient as WsClientMiniapp } from 'tsrpc-miniapp';
import { MsgChat } from '../../scripts/shared/protocols/MsgChat';
import { serviceProto, ServiceType } from '../../scripts/shared/protocols/serviceProto';
import { ChatBoxMsgItem } from './prefabs/ChatBox_MsgItem/ChatBox_MsgItem';
const { ccclass, property } = _decorator;
@ccclass('ChatBox')
export class ChatBox extends Component {
@property
roomName = '';
// Prefabs
@property(Prefab)
prefabMsgItem!: Prefab;
// Nodes
@property(Label)
labelTitle!: Label;
@property(ScrollView)
msgScroll!: ScrollView;
@property(EditBox)
inputSend!: EditBox;
client!: BaseWsClient<ServiceType>;
onLoad() {
// Create client by platform
if (MINIGAME) {
this.client = new WsClientMiniapp(serviceProto, {
server: 'ws://127.0.0.1:3000',
logger: console
})
}
else {
this.client = new WsClientBrowser(serviceProto, {
server: 'ws://127.0.0.1:3000',
logger: console
})
}
// Connect at startup
this.connect();
// Listen Msg
this.client.listenMsg('Chat', v => { this.onChatMsg(v) })
// When disconnected
this.client.flows.postDisconnectFlow.push(v => {
// Retry after 2 seconds
this.labelTitle.string = `🔴 Disconnected`;
setTimeout(() => {
this.connect();
}, 2000)
return v;
})
}
async connect(): Promise<void> {
this.labelTitle.string = `🟡 Connecting...`;
let res = await this.client.connect();
if (!res.isSucc) {
this.labelTitle.string = `🔴 Disconnected`;
// Retry after 2 seconds
await new Promise(rs => { setTimeout(rs, 2000) });
await this.connect();
}
this.labelTitle.string = '🟢 ' + this.roomName;
}
async send() {
if (!this.inputSend.string) {
return;
}
let ret = await this.client.callApi('Send', {
content: this.inputSend.string
});
// Error
if (!ret.isSucc) {
alert(ret.err.message);
return;
}
// Success
this.inputSend.string = '';
}
onChatMsg(msg: MsgChat) {
let node = instantiate(this.prefabMsgItem);
this.msgScroll.content!.addChild(node);
node.getComponent(ChatBoxMsgItem)!.options = {
msg: msg
}
this.msgScroll.scrollToBottom(0.2);
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.22",
"importer": "typescript",
"imported": true,
"uuid": "e256ef5e-ec1a-413f-a72b-a3149113fbd6",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "f67e9512-1750-46bc-914f-062245e06148",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "b51ae285-508e-4c3d-955c-02e12f6c2289",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,548 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false
},
{
"__type__": "cc.Node",
"_name": "ChatBox_MsgItem",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 10
}
],
"_active": true,
"_components": [
{
"__id__": 18
},
{
"__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
}
],
"_prefab": {
"__id__": 26
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -95.79999999999998,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "message",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
}
],
"_prefab": {
"__id__": 9
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 20,
"y": 15.11999999999999,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 616,
"height": 81.35999999999999
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 111,
"g": 111,
"b": 111,
"a": 255
},
"_string": "啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊",
"_horizontalAlign": 0,
"_verticalAlign": 0,
"_actualFontSize": 24,
"_fontSize": 24,
"_fontFamily": "Arial",
"_lineHeight": 36,
"_overflow": 3,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"_alignFlags": 40,
"_target": null,
"_left": 20,
"_right": 20,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 640,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0d0EfiWOlKKJ7mcNKs1LZa"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "8dI1EQZzVFsJ+aRAFdts43"
},
{
"__type__": "cc.Node",
"_name": "time",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 15
}
],
"_prefab": {
"__id__": 17
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 565.29,
"y": -40.68,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_contentSize": {
"__type__": "cc.Size",
"width": 141.42,
"height": 30.24
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 14
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 75,
"g": 128,
"b": 187,
"a": 255
},
"_string": "下午10:57:53",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 24,
"_fontSize": 24,
"_fontFamily": "Arial",
"_lineHeight": 24,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 10
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"_alignFlags": 32,
"_target": null,
"_left": 0,
"_right": 20,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d5mZ4hY09Hg5vvBWIQESW/"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "f1/rIjCeNEyK90oXy196pl"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"_contentSize": {
"__type__": "cc.Size",
"width": 656,
"height": 151.59999999999997
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fdYt2dfxlHq55xokljDdID"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 21
},
"_resizeMode": 1,
"_layoutType": 2,
"_cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_startAxis": 0,
"_paddingLeft": 0,
"_paddingRight": 0,
"_paddingTop": 20,
"_paddingBottom": 20,
"_spacingX": 0,
"_spacingY": 0,
"_verticalDirection": 1,
"_horizontalDirection": 0,
"_constraint": 0,
"_constraintNum": 2,
"_affectedByScale": false,
"_isAlign": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2aP3wVb2pMEo5d4J+YmiTl"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 23
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "0638b78e-5b91-4912-b2b8-06eed04deede@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "1bGiG94TxIm65HBL1dQZbC"
},
{
"__type__": "a9052CyCzdOc4dnnkAaz7cY",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 25
},
"labelMessage": {
"__id__": 5
},
"labelTime": {
"__id__": 13
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e4fisXaplL/qQ54HD/3H/H"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "87UoyxPYRKrJRuRW07pDnM"
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.30",
"importer": "prefab",
"imported": true,
"uuid": "5393b4df-3fd4-4342-a3c1-b2dc4763d062",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "ChatBox_MsgItem"
}
}

View File

@ -0,0 +1,30 @@
import { Component, Label, _decorator } from 'cc';
import { MsgChat } from '../../../../scripts/shared/protocols/MsgChat';
const { ccclass, property } = _decorator;
export interface ChatBoxMsgItemOptions {
msg: MsgChat
}
@ccclass('ChatBoxMsgItem')
export class ChatBoxMsgItem extends Component {
@property(Label)
labelMessage!: Label;
@property(Label)
labelTime!: Label;
private _options!: ChatBoxMsgItemOptions;
public get options(): ChatBoxMsgItemOptions {
return this._options;
}
public set options(v: ChatBoxMsgItemOptions) {
this._options = v;
this.labelMessage.string = v.msg.content;
this.labelTime.string = v.msg.time.toLocaleTimeString();
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.22",
"importer": "typescript",
"imported": true,
"uuid": "a90520b2-0b37-4e73-8767-9e401acfb718",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "8f992327-d7bd-4550-9784-00505b99ce9a",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "cf5523f9-257d-4ab2-8926-bea90fb7572e",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
{
"ver": "1.1.30",
"importer": "scene",
"imported": true,
"uuid": "86c03e47-dc7e-4335-92f0-cf39fcd2462e",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,44 @@
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
/**
* Predefined variables
* Name = ChatScene
* DateTime = Wed Sep 01 2021 23:21:08 GMT+0800 ()
* Author = twsmj
* FileBasename = ChatScene.ts
* FileBasenameNoExtension = ChatScene
* URL = db://assets/scenes/ChatScene/ChatScene.ts
* ManualUrl = https://docs.cocos.com/creator/3.3/manual/en/
*
*/
@ccclass('ChatScene')
export class ChatScene extends Component {
// [1]
// dummy = '';
// [2]
// @property
// serializableDummy = 0;
start () {
// [3]
}
// update (deltaTime: number) {
// // [4]
// }
}
/**
* [1] Class member could be defined like this.
* [2] Use `property` decorator if your want the member to be serializable.
* [3] Your initialization goes here.
* [4] Your update function goes here.
*
* Learn more about scripting: https://docs.cocos.com/creator/3.3/manual/en/scripting/
* Learn more about CCClass: https://docs.cocos.com/creator/3.3/manual/en/scripting/ccclass.html
* Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.3/manual/en/scripting/life-cycle-callbacks.html
*/

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.22",
"importer": "typescript",
"imported": true,
"uuid": "73fb73c7-9edb-4a71-b81c-212c00827031",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "9983b088-7be4-480f-8be4-8bea24b2909d",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "fbfb5de1-69ef-43be-976d-d66036b4b407",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "ba5a8782-c57d-437b-9371-4441de673229",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,4 @@
export interface MsgChat {
content: string,
time: Date
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.22",
"importer": "typescript",
"imported": true,
"uuid": "bd48404c-a47a-4bbc-b177-19352bd570bf",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,7 @@
export interface ReqSend {
content: string
}
export interface ResSend {
time: Date
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.22",
"importer": "typescript",
"imported": true,
"uuid": "2a458e30-4c4a-4f1a-9aff-05ea0bdf0ab6",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,75 @@
import { ServiceProto } from 'tsrpc-proto';
import { MsgChat } from './MsgChat';
import { ReqSend, ResSend } from './PtlSend';
export interface ServiceType {
api: {
"Send": {
req: ReqSend,
res: ResSend
}
},
msg: {
"Chat": MsgChat
}
}
export const serviceProto: ServiceProto<ServiceType> = {
"services": [
{
"id": 0,
"name": "Chat",
"type": "msg"
},
{
"id": 1,
"name": "Send",
"type": "api"
}
],
"types": {
"MsgChat/MsgChat": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "content",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "time",
"type": {
"type": "Date"
}
}
]
},
"PtlSend/ReqSend": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "content",
"type": {
"type": "String"
}
}
]
},
"PtlSend/ResSend": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "time",
"type": {
"type": "Date"
}
}
]
}
}
};

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.22",
"importer": "typescript",
"imported": true,
"uuid": "56f77762-3150-4a83-ab4a-15025fd73ade",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "b938b4e9-6c3a-434d-9d4b-2b9a0fa0b4bf",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

View File

@ -0,0 +1,74 @@
{
"ver": "1.0.21",
"importer": "image",
"imported": true,
"uuid": "0638b78e-5b91-4912-b2b8-06eed04deede",
"files": [
".png",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "0638b78e-5b91-4912-b2b8-06eed04deede@6c48a",
"displayName": "box",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "0638b78e-5b91-4912-b2b8-06eed04deede"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "0638b78e-5b91-4912-b2b8-06eed04deede@f9941",
"displayName": "box",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2,
"height": 2,
"rawWidth": 2,
"rawHeight": 2,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"isUuid": true,
"imageUuidOrDatabaseUri": "0638b78e-5b91-4912-b2b8-06eed04deede@6c48a",
"atlasUuid": ""
},
"ver": "1.0.9",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": false,
"type": "sprite-frame",
"redirect": "0638b78e-5b91-4912-b2b8-06eed04deede@f9941"
}
}

View File

@ -0,0 +1,10 @@
{
"name": "tsrpc-cocos-3-3-0",
"type": "3d",
"uuid": "cd1e2fff-2ab5-4407-b917-e60b25207723",
"version": "3.3.0",
"dependencies": {
"tsrpc-browser": "^3.0.6",
"tsrpc-miniapp": "^3.0.6"
}
}

View File

@ -0,0 +1,60 @@
{
"__version__": "1.2.8",
"log": {
"level": 4
},
"common": {
"outputName": "web-mobile",
"mainBundleCompressionType": "merge_dep",
"platform": "web-mobile"
},
"BuildTaskManager": {
"taskMap": {
"1630512909207": {
"id": "1630512909207",
"progress": 1,
"state": "success",
"message": "2021-9-2 00:23 Build success in 30639 ms!",
"options": {
"name": "tsrpc-cocos-3-3-0",
"platform": "wechatgame",
"buildPath": "project://build",
"debug": false,
"md5Cache": false,
"sourceMaps": false,
"replaceSplashScreen": false,
"mainBundleCompressionType": "merge_dep",
"mainBundleIsRemote": false,
"mergeStartScene": false,
"experimentalEraseModules": false,
"compressTexture": true,
"packAutoAtlas": true,
"startScene": "86c03e47-dc7e-4335-92f0-cf39fcd2462e",
"scenes": [
{
"url": "db://assets/scenes/ChatScene/ChatScene.scene",
"uuid": "86c03e47-dc7e-4335-92f0-cf39fcd2462e",
"inBundle": false
}
],
"outputName": "wechatgame",
"packages": {
"cocos-service": {
"configID": "ad0366",
"services": []
},
"wechatgame": {
"startSceneAssetBundle": false,
"orientation": "portrait",
"appid": "wx6ac3f5090a6b99c5",
"separateEngine": false,
"wasm": "js"
}
}
},
"time": "2021-9-2 00:23",
"dirty": false
}
}
}
}

View File

@ -0,0 +1,20 @@
{
"options": {
"web-desktop": {
"configID": "ad0366",
"services": []
},
"wechatgame": {
"configID": "ad0366",
"services": []
},
"web-mobile": {
"configID": "ad0366",
"services": []
}
},
"builder-options": {
"configID": "ad0366",
"services": []
}
}

View File

@ -0,0 +1,3 @@
{
"__version__": "1.0.1"
}

View File

@ -0,0 +1,3 @@
{
"__version__": "1.0.5"
}

View File

@ -0,0 +1,6 @@
{
"__version__": "1.0.1",
"general": {
"start_scene": "86c03e47-dc7e-4335-92f0-cf39fcd2462e"
}
}

View File

@ -0,0 +1,3 @@
{
"__version__": "1.0.0"
}

View File

@ -0,0 +1,71 @@
{
"gizmos-infos": {
"is2D": true,
"is3DIcon": false,
"iconSize": 2,
"gridVisible": true,
"gridColor": [
150,
150,
150,
255
],
"isIconGizmo3D": false,
"iconGizmoSize": 2,
"isGridVisible": true
},
"float-window": {
"position": {
"cc": {
"Camera": {
"dock": false,
"top": null,
"bottom": 10,
"left": null,
"right": 10
}
}
}
},
"camera-infos": {
"f46876e4-e81b-4931-b493-6d367be385e7": {
"position": {
"x": 375.0000000000001,
"y": 600,
"z": 5000
},
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"viewCenter": {
"x": 0,
"y": 0,
"z": 0
}
},
"86c03e47-dc7e-4335-92f0-cf39fcd2462e": {
"position": {
"x": 807.1672726448774,
"y": 621.6458364416596,
"z": 5000
},
"rotation": {
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"viewCenter": {
"x": 0,
"y": 0,
"z": 0
}
}
},
"camera-uuids": [
"86c03e47-dc7e-4335-92f0-cf39fcd2462e"
]
}

View File

@ -0,0 +1,9 @@
{
"options": {
"web-mobile": {
"polyfills": {
"coreJs": false
}
}
}
}

View File

@ -0,0 +1,3 @@
{
"__version__": "1.2.8"
}

View File

@ -0,0 +1,22 @@
{
"game": {
"name": "UNKNOW GAME",
"app_id": "UNKNOW",
"c_id": "0"
},
"appConfigMaps": [
{
"app_id": "UNKNOW",
"config_id": "ad0366"
}
],
"configs": [
{
"app_id": "UNKNOW",
"config_id": "ad0366",
"config_name": "Default",
"config_remarks": "",
"services": []
}
]
}

View File

@ -0,0 +1,3 @@
{
"__version__": "1.0.1"
}

View File

@ -0,0 +1,3 @@
{
"__version__": "1.0.5"
}

View File

@ -0,0 +1,3 @@
{
"__version__": "1.0.0"
}

View File

@ -0,0 +1,9 @@
{
"__version__": "1.0.1",
"general": {
"designResolution": {
"width": 750,
"height": 1200
}
}
}

View File

@ -0,0 +1,6 @@
{
/* Base configuration. Do not edit this field. */
"extends": "./temp/tsconfig.cocos.json"
/* Add your custom configuration here. */
}