GithubHelp home page GithubHelp logo

rosaserver / rosaserver Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 9.0 3.73 MB

A server scripting API for Sub Rosa.

License: MIT License

C++ 92.84% CMake 1.07% Shell 0.18% Lua 5.89% C 0.02%
lua luajit moonjit cpp subrosa

rosaserver's Introduction

CMake CodeQL

A linux server scripting API for Sub Rosa.

⚠ Early in development, APIs can change at any time.

RosaServer uses LuaJIT/moonjit; this means there's no hit to performance while being able to create anything from moderation tools to complex custom games with easy-to-write version agnostic code.

Getting Started

Installing

  • Build the library or download the latest Release.
  • Your directory should contain libluajit.so, librosaserver.so, subrosadedicated.x64, and the data folder (the last two can be found with your game install).
    • You will also need the rosaserversatellite binary if you plan to use the ChildProcess API. Make sure it has execute permissions.
  • There's a 99% chance you'll also want to use RosaServerCore.

Running

LD_PRELOAD="$(pwd)/libluajit.so $(pwd)/librosaserver.so" ./subrosadedicated.x64

The server will start as normal and main/init.lua will be executed.

Documentation

For complete reference on using the Lua API, go to the wiki.

Building

Make sure all submodules are cloned, and run ./build.sh

Required Packages

  • build-essential on Debian/Ubuntu
  • cmake
  • libssl-dev
  • libsqlite3-dev
  • libopus-dev

Here's a basic script I use to copy the required files after they're compiled. For example, ./build.sh && ./postbuild.sh

#!/bin/bash

DEST=../RosaServerCore/

cp ./moonjit/src/libluajit.so "$DEST"
cp ./release/RosaServer/librosaserver.so "$DEST"
cp ./release/RosaServerSatellite/rosaserversatellite "$DEST"

Thanks to these open source libraries:

rosaserver's People

Contributors

jdbool avatar noche-x avatar sammy-0 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

rosaserver's Issues

Special characters such as 'ığüçöş' is not handled properly

Describe the bug
When typing a special unicode charecter such as 'ğ' it displays a unknown character that needs to be deleted twice and such.

To Reproduce
Steps to reproduce the behavior:

  1. ./start
  2. Type a special character that is not handled properly.
  3. See error

Expected behavior
I would expect it to print that character, but something else prints.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Unicode handling?

item.isGun returning nil

Describe the bug
When trying to check if a item is a gun or not in ItemLink hook it's always returning nil. Buying a gun or /arm-ing.

To Reproduce
Steps to reproduce the behavior:

  1. Hook ItemLink.
  2. Use this code:
    if item then if parentHuman then mode:print(item.isGun) end end
  3. Go in-game and try to buy a gun or /arm.
  4. See error.

Expected behavior
For that value to be either true or false.

Screenshots
image

Additional context
I'm guessing that this is a property that I need to set.

When a line wraps around and then the terminal expands, line gets messed up

Describe the bug
If you type a line so long that wraps around the terminal and then expand the terminal, the line merges incorrectly.

To Reproduce
Steps to reproduce the behavior:

  1. Launch.
  2. Type a long line and make it wrap around the terminal.
  3. Expand or make the font size smaller to make the line one line.
  4. See error

Expected behavior
Line should be correct instead of gibberish.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Can look for terminal expand events and font size change events and then rewrite the line.

Segmentation fault in VehicleDestroy hook via printing vehicle parameter

Describe the bug
When printing the vehicle/veh parameter in the VehicleDelete hook, a segmentation fault occurs.

To Reproduce
Steps to reproduce the behavior:

  1. Create a VehicleDelete hook.
  2. Do print(veh).
  3. Go 16 units away from a TrafficCar to make it despawn.
  4. See error.

Expected behavior
Expected for it to print Vehicle (0).

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Stack traceback:
#0 librosaserver.so(+0x3c67e1) [0x7fb3f2eac7e1]
#1 /usr/lib/libc.so.6(+0x3cda0) [0x7fb3f27cfda0]
#2 librosaserver.so(_ZN3Lua5printEN3sol13variadic_argsENS0_10this_stateE+0x236) [0x7fb3f2df14b6]
#3 librosaserver.so(_ZN3sol15function_detail21upvalue_free_functionIRFvNS_13variadic_argsENS_10this_stateEELb0EE4callEP9lua_State+0x4a) [0x7fb3f2f2210a]
#4 librosaserver.so(+0x3c434a) [0x7fb3f2eaa34a]
#5 libluajit.so(+0xa78a) [0x7fb3f34fa78a]
#6 libluajit.so(lua_pcall+0x59) [0x7fb3f350d8c9]
#7 librosaserver.so(+0x372bb3) [0x7fb3f2e58bb3]
#8 librosaserver.so(_ZN5Hooks13deleteVehicleEi+0x105) [0x7fb3f2e68025]
#9 ./subrosadedicated.x64(+0x5d750) [0x563c00c5d750]

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.