How to Alphabetize Add-on List?

Author Topic: How to Alphabetize Add-on List?  (Read 3335 times)

It didn't, but I think its because I'm using BLG hosting- I can't execute client scripts cuz I can't launch the client.
You can execute client scripts fine, but it looks like the hook that this script is using is something that won't be called unless you visit the add-ons list when starting a game. Try executing this add-on and typing fixAddOnListSorting(); in the server's console and seeing if you have any luck.

It didn't, but I think its because I'm using BLG hosting- I can't execute client scripts cuz I can't launch the client.
I did not realize that. I figured it was for an older version of Blockland.

Anyway, I modified it again so that it will (hopefully) work for BLG hosting and the Blockland client. I tested it on a dedicated server, from which I had to manually invoke customGameGuiServer::populateAddonList. Everything should work fine. But if someone could test it on a BLG server and tell me the results, that would be much appreciated.

The download link: https://leopard.hosting/download.php?f=yvyss&name=Support_FixAddonSorting.zip

You can execute client scripts fine, but it looks like the hook that this script is using is something that won't be called unless you visit the add-ons list when starting a game. Try executing this add-on and typing fixAddOnListSorting(); in the server's console and seeing if you have any luck.
That should not work. My original modified script references $CustomGameGui::AddonCount and $CustomGameGui::Addon[%i], while the old script references $CustomGameGuiServer::AddonCount and $CustomGameGuiServer::Addon[%i]. The new one should fix this problem though.

Hmm, it still doesn't work :(
You know, I even tried echoing $CustomGui::AddonCount and nothing appeared in console :I

EDIT: !!!! I tried doing customGameGuiServer::populateAddonList(); and it looks like it DID reorganize the list, buuuuuuuuut when I restart the server everything is still completely randomly executed.
« Last Edit: May 08, 2017, 06:43:00 PM by --LegoPepper-- »

To make it 'mostly' alphabetical, you could create a new NTFS partition and put Blockland there.

To make it 'mostly' alphabetical, you could create a new NTFS partition and put Blockland there.
I'm probably just gonna make a gamemode like you suggested.

I'm probably just gonna make a gamemode like you suggested.
I forgot I even suggested that. That's a good idea.

Hmm, it still doesn't work :(
You know, I even tried echoing $CustomGui::AddonCount and nothing appeared in console :I

EDIT: !!!! I tried doing customGameGuiServer::populateAddonList(); and it looks like it DID reorganize the list, buuuuuuuuut when I restart the server everything is still completely randomly executed.
$CustomGui::AddonCount is not a thing. You are thinking of either $CustomGameGui::AddonCount or $CustomGameGuiServer::AddonCount.

When testing on a dedicated server, I had to manually invoke customGameGuiServer::populateAddonList(), too. $CustomGameGuiServer::AddonCount is not assigned any values until you populate the add-on list. It seems the dedicated server does not do this immediately after the server starts since it has no need to. Whenever the need arises for the add-on list to be populated, the script I posted should alphabetize it.

But if you really need to populate the add-on list when the server starts for one reason or another, you could just modify the script I posted. Just add
Code: [Select]
CustomGameGuiServer::populateAddonList();to the last line of server.cs.

I'm probably just gonna make a gamemode like you suggested.
Out of curiosity, what kind of gamemode are you thinking of? Feel free to link me to another forum post or PM me to avoid derailing this thread.

Out of curiosity, what kind of gamemode are you thinking of? Feel free to link me to another forum post or PM me to avoid derailing this thread.
What I meant was I should just host with a Gamemode_ instead of trying to alphabetically sort my add-ons before executing everything.

From what I've been told, gamemode.txt will execute the add-ons in the order you put them in the file.

I've had this same problem running Blockland through Wine.

I think Wine actually fixed that issue itself, I remember using 1.6 and seeing this problem but later versions; I think 1.8+ does not have this problem anymore.

It seems Blockland Glass has a similar problem.



Our script does not seem to fix it. I guess I will add it as an issue on Blockland Glass' GitHub repository. I may even consider making a pull request.

EDIT: I added the issue to the GitHub repo (https://github.com/BlocklandGlass/BlocklandGlass/issues/244).
« Last Edit: May 13, 2017, 03:26:05 AM by Platypi »

It seems Blockland Glass has a similar problem.



Our script does not seem to fix it. I guess I will add it as an issue on Blockland Glass' GitHub repository. I may even consider making a pull request.

EDIT: I added the issue to the GitHub repo (https://github.com/BlocklandGlass/BlocklandGlass/issues/244).
I'll have that fixed in 4.1, thanks for pointing it out.

issue is with ext4/those filesystems, im running btrfs and I have sorting the correct order

I'll have that fixed in 4.1, thanks for pointing it out.
Good to hear! Thanks, mate.