GithubHelp home page GithubHelp logo

ketoo / noahgameframe Goto Github PK

View Code? Open in Web Editor NEW
3.9K 330.0 1.1K 29.46 MB

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.

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

License: Apache License 2.0

C++ 57.92% C 30.26% HTML 0.32% C# 6.39% Lua 0.27% Batchfile 0.05% Shell 0.07% Makefile 0.27% Java 0.34% M4 0.02% CMake 0.61% SAS 0.02% CLIPS 0.05% Pascal 0.71% Ada 0.90% Assembly 1.39% DIGITAL Command Language 0.27% Module Management System 0.02% Perl 0.04% Roff 0.08%
server-architecture unity3d architecture gameserver game unity mmo game-server gamedev game-development

noahgameframe's Introduction

2021.7.9 在新西兰奥克兰的一场车祸中,ketoo 永远离开了我们。

On July 9, 2021, ketoo left us forever in a car accident in Auckland, New Zealand.

由于mater有权限合并了, master-new 分支后续不再维护。 直接维护master即可,pr也提交到master即可

Since mater has permission to merge, the master-new branch will no longer be maintained. You can directly maintain the master, and the pr can also be submitted to the master

NoahGameFrame

  • develop Build Status
  • master Build Status
  • chat Join the chat at https://gitter.im/ketoo/NoahGameFrame

#####QQ群:330241037 NF开源服务器引擎2群

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 design
  • An extensible plugin framework that makes getting your application running quick and easy
  • A clean, uncluttered design and stable engine that has been used in several commercial products
  • A high performance actor model (by a safe thread pool)
  • Event and attribute-driven, making it clear and easy to maintain your business
  • Based on standard C++ development, ensuring cross-platform support
  • An existing C++ and C# game client for rapid development
  • Cross-platform support

Tutorial && Documents

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

Architecture

App Architecture:

App Architecture

Server Architecture

Server Architecture

Get the Sources:

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

or

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

Dependencies

  • libevent
  • easylogging++
  • google protobuf
  • hiredis
  • ajson
  • concurrentqueue
  • RapidXML
  • LuaIntf
  • navigation
  • lua

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 cmake
  • sudo apt-get install automake
  • sudo 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

  1. Git pull all source
  2. Run the script file named build_dep.bat where located /Dependencies (墙内上网的同学请点击:墙内下载依赖库.bat)
  3. Build the solution(if u build failed, please build again(not rebuild all))
  4. Run the binary file by _Out/rund.bat

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

  1. Git pull all source
  2. Run install4cmake.sh to build NF (or run cd /Dependencies ./build_dep.sh then run buildServer.sh)
  3. 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

Showcase

Tutorial && Documents

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

License

The NFrame project is currently available under the Apache License.

Tutorial:

// -------------------------------------------------------------------------
//    @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;
}

  • how to use the world's most advanced data engine

  • how to use the synchronous events

  • how to use the asynchronous events
  • use multiple cpus to get high performance

How to Create a New LuaScriptModule

Step 1

Create a Lua Script File, and Must Contain following functions

  • awake()

  • init()

  • ready_execute()

  • after_init()

  • before_shut()

  • shut()

Mostly like this

test_module = {}
register_module(test_module,"test_module");


function test_module.awake()

end

function test_module.init()
end

function test_module.after_init()
end

function test_module.ready_execute()
end

function test_module.before_shut()
end

function 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


New Feature in future: Blue Print System

Demo:

Showcase


Amazing open source projects:

breeze

gce

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

moon

Tutorial && Documents

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

noahgameframe's People

Contributors

908760230 avatar bluesky7290 avatar flyicegood avatar fvsfvs123 avatar gajin2 avatar ifivebig avatar jamesjba avatar johance2 avatar kemibai avatar kenkinky avatar ketoo avatar lcals avatar lizho avatar mingbujian avatar nickyang4github avatar schwantz avatar sherlockpei avatar sl-sandy avatar smallant avatar sniper00 avatar superzmy avatar tangyu1018 avatar wangzhione avatar windzxa avatar xiaolanpingguo avatar xiaomingfun avatar xinst avatar xitontong avatar yss-al avatar zhxilin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noahgameframe's Issues

Database is missing. [request]

There is no sql except app_test.sql.

Where is data to run Unity ? After login OnWorldList packet received but nothing in it. Is there any example ?

Topic1: Load balancing & Scaling

Background:

