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

[Enhancement] rework for enable choosing of a custom datapack name #572

Merged
merged 20 commits into from
Nov 19, 2022

Conversation

dudantas
Copy link
Contributor

@dudantas dudantas commented Nov 7, 2022

With this modification, we will be able to focus on just one repository (the canary), and archive otservbr-global.

The intention is that we can have two datapacks in the same repository, being able to easily switch from one to the other, just change in config.lua the "dataPackDirectory" from "data-otservbr-global" to "data-canary" or vice versa.

The main purpose is to facilitate our development, at the same time that the community will be able to contribute in a single repository, but keeping the choice of using a "clean" datapack.

I made some more modifications, such as removing the unused C++ gamestore, I also removed the "allowPickupable" tag, which was duplicated, and I made some other adjustments.

Folder structure changes
Now we have the following structure

data = this will be the "core" folder, it is where the files that are absolutely necessary for the distro to open correctly, such as libs, xmls, etc. Here we will have files that both the global and the canary datapack will share with each other
data-otservbr-global = here will be the global datapack files, some libs and folders that are only for the global server, such as scripts, monsters, npcs, world.
data-canary = a "clean" datapack as far as possible, with only the scripts and files necessary for the server to work.
NOTE: The "data" folder is actually the "core" of the server, we didn't rename it to avoid having to make changes to the sites and login.php, since they read the "data/xml". The other two folders, data-otservbr-global and data-canary can be changed in config.lua, which one you want the executable to read, by default we'll point to the global one, as that's what most use. If you want to start a custom server with "as few files and scripts as possible", then switch to "data-canary".

We also added a boolean in config.lua that allows choosing another name for the datapack, by default we will also keep this disabled, since we will only maintain support for these two datapacks, it is up to each one to know what they are doing in case they want to change it.

So, in the end, we have the reorganization in the folders:
58855

Note that we made few real changes to the files, the abundance of modified files is due to moving from one folder to another and also adding the global datapack to this repository (with an abundance of files). If you want to migrate your datapack to the global one, you should know what you're doing, if you don't know, just pass your modifications to the "new files" or get in touch on our discord group, so we can help you.

This modification allows us to choose the name of the folder "datapack", to work more easily with the global pack.

If everything goes as planned, we can migrate the global repository here, without necessarily affecting the development of the custom. Who wants to use the global datapack, just change the name, who wants to use the usual "data", can also.

Also removed the c++ store functions as it was not used.

How to test:

Take the global pack, rename it to "data-global", in the src/core.hpp file, in "DATAPACK_FOLDER_NAME" put the same folder you renamed, compile and test.

Fix for not remove items with decay added from map
@dudantas dudantas force-pushed the enable-choose-custom-datapack-folder-name branch from 34e3831 to a38386a Compare November 7, 2022 18:35
• Using FLAG_NOLIMIT when returning the hireling lamp to user's store inbox.
• Ignoring the inbox available slots in this case avoids a crash in the hireling_lib file when the user losing the house has a full store inbox.
@dudantas dudantas force-pushed the enable-choose-custom-datapack-folder-name branch from ad47915 to 281ddaf Compare November 8, 2022 12:26
@sonarcloud
Copy link

sonarcloud bot commented Nov 17, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dudantas dudantas merged commit 6c924eb into main Nov 19, 2022
@dudantas dudantas deleted the enable-choose-custom-datapack-folder-name branch November 19, 2022 01:33
luan pushed a commit that referenced this pull request Jul 11, 2023
)

With this modification, we will be able to focus on just one repository (the canary), and archive otservbr-global repository.

The intention is that we can have two datapacks in the same repository, being able to easily switch from one to the other, just change in config.lua the "dataPackDirectory" from "data-otservbr-global" to "data-canary" or vice versa.

The main purpose is to facilitate our development, at the same time that the community will be able to contribute in a single repository, but keeping the choice of using a "clean" datapack.

I made some more modifications, such as removing the unused C++ gamestore, I also removed the "allowPickupable" tag, which was duplicated, and I made some other adjustments.

Folder structure changes
Now we have the following structure:
• data = this will be the "core" folder, it is where the files that are absolutely necessary for the executable to open correctly, such as libs, xmls, etc. Here we will have files that both the global and the canary datapack will share with each other
• data-otservbr-global = here will be the global datapack files, some libs and folders that are only for the global server, such as scripts, monsters, npcs, world.
• data-canary = a "clean" datapack as far as possible, with only the scripts and files necessary for the server to work.

• NOTE: The "data" folder is actually the "core" of the server, we didn't rename it to avoid having to make changes to the sites and login.php, since they read the "data/xml". The other two folders, data-otservbr-global and data-canary can be changed in config.lua, which one you want the executable to read, by default we'll point to the global one, as that's what most use. If you want to start a custom server with "as few files and scripts as possible", then switch to "data-canary".

We also added a boolean in config.lua that allows choosing another name for the datapack, by default we will also keep this disabled, since we will only maintain support for these two datapacks, it is up to each one to know what they are doing in case they want to change it.

So, in the end, we have the reorganization in the folders:
![58855](https://user-images.githubusercontent.com/8551443/202463807-c0902611-4d6e-493d-b72d-8d85d5009d55.jpg)

Note that we made few real changes to the files, the abundance of modified files is due to moving from one folder to another and also adding the global datapack to this repository (with an abundance of files). If you want to migrate your datapack to the global one, you should know what you're doing, if you don't know, just pass your modifications to the "new files" or get in touch on our discord group so we can help you: https://discord.gg/X3mSnMH8jg
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

Successfully merging this pull request may close these issues.

None yet

3 participants