NoahGameFrame一个用于C++的快速,可扩展的分布式游戏服务器框架

网友投稿 1842 2022-11-05

NoahGameFrame一个用于C++的快速,可扩展的分布式游戏服务器框架

NoahGameFrame一个用于C++的快速,可扩展的分布式游戏服务器框架

NoahGameFrame

Tutorial && Documents

https://github.com/ketoo/NoahGameFrame/wiki

What is NoahGameFrame?

NoahGameFrame (NF) is a lightweight, fast, scalable, distributed plugin framework. NF is greatly inspired by OGRE and Bigworld.

Features

Easy-to-use, interface-oriented designAn extensible plugin framework that makes getting your application running quick and easyA clean, uncluttered design and stable engine that has been used in several commercial productsA high performance actor model (by a safe thread pool)Event and attribute-driven, making it clear and easy to maintain your businessBased on standard C++ development, ensuring cross-platform supportAn existing C++ and C# game client for rapid developmentCross-platform support

Tutorial && Documents

https://github.com/ketoo/NoahGameFrame/wiki

Architecture

App Architecture:

Server Architecture

Get the Sources:

git clone https://github.com/ketoo/NoahGameFrame.git

or

svn checkout https://github.com/ketoo/NoahGameFrame

Dependencies

libeventeasylogging++google protobufhiredisajsonconcurrentqueueRapidXMLLuaIntfnavigationlua

Tutorial && Documents

https://github.com/ketoo/NoahGameFrame/wiki

IF YOU CAN NOT BUILD THE DEPENDENCIES THEN PLEASE RUN THE CMDS BELOW TO SET UP THE ENVIRONMENT:

sudo apt-get install g++sudo apt-get install cmakesudo apt-get install automakesudo apt-get install zip unzip

Supported Compilers

GCC >= 7 (Tested on Ubuntu 16.04)MSVC >= VS2019 (Tested on Win10)

Build and Install

FOR WINDOWS, MSVC >= 2019

FOR LINUX(UBUNTU, CENTOS) ---- please use administrator(or sudo) to do these:

Git pull all sourceRun install4cmake.sh to build NF (or run cd /Dependencies ./build_dep.sh then run buildServer.sh)Run the binary file by _Out/rund.sh

IF YOU LIVING IN A COUNTRY CANNOT ACCESS GITHUB FASTLY PLZ BUILD NF WITH VPN

HOW TO RUN HELLO WORLD

https://github.com/ketoo/NoahGameFrame/wiki/How-to-run-the-Helloworld

HOW TO DEBUG WITH UNITY3D

https://github.com/ketoo/NoahGameFrame/wiki/How-to-debug-with-unity3d

Unity Multiplayer Demo

WebSite: https://github.com/ketoo/NFUnitySDK

Tutorial && Documents

https://github.com/ketoo/NoahGameFrame/wiki

License

The NFrame project is currently available under the Apache License.

Tutorial:

01-Hello world, add a module

// -------------------------------------------------------------------------// @FileName : HelloWorld1.h// @Author : ketoo// @Date : 2014-05-01 08:51// @Module : HelloWorld1//// -------------------------------------------------------------------------#ifndef NFC_HELLO_WORLD1_H#define NFC_HELLO_WORLD1_H#include "NFComm/NFPluginModule/NFIPluginManager.h"class HelloWorld1 : public NFIModule{public: HelloWorld1(NFIPluginManager* p) { pPluginManager = p; } virtual bool Init(); virtual bool AfterInit(); virtual bool Execute(); virtual bool BeforeShut(); virtual bool Shut();protected:};#endif#include "HelloWorld1.h"bool HelloWorld1::Init(){ // Use this for initialization std::cout << "Hello, world1, Init" << std::endl; return true;}bool HelloWorld1::AfterInit(){ // AfterInit is called after Init std::cout << "Hello, world1, AfterInit" << std::endl; return true;}bool HelloWorld1::Execute(){ // Execute is called once per frame //std::cout << "Hello, world1, Execute" << std::endl; return true;}bool HelloWorld1::BeforeShut(){ //before final std::cout << "Hello, world1, BeforeShut" << std::endl; return true;}bool HelloWorld1::Shut(){ //final std::cout << "Hello, world1, Shut" << std::endl; return true;}

02-Hello world, test data driver

how to use the world's most advanced data engine

03-Hello world, test heartbeat and event system

how to use the synchronous events

04-Hello actor, test actor model(async event system)

how to use the asynchronous eventsuse multiple cpus to get high performance

How to Create a New LuaScriptModule

Step 1

Create a Lua Script File, and Must Contain following functions

reload()awake()init()ready_execute()after_init()before_shut()shut()

Mostly like this

test_module.lua

test_module = {}register_module(test_module,"test_module");function test_module.reload()endfunction test_module.awake() reload();endfunction test_module.init()endfunction test_module.after_init()endfunction test_module.ready_execute()endfunction test_module.before_shut()endfunction test_module.shut()end

##Step 2 Add your LuaScriptModule Infomation into script_list.lua

ScriptList={ {tbl=nil, tblName="TestModule"}, {tbl=nil, tblName="TestModule2"},}load_script_file(ScriptList)

##Hot fix Add your lua script file name on here script_reload.lua

About The Author

Mail: 342006@qq.comBBS: http://bbs.noahframe.com

Amazing open source projects:

breeze

Auther: zsummerGithub: https://github.com/zsummer/breezeDescription:A fast, scalable, distributed game server framework for C++

gce

Auther: nousxiongGitHub: https://github.com/nousxiong/gceDescription: The Game Communication Environment (GCE) is an actor model framework for online game development.

moon

Auther: bruceGitHub: https://github.com/sniper00/moon.gitDescription: A cross-platform,lightweight,scalable game server framework written in C++, and suport Lua Script.

Tutorial && Documents

https://github.com/ketoo/NoahGameFrame/wiki

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:JVM完全解读之Metaspace解密源码分析
下一篇:jvm原理之SystemGC源码分析
相关文章

 发表评论

暂时没有评论,来抢沙发吧~