Currently, load balancing & Scaling play an important role in information system especial in the business environment. In the gaming industry, to hold on many people online in a short time we need the operator add new game process at run-time. To achieve the objective the architect-designer would design this feature before the system released.

A load balancer serves as the gates for clients, the load balancer distributes incoming traffic across multiple targets, it looks like easy to implement?

Please discuss how to design this module with different situations under gaming field.

在IT产业高速发展的今天,服务器集群的负载均衡和高扩展性在信息系统特别是商业运行环境中的信息系统中变得越来越重要了.同样的,在多人在线游戏领域里,我们也需要尽可能的支持玩家的高并发数.目前来说,支持运行期动态的增减服务器,是我们解决这个问题的良好办法.然而要达到热插拔服务器,就需要我们在服务器程序中设计相应的功能模块.
或许我们可以使用多台面向客户端的网关服务器用以负载均衡,然后再通过网关服务器分发消息到不同的后台处理服务器,怎么样?看起来很简单吧?
那么请分享一下你的独到见解: 在游戏服务器领域中,如何设计这样一个负载均衡的模块来应对高并发条件下的各种情况.快来加入我们的讨论吧!

Question about server side programming

Hey there,
I was originally looking around for a network layer / messaging system for my game and then I came across KBEngine and thought it looked pretty neat but found out it really was not something I would be able to use as it would require me to convert all of my current C# serverside code for my game as well as all my server-side assets to python to be able to use them, so I started looking around more and that brought me here to NGF.

That being said, if I already have a lot of my server-side logic already written in C# would I have to rewrite it all in order to use NGF with my game?

Thanks!

Topic7: MicroServices

Microservices is a software development technique—a variant of the service-oriented architecture (SOA) architectural style that structures an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight. The benefit of decomposing a large application into different smaller services is that it improves modularity and makes the application easier to understand, develop, test, and more resilient to architecture erosion.

So, how to use Microservices in the game development industry?

In my opinion, some fields such as storage service, OAuth service, and pathfinding service can be developed as Microservices style modules.

What is your opinion about Microservices? Please leave here to give us a new view!

Topic4: Exception Handling in back-end

Background:

Exception handling enables a function that encounters an unusual situation to throw an exception and pass control to a direct or indirect caller of that function. The caller may or may not be able to handle the exception.

Before joining this topic, please think deeply that why using exception handling? What are the benefits when we used exception handling?

Basic the background of the gaming industry, please chat here that how we can design a grace module to deal with the exception.

异常处理是指在程序异常的情况下,函数内部会抛出一个异常,通过异常处理机制,将代码执行的控制权直接或间接交由异常处理函数.异常处理函数并不能保证一定能处理掉该异常.

在加入讨论这个话题之前,请深入思考一下,为什么我们需要异常处理?通过处理异常,我们能够得到什么好处?

基于游戏行业的背景,请在这里讨论一下,我们如何能设计一个优雅的异常处理模块.

Topic6: Game Networking Techniques

In games, we have multiple players playing the game on a client. From the outside, it seems magical: two or more players sharing a consistent experience across the network like they actually exist together in the same virtual world. How do you make sure they are playing the same game?

What are the differences between lockstep and state sync?

Please leave your experiences here and join the chat.

訊息route?

以下是擷取NFCChatModule.cpp

case NFMsg::ReqAckPlayerChat_EGameChatType::ReqAckPlayerChat_EGameChatType_EGCT_WORLD:
{
	m_pNetModule->SendMsgPBToAllClient(NFMsg::EGMI_ACK_CHAT, xMsg);
}

是送給所有在線的玩家嗎?
訊息是這樣走的嗎? gameserver->masterserver->proxyserver(s)

case NFMsg::ReqAckPlayerChat_EGameChatType::ReqAckPlayerChat_EGameChatType_EGCT_GUILD:
{
	NFGUID xTargetID = NFINetModule::PBToNF(xMsg.target_id());
	NFGUID xGuildID = m_pKernelModule->GetPropertyObject(nPlayerID, NFrame::Player::GuildID());
	if (!xGuildID.IsNull() && xGuildID == xTargetID)
	{
		//send to world server
		m_pGameServerToWorldModule->TransmitToWorld(xGuildID.nData64, nMsgID, xMsg);
	}
}

送給本worldserver所有的client?
路徑?

