Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
- Removed the statistics system.
Browse files Browse the repository at this point in the history
- Removed an unused event handler.
  • Loading branch information
MegadreamsBE committed Sep 11, 2016
1 parent 7600721 commit 667402b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 250 deletions.
34 changes: 2 additions & 32 deletions c_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function Core.onSettingsReceived(lSettingsTable)
end

if(Core.g_SettingsTable["enablecredits"]["value"]) then
outputChatBox("#3A85D6[Anti-Bounce]: #ffffffv2.4.0 has been created by #368DEBArezu #ffffffand #368DEB"
outputChatBox("#3A85D6[Anti-Bounce]: #ffffffv2.5.0 has been created by #368DEBArezu #ffffffand #368DEB"
.."MegaDreams#ffffff.",255,255,255,true)
end

Expand All @@ -129,35 +129,15 @@ function Core.onSettingsReceived(lSettingsTable)

Core.g_LastCheck = getRealTime().timestamp

if(Core.g_SettingsTable["enableplayerstats"]["value"] == true) then
Core.updateUsageInfo()
setTimer(Core.updateUsageInfo,180000,0)
end

addCommandHandler("bouncedebug",Core.toggleDebug)

addEventHandler("onClientVehicleCollision",Core.g_Root,Core.onVehicleCollision)
addEventHandler("onClientPreRender",Core.g_Root,Core.onPreRender)
addEventHandler("onClientRender",Core.g_Root,Core.onDebugRender)
triggerEvent("onAntiBouncedLoaded",Core.g_Root)
end
addEvent("onSettingsReceived",true)
addEventHandler("onSettingsReceived",Core.g_ResourceRoot,Core.onSettingsReceived)

function Core.updateUsageInfo()
if not (Core.g_bABEnabled) then
Core.g_UsageTable["time_disabled"] = Core.g_UsageTable["time_disabled"] + (getRealTime().timestamp - Core.g_LastCheck)
else
Core.g_UsageTable["time_enabled"] = Core.g_UsageTable["time_enabled"] + (getRealTime().timestamp - Core.g_LastCheck)
end

Core.g_LastCheck = getRealTime().timestamp

Core.g_UsageTable["uuid"] = Preferences:generateUniqueId()
Core.g_UsageTable["code"] = sha256(getPlayerSerial())
setElementData(localPlayer,"ab.player.usage",Core.g_UsageTable,true)
end

function Core:toggleBounce()
Core.g_bABEnabled = not Core.g_bABEnabled

Expand All @@ -168,17 +148,7 @@ function Core:toggleBounce()
outputChatBox(Core.g_SettingsTable["togglemessage"]["value"]:gsub("%%1",Core.g_SettingsTable["disabledmessage"]["value"]),255,255,255,true)
end
end

if(Core.g_SettingsTable["enableplayerstats"]["value"] == true) then
if(Core.g_bABEnabled) then
Core.g_UsageTable["time_disabled"] = Core.g_UsageTable["time_disabled"] + (getRealTime().timestamp - Core.g_LastCheck)
else
Core.g_UsageTable["time_enabled"] = Core.g_UsageTable["time_enabled"] + (getRealTime().timestamp - Core.g_LastCheck)
end

Core.g_LastCheck = getRealTime().timestamp
end

Preferences:updatePreferences()
triggerEvent("onAntiBounceToggled",Core.g_Root,Core.g_bABEnabled)
end
Expand Down Expand Up @@ -224,7 +194,7 @@ function Core:onDebugRender()
return
end

dxDrawText("== Anti-Bounce (v2.4.0) Debug ==", Core.g_ScreenW-conv(250), Core.g_ScreenH-conv(165), 0, 0,
dxDrawText("== Anti-Bounce (v2.5.0) Debug ==", Core.g_ScreenW-conv(250), Core.g_ScreenH-conv(165), 0, 0,
tocolor(255, 255, 255, 255), conv(1), "default","left","top",false,false,false,true)

if(Core.g_bABEnabled) then
Expand Down
3 changes: 1 addition & 2 deletions meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<meta>
<info author="Arezu and MegaDreams" name="Anti-Bounce" version="2.4.0" description="Anti-Bounce" type="misc" />
<info author="Arezu and MegaDreams" name="Anti-Bounce" version="2.5.0" description="Anti-Bounce" type="misc" />

<script src="c_core.lua" type="client" cache="false" />
<script src="c_preferences.lua" type="client" cache="false" />
Expand All @@ -8,7 +8,6 @@
<script src="s_core.lua" type="server" />
<script src="s_settings.lua" type="server" />
<script src="s_updater.lua" type="server" />
<script src="s_statistics.lua" type="server" />

<oop>true</oop>
</meta>
4 changes: 1 addition & 3 deletions s_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Core.g_Root = getRootElement()
Core.g_ThisResource = Resource:getThis()
Core.g_ResourceRoot = Core.g_ThisResource:getRootElement()

Core.VERSION = 240
Core.VERSION = 250

----------------------
-- Functions/Events
Expand All @@ -50,7 +50,5 @@ Core.VERSION = 240
function Core:onResourceStart()
Settings:loadSettings()
Updater:setup()

Statistics:setup()
end
addEventHandler("onResourceStart",Core.g_ResourceRoot,Core.onResourceStart)
33 changes: 7 additions & 26 deletions s_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,17 @@ Settings.g_SettingsTable = {
["enablestats"] = {
["value"] = true,
["value_type"] = 0,
["removed"] = true
},
["enablesettingstats"] = {
["value"] = true,
["value_type"] = 0,
["removed"] = true
},
["enableplayerstats"] = {
["value"] = true,
["value_type"] = 0,
["removed"] = true
},
}

Expand All @@ -152,6 +155,10 @@ function Settings:loadSettings()

if(Settings.g_SettingsTable[lNodeName] ~= nil) then
if(Settings.g_SettingsTable[lNodeName]["value"] ~= nil) then
if(Settings.g_SettingsTable[lNodeName]["removed"]) then
outputDebugString("[Anti-Bounce]: Setting '"..lNodeName.."' has been removed. Please remove it from your configuration.",0,58,133,214)
end

local lValue = lNode:getValue()

if(lValue ~= false and lValue ~= "") then
Expand Down Expand Up @@ -346,32 +353,6 @@ function Settings:createConfigurationFile()
Default: ]]..tostring(Settings.g_SettingsTable["updatechecktimer"]["value"])..[[
-->
<updatechecktimer>]]..tostring(Settings.g_SettingsTable["updatechecktimer"]["value"])..[[</updatechecktimer>
<!--
Allows various statistics to be send to our database. This allows us to get a good idea about the usage of the Anti-Bounce
and on what it runs. This allows us to improve the Anti-Bounce on the right moments. This information is sent anonymously
with the use of an unique ID we cannot link to any server at all.
true = enabled, false = disabled, Default: ]]..tostring(Settings.g_SettingsTable["enablestats"]["value"])..[[
-->
<enablestats>]]..tostring(Settings.g_SettingsTable["enablestats"]["value"])..[[</enablestats>
<!--
When enabled this allows some of your settings to be sent when collecting statistics.
true = enabled, false = disabled, Default: ]]..tostring(Settings.g_SettingsTable["enablesettingstats"]["value"])..[[
-->
<enablesettingstats>]]..tostring(Settings.g_SettingsTable["enablesettingstats"]["value"])..[[</enablesettingstats>
<!--
When enabled this allows some data of the usage of the Anti-Bounce to be sent when collecting statistics.
This one is the most important one when it comes to giving us an idea on how to improve our script.
This information is sent anonymously with the usage of an unique ID instead of an IP or serial. We cannot
trace this unique ID back to the player him or herself.
true = enabled, false = disabled, Default: ]]..tostring(Settings.g_SettingsTable["enableplayerstats"]["value"])..[[
-->
<enableplayerstats>]]..tostring(Settings.g_SettingsTable["enableplayerstats"]["value"])..[[</enableplayerstats>
</config>]])

lConfigFile:close()
Expand Down
187 changes: 0 additions & 187 deletions s_statistics.lua

This file was deleted.

0 comments on commit 667402b

Please sign in to comment.