Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs to be able to run first #5

Closed
subsoap opened this issue Oct 25, 2019 · 4 comments
Closed

Needs to be able to run first #5

subsoap opened this issue Oct 25, 2019 · 4 comments

Comments

@subsoap
Copy link

subsoap commented Oct 25, 2019

This project is a decent example of why we need to be able to have a script which is guaranteed to be ran first within the init/update lifecycles since the console.go needs to init to start the server, but other scripts could have server commands on their init too.

@britzl
Copy link
Owner

britzl commented Oct 25, 2019

But do you really need to be able to control the order in this case? Other scripts with commands should be able to register even if the server hasn't started?

@subsoap
Copy link
Author

subsoap commented Oct 25, 2019

console.server is not available until console.start() is called so anything which uses console.server will not work until console.go gets a chance to init. I solved it for me by putting the same functions that console.go has into the script I can using console.server with on its init.

@rocamocha
Copy link

console.server is not available until console.start() is called so anything which uses console.server will not work until console.go gets a chance to init. I solved it for me by putting the same functions that console.go has into the script I can using console.server with on its init.

This seems like it's a super sensible solution to that problem if you were to do this maybe via a module and using a flag that only pops once to toggle execution. Are there other use cases for a guaranteed run-first script that can't be solved by a similar solution?

@britzl
Copy link
Owner

britzl commented Sep 23, 2022

It should be possible to solve this in defcon.lua too. Let me take a look.

@britzl britzl closed this as completed in 0de95b8 Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants