Git Product home page Git Product logo

goweblua's Introduction

GoDoc Build Status Go Report

简介

本项目是用go语言编写,结合cgo功能,支持高并发执行lua脚本的程序。

扩展

  • 可以扩展成战斗逻辑用lua编写的战斗验证服务器。这里展示了golang运行多个lua虚拟机,充分利用多核性能的个实现。
  • 可以扩展用grpc做外部的可负载均衡的接口,我这里只简单的实现了用http做外部接口

编译

  • 输入命令 make
  • windows下编译battle因为用了c代码,编译需要gcc和make,windows下需要安装mingw-64x或者tdm64-gcc(需要把tdm64-gcc/bin/mingw32-make.exe改成make.exe)。
  • 因为用了cgo所以不支持交叉编译

运行

  • 要确保assets文件夹在可执行文件旁边
  • 若要修改初始加载的lua文件或执行执行函数清修改
     k_luaFile                   = "assets/main.lua"
     k_luaFunc                   = "MyFunc"
    

lua库

  • 我用的是LuaJIT-2.1.0-beta1,可自行替换lua的c代码,但要修改c/Makefile

Web接口

goweblua's People

Contributors

byebyebruce avatar

Watchers

James Cloos avatar

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.