Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hanxi/sample-netgame-server
a sample net game server. contain a gateway, logicserver and a console client.
https://github.com/hanxi/sample-netgame-server
Last synced: 6 days ago
JSON representation
a sample net game server. contain a gateway, logicserver and a console client.
- Host: GitHub
- URL: https://github.com/hanxi/sample-netgame-server
- Owner: hanxi
- Created: 2014-07-31T13:56:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-14T02:42:51.000Z (about 10 years ago)
- Last Synced: 2023-03-15T02:32:49.249Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 1.04 MB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## simple network game server
> ### gateway
> ### logic server
> ### console client
> ### net protocal (lproto)
## test in linux
* compile and run
```
$ make # compile
$ ./bin.gateway/gateway # start gateway (on tty 1)
$ ./bin.server/server # start server (on other tty2)
$ lua ./bin.client/client.lua # start client (on other tty3)
$ 1 {ping="xxx",ret=2,} # send request to server (on client tty3)
```### about test
1. start gateway, wait message from client or server
2. start server, connect to gateway, gateway set server and save server fd
3. start client, connect to gateway and connect server, send others message to server
4. input cmd in client tty: 1 {ping="xxx",ret=2,} . will send protocal to server. cmd like : protId {} (prot must define)
5. if you want connect to gateway as debugclient, change client handshake md5 string for "debug_md5" in client.lua
## others :
1. 3rd/cstring was copy from https://github.com/cloudwu/cstring
2. 3rd/socket-server was copy from https://github.com/cloudwu/socket-server
3. copy from https://github.com/cloudwu/skynet
> * 3rd/lua-md5
> * lualib-src/lua-clientsocket.c
> * bin.client/client.lua
> * common-src/databuffer.h
> * common-src/hashid.h