# FYCGameFramework_Pinus **Repository Path**: dony1122/FYCGameFramework_Pinus ## Basic Information - **Project Name**: FYCGameFramework_Pinus - **Description**: FYCGameFramework作为客户端框架,Pinus作为服务端框架的CocosCreator的Demo - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 5 - **Created**: 2022-03-27 - **Last Updated**: 2022-05-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 添加服务器 需要修改的配置文件有: - game-server/config/adminServer.json ```typescript [{ "type": "connector", "token": "" }, { "type": "chat", "token": "" }, { "type": "gate", "token": "" }] ``` - game-server/config/servers.json ```typescript { "development": { "connector": [{ "id": "connector-server-1", "host": "127.0.0.1", "port": 4050, "clientHost": "127.0.0.1", "clientPort": 3050, "frontend": true } ], "chat": [{ "id": "chat-server-1", "host": "127.0.0.1", "port": 6050 } ], "gate": [{ "id": "gate-server-1", "host": "127.0.0.1", "port": 4014, "clientHost": "127.0.0.1", "clientPort": 3014, "frontend": true }] }, "production": { "connector": [{ "id": "connector-server-1", "host": "127.0.0.1", "port": 4050, "clientHost": "127.0.0.1", "clientPort": 3050, "frontend": true } ], "chat": [{ "id": "chat-server-1", "host": "127.0.0.1", "port": 6050 } ], "gate": [{ "id": "gate-server-1", "host": "127.0.0.1", "port": 4014, "clientHost": "127.0.0.1", "clientPort": 3014, "frontend": true }] } } ``` - game-server/app.ts ```typescript // app configuration app.configure('production|development', 'connector', function () { app.set('connectorConfig', { connector: pinus.connectors.hybridconnector, heartbeat: 3, useDict: true, useProtobuf: true }); }); // app configuration app.configure('production|development', 'gate', function () { app.set('connectorConfig', { connector: pinus.connectors.hybridconnector, useProtobuf: true }); }); // app configuration app.configure('production|development', function () { // route configures app.route('chat', RouteUtil.chat); // filter configures app.filter(new pinus.filters.timeout); }); ```