Giter Club home page Giter Club logo

Comments (4)

gutenye avatar gutenye commented on July 24, 2024

为什么要SERVER对SERVER通信? 我的理解只要 ROOMSERVER <-> CLIENT 和 LOBBYSERVER <-> CLIENT 就好了.

from qsanguosha.

hejun442001 avatar hejun442001 commented on July 24, 2024

@gutenye 还有 ROOMSERVER <-> LOBBYSERVER

from qsanguosha.

 avatar commented on July 24, 2024

我的意见是仍然只使用一个字段,但是拆分枚举

比如 int type = SERVER_SOURCE & SEREVER_DEST & PACKET_TYPE_REQUEST

souce用头2个bit, dst用另外两个bit,type再用两个bit

在 2012年7月27日 上午1:56,Pan, Shi Zhu <
[email protected]

写道:

目前对于包的类型定义,有下列几种:

  •   S_SERVER_REQUEST,
    
  •   S_SERVER_REPLY,
    
  •   S_SERVER_NOTIFICATION,
    
  •   S_CLIENT_REQUEST,
    
  •   S_CLIENT_REPLY,
    
  •   S_CLIENT_NOTIFICATION,
    

实际上,需要描述的有三个层面的信息:

  1. 发送方(SERVER,CLIENT)
  2. 接受方(SERVER,CLIENT)
  3. 类型(REQUEST,REPLY,NOTIFICATION)

现有情况下,因为只考虑了 SERVER to CLIENT 以及 CLIENT to SERVER 的信息,所以,2x3 只有六种类别。

但是,如果 SERVER to SERVER 需要考虑,再加上,GAMESERVER 与 LOBBYSERVER 两种不同的
SERVER,实际就会有三个层面:3x3x3 = 27 种类别。

现在有几种方案实现:

  1. 用 27 个枚举来实现,这样仍然保持一个字段,只是类型从现在的 6 种变成了 27
    种(当然这其中某些方式可能不会出现,但仍然需要记录下来。这个方案,协议字段数量不变:[1,2,3,4,[]]
  2. 扩展为两个字段,发送方+类型,9个枚举,接受方,3个枚举。这个方案需要在目前的协议中扩展一个字段:[1,2,3,4,5,[]]
  3. 扩展为两个字段,发送方+类型+接受方,各3个枚举。这个方案需要在目前的协议中扩展两个字段:[1,2,3,4,5,6,[]]

哪个比较合适呢?


Reply to this email directly or view it on GitHub:
#44

from qsanguosha.

pansz avatar pansz commented on July 24, 2024

我的意见是仍然只使用一个字段,但是拆分枚举

okay, seems to be brilliant.

from qsanguosha.

Related Issues (20)

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.