客户端向服务端发送 请求: this.network.send("/////",)  上面这段代码要写在logic.js中,(关于服务端的东西全部扔到logic中);

////中写协议; 协议用来规定传输数据和返回数据的格式。

并且要在serverProto.js 和 clientProto.js 中配置协议的数据格式:

 

在connector文件夹下的sampleHandler.js里面写getbaobei函数:

1. cocos creator 连接服务端

重启服务器,登录之后就可以刷新了

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-12-25
  • 2022-01-15
  • 2021-11-24
  • 2022-12-23
  • 2021-08-22
猜你喜欢
  • 2021-04-13
  • 2021-11-12
  • 2022-12-23
  • 2021-06-23
  • 2021-11-01
  • 2021-11-06
  • 2021-08-05
相关资源
相似解决方案