{"action":"created","issue":{"url":"https://api.github.com/repos/name5566/leaf/issues/133","repository_url":"https://api.github.com/repos/name5566/leaf","labels_url":"https://api.github.com/repos/name5566/leaf/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/name5566/leaf/issues/133/comments","events_url":"https://api.github.com/repos/name5566/leaf/issues/133/events","html_url":"https://github.com/name5566/leaf/issues/133","id":377666288,"node_id":"MDU6SXNzdWUzNzc2NjYyODg=","number":133,"title":"关于protobuf msg id自动生成的设计","user":{"login":"w19787","id":731496,"node_id":"MDQ6VXNlcjczMTQ5Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/731496?v=4","gravatar_id":"","url":"https://api.github.com/users/w19787","html_url":"https://github.com/w19787","followers_url":"https://api.github.com/users/w19787/followers","following_url":"https://api.github.com/users/w19787/following{/other_user}","gists_url":"https://api.github.com/users/w19787/gists{/gist_id}","starred_url":"https://api.github.com/users/w19787/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w19787/subscriptions","organizations_url":"https://api.github.com/users/w19787/orgs","repos_url":"https://api.github.com/users/w19787/repos","events_url":"https://api.github.com/users/w19787/events{/privacy}","received_events_url":"https://api.github.com/users/w19787/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-06T02:26:09Z","updated_at":"2018-11-09T01:36:45Z","closed_at":null,"author_association":"NONE","body":"初步接触leaf，对这个id还是不能理解为什么要自动生成？这个id是由服务器消息注册顺序决定的，那如何做到向后兼容呢？\r\n\r\n比如游戏客户端发布了1.0版本，消息id m1.0. 而后服务端注册顺序发生变化了，这样客户端消息不是不兼容了吗？每次都强制客户端升级？"},"comment":{"url":"https://api.github.com/repos/name5566/leaf/issues/comments/437219358","html_url":"https://github.com/name5566/leaf/issues/133#issuecomment-437219358","issue_url":"https://api.github.com/repos/name5566/leaf/issues/133","id":437219358,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzIxOTM1OA==","user":{"login":"name5566","id":274551,"node_id":"MDQ6VXNlcjI3NDU1MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/274551?v=4","gravatar_id":"","url":"https://api.github.com/users/name5566","html_url":"https://github.com/name5566","followers_url":"https://api.github.com/users/name5566/followers","following_url":"https://api.github.com/users/name5566/following{/other_user}","gists_url":"https://api.github.com/users/name5566/gists{/gist_id}","starred_url":"https://api.github.com/users/name5566/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/name5566/subscriptions","organizations_url":"https://api.github.com/users/name5566/orgs","repos_url":"https://api.github.com/users/name5566/repos","events_url":"https://api.github.com/users/name5566/events{/privacy}","received_events_url":"https://api.github.com/users/name5566/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T01:36:45Z","updated_at":"2018-11-09T01:36:45Z","author_association":"OWNER","body":"相关讨论：https://github.com/name5566/leaf/pull/88 https://github.com/name5566/leaf/issues/26\r\n\r\n说一下为什么选择自动生成的方式：\r\n1. 自动生成的方式简单不容易出错\r\n2. 如果服务端消息发生改变客户端不改变的情况很少\r\n3. Leaf 的自动生成方案可以支持消息兼容的问题\r\n\r\n这里主要说一下如何做到服务器和客户端消息版本不一致。消息注册的顺序决定了消息的 ID。保持兼容的几种情况：\r\n* 某个消息服务器不再使用的时候。保留消息注册，不进行消息路由\r\n* 服务器需要增加某个消息的时候。把消息注册到最后的位置\r\n\r\n这样可以保证新的消息兼容旧的客户端。"}}
{"actor":{"display_login":"name5566"}}