Giter Site home page Giter Site logo

ddz_skynet's Introduction

ddz_skynet

simple implemetation of doudizhu(斗地主), based on skynet

这是在空闲时研究云风的skynet写的一个demo,实现一个C/S的斗地主的基本逻辑,接口包括:

  • 自动注册,已注册时自动登录
  • 自动创建房间
  • 进入房间或离开房间
  • 准备或取消准备游戏
  • 游戏开始时叫地主&抢地主的基本逻辑
  • 斗地主玩法的全部规则实现

大概是花了3天左右时间写的demo,功能比较不完善,主要的时间也花在了斗地主的规则上。而像复用game、room这几个skynet service,以及一些网络处理细节上还未来得及做,留待后续有时间处理吧。

使用sproto,具体协议见proto目录。

如何运行

进入目录后,服务端使用:

./run.sh

客户端使用:

./client.sh 玩家姓名

如果要在多台不同机器上运行,需要更改client.sh脚本,把127.0.0.1的IP地址改成服务器IP即可。

##如何编译 clone 下本仓库。 更新 submodule ,服务器部分需要用到 skynet ;客户端部分需要用到 lsocket 。

git submodule update --init

编译 skynet

cd skynet
make linux

编译 lsocket(如果你需要客户端)

make socket

编译 skynet package 模块

make

ddz_skynet's People

Contributors

donnki avatar

Watchers

James Cloos avatar  avatar

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.