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

admin: some tweaks #347

Merged
merged 17 commits into from
Sep 25, 2021
Merged

admin: some tweaks #347

merged 17 commits into from
Sep 25, 2021

Conversation

stoneage-mta
Copy link
Contributor

This PR replaces deprecated functions, removes unused code, fixes calls to non-existing functions, etc...

I found them using this, and maybe in the near future, i can send other PRs doing the same to other resources.

[admin]/admin/server/admin_sync.lua Show resolved Hide resolved
[admin]/admin/server/admin_sync.lua Show resolved Hide resolved
[admin]/admin/server/admin_sync.lua Show resolved Hide resolved
[admin]/admin/server/admin_sync.lua Show resolved Hide resolved
Copy link
Contributor

@jlillis jlillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good after a brief review. Nice work.

@ricksterhd123
Copy link
Contributor

Did you have to setup vscode-lua in some way to stop warning about mta functions? I remember trying similar tools and it wouldn't stop complaining about mta functions. I have a lot of old code to refactor and this tool would be great. Perhaps you could fork it and add MTA specific features such as spotting deprecated functions etc? I can imagine it would be very popular among scripters.

@ricksterhd123
Copy link
Contributor

On the same topic: Dutch showed me this before: https://github.com/Koihik/LuaFormatter and it looks promising perhaps we could configure a standard formating for mtasa resources. Only issues I had with it was that lambda functions would look weird but i think it's configurable. Shall we open a discussion? Maybe it's unecessary but I think it would be worth it.

@stoneage-mta
Copy link
Contributor Author

stoneage-mta commented Aug 25, 2021

Did you have to setup vscode-lua in some way to stop warning about mta functions? I remember trying similar tools and it wouldn't stop complaining about mta functions. I have a lot of old code to refactor and this tool would be great. Perhaps you could fork it and add MTA specific features such as spotting deprecated functions etc? I can imagine it would be very popular among scripters.

Hi, you're right, we could fork that project and make it ignore MTA functions by default, but in my case, I just created a dummy .lua file in the same workspace and declared all MTA functions inside it, then the extension will detect that the function has been declared, but since we haven't added this dummy file to meta.xml, the server will still work fine.

Here is the file I was using:
mta.zip

This repo still has a lot of that, it would be great if more people could use this technique to help clean it up :)

@stoneage-mta
Copy link
Contributor Author

On the same topic: Dutch showed me this before: https://github.com/Koihik/LuaFormatter and it looks promising perhaps we could configure a standard formating for mtasa resources. Only issues I had with it was that lambda functions would look weird but i think it's configurable. Shall we open a discussion? Maybe it's unecessary but I think it would be worth it.

Maybe we could use #250 to discuss this subject

@Dutchman101
Copy link
Member

Tested on a high traffic server for over a month, and confirmed to be stable.

@Dutchman101 Dutchman101 merged commit 8fefa02 into multitheftauto:master Sep 25, 2021
@stoneage-mta stoneage-mta deleted the admin-tweaks branch October 25, 2021 14:28
@patrikjuvonen patrikjuvonen added this to the 1.5.9 milestone Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants