Giter Club home page Giter Club logo

luachip's Introduction

LuaChip

A Garry's Mod addon that allows players to script in Lua and run it on the server (maybe clientside execution in the future too?).

luachip's People

Contributors

danielga avatar

Watchers

 avatar  avatar

luachip's Issues

Limiting code execution time

This is going to be tricky. And all seemed to work perfectly. Sigh. Windows timers only have milisecond resolution (and very bad at that) so os.clock is a no-go on it. SysTime seemed to work but seems to just get massive time jumps randomly. On Linux (and I suppose Mac OSX) this works better. SysTime seems to have the same time jumps but less frequently and os.clock seems to work great and has a few microseconds resolution (which is good). As such, os.clock is the default on Linux.

To time or not to time, that is the question. Basically, either find a workaround on Windows or count operations. The idea is, each function has a set ops cost and each Lua op counts as one(?) LuaChip op. So, each time debug hooks are called, add their "count" value to the total ops consumed. I feel dirty...

Lua debug hooks and stopping coroutines

When stopping coroutines (if they spent too much time executing) while they were calling a Lua C function that, for example, makes a hook.Call like Player:Kill, can create errors inside those hooks and there's no way for the debug hook to know this (besides using expensive debug.getinfo). Maybe remove the debug hook on calling certain C functions and replace it later?

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.