All Projects → cloudfreexiao → skynet-cocos-creator

cloudfreexiao / skynet-cocos-creator

Licence: other
skynet cocoscreator puremvc

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to skynet-cocos-creator

cocos-creator-puremvc
cocos-creator-puremvc 是一个cocos creator项目基础架构。
Stars: ✭ 49 (+11.36%)
Mutual labels:  puremvc, cocoscreator
cocos2d-bgfx
cocos2d-x-lite use bgfx as the rendering backend
Stars: ✭ 54 (+22.73%)
Mutual labels:  cocoscreator
skynet pbc
skyne use pbc protobuf
Stars: ✭ 44 (+0%)
Mutual labels:  skynet
firing balls
Physical pinball game with cocos creator 小游戏【不停歇的球】源码
Stars: ✭ 120 (+172.73%)
Mutual labels:  cocoscreator
ZNet
基于libuv的skynet移植
Stars: ✭ 35 (-20.45%)
Mutual labels:  skynet
puremvc-delphi-standard-framework
A Delphi implementation of PureMVC (http://puremvc.org/)
Stars: ✭ 44 (+0%)
Mutual labels:  puremvc
freeioe
FreeIOE is a framework for building IOE (Internet Of Everything) edge-computing gateway 开源的边缘计算网关框架. 讨论群: 291292378
Stars: ✭ 77 (+75%)
Mutual labels:  skynet
CocosCreator-ScrollVIewPlus
Cocos Creator ScrollVIew 优化系列
Stars: ✭ 83 (+88.64%)
Mutual labels:  cocoscreator
CosmosFramework
CosmosFramework is a lightweight plug-in Unity development framework . Has a rich Unity method extensions and toolchain. async/await syntax support, multi-network channel support.Long term support for this project
Stars: ✭ 176 (+300%)
Mutual labels:  puremvc
AppFacadeMVC
AppFacade For PureMVC
Stars: ✭ 13 (-70.45%)
Mutual labels:  puremvc
UnitySkynetMultiPlayerGame
skynet server, unity client, state sync multiplaye game
Stars: ✭ 23 (-47.73%)
Mutual labels:  skynet
SparkServer
SparkServer是一个参照skynet设计的C#服务端框架,能够无缝整合到skynet集群机制中,也能自行组网,构建只有SparkServer节点的集群
Stars: ✭ 184 (+318.18%)
Mutual labels:  skynet
CocosCreatorWebGL
用cocos creator实现《WebGL编程指南》里面的案例
Stars: ✭ 27 (-38.64%)
Mutual labels:  cocoscreator
coctohug
Coctohug - Manage dozens of chia forks mining from a web browser! Nice localization with support of dozens of languages. Runs on Linux, Windows, MacOS, and more...
Stars: ✭ 36 (-18.18%)
Mutual labels:  skynet
cocos-creator-level-editor
Cocos Creator 关卡编辑器
Stars: ✭ 28 (-36.36%)
Mutual labels:  cocoscreator
skynet-lua-websocket
Add a lua websocket library for the skynet game server framework.
Stars: ✭ 23 (-47.73%)
Mutual labels:  skynet
CocosProjectTemplate
一个Cocos Creator使用的应用基础框架 微信小游戏版本https://github.com/ustchcl/CocosProjectTemplateWx
Stars: ✭ 20 (-54.55%)
Mutual labels:  cocoscreator
2048
使用 Cocos Creator 开发微信小游戏 2048(代码基于 Cocos Creator 1.10)
Stars: ✭ 26 (-40.91%)
Mutual labels:  cocoscreator
skynet
Use Sia Skynet and SkyDB in your Dart and Flutter projects (Decentralized CDN and database)
Stars: ✭ 25 (-43.18%)
Mutual labels:  skynet
Skynet3d
Skynet3d
Stars: ✭ 62 (+40.91%)
Mutual labels:  skynet

skynet-cocos-creator-client

本项目是基于cocos-creator-puremvc 为基础 搭建的一个cocos creator 可以与skynet通信的 基础架构项目。

技术栈

安装

使用npm install

script目录结构

  • controller
    • bootstrap 需要初始化的MVC
    • commands 游戏内Command,增加Command基本都应该在这里
    • StartupCommand.ts 启动Command
  • lib
    • puremvc
    • state-machine状态机
    • behavior3行为树
  • model
    • GameProxy.ts ws数据代理
    • HttpProxy.ts http数据代理
    • GameProxy.ts 游戏数据代理示例
  • view
    • component 视图组件
    • StartViewMediator.ts Start场景中介
  • AppFacade.ts puremvc入口
  • Start.ts 开始场景启动脚本,AppFacade在这里初始化

注意点

  1. Command与Proxy、Mediator
    Command管理应用程序的 Business Logic(业务逻辑),要协调Model 与视图状态。

    Model 通过使用 Proxy 来保证数据的完整性、一致性 。Proxy 集中程序的Domain Logic(域逻辑),并对外公布操作数据对象的API。它封装了所有对数据模型的操作,不管数据是客户端还是服务器端的。

    Mediator 和Proxy 可以提供一些操作接口让Command 调用来管理View Component 和Data Object ,同时对 Command隐藏具体操作的细节。

  2. 一般一个Mediator(handleNotification方法)处理的Notification应该在4、5个之内。
    还要注意的是,Mediator的职责应该要细分。如果处理的Notification很多,则意味着Mediator需要被拆分,在拆分后的子模块的Mediator里处理要比全部放在一起更好。

  3. 应该避免Mediator与Proxy 直接交互。
    通常应该遵从了这个规则,但实际上项目Mediator中不可避免需要获取Proxy数据,如果每次都通过一个Notification去获取数据,然后返回数据给Mediator,这样无形中增加了通信次数、带反馈数据的通信加重通信负担。所以可以适当是的在Mediator中facade.retrieveProxy获取Proxy然后拿到数据,而且从proxy直接拿数据,可以保证拿到最新数据。

  4. 与skynet交互是 先http验证然后拿到 ws 相关所需的信息 再以 rpcId(大端4字节) + body 形式的数据结构

参考文档

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].