All Projects → cwjokaka → cheshuo

cwjokaka / cheshuo

Licence: MIT License
🎃A lightweight game server framework. Based on Springboot and Netty. Using ProtoBuf as communication between client and server.

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cheshuo

Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+8504.35%)
Mutual labels:  protobuf, tcp, netty, nio
twjitm-core
采用Netty信息加载实现长连接实时通讯系统,客户端可以值任何场景,支持实时http通讯、webSocket通讯、tcp协议通讯、和udp协议通讯、广播协议等 通过http协议,rpc协议。 采用自定义网络数据包结构, 实现自定义网络栈。
Stars: ✭ 98 (+326.09%)
Mutual labels:  protobuf, tcp, maven, netty
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (+1760.87%)
Mutual labels:  maven, netty, nio, mybatis
Seconds Kill
基于 Springboot + Redis + Kafka 的秒杀系统,乐观锁 + 缓存 + 限流 + 异步,TPS 从 500 优化到 3000
Stars: ✭ 180 (+682.61%)
Mutual labels:  maven, lombok, springboot, mybatis
Spring Dubbo Service
微服务 spring dubbo项目:dubbo rpc;druid数据源连接池;mybatis配置集成,多数据源;jmx监控MBean;定时任务;aop;ftp;测试;Metrics监控;参数验证;跨域处理;shiro权限控制;consul服务注册,发现;redis分布式锁;SPI服务机制;cat监控;netty服务代理;websocket;disconf;mongodb集成;rest;docker;fescar
Stars: ✭ 224 (+873.91%)
Mutual labels:  maven, netty, mybatis
My Blog
🌴A simple & beautiful blogging system implemented with spring-boot & thymeleaf & mybatis My Blog 是由 SpringBoot + Mybatis + Thymeleaf 等技术实现的 Java 博客系统,页面美观、功能齐全、部署简单及完善的代码,一定会给使用者无与伦比的体验
Stars: ✭ 2,400 (+10334.78%)
Mutual labels:  maven, springboot, mybatis
Mobileimsdk
一个原创移动端IM通信层框架,轻量级、高度提炼,历经8年、久经考验。可能是市面上唯一同时支持UDP+TCP+WebSocket三种协议的同类开源框架,支持iOS、Android、Java、H5,服务端基于Netty。
Stars: ✭ 3,864 (+16700%)
Mutual labels:  tcp, netty, nio
T Io
解决其它网络框架没有解决的用户痛点,让天下没有难开发的网络程序
Stars: ✭ 1,331 (+5686.96%)
Mutual labels:  tcp, netty, nio
Simplenet
An easy-to-use, event-driven, asynchronous network application framework compiled with Java 11.
Stars: ✭ 164 (+613.04%)
Mutual labels:  tcp, maven, nio
netty-learning
bio, nio到 netty各种使用案例, 包含基础使用案例,各api使用方法,零拷贝,websocket,群聊,私聊,编码,解码,自定义协议,protobuf等使用案例,rpc服务器,客户端等等学习
Stars: ✭ 49 (+113.04%)
Mutual labels:  netty, nio, springboot
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (+2213.04%)
Mutual labels:  protobuf, tcp, netty
Almost Famous
🌟 Almost-Famous(成名之路) ——卡牌游戏开源项目,架构使用SpringBoot+Netty+Maven+SpringCloud来搭建多进程分布式框架,包括Cloud、Unique、Login、Game、Match、Battle 等服务。
Stars: ✭ 131 (+469.57%)
Mutual labels:  protobuf, maven, netty
Spring Boot Quick
🌿 基于springboot的快速学习示例,整合自己遇到的开源框架,如:rabbitmq(延迟队列)、Kafka、jpa、redies、oauth2、swagger、jsp、docker、spring-batch、异常处理、日志输出、多模块开发、多环境打包、缓存cache、爬虫、jwt、GraphQL、dubbo、zookeeper和Async等等📌
Stars: ✭ 1,819 (+7808.7%)
Mutual labels:  maven, springboot, mybatis
Ssm Demo
🍌Spring+SpringMVC+Mybatis+easyUI实现简单的后台管理系统
Stars: ✭ 1,639 (+7026.09%)
Mutual labels:  maven, springboot, mybatis
Ibase4j
Spring,SpringBoot 2.0,SpringMVC,Mybatis,mybatis-plus,motan/dubbo分布式,Redis缓存,Shiro权限管理,Spring-Session单点登录,Quartz分布式集群调度,Restful服务,QQ/微信登录,App token登录,微信/支付宝支付;日期转换、数据类型转换、序列化、汉字转拼音、身份证号码验证、数字转人民币、发送短信、发送邮件、加密解密、图片处理、excel导入导出、FTP/SFTP/fastDFS上传下载、二维码、XML读写、高精度计算、系统配置工具类等等。
Stars: ✭ 1,548 (+6630.43%)
Mutual labels:  maven, springboot, mybatis
Vsblog
☕🖖 一个采用vue及springboot开发的超简洁的个人博客系统,相信我它定会让你眼前一亮~
Stars: ✭ 78 (+239.13%)
Mutual labels:  maven, springboot, mybatis
itstack-naive-chat-server
💞 《服务端》| 服务端同样使用Netty4.x作为socket的通信框架,同时在服务端使用Layui作为管理后台的页面,并且我们的服务端采用偏向于DDD领域驱动设计的方式与Netty集合,以此来达到我们的框架结构整洁干净易于扩展。同时我们的通信协议也是在服务端进行定义的,并对外提供可引入的Jar包,这样来保证客户端与服务端共同协议下进行通信。
Stars: ✭ 21 (-8.7%)
Mutual labels:  netty, springboot, mybatis
Perfect Ssm
🍇更完善的Spring+SpringMVC+Mybatis+easyUI后台管理系统(RESTful API+redis)
Stars: ✭ 606 (+2534.78%)
Mutual labels:  maven, springboot, mybatis
Nettydemo
Netty应用到Android,包含客户端、服务端(断线重连、心跳、黏包处理)
Stars: ✭ 183 (+695.65%)
Mutual labels:  tcp, netty, nio
Logistics-admin
SpringBoot+adminlte+maven的物流公司管理系统
Stars: ✭ 61 (+165.22%)
Mutual labels:  maven, springboot, mybatis

