mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
fix: remove log tempoary
This commit is contained in:
parent
2bdf0383dd
commit
75001c3ddc
|
@ -2,7 +2,7 @@
|
||||||
// Methods
|
// Methods
|
||||||
//
|
//
|
||||||
|
|
||||||
hook.Add("gmInte:PlayerReady", "gmInte:Player:Ready", function(ply)
|
function gmInte.playerReady(ply)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
|
|
||||||
// Initialize Time
|
// Initialize Time
|
||||||
|
@ -11,13 +11,6 @@ hook.Add("gmInte:PlayerReady", "gmInte:Player:Ready", function(ply)
|
||||||
// Send Public Config
|
// Send Public Config
|
||||||
gmInte.publicGetConfig(ply)
|
gmInte.publicGetConfig(ply)
|
||||||
|
|
||||||
// Send Player Ready
|
|
||||||
gmInte.playerReady(ply)
|
|
||||||
end)
|
|
||||||
|
|
||||||
function gmInte.playerReady(ply)
|
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
|
||||||
|
|
||||||
gmInte.http.post("/players/" .. ply:SteamID64() .. "/ready", {
|
gmInte.http.post("/players/" .. ply:SteamID64() .. "/ready", {
|
||||||
["player"] = gmInte.getPlayerFormat(ply)
|
["player"] = gmInte.getPlayerFormat(ply)
|
||||||
})
|
})
|
||||||
|
@ -38,98 +31,102 @@ function gmInte.playerDisconnected(ply)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
function gmInte.playerSpawn(ply)
|
-- function gmInte.playerSpawn(ply)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
-- if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
|
|
||||||
gmInte.http.post("/players/" .. ply:SteamID64() .. "/spawn",
|
-- gmInte.http.post("/players/" .. ply:SteamID64() .. "/spawn",
|
||||||
{
|
-- {
|
||||||
["player"] = gmInte.getPlayerFormat(ply)
|
-- ["player"] = gmInte.getPlayerFormat(ply)
|
||||||
}
|
-- }
|
||||||
)
|
-- )
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function gmInte.postLogPlayerDeath(ply, inflictor, attacker)
|
-- function gmInte.postLogPlayerDeath(ply, inflictor, attacker)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
-- if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
if (!attacker:IsValid() || !attacker:IsPlayer(attacker)) then return end
|
-- if (!attacker:IsValid() || !attacker:IsPlayer(attacker)) then return end
|
||||||
if (!inflictor:IsValid()) then return end
|
-- if (!inflictor:IsValid()) then return end
|
||||||
|
|
||||||
gmInte.http.post("/logs/playerDeath",
|
-- gmInte.http.post("/logs/playerDeath",
|
||||||
{
|
-- {
|
||||||
["player"] = gmInte.getPlayerFormat(ply),
|
-- ["player"] = gmInte.getPlayerFormat(ply),
|
||||||
["inflictor"] = gmInte.getEntityFormat(inflictor),
|
-- ["inflictor"] = gmInte.getEntityFormat(inflictor),
|
||||||
["attacker"] = gmInte.getPlayerFormat(attacker)
|
-- ["attacker"] = gmInte.getPlayerFormat(attacker)
|
||||||
}
|
-- }
|
||||||
)
|
-- )
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function gmInte.postLogPlayerInitialSpawn(ply)
|
-- function gmInte.postLogPlayerInitialSpawn(ply)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
-- if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
|
|
||||||
gmInte.http.post("/logs/playerInitialSpawn",
|
-- gmInte.http.post("/logs/playerInitialSpawn",
|
||||||
{
|
-- {
|
||||||
["ply"] = gmInte.getPlayerFormat(ply)
|
-- ["ply"] = gmInte.getPlayerFormat(ply)
|
||||||
}
|
-- }
|
||||||
)
|
-- )
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function gmInte.postLogPlayerHurt(ply, attacker, healthRemaining, damageTaken)
|
-- function gmInte.postLogPlayerHurt(ply, attacker, healthRemaining, damageTaken)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
-- if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
if (!attacker:IsValid() || !attacker:IsPlayer(attacker)) then return end
|
-- if (!attacker:IsValid() || !attacker:IsPlayer(attacker)) then return end
|
||||||
|
|
||||||
// Wait a second to see if the player is going to be hurt again
|
-- // Wait a second to see if the player is going to be hurt again
|
||||||
ply.gmodInteLastHurt = ply.gmodInteLastHurt || {}
|
-- ply.gmodInteLastHurt = ply.gmodInteLastHurt || {}
|
||||||
local locCurTime = CurTime()
|
-- local locCurTime = CurTime()
|
||||||
ply.gmodInteLastHurt[attacker:SteamID64()] = locCurTime
|
-- ply.gmodInteLastHurt[attacker:SteamID64()] = locCurTime
|
||||||
|
|
||||||
timer.Simple(1, function()
|
-- timer.Simple(1, function()
|
||||||
if (ply.gmodInteLastHurt[attacker:SteamID64()] != locCurTime) then
|
-- if (ply.gmodInteLastHurt[attacker:SteamID64()] != locCurTime) then
|
||||||
ply.gmodInteTotalDamage = ply.gmodInteTotalDamage || 0
|
-- ply.gmodInteTotalDamage = ply.gmodInteTotalDamage || 0
|
||||||
ply.gmodInteTotalDamage = ply.gmodInteTotalDamage + damageTaken
|
-- ply.gmodInteTotalDamage = ply.gmodInteTotalDamage + damageTaken
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
|
|
||||||
gmInte.http.post("/logs/playerHurt",
|
-- gmInte.http.post("/logs/playerHurt",
|
||||||
{
|
-- {
|
||||||
["victim"] = gmInte.getPlayerFormat(ply),
|
-- ["victim"] = gmInte.getPlayerFormat(ply),
|
||||||
["attacker"] = gmInte.getPlayerFormat(attacker),
|
-- ["attacker"] = gmInte.getPlayerFormat(attacker),
|
||||||
["healthRemaining"] = healthRemaining,
|
-- ["healthRemaining"] = healthRemaining,
|
||||||
["damageTaken"] = ply.gmodInteTotalDamage
|
-- ["damageTaken"] = ply.gmodInteTotalDamage
|
||||||
}
|
-- }
|
||||||
)
|
-- )
|
||||||
end)
|
-- end)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function gmInte.postLogPlayerSpawnedSomething(object, ply, ent, model)
|
-- function gmInte.postLogPlayerSpawnedSomething(object, ply, ent, model)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
-- if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
if (!ent:IsValid()) then return end
|
-- if (!ent:IsValid()) then return end
|
||||||
|
|
||||||
gmInte.http.post("/logs/playerSpawnedSomething",
|
-- gmInte.http.post("/logs/playerSpawnedSomething",
|
||||||
{
|
-- {
|
||||||
["object"] = object,
|
-- ["object"] = object,
|
||||||
["player"] = gmInte.getPlayerFormat(ply),
|
-- ["player"] = gmInte.getPlayerFormat(ply),
|
||||||
["entity"] = gmInte.getEntityFormat(ent),
|
-- ["entity"] = gmInte.getEntityFormat(ent),
|
||||||
["model"] = model || ""
|
-- ["model"] = model || ""
|
||||||
}
|
-- }
|
||||||
)
|
-- )
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function gmInte.postLogPlayerGivet(ply, class, swep)
|
-- function gmInte.postLogPlayerGivet(ply, class, swep)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
-- if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
|
|
||||||
gmInte.http.post("/logs/playerGive",
|
-- gmInte.http.post("/logs/playerGive",
|
||||||
{
|
-- {
|
||||||
["player"] = gmInte.getPlayerFormat(ply),
|
-- ["player"] = gmInte.getPlayerFormat(ply),
|
||||||
["class"] = class,
|
-- ["class"] = class,
|
||||||
["swep"] = swep
|
-- ["swep"] = swep
|
||||||
}
|
-- }
|
||||||
)
|
-- )
|
||||||
end
|
-- end
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Hooks
|
// Hooks
|
||||||
//
|
//
|
||||||
|
|
||||||
|
hook.Add("gmInte:PlayerReady", "gmInte:Player:Ready", function(ply)
|
||||||
|
gmInte.playerReady(ply)
|
||||||
|
end)
|
||||||
|
|
||||||
hook.Add("ShutDown", "gmInte:Server:Shutdown:SavePlayers", function()
|
hook.Add("ShutDown", "gmInte:Server:Shutdown:SavePlayers", function()
|
||||||
for ply, ply in pairs(player.GetAll()) do
|
for ply, ply in pairs(player.GetAll()) do
|
||||||
gmInte.playerDisconnected(ply)
|
gmInte.playerDisconnected(ply)
|
||||||
|
@ -145,50 +142,50 @@ hook.Add("PlayerDisconnected", "gmInte:Player:Disconnect", function(ply)
|
||||||
gmInte.playerDisconnected(ply)
|
gmInte.playerDisconnected(ply)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
hook.Add("PlayerSpawn", "gmInte:Player:Spawn", function(ply)
|
-- hook.Add("PlayerSpawn", "gmInte:Player:Spawn", function(ply)
|
||||||
gmInte.playerSpawn(ply)
|
-- gmInte.playerSpawn(ply)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerInitialSpawn", "gmInte:Player:InitialSpawn", function(ply)
|
-- hook.Add("PlayerInitialSpawn", "gmInte:Player:InitialSpawn", function(ply)
|
||||||
gmInte.postLogPlayerInitialSpawn(ply)
|
-- gmInte.postLogPlayerInitialSpawn(ply)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerGiveSWEP", "gmInte:Player:SWEPs", function( ply, class, swep )
|
-- hook.Add("PlayerGiveSWEP", "gmInte:Player:SWEPs", function( ply, class, swep )
|
||||||
gmInte.postLogPlayerGivet(ply, class, swep)
|
-- gmInte.postLogPlayerGivet(ply, class, swep)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerDeath", "gmInte:Player:Death", function(ply, inflictor, attacker)
|
-- hook.Add("PlayerDeath", "gmInte:Player:Death", function(ply, inflictor, attacker)
|
||||||
gmInte.postLogPlayerDeath(ply, inflictor, attacker)
|
-- gmInte.postLogPlayerDeath(ply, inflictor, attacker)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerHurt", "gmInte:Player:Hurt", function(ply, attacker, healthRemaining, damageTaken)
|
-- hook.Add("PlayerHurt", "gmInte:Player:Hurt", function(ply, attacker, healthRemaining, damageTaken)
|
||||||
gmInte.postLogPlayerHurt(ply, attacker, healthRemaining, damageTaken)
|
-- gmInte.postLogPlayerHurt(ply, attacker, healthRemaining, damageTaken)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerSpawnedProp", "gmInte:Player:SpawnedProp", function(ply, model, ent)
|
-- hook.Add("PlayerSpawnedProp", "gmInte:Player:SpawnedProp", function(ply, model, ent)
|
||||||
gmInte.postLogPlayerSpawnedSomething("SENT", ply, ent, model)
|
-- gmInte.postLogPlayerSpawnedSomething("SENT", ply, ent, model)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerSpawnedSENT", "gmInte:Player:SpawnedSENT", function(ply, ent)
|
-- hook.Add("PlayerSpawnedSENT", "gmInte:Player:SpawnedSENT", function(ply, ent)
|
||||||
gmInte.postLogPlayerSpawnedSomething("SENT", ply, ent)
|
-- gmInte.postLogPlayerSpawnedSomething("SENT", ply, ent)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerSpawnedNPC", "gmInte:Player:SpawnedNPC", function(ply, ent)
|
-- hook.Add("PlayerSpawnedNPC", "gmInte:Player:SpawnedNPC", function(ply, ent)
|
||||||
gmInte.postLogPlayerSpawnedSomething("NPC", ply, ent)
|
-- gmInte.postLogPlayerSpawnedSomething("NPC", ply, ent)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerSpawnedVehicle", "gmInte:Player:SpawnedVehicle", function(ply, ent)
|
-- hook.Add("PlayerSpawnedVehicle", "gmInte:Player:SpawnedVehicle", function(ply, ent)
|
||||||
gmInte.postLogPlayerSpawnedSomething("Vehicle", ply, ent)
|
-- gmInte.postLogPlayerSpawnedSomething("Vehicle", ply, ent)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerSpawnedEffect", "gmInte:Player:SpawnedEffect", function(ply, model, ent)
|
-- hook.Add("PlayerSpawnedEffect", "gmInte:Player:SpawnedEffect", function(ply, model, ent)
|
||||||
gmInte.postLogPlayerSpawnedSomething("Effect", ply, ent, model)
|
-- gmInte.postLogPlayerSpawnedSomething("Effect", ply, ent, model)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerSpawnedRagdoll", "gmInte:Player:SpawnedRagdoll", function(ply, model, ent)
|
-- hook.Add("PlayerSpawnedRagdoll", "gmInte:Player:SpawnedRagdoll", function(ply, model, ent)
|
||||||
gmInte.postLogPlayerSpawnedSomething("Ragdoll", ply, ent, model)
|
-- gmInte.postLogPlayerSpawnedSomething("Ragdoll", ply, ent, model)
|
||||||
end)
|
-- end)
|
||||||
|
|
||||||
hook.Add("PlayerSpawnedSWEP", "gmInte:Player:SpawnedSWEP", function(ply, ent)
|
-- hook.Add("PlayerSpawnedSWEP", "gmInte:Player:SpawnedSWEP", function(ply, ent)
|
||||||
gmInte.postLogPlayerSpawnedSomething("SWEP", ply, ent)
|
-- gmInte.postLogPlayerSpawnedSomething("SWEP", ply, ent)
|
||||||
end)
|
-- end)
|
Loading…
Reference in New Issue
Block a user