All Projects → sundream → Ggapp

sundream / Ggapp

Licence: mit
A game server example,base on gg+skynet

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Ggapp

Pitaya
Scalable game server framework with clustering support and client libraries for iOS, Android, Unity and others through the C SDK.
Stars: ✭ 927 (+1395.16%)
Mutual labels:  game, game-server, game-framework
Gameproject3
游戏服务器框架,网络层分别用SocketAPI、Boost Asio、Libuv三种方式实现, 框架内使用共享内存,无锁队列,对象池,内存池来提高服务器性能。还包含一个不断完善的Unity 3D客户端,客户端含大量完整资源,坐骑,宠物,伙伴,装备, 这些均己实现上阵和穿戴, 并可进入副本战斗,多人玩法也己实现, 持续开发中。
Stars: ✭ 655 (+956.45%)
Mutual labels:  game, game-server, game-framework
Nanoserver
DEMO: Mahjong server base on nano(https://github.com/lonng/nano)
Stars: ✭ 706 (+1038.71%)
Mutual labels:  game, game-server, game-framework
Einx
a framework in golang for game server or app server
Stars: ✭ 376 (+506.45%)
Mutual labels:  game, game-server, game-framework
Moon
A cross-platform,lightweight,scalable game server framework written in C++, and support Lua Script
Stars: ✭ 313 (+404.84%)
Mutual labels:  game, game-server
Noahgameframe
A fast, scalable, distributed game server engine/framework for C++, include the actor library, network library, can be used as a real time multiplayer game engine ( MMO RPG/MOBA ), which support C#/Lua script/ Unity3d, Cocos2dx and plan to support Unreal.
Stars: ✭ 3,258 (+5154.84%)
Mutual labels:  game, game-server
Ark
ARK is a lightweight, agility, elastic, distributed plugin framework written in C++,make it easier and faster to create your own application service.
Stars: ✭ 370 (+496.77%)
Mutual labels:  game, game-server
Stendhal
Stendhal is a fun friendly and free multiplayer online adventure game with an old school feel.
Stars: ✭ 194 (+212.9%)
Mutual labels:  game, game-server
Leaf
A game server framework in Go (golang)
Stars: ✭ 4,250 (+6754.84%)
Mutual labels:  game-server, game-framework
Nakama
Distributed server for social and realtime games and apps.
Stars: ✭ 5,293 (+8437.1%)
Mutual labels:  game-server, game-framework
Gonet
go分布式服务器,基于内存mmo
Stars: ✭ 804 (+1196.77%)
Mutual labels:  game, game-framework
Dolphin
**pigame** is a game server template for Erlang.
Stars: ✭ 23 (-62.9%)
Mutual labels:  game, game-server
Linuxgsm
The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
Stars: ✭ 3,063 (+4840.32%)
Mutual labels:  game, game-server
The Tale
Основной репозиторий проекта: сайт и логика игры
Stars: ✭ 256 (+312.9%)
Mutual labels:  game, game-server
Gameservers Docker
A bunch of game servers I use, dockerised
Stars: ✭ 322 (+419.35%)
Mutual labels:  game, game-server
Pss
This is a based plug-in framework that provides cross-platform IO and logically separated plug-in services.
Stars: ✭ 219 (+253.23%)
Mutual labels:  game, game-server
Dst Dedicated Server
Don't Starve Together dedicated server guide for all platforms (Linux, Mac, Windows) with Docker. Extensive documentation covering mods installation, server config and performance, world generation and setting up admins.
Stars: ✭ 187 (+201.61%)
Mutual labels:  game, game-server
Otxserver
OTX Server from:
Stars: ✭ 187 (+201.61%)
Mutual labels:  game, game-server
Racingworld
💥 A multiplayer online 3D game about racing 💥
Stars: ✭ 50 (-19.35%)
Mutual labels:  game, game-server
Forgottenserver
A free and open-source MMORPG server emulator written in C++
Stars: ✭ 1,024 (+1551.61%)
Mutual labels:  game, game-server

ggApp

ggApp是一个基于gg的游戏服务器示例, 引擎使用skynet,上层使用Lua开发。

Table of Contents

状态

stable(Make it better)

特点

  • 对skynet引擎无任何修改
  • 结构简单,易于使用

服务器

  • 检出

     cd ~ && git clone https://github.com/sundream/ggApp --recursive
    
  • 依赖项

    • 工具/库

      • ubuntu18.04
        # in ubuntu 16.04,you need change readline-dev to libreadline-dev
        sudo apt install -y protobuf-compiler protobuf-c-compiler readline-dev autoconf git subversion telnet netcat libcurl4-openssl-dev
        
      • centos
        sudo yum install -y protobuf-compiler protobuf-c-compiler readline-devel autoconf git subversion telnet nc libcurl-devel
        
    • 其他工具(非必要安装)

      • lua-5.3.5
      • python-2.7.16
         curl -R -O https://www.python.org/ftp/python/2.7.15/Python-2.7.16.tgz
         tar -zxvf Python-2.7.16.tgz
         cd Python-2.7.16
         ./configure
         make
         sudo make install
        
      • luarocks for lua5.3
         git clone https://github.com/luarocks/luarocks
         cd luarocks
         ./configure --lua-version=5.3 --with-lua-include=/usr/local/include
         make build
         sudo make install
        
  • 安装DB(框架默认使用mongodb)

  • 编译loginserver

     cd ~/ggApp/loginserver
     make linux
     # make macosx
    
  • 编译gameserver

     cd ~/ggApp/gameserver
     make linux
     # make macosx
    
  • 运行loginserver

    • 首次启动准备工作

       cd ~/ggApp
       mkdir -p loginserver/log
      
    • 直接启动

       cd ~/ggApp/loginserver
       ./skynet src/app/config/loginserver.config
       // 启动后成功后控制台会提示start,另外log/game/game$DATE.log会记录启服/关服日志
       // 你也可以在控制台中执行任何lua代码
      
    • shell管理

       cd ~/ggApp/loginserver/shell
       sh status.sh	# 查看状态
       sh start.sh		# 启动
       sh stop.sh		# 关闭
       sh restart.sh	# 重启
       sh kill.sh		# 强制关闭
      
  • 导入app

    # 首次启动/app有变动时执行
    python tools/script/add_app.py --app=tools/script/app.config --loginserver="127.0.0.1:8885"
    
  • 导入服务器列表

     # 首次启动/服务器配置有变动时执行
     python tools/script/import_servers.py --appid=appid --config=tools/script/servers.dev.config --loginserver="127.0.0.1:8885"
    
  • 生成服务器配置文件

     # 服务器配置有变动时执行
     python tools/script/generate_gameserver_config.py --config=tools/script/servers.dev.config --out=~/ggApp/gameserver/src/app/config
    
  • 运行gameserver

    • 首次启动准备工作

       cd ~/ggApp
       # gameserver_1为服务器名
       ln -s gameserver gameserver_1
       mkdir -p gameserver_1/log
      
    • 直接启动

       cd ~/ggApp/gameserver_1
       ./skynet src/app/config/gameserver_1.config
       // 启动后成功后控制台会提示start,另外log/game/game$DATE.log会记录启服/关服日志
       // 你也可以在控制台中执行任何lua代码
      
    • shell管理

       cd ~/ggApp/gameserver_1/shell
       sh status.sh	# 查看状态
       sh start.sh		# 启动
       sh stop.sh		# 关闭
       sh restart.sh	# 重启
       sh kill.sh		# 强制关闭
      
    • 执行gm指令

       cd ~/ggApp/gameserver_1/shell
       sh gm.sh #提示用法
       sh gm.sh 0 help help
       sh gm.sh 0 exec 'print(\"hello\")'
       curl 'http://127.0.0.1:18888/call/8 "gm","0 exec print(\"hello\")"'
      

Back to TOC

客户端

see client/README.md

Back to TOC

压测工具

see robot/README.md

Back to TOC

服务器结构

  • 节点结构
    节点结构
     登录服: 负责账密验证,充值回调验证等
     游戏服: 负责游戏玩法逻辑(根据不同需求可划分成不同功能服)
     DB: 示例使用mongodb,你也可以使用redis集群/mongo集群
    
  • 内部结构
    内部结构
     说明: 这里的结构并不包括skynet本身启动的服务
     网关服务: 管理客户端连接,协议编码,协议加解密等。目前支持tcp,kcp,websocket网关,可选择使用/混合使用
     主服务: 负责游戏主要玩法逻辑,我们推荐大部分玩法在主服务实现,特定玩法可自定义服务实现
     Logger服务: 日志处理
    

Back to TOC

目录结构

  • 大致目录结构
+~/ggApp  
    +gg                         // 公共代码
	+loginserver				// 登陆服
	+gameserver					// 游戏服
		+src
			+gg					// -> ../../gg
			+app				// 游戏逻辑
			+proto				// 协议
		+shell					// 启服/关服等脚本
	+client						// 简易客户端(如可用来给服务器发送协议,快速登录等)
	+robot						// 压测工具
	+tools						// 其他工具
        +db                     // db配置示例
		+script					// 部分管理脚本
+~/db							// db(包含示例配置)
	+redis					// redis数据库
	+mongodb				// mongo数据库

Back to TOC

开发环境

  • centos运行服务器+window开发
	1. 安装samba
		sudo yum install -y samba samba-client

	2. 在/etc/samba/smb.conf下增加以下配置
	#$USER为你的用户名
	[$USER]
		comment = samba share folder
		path = /home/$USER
		available = yes
		browseable = yes
		public = yes
		writable = yes
		force user = $USER
		force group = $USER
		create mask = 0664
		directory mask = 0775

	3. 增加samba账户
		sudo touch /etc/samba/smbpasswd
		sudo smbpasswd -a $USER
		执行上面命令后会提示输入密码,输入两次密码创建samba账户

	4. 重启samba服务
		sudo systemctl restart smb nmb

	5. window下连接samba
		在资源管理器地址栏输入: \\$IP即可看到共享文件$USER
		右键$USER文件夹,点击<映射为网络驱动>,以便以后方便访问

文档

  • 生成文档

     如果没有安装ldoc,可用以下指令安装
     sudo luarocks install ldoc
     // sudo apt install lua-doc		# ubuntu下也可以用这种方式安装
     目前loginserver和gameserver进行了文档注释,可以用ldoc工具导出html文档,如:
     cd loginserver
     ldoc .
     执行后将会生成doc目录,用浏览器打开doc/index.html即可查看文档
    
  • 查看Wiki来了解更多细节

  • 静态代码检查

     提前安装luacheck
     sudo luarocks install luacheck
     // sudo apt install lua-check	# ubuntu下也可以用这种方式安装
     目前loginserver和gameserver配置了luacheck静态检查规则,可以用luacheck进行检查,如:
     cd gameserver
     luacheck . | tee /tmp/luacheck.out
    

Back to TOC

一键部署

使用ggApp-ansible一键部署,他会自动帮我们 安装必要软件,安装依赖,生成db配置文件等.

社区

Back to TOC

证书

ggApp is licensed under the MIT License,Version 0.3.0. See LICENSE for the full license text.

Back to TOC

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].