Code Monkey home page Code Monkey logo

Comments (5)

marado avatar marado commented on September 21, 2024

Why shouldn't an admin be able to run those commands from within the MUD?

from ranviermud.

shawncplus avatar shawncplus commented on September 21, 2024

In theory they could but the MVP is that they only run them from the server. Having them run the commands through the mud (specifically shutdown/restart) would require extra code to reattach sockets through the actual process shutting down which I haven't taken the time to look into yet

from ranviermud.

stephcurt avatar stephcurt commented on September 21, 2024

Following up on my pullrequest (#90) I was thinking this would be some good next steps. Let me know what you think:

  • Add flag to Server.js that serverOperation checks to make sure other operations aren't already in-flight.
  • Add option to server shutdown to shutdown and process.exit()
  • Store server operation timeouts as variables so you can call clearTimeout on them if you want to, maybe allowing for a "Cancel" server command?
  • Separate out console input into its own class that extends EventEmitter and emits to the 'data' event (in the same way the Telnet Class does)
  • Add arg to data event emitted to in Telnet and the new Console class that specifies where the command is coming from
  • Add logic to command parser to separate server console commands from telnet commands to ensure players cant send server commands.
  • Add command script for server commands to /bundles/core-commands/commands/ to be consistent with other commands

Notes on things I don't like about my checkin but don't have solution to yet:

  • Countdown counter for player warn is a global variable
  • BroadcastAt method for each player called via players.foreach, should we modify .players getter to include a method for players.broadcast that broadcasts to all players?
  • Server.js instance is a scoped variable. Need to be able to access with state in tact from other modules. Possibly move Server variables outside class and make them globals, then make server methods static? I'm still relatively new to node so I'm not sure on the best design pattern to use here.

from ranviermud.

shawncplus avatar shawncplus commented on September 21, 2024

BroadcastAt method for each player called via players.foreach

This bit

this.GameState.PlayerManager.players.forEach(p => Broadcast.sayAt(p, `${warningStr} ${global.countdown/ 1000} SECONDS`));

Should be

Broadcast.sayAt(this.GameState.PlayerManager, `${warningStr} ${global.countdown/1000} SECONDS`);

PlayerManager is a Broadcastable so it can just be passed in as a target to sayAt(), likewise with Area and Room

Server.js instance is a scoped variable. Need to be able to access with state in tact from other modules.

this.GameState = { server: this, ... } should work just fine

from ranviermud.

shawncplus avatar shawncplus commented on September 21, 2024

The main ./ranvier executable no longer has any commands, this can be implemented in bundle-land with server events

from ranviermud.

Related Issues (20)

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.