Coder Social home page Coder Social logo

dianbingx / fycgameframework_pinus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from foryun1009/fycgameframework_pinus

0.0 1.0 0.0 461 KB

FYCGameFramework作为客户端框架,Pinus作为服务端框架的CocosCreator的Demo

Shell 0.10% JavaScript 38.07% TypeScript 60.63% CSS 0.42% HTML 0.68% Batchfile 0.09%

fycgameframework_pinus's Introduction

添加服务器

需要修改的配置文件有:

  • game-server/config/adminServer.json

    [{
        "type": "connector",
        "token": ""
    }, {
        "type": "chat",
        "token": ""
    }, {
        "type": "gate",
        "token": ""
    }]
  • game-server/config/servers.json

    {
      "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

    // 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);
    });

fycgameframework_pinus's People

Contributors

foryun1009 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.