Guild icon
Ark Server Api
── ( Promote | Content ) ── / 【💻】ᴘʟᴜɢɪɴꜱ
This channel is designed for any plugin devs to release the "plugins" that is on ArkServerAPI website.
Avatar
Rogue Leader 12/12/2018 8:33 AM
Contribute to barnwellrd/New-Player-Protection development by creating an account on GitHub.
👍 9
👏 7
8:33 AM
Contribute to barnwellrd/Dino-Passive-Protection development by creating an account on GitHub.
👏 8
Avatar
GSH | MrOwlSky 6/17/2020 3:15 AM
Contribute to barnwellrd/Max-Imprint development by creating an account on GitHub.
Avatar
An Ark Survival Evolved plugin that adds the "/fill" command (uses fertilizer from player inventory and nearby dung beetles to auto fill crop plots in given radius). - GitHub - K0...
Avatar
@OSubMarin if (loadedClasses.size() > 0) { auto it = loadedClasses.begin(); auto end = loadedClasses.end(); while (it != end) { if ((*it).first.Compare(*blueprintPath) == 0) return (*it).second; it++; } } any reason to store the iterator and end as locals?
7:11 AM
I'm fairly certain for loops implicitly do this
Avatar
That's because it is not a for loop it's a while loop. Unlike for loops, with while loops you want to declare your variables outside of the loop scope otherwise the loadedClasses.begin() and loadedClasses.end() functions would get called multiple times. Using a for loop is different : Everything can be declared in the for statement (one-liner), and there is dedicated section on this line for your declarations (for (declare_here; ...).
Avatar
Depending on your taste and situation you might prefer to use a one-liner or not.
5:02 PM
One-liner is generally something I add during refactoring since it's more convenient for me to have clear separate declarations and instructions when I work on the code. Hence you won't see much for loops on my work-in-progress code, except for simple things like an integer counter ^^ (edited)
5:05 PM
(Also I don't always do refactoring! That's also time consuming task 😝 In the end, any for loop is turned into a while loop at compile time anyway, so using for loops is actually less efficient even if that's negligible). (edited)
Avatar
Avatar
substitute
@OSubMarin if (loadedClasses.size() > 0) { auto it = loadedClasses.begin(); auto end = loadedClasses.end(); while (it != end) { if ((*it).first.Compare(*blueprintPath) == 0) return (*it).second; it++; } } any reason to store the iterator and end as locals?
Just refactored it (see latest version: 1.4) 😉
Avatar
@OSubMarin hello bro sry for mention you i am trying to learn more about plugin dev in ark and i found an open source rep for u createing plugin called AutoFillCorp i just want to ask about MyBPLoadClass this thing in it
2:54 PM
i want just to know what is it and where it comes from
2:54 PM
is it native thing in the API ?
2:55 PM
and if there is a wiki or documentation to this
2:55 PM
also wants to ask about this block of code bec i am still begginer in c++ c++ static std::map<unsigned long long, long long> lastRunCommandTime = std::map<unsigned long long, long long>();
2:55 PM
what does it do
Avatar
Hello @NT Diesel, the purpose of the function MyBPLoadClass() is to load Blueprint classes only once (instead of loading blueprint classes every time I need them). Basically, when I call MyBPLoadClass() it will load the blueprint class and stores the result in the loadedClasses map. Then if I call MyBPLoadClass() again to load the same blueprint class, instead of loading it again it will return the result that was stored in loadedClasses map. This function is not mandatory (I could call UVictoryCore::BPLoadClass function directly), it's just an optimisation to save some processing time. (edited)
Avatar
The goal of the lastRunCommandTime map is to limit the number of commands that a user can perform in a given time interval (FILLCROPS_INTERVAL_DELAY). When a user performs the fill crops command it will store his Steam ID and the current timestamp in that map. Then if the same user tries to do the same command again, the code will check if the time difference between current request and previous request is superior to the given time interval. Basically it does "if (current time - stored time > FILLCROPS_INTERVAL_DELAY)". So if the time interval has not been reached yet the command will be rejected. This is not mandatory to do all that (but it's good for performance and security to limit the amount of commands that can be performed in a given time). (edited)
✅ 1
Avatar
Avatar
NT Diesel
also wants to ask about this block of code bec i am still begginer in c++ c++ static std::map<unsigned long long, long long> lastRunCommandTime = std::map<unsigned long long, long long>();
If you are new to C++ my advise is to never use the new keyword or other memory allocation functions unless it's mandatory. Instead try to declare all your variables with fixed sizes so that they are allocated on the stack. That way you will not have to free the resources with the delete keyword and you will avoid memory leakage. Try to use UE containers (TArray, TMap, ...) or STD containers (std::list, std::map) when possible because they are efficient and memory/thread safe. See here for details on TArray and how to use them: https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/TArrays/
❤️ 1
Avatar
Avatar
OSubMarin
If you are new to C++ my advise is to never use the new keyword or other memory allocation functions unless it's mandatory. Instead try to declare all your variables with fixed sizes so that they are allocated on the stack. That way you will not have to free the resources with the delete keyword and you will avoid memory leakage. Try to use UE containers (TArray, TMap, ...) or STD containers (std::list, std::map) when possible because they are efficient and memory/thread safe. See here for details on TArray and how to use them: https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/TArrays/
thank you very much my bro ❤️
Avatar
Avatar
OSubMarin
If you are new to C++ my advise is to never use the new keyword or other memory allocation functions unless it's mandatory. Instead try to declare all your variables with fixed sizes so that they are allocated on the stack. That way you will not have to free the resources with the delete keyword and you will avoid memory leakage. Try to use UE containers (TArray, TMap, ...) or STD containers (std::list, std::map) when possible because they are efficient and memory/thread safe. See here for details on TArray and how to use them: https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/TArrays/
Sry for mention again but i just want to say thank u for this link which let me know more things i wouldnt have know anytime near
6:23 AM
This link is too usefulll
6:23 AM
And if u have any another usefull links please can u send them ?
6:24 AM
Some things that discuss the data types and classes or any things related to unreal or ark
Avatar
You're welcome. No I don't have other links, plugins examples from this channel and official documentation (https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/) will be your best sources of information.
Avatar
You can get inspiration by looking at the existing game code. There are two different methods to look at the game code. The first one is to install Unreal Engine editor for Ark (that way you can see all blueprint's classes and their workflow). But some of the code will be missing from the UE editor, so you might need the second method in addition. The second method is to install Ghidra (or IDA) and to decompile Ark server executable (ShooterGameServer.exe). (edited)
Avatar
Ok thanks bro ❤️
Avatar
How have you guys gone about accessing the TribeData.RankGroups? Either for online or offline players
12:33 AM
Everything ive tried has some weird values for the RankGroupRankField and debugger is being incredibly frustrating
Avatar
Anyone using API::Requests::Get().CreatePostRequest successfully ?
Avatar
A lot of people
Avatar
I have an issue where it is sending no data, it send headers but the actual passed data does not go through, if I change it to get request then it works fine
11:03 AM
any thoughts ?
Avatar
Am I perhaps in the wrong channel ?
Avatar
Avatar
Grumpy
Am I perhaps in the wrong channel ?
I received the news that I will move to GSH server in the near future, but I didn't see the channel related to plug-in development in GSH. So it should be right to communicate on this channel at present.
11:23 AM
But I usually study C++ on the Global-General channel.
Exported 37 message(s)
Timezone: UTC+1