cheshuo

一个轻量级的游戏服务器框架,基于Springboot和Netty,使用Protobuf作为客户端和服务器之间的通信.功能逐步完善中...😘


目前支持协议:

  • TCP
  • Websocket

项目依赖:

名称 用于 链接
JDK1.8 Java环境
Springboot 2.X 主要使用IOC与简化配置,以及方便日后使用全家桶 https://spring.io/projects/spring-boot
Netty 4.X NIO通讯框架 https://netty.io/
jprotobuf 简化java protobuf编解码 https://github.com/jhunters/jprotobuf
Maven 项目构建

模块介绍:

模块名 说明
game-client-demo H5界面的游戏客户端模拟, 使用TCP协议时需开启TcpAgent把ws转为TCP
game-framework 游戏服务框架的实现
game-server-demo 基于game-framework实现的简单服务器demo

快速开始:

1.添加依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>cheshuo-spring-boot-starter</artifactId>
    <version>1.0.0</version>
</dependency>

2.参考配置application.yml

cheshuo:
  host: localhost		# 服务地址, 默认0.0.0.0
  server:
    tcp:
      enable: true		# 开启TCP服务, 默认false
      port: 8400		# TCP服务端口, 默认8400
    websocket:
      enable: true		# 开启Websocket服务, 默认true
      port: 8500		# Websocket服务端口, 默认8500

3.编写请求&响应体

@MessageMeta(module = Modules.USER, cmd = UserCmd.LOGIN_REQ)
public class LoginReq extends Message {
    private String account;
    private String password;
	// 省略getter & setter...
}
@MessageMeta(module = Modules.USER, cmd = UserCmd.LOGIN_RESP)
public class LoginResp extends Message {
	private Integer code;
	// 省略getter & setter...
}

4.注册Handler

// module类型为short, 表示业务模块编号
@Handler(module = Modules.USER)
public class UserHandler {
    
    // 业务处理类
    private final UserService userService;
    
    // 省略getter & setter...
    
    // cmd类型为short, 表示具体业务
    @Mapping(cmd = UserCmd.LOGIN_REQ)
    public LoginResp login(Session session, LoginReq loginReq) {
        return userService.login(session, loginReq);
    }
}

5.引导启动

import org.lx.framework.ServerBootstrap;

@SpringBootApplication
public class Application implements CommandLineRunner {

    private ServerBootstrap serverBootstrap;

    public Application(ServerBootstrap serverBootstrap) {
        this.serverBootstrap = serverBootstrap;
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    public void run(String... strings) throws Exception {
        serverBootstrap.startAll();
    }

}

License

Open source based on MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].