Home
Softono
jwEngine

jwEngine

Open source C
367
Stars
86
Forks
0
Issues
14
Watchers
3 years
Last Commit

About jwEngine

jwEngine is a cross-platform C++ and Lua server framework designed to simplify and accelerate game or network server development. It provides an event-driven networking model with TCP and KCP support, allowing developers to write server logic in either C++ or Lua with minimal boilerplate. Core capabilities include connection management, packet handling, asynchronous event loops based on libuv, and Redis integration via hiredis. The framework supports multiple process types such as base, cell, and database servers, enabling scalable multi-process architectures. Built-in serialization tools are included, though protobuf is recommended for production use. jwEngine integrates several open-source libraries including sol2 for Lua bindings, concurrentqueue for lock-free messaging, lua-protobuf, http-parser, and llhttp. It is suitable for developers building online game servers, real-time applications, or custom network services who want a lightweight, flexible foundation with scripting capabilities for rapid iterati

Platforms

Web Self-hosted

Languages

C

Links

jwEngine

一个跨平台的c++<->lua服务器快速解决方案,该框架即可快速响应服务器开发工作,设计思想:“让事情变得更简单”
A cross platform C + + < - > Lua server fast solution, the framework can quickly respond to the server development work, the design idea: "make things easier"

c++ tcp server

class INetEvent : public NetEvent
{
public:
    virtual void onAccept(NetConnect * conn){}
    virtual void onClose(NetConnect * conn){}
    virtual void onMsg(NetConnect * conn, int msgtype, NetPacket * pack){}
};

int main()
{
    EventLoop::Instance()->init();

    INetEvent eve;
    NetServer server(EventLoop::Instance(), &eve);
    server.listen("127.0.0.1", 3001);

    return EventLoop::Instance()->run();
}

lua tcp server

event_init()

server = NetServer:new()
server.on_accept = function(conn)
end

server.on_close = function(conn)
end

server.on_msg = function(conn, msgtype, pack)
end

server:listen("127.0.0.1", 3001, false)

event_run()

start run

base process cell process db process
start engine.exe base.lua start engine.exe cell.lua start engine.exe db.lua

serialization

The serialization tool provided is experimental and may be fragile. It is recommended to use more powerful protobuf

Integrated open source library

libuv
sol2
concurrentqueue
lua
hiredis
kcp
lua-protobuf
http-parser
llhttp

Learn more

For more examples, please refer to example

更多项目:jwServer | jwNet

有任何建议、BUG、疑问,统一解决QQ群:458421068
My email: [email protected]