GithubHelp home page GithubHelp logo

voltara / fluffos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from quixadhal/fluffos

1.0 1.0 0.0 5.99 MB

The FluffOS LpMUD driver (descendant of MudOS)

License: Other

Shell 0.15% C 97.47% Logos 1.01% C++ 1.13% Perl 0.20% D 0.04%

fluffos's People

Contributors

quixadhal avatar thefallentree avatar

Stargazers

 avatar

Watchers

 avatar

fluffos's Issues

call_out can enter an inifinite loop

void evil()
{
call_out("evil", 0);
}

The above causes an infinite loop because each call_out apply to "evil" gets a new eval_cost budget.

Propose fixing by limiting eval_cost for new immediate call_outs added while processing call_outs.

setup_new_commands does not check for moved objects

When applying init() over the destination's inventory, the loop does not check whether a traversed object was moved away. This can result in setup_new_commands proceeding to apply init over the wrong object's inventory. Two problems here: (1) Part of the destination's inventory will not have init() run; (2) Another unrelated object's inventory WILL have init() run.

A fairly straightforward mitigation is to throw an error if (dest != ob->super) for a traversed object.

efun::eval_cost returns inaccurate numbers

Evaluation cost is tracked internally by a CPU clock alarm; the eval_cost efun returns an estimate based on elapsed wall time. This can even return negative numbers to the caller. Proposed fix is to add an optional POSIX timers based eval_cost mechanism, and to use timer_gettime() when querying the amount remaining.

setitimer/getitimer is not as suitable because getitimer only has 1/250 second resolution on current versions of Linux, which limits precision when profiling LPC code.

get_user_command skips a user every time a command is found

/* find and return a user command */
for (i = 0; i < max_users; i++) {
    ip = all_users[NextCmdGiver++];
    NextCmdGiver %= max_users;

    /* ... */

    /* if there's a command in the buffer, pull it out! */
    if (ip->iflags & CMD_IN_BUF) {
        NextCmdGiver++;
        NextCmdGiver %= max_users;
        user_command = first_cmd_in_buf(ip);
        break;
    }

It is not necessary to increment NextCmdGiver a second time; this allows one user to starve another of command processing time.

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.