<p>It is my first time using golang, but it is a pretty sweet language to design simple servers. I was making a simple html5 multiplayer demo with websockets.
here is the code : <a href="https://github.com/Sweetkubuni/golang_game/blob/master/server.go" rel="nofollow">link</a></p>
<p>I was wondering what is a clean way to re-sync users, who lost connection? What are some good practices with golang?</p>
<hr/>**评论:**<br/><br/>nhooyr: <pre><p>gofmt your code!</p></pre>kubuni: <pre><p>oh shit, I didnt even know about gofmt lol</p></pre>nhooyr: <pre><p>Read the docs on the main website for even more cool stuff.</p></pre>Jamo008: <pre><p>Isn't really a golang thing, more of a general protocol/architecture thing. Mostly dependent on the use case. I have a solution in <a href="https://github.com/jpillora/velox" rel="nofollow">https://github.com/jpillora/velox</a> though there's a few ways to do it.</p></pre>HugoWeb: <pre><p>I'm trying <a href="https://github.com/olahol/melody" rel="nofollow">https://github.com/olahol/melody</a> instead of using gorilla/websockets directly for my current project.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传