Skip to content

Commit

Permalink
Updated to v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
the1schwartz committed May 2, 2022
1 parent 47db3c1 commit a93f6c6
Show file tree
Hide file tree
Showing 28 changed files with 75 additions and 40 deletions.
2 changes: 2 additions & 0 deletions ExampleProject/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Packages/
wally.lock
6 changes: 5 additions & 1 deletion ExampleProject/default.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@
"$className": "DataModel",

"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"Common": {
"$path": "src/shared"
},
"GameAnalyticsSDK": {
"GameAnalytics": {
"$path": "../default.project.json"
}
},

"ServerScriptService": {
"$className": "ServerScriptService",
"Server": {
"$path": "src/server"
}
},

"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"Client": {
"$path": "src/client"
}
Expand Down
7 changes: 5 additions & 2 deletions ExampleProject/src/client/init.client.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GameAnalyticsInit = require(ReplicatedStorage.GameAnalyticsSDK.Initialize)
-- using wally package
--local GameAnalytics = require(ReplicatedStorage.Packages.GameAnalytics)
-- using rojo or manually copied in
local GameAnalytics = require(ReplicatedStorage.GameAnalytics)

GameAnalyticsInit.initClient()
GameAnalytics:initClient()
11 changes: 8 additions & 3 deletions ExampleProject/src/server/init.server.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GameAnalytics = require(ReplicatedStorage.GameAnalyticsSDK)
local GameAnalyticsInit = require(ReplicatedStorage.GameAnalyticsSDK.Initialize)
-- using wally package
--local GameAnalytics = require(ReplicatedStorage.Packages.GameAnalytics)
-- using rojo or manually copied in
local GameAnalytics = require(ReplicatedStorage.GameAnalytics)

GameAnalyticsInit.initServer("MY_GAME_KEY", "MY_SECRET_KEY")
GameAnalytics:setEnabledInfoLog(true)
GameAnalytics:setEnabledVerboseLog(true)

GameAnalytics:initServer("MY_GAME_KEY", "MY_SECRET_KEY")
33 changes: 33 additions & 0 deletions ExampleProject/wally.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "GameAnalyticsSDK test project",
"tree": {
"$className": "DataModel",

"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"Common": {
"$path": "src/shared"
},
"Packages": {
"$path": "Packages"
}
},

"ServerScriptService": {
"$className": "ServerScriptService",
"Server": {
"$path": "src/server"
}
},

"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"Client": {
"$path": "src/client"
}
}
}
}
}
8 changes: 8 additions & 0 deletions ExampleProject/wally.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "gameanalytics/exampleproject"
version = "0.1.0"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"

[dependencies]
GameAnalytics = "gameanalytics/[email protected]"
3 changes: 0 additions & 3 deletions GameAnalyticsSDK/init.lua

This file was deleted.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ If you have any issues or feedback regarding the SDK, please contact our friendl
Changelog
---------
<!--(CHANGELOG_TOP)-->
**2.2.0**
* added support for wally

**2.1.35**
* fixed argument order

Expand Down
4 changes: 2 additions & 2 deletions default.project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "GameAnalyticsSDK",
"name": "gameanalytics-sdk",
"tree": {
"$path": "GameAnalyticsSDK"
"$path": "gameanalytics-sdk"
}
}
Binary file added gameanalytics-sdk/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local version = {
SdkVersion = "2.1.35"
SdkVersion = "2.2.0"
}

return version
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,13 @@ end

local requiredInitializationOptions = {"gameKey", "secretKey"}

function ga:initServer(gameKey: string, secretKey: string)
ga:initialize({
gameKey = gameKey,
secretKey = secretKey
})
end

function ga:initialize(options)
threading:performTaskOnGAThread(function()
for _, option in ipairs(requiredInitializationOptions) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,4 @@ function module.initClient()
Postie.setCallback("getPlatform", getPlatform)
end

function module.initServer(gameKey: string, secretKey: string)
local GameAnalytics = require(script.Parent.GameAnalytics)

GameAnalytics:initialize({
build = "0.1",

gameKey = gameKey,
secretKey = secretKey,

enableInfoLog = true,
enableVerboseLog = false,

--debug is by default enabled in studio only
enableDebugLog = nil,

automaticSendBusinessEvents = true,
reportErrors = true,

availableCustomDimensions01 = {},
availableCustomDimensions02 = {},
availableCustomDimensions03 = {},
availableResourceCurrencies = {},
availableResourceItemTypes = {},
availableGamepasses = {},
})
end

return module
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "gameanalytics/gameanalytics-sdk"
description = "Official Roblox SDK for GameAnalytics. GameAnalytics is a free analytics platform that helps game developers understand their players' behaviour by delivering relevant insights."
version = "2.1.35"
version = "2.2.0"
license = "MIT"
authors = ["GameAnalytics <[email protected]>"]
realm = "shared"
Expand Down

0 comments on commit a93f6c6

Please sign in to comment.