Closed brinkokevin closed 4 years ago
Everything in the GameAnalyticsServer script is code that needs to run once on the server when the server has started. I am no Roblox export so you are welcome to suggest a solution if you have one.
Regarding the settings it can be done in two ways as described here: https://gameanalytics.com/docs/item/roblox-sdk#initializing
because of the issues you just mentioned.
Modules also execute code one time when required. Take a look at some changes that I made here https://github.com/brinkokevin/GA-SDK-ROBLOX/commits/master
You are welcome to make a PR if you feel it will improve the SDK
It would be great if you could move code from GameAnalyticsServer to the main module. I don't see why we would have to use two server scripts to setup game analytics. The Settings table should also be moved to GameAnalyticsServerInitUsingSettings instead of being a table inside of the GameAnalytics module. At the moment every time I want to update GameAnalytics to the latest version I have to save my Settings module, replace all files with the new ones and add my settings back to the module. Ideally, there should be only 1 server script where we modify the settings which we can send to the "initialize" method. Initialization should accept all arguments which the Settings module has at the moment.
My server script should look something like this