case NFMsg::ReqAckPlayerChat_EGameChatType::ReqAckPlayerChat_EGameChatType_EGCT_PRIVATE:
case NFMsg::ReqAckPlayerChat_EGameChatType::ReqAckPlayerChat_EGameChatType_EGCT_TEAM:
{
	if (xMsg.has_target_id())
	{
		NFGUID xTargetID = NFINetModule::PBToNF(xMsg.target_id());
		if (!xTargetID.IsNull())
		{
			if (m_pKernelModule->GetObject(xTargetID))
			{

			}
			else
			{
				//send to world server
				m_pGameServerToWorldModule->TransmitToWorld(xTargetID.nData64, nMsgID, xMsg);
			}
		}
	}
}

傳送給單一client或team
路徑?

以上還煩請解說,謝謝!

create neat filenames for dump file

In ApplicationCrashHandler, it better to use later formation

sprintf(szDmupName, "%d_%d_%d_%d_%d_%d.dmp"
sprintf(szDmupName, "%04d_%02d_%02d_%02d_%02d_%02d.dmp"

looking for a mature version

I've browsed the develop code base, the framework seems not mature enough for real project to use. Is there any recommendable version that I could start for my server project?

Object 3D distance

Hello, i need to get a distance between two players and make one player follow the other, but keep a small distance
Example, i have 2 player: PlayerA and PlayerB


PlayerA.PositionX = 500.0
PlayerA.PositionZ = 0.0
PlayerA.PositionY = 100.0

PlayerA.PositionX = 200.0
PlayerA.PositionZ = 0.0
PlayerA.PositionY = 300.0

How can I get the distance between them? I need to get a vector? (Use NF)
Me need 2 example, first: use X,Z,Y coords; second: use X,Y (in 3D, but not used height Z coord)

Here example:
image

And, if i'm not mistake, me need get character position and add object radius to vector, for get object size and create correct collision

Especial Thanks

It's the very biggest pity that our project of game has been dropped. In most time, NoahGameFrame works so well that I just need to write few code to develop our service.
Due to the end of this project, I can hardly help to improve NoahGameFrame more.
Many thanks to NoahGameFrame, it helped me a lot.
Good luck.

Copy executable and dependencies built via cmake to remote machine will fail to start

Building solution via cmake scripts in my local system (I've tested in CentOS 7), it works normally.
But after copy all executable , dlls and any dependencies to remote linux matchine, it fails to run the NFPluginLoader.

It seems that cmake will link the dependencies as absolute path for my local machine. The remote machine could not find theses path, so it fails to run.

Anyone has this issue?

ScheduleModule guide ?

Hello, give examples of how to use this function. Does it work stably?
This is a very useful feature to perform tasks at a specific time!
https://github.com/ketoo/NoahGameFrame/blob/449d1be0969d95025a3bad9f14ac99a75d97a3d9/NFComm/NFPluginModule/NFIScheduleModule.h

What do you think, is it worth using this task manager to issue effects to the player and remove effects?

Do I understand correctly that this module is capable of calling functions at a certain time (and he support arguments) for a specific player?
Is the client ID (NFGUID) or task name used for identification?
Can the same task name be used for all player IDs (NFGUID)

Please documentation : (
oh yea, what is ->

if (performanceModule.CheckTimePoint(1))
{
std::ostringstream os;
os << "---------------module scehdule performance problem------------------- ";
os << performanceObject.TimeScope();
os << "---------- ";
m_pLogModule->LogWarning(NFGUID(), os, __FUNCTION__, __LINE__);
}

Does this module have performance problems?

Win10 VS2017 build client cocos2d-x error

Error C2440 '=': cannot convert from 'NFCUISelectServer *' to 'std::function<int (int,const NFDataList &)> *' (compiling source file ..\Classes\NF\UI\NFCUISelectServer.cpp) NFDemo d:\workspace\billiardserver\nfclient\cocos\classes\nf\logic\nfclogicbase.h 46

NF and Redis

What are these methods generally used for?
Could you explain what these functions are generally responsible for?
In the NF examples, some functions, such as VerifyAccount, accept only the string strAccount, and not
strAccount + "_AccountInfo "

	virtual NFList<std::string> GetDriverIdList() = 0;
	virtual NF_SHARE_PTR<NFIRedisClient>  GetDriver(const std::string& strID) = 0;
	virtual NF_SHARE_PTR<NFIRedisClient>  GetDriverBySuitRandom() = 0;
	virtual NF_SHARE_PTR<NFIRedisClient>  GetDriverBySuitConsistent() = 0;
	virtual NF_SHARE_PTR<NFIRedisClient>  GetDriverBySuit(const std::string& strHash) = 0;

vs2017编译错误

编译NoahFrameX.sln 出现:Error C2447 '{': missing function header (old-style formal list?) (compiling source file NFCChaseState.cpp) NFAIPlugin d:\study files\network\noahgameframe-5.2.4\nfmidware\nfaiplugin\nfistate.h 16

vs2013编译失败

1> logging.cc
1>F:\NoahGameFrame\Dependencies\glog-0.3.3\src\windows\port.h(117): warning C4005: “va_copy”: 宏重定义
1> D:\Microsoft Visual Studio 12.0\VC\include\stdarg.h(37) : 参见“va_copy”的前一个定义
1>....\src\logging.cc(75): error C2039: “min”: 不是“std”的成员
1>....\src\logging.cc(75): error C2873: “min”: 符号不能用在 using 声明中
1>....\src\logging.cc(586): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据
1>....\src\logging.cc(719): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据
1>....\src\logging.cc(744): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据
1>....\src\logging.cc(754): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据
1>....\src\logging.cc(1033): warning C4267: “初始化”: 从“size_t”转换到“const int”,可能丢失数据
1>....\src\logging.cc(1314): warning C4267: “初始化”: 从“size_t”转换到“const int”,可能丢失数据
1>....\src\logging.cc(1386): error C2065: “min”: 未声明的标识符
1>....\src\logging.cc(1386): error C2062: 意外的类型“int”
1>....\src\logging.cc(1409): warning C4267: “参数”: 从“size_t”转换到“unsigned int”,可能丢失数据
1>....\src\logging.cc(1487): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据
1>....\src\logging.cc(1500): warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

PS:
例如编译NFDep libglog_static, 有以上的报错

Topic5: Coroutine & Asynchronous programming

Background:

Normally, the program executes a sequence of computations by line. Sometimes, the codes will spend a lot of time in reading files or waiting for something, as a result, the program blocking. Is there have any way to optimize this situation?

Please leave messages here for discussing.

在通常情况下,我们的程序只会顺序的执行一系列的计算任务.在一些情况下,程序会花费大量的时间在加载文件或等待某个任务完成,从而导致程序运行阻塞.那么是否有什么办法可以优化这个问题呢?

请留下你的看法, 让我们一起讨论吧!

NoahGameFrame/README.md

似乎文档需要更新一下了。

  • Run the binary file by **_Out/Debug/rund.bat 编译完成后,rund.bat 在 _Out 目录下面了。

  • Run **GenerateConfigXML.bat** to generate configuration files 在 install4vs.bat 中就已经执行了。所以是不是 clone 下来工程后,就先 build NFFileProcess project 这个呢。因为我 clone 下来直接用 vs2015 编译了,发现编译不过去,才看的 README.md ,此时 NFFileProcess 已经被 build 完了。

Topic2: Hotfix at run-time

Background:

Good user experience can bring more customer. Nowadays, many developers think that hotfix is a cool technical, besides, many designers believe that hotfix feature can boost the user experience when adding new features at run-time.

It's a waste life thing or not? Please extend your opinion here to join the discussion.

关于插件静态库链接

您好,作者
想请问下,插件动态库链接全部换成静态库链接是出于什么考虑的呢?
如果全部静态库链接,那么所有的server都会链接重复的 插件,比如每个server都会链接好友业务插件。
这样每个进程不是包括了很多自己用不到的插件。

A callback register bug.

myDelegationHandler += new MsgDelegation(msgDelegate);

After a += operation, a delegate can be a new object. In this case, we can see that:

MsgDelegation myDelegationHandler = (MsgDelegation)mhtMsgDelegation[eMsg];
var b1 = object.ReferenceEquals(myDelegationHandler, mhtMsgDelegation[eMsg]); // b1 = true
myDelegationHandler += new MsgDelegation(msgDelegate);
var b2 = object.ReferenceEquals(myDelegationHandler, mhtMsgDelegation[eMsg]); // b2 = false

To fix it, just append one line like this:

MsgDelegation myDelegationHandler = (MsgDelegation)mhtMsgDelegation[eMsg];
myDelegationHandler += new MsgDelegation(msgDelegate);
mhtMsgDelegation[eMsg] = myDelegationHandler; // fix bug

Same issue at

myDelegationHandler += new ResultCodeDelegation(msgDelegate);

Adding Flatbuffers to NF

Hi, I like the NF framework and I recently found Google flatbuffers.
It would be very useful to add flatbuffers to NF by adding specific API commands for NF to interact with Flatbuffers.

Flatbuffers can store data in Redis, as well as, when storing data in flatbuffers, you do not need to unpack it for reading / use. This is a convenient library for storing data and structures of NPCs, monsters.
https://github.com/google/flatbuffers

What do you think about it?

Game object collision

Hello, NF support game object collision?
I need to check the collision of two *players or objects on the server

How create .proto file and disable protobuf?

Hello, im try use NF for my game.
Im not understand how use "NFMsg" in callback, he use protobuf, but me need use defualt method, without protobuf. And how create NFMsg for my packets in .proto files? And where he taked NFMsg set_event_code and set__... comands?

After failure im try create my array, not use NFMsg (.proto) files
i'm create "char xMsg[1024]", push array bytes for test and try send on serve use

Bytes in xMsg "00 00 00 04 00 00 00 02 00 00 00 08"
m_pNetModule->SendMsg(3, xMsg, nSockIndex);

But, in SendMsg function the array xMsg is nulled, why?
SendMsg function correct read аirst arg - OpCode, but the second transmitted incorrectly.

Topic3: How to save your data when the application crash

Background:

Player's data is our income. How to save your customer's data when the program crash for whatever reason is a critical problem when designing the architecture.

How can we do something to avoid losing too much data when the disaster happened?
Please leave your idea here to help others solve this problem.

在游戏中,玩家的数据是极其重要的.在程序异常崩溃的情况下,如何尽可能的保存用户的信息是服务器架构的一个关键问题.

因此,如何避免在这种极端情况下丢失大量的用户数据?请尽情发表你的看法来帮助大家解决这个问题吧!

hiredis in NF

Hello, NF framework not use async hiredis?
I'm test Redis use clock(); for get results, and he left 0,011 time on get respond from Redis server (i'm use server Redis on local machine, where i'm start server)
is HMGET function is blocking?
here example
image
image
image

Time statistic:
Inventory Create Left: 0,015 time
Inventory Get Free Slot Left: 0,010~0,011 time
Why Redis eat 10 ms?

i'm find here example for async Redis
https://github.com/redis/hiredis/blob/master/examples/example-libevent.c

Soo, what problem?

Game session

Hi, how the session check is done in NF to prevent twice authorization on the one account?

The fact is that the authorization server somehow needs to communicate with other servers in order to somehow transfer account state from one server to another, but I could not figure out how to do this without using Redis.
If the function of sending a packet to another server would support returning the callback, it would be great, but this is not possible in NF.
How can I solve my problem without using Redis to store online session accounts?

Thank you for your patience.

Error on compiling NF

I try to compile NF (branch master), but it got error. Should I add new property call "PVPType" to Player.xlsx and run ./NFFileProcess again (I don't know how to define it). Please help me solve this problem, thanks so much.
Screen Shot 2019-05-01 at 16 42 12

似乎有个错误

NoahGameFrame/NFClient/Cocos/Classes/NF/Logic/NFCLogicBase.h 第46行
应该是
mModuleEventPrtMap[pBase] = functorPtr.get();

MacOS run crash. (10.13.4)

Hi. I have installed engine.
But when I want to run "rund.sh" in my logs are:


2018-07-14 04:29:06,991 FATAL [default] CRASH HANDLED; Application has crashed due to [SIGSEGV] signal
2018-07-14 04:29:06,991 WARN  [default] Aborting application. Reason: Fatal log at [/Users/Downloads/NoahGameFrame-5.3.0/NFComm/NFLogPlugin/easylogging++.h:5646]

I don't know what's wrong. Can you help me? I just now build. What should I do next? Maybe some configuration?

centos: 编译错误

centos环境:gcc4.8.2 g++4.8.2

运行install4cmake.sh报了挺多异常和错误:

configure: creating ./config.status
config.status: creating libevent.pc
config.status: creating libevent_openssl.pc
config.status: creating libevent_pthreads.pc
config.status: creating libevent_core.pc
config.status: creating libevent_extra.pc
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: creating evconfig-private.h
config.status: evconfig-private.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
Makefile:1623: .deps/epoll_sub.Plo: No such file or directory
Makefile:1624: .deps/buffer.Plo: No such file or directory
Makefile:1625: .deps/buffer_iocp.Plo: No such file or directory
Makefile:1626: .deps/bufferevent.Plo: No such file or directory
Makefile:1627: .deps/bufferevent_async.Plo: No such file or directory
Makefile:1628: .deps/bufferevent_filter.Plo: No such file or directory
Makefile:1629: .deps/bufferevent_pair.Plo: No such file or directory
Makefile:1630: .deps/bufferevent_ratelim.Plo: No such file or directory
Makefile:1631: .deps/bufferevent_sock.Plo: No such file or directory
Makefile:1632: .deps/devpoll.Plo: No such file or directory
Makefile:1633: .deps/epoll.Plo: No such file or directory
Makefile:1699: test/.deps/test_regress-tinytest.Po: No such file or directory
make: *** No rule to make target `test/.deps/test_regress-tinytest.Po'.  Stop.
cp: cannot stat `./.libs/*.a': No such file or directory
cp: cannot stat `./.libs/*.a': No such file or directory
cp: cannot stat `./.libs/*.a': No such file or directory
checking whether to disable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for working memcmp... yes
checking for working strtod... ^Cmake  all-recursive
make[1]: Entering directory `/share/node_source/NoahGameFrame/Dependencies/protobuf'
Making all in .
make[2]: Entering directory `/share/node_source/NoahGameFrame/Dependencies/protobuf'
make[2]: Leaving directory `/share/node_source/NoahGameFrame/Dependencies/protobuf'
Making all in src
make[2]: Entering directory `/share/node_source/NoahGameFrame/Dependencies/protobuf/src'
/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -fPIC -MT atomicops_internals_x86_gcc.lo -MD -MP -MF .deps/atomicops_internals_x86_gcc.Tpo -c -o atomicops_internals_x86_gcc.lo `test -f 'google/protobuf/stubs/atomicops_internals_x86_gcc.cc' || echo './'`google/protobuf/stubs/atomicops_internals_x86_gcc.cc
'./libtool: line 611: syntax error near unexpected token `in
'./libtool: line 611: `    case ${1} in
make[2]: *** [atomicops_internals_x86_gcc.lo] Error 2
make[2]: Leaving directory `/share/node_source/NoahGameFrame/Dependencies/protobuf/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/share/node_source/NoahGameFrame/Dependencies/protobuf'
make: *** [all] Error 2
Making check in .
make[1]: Entering directory `/share/node_source/NoahGameFrame/Dependencies/protobuf'
make  check-local
make[2]: Entering directory `/share/node_source/NoahGameFrame/Dependencies/protobuf'
Making lib/libgtest.a lib/libgtest_main.a in gtest
make[3]: Entering directory `/share/node_source/NoahGameFrame/Dependencies/protobuf/gtest'
make[3]: *** No rule to make target `lib/libgtest.la'.  Stop.
make[3]: Leaving directory `/share/node_source/NoahGameFrame/Dependencies/protobuf/gtest'
make[2]: *** [check-local] Error 2
make[2]: Leaving directory `/share/node_source/NoahGameFrame/Dependencies/protobuf'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/share/node_source/NoahGameFrame/Dependencies/protobuf'
make: *** [check-recursive] Error 1
cp: cannot stat `./src/.libs/*.a': No such file or directory
cp: cannot stat `./src/.libs/*.a': No such file or directory
cp: cannot stat `./src/.libs/*.a': No such file or directory
cp: cannot stat `./src/.libs/*.so': No such file or directory
cp: cannot stat `./src/.libs/*.so.*': No such file or directory
cp: cannot stat `./src/.libs/*.so': No such file or directory
cp: cannot stat `./src/.libs/*.so.*': No such file or directory
cp: cannot stat `./src/.libs/*.dylib': No such file or directory
cp: cannot stat `./src/.libs/*.dylib.*': No such file or directory
cp: cannot stat `./src/.libs/*.dylib': No such file or directory
cp: cannot stat `./src/.libs/*.dylib.*': No such file or directory
cp: cannot stat `./src/.libs/*.a': No such file or directory
cp: cannot stat `./src/.libs/*.a': No such file or directory

/share/node_source/NoahGameFrame/NFComm/NFNetPlugin/NFCNet.cpp:416:54: error: ‘bufferevent_get_max_to_read’ was not declared in this scope
int nSizeRead = (int)bufferevent_get_max_to_read(bev);
^

/share/node_source/NoahGameFrame/NFComm/NFNetPlugin/NFCNet.cpp:417:56: error: ‘bufferevent_get_max_to_write’ was not declared in this scope
  int nSizeWrite = (int)bufferevent_get_max_to_write(bev);

make[2]: *** [NFComm/NFNetPlugin/CMakeFiles/NFNetPlugin.dir/NFCNet.cpp.o] Error 1
make[1]: *** [NFComm/NFNetPlugin/CMakeFiles/NFNetPlugin.dir/all] Error 2
make: *** [all] Error 2

新手学习游戏引擎 希望能帮忙~

还有一个问题:直接下载下来的代码放在centos上,需要把里面的shell文件和一些其他的执行文件都重新设置 Unix编码格式才能正常运行,否则无法运行。

qq 20170914130450

新报错:
[ 31%] Linking CXX shared library ../../../../../_Out/Release/NFNetPlugin.so
[ 33%] Built target NFNetPlugin
[ 33%] Linking CXX executable ../../../../../_Out/Release/NFPluginLoader
../../../../../_Out/Release/NFNetPlugin.so: undefined reference to evhttp_connection_base_bufferevent_new' ../../../../../_Out/Release/NFNetPlugin.so: undefined reference to clock_gettime'
collect2: error: ld returned 1 exit status
make[2]: *** [../../../_Out/Release/NFPluginLoader] Error 1
make[1]: *** [NFComm/NFPluginLoader/CMakeFiles/NFPluginLoader.dir/all] Error 2
make: *** [all] Error 2

client can not connect to server

hi guys, I was playing with the demo and find two problems:

  1. _Out\Server\NFDataCfg\mysql\NFrame.sql does not have accountinfo table.
  2. No register function button in unity client.

NFLoginServer log content:

[INFO | 2015-06-27 21:05:03,439] | Indent[0-0] NF_NET_EVENT_CONNECTED connectioned success NFCLoginToMasterModule::OnSocketMSEvent 235
[INFO | 2015-06-27 21:05:03,444] | Indent[0-106001] LoginServer_1 Register
[INFO | 2015-06-27 21:05:03,452] | Indent[0-1] WorldInfo
[INFO | 2015-06-27 21:06:01,213] | Indent[0-516] NF_NET_EVENT_CONNECTED connectioned success NFCLoginNet_ServerModule::OnSocketClientEvent 312
NFNet || 非法消息:unMsgID=100
BadQuery [query error] Error: Table 'app_test.accountinfo' doesn't exist
NFNet || 非法消息:unMsgID=100
NFNet || 非法消息:unMsgID=100
NFNet || 非法消息:unMsgID=100
NFNet || 非法消息:unMsgID=100

NFCProxyServerToGameModule中AfterInit没连接gameServer的逻辑

你好,有两个问题请问下
1.我在NFCProxyServerToGameModule中没找到连接gameServer的逻辑,是在别处还是?
2.在NFCWorldNet_ServerModule中维护了dbServer并接收其消息,但看架构worldServer应该只保存gameServer和proxyServer的peer。

Help, more info about server role

Hello, can you pls help?
I launched NF, but I cannot understand the role of the "Proxy" and "Master" servers.
How data is transferred (server to server) and how I can configure IP and Port in Server.xml so that clients can connect, but the connection between the servers was local.

Strange output while running runtutoriald.sh

Output:

Adizbek:_Out adizbek$ ./runtutoriald.sh 


************************************************
**                                            **
**                 NoahFrame                  **
**   Copyright (c) 2011-2018, LvSheng.Huang   **
**             All rights reserved.           **
**                                            **
************************************************


-d Run itas daemon mode, only on linux
-x Close the 'X' button, only on windows
Instance: name.xml File's name to instead of "Plugin.xml" when programs be launched, all platform
Instance: "ID=number", "Server=GameServer"  when programs be launched, all platform


CreateBackThread, thread ID = 0x7000018ae000
Using [../NFDataCfg/Struct/LogicClass.xml]
LogConfig: ../NFDataCfg/Debug/logconfig/TutorialServer.conf

Hello Lua script_module
../NFDataCfg/ScriptModule/NFScriptSystem.lua:112: attempt to get length of a nil value (global 'ScriptList')
stack traceback:
        [C]: in metamethod '__len'
        ../NFDataCfg/ScriptModule/NFScriptSystem.lua:112: in function 'module_awake'
[INFO  | 2018-07-14 15:29:25,472] | 1 | 0 | Indent[0-0] Create scene success, groupId:0, scene id: 0 CreateScene 990
[INFO  | 2018-07-14 15:29:25,473] | 2 | 0 | Indent[0-0] Create scene success, groupId:0, scene id: 1 CreateScene 990
[INFO  | 2018-07-14 15:29:25,473] | 3 | 0 | Indent[0-0] Create scene success, groupId:0, scene id: 2 CreateScene 990
[INFO  | 2018-07-14 15:29:25,473] | 4 | 0 | Indent[0-0] Create scene success, groupId:0, scene id: 3 CreateScene 990
[INFO  | 2018-07-14 15:29:25,473] | 5 | 0 | Indent[0-0] Create scene success, groupId:0, scene id: 4 CreateScene 990
[INFO  | 2018-07-14 15:29:25,473] | 6 | 0 | Indent[0-0] Create scene success, groupId:0, scene id: 5 CreateScene 990
[INFO  | 2018-07-14 15:29:25,473] | 7 | 0 | Indent[0-0] Create scene success, groupId:0, scene id: 6 CreateScene 990
../NFDataCfg/ScriptModule/NFScriptSystem.lua:119: attempt to get length of a nil value (global 'ScriptList')
stack traceback:
        [C]: in metamethod '__len'
        ../NFDataCfg/ScriptModule/NFScriptSystem.lua:119: in function 'module_init'
../NFDataCfg/ScriptModule/NFScriptSystem.lua:125: attempt to get length of a nil value (global 'ScriptList')
stack traceback:
        [C]: in metamethod '__len'
        ../NFDataCfg/ScriptModule/NFScriptSystem.lua:125: in function 'module_after_init'
../NFDataCfg/ScriptModule/NFScriptSystem.lua:131: attempt to get length of a nil value (global 'ScriptList')
stack traceback:
        [C]: in metamethod '__len'
        ../NFDataCfg/ScriptModule/NFScriptSystem.lua:131: in function 'module_ready_execute'
^C

module_init, module_after_init, module_ready_execute, what are they?

CONTACT WITH KETOO!

Would appreciate it if I could get an email or skype contact with the author of NGF.
Cheers!

Adam Bielski

NFScheduleModule time and Count change method

Hello, ketoo
I needed to prolong the time for "AddSchedule",
I noticed that there was no such implementation, and using RemoveSchedule to call "AddSchedule" again is too expensive.
I propose to add a method to extend the time "Schedule"
for example:
virtual bool ChangeTimeSchedule (const std :: string & strScheduleName, const float fTime);

In addition, the same function can be added for Count, I think it will be useful
virtual bool ChangeTimeSchedule (const std :: string & strScheduleName, const int nCount);

NFDataList::Clear() did not reset type when clear data

NFDataList::Clear() has 2 bugs:

  1. never reset type for the item that has been removed
NFDataList xDataList;
for (int i = 0; i < 10; ++i)
{
	xDataList << i;
}
xDataList.Clear();
xDataList << "Hello NF"; //This line will not succeed

After clear the NFDataList, append new data of different type will fail.

  1. first STACK_SIZE items will not be removed
NFDataList xDataList;
xDataList << 10;
xDataList.Clear(); 

It will only set mnUseSize to 0 without reset data, cause mvList.size() < STACK_SIZE

How it's work in Tutorial4

Hello, im find this tutorial4 and he use this code

bool NFCHelloWorld4Module::AfterInit()
{
	
	std::cout << "Hello, world4, AfterInit" << std::endl;

	m_pActorModule = pPluginManager->FindModule<NFIActorModule>();

	int nActorID = m_pActorModule->RequireActor();
	m_pActorModule->AddComponent<NFCHttpComponent>(nActorID);
	m_pActorModule->AddDefaultEndFunc(nActorID, this, &NFCHelloWorld4Module::HttpRequestAsyEnd);

	for (int i = 0; i < 10; ++i)
	{
		m_pActorModule->SendMsgToActor(nActorID, NFGUID(10, 20), i, "Test actor!");
	}

	std::cout << "Hello, world4, AfterInit end" << std::endl;

	return true;
}

How he call:
m_pActorModule->SendMsgToActor(nActorID, NFGUID(10, 20), i, "Test actor!");
if this func not take 4 args?

bool NFCActorModule::SendMsgToActor(const int nActorIndex, const int nEventID, const std::string& strArg)

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.