Skip to content

Commit

Permalink
Several Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bleonheart committed Aug 30, 2024
1 parent 814c6c2 commit b1ff4d3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 78 deletions.
16 changes: 2 additions & 14 deletions lilia/gamemode/core/hooks/core/server.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local GM = GM or GAMEMODE

function GM:onCharCreated(client, character, data)
LiliaDeprecated("onCharCreated is deprecated. Use OnCharCreated for optimization purposes.")
hook.Run("OnCharCreated", client, character, data)
Expand Down Expand Up @@ -46,12 +45,6 @@ function GM:PlayerLoadedChar(client, character, lastChar)
end

character:setData("loginTime", os.time())
if lia.config.ServerWorkshopID ~= "" and not client:getLiliaData("workshopRequested") then
net.Start("RequestServerContent")
net.Send(client)
client:setLiliaData("workshopRequested", true)
end

hook.Run("PlayerLoadout", client)
end

Expand Down Expand Up @@ -93,6 +86,7 @@ function GM:PrePlayerLoadedChar(client)
client:ExitVehicle()
client:Freeze(false)
end

function GM:OnPickupMoney(client, moneyEntity)
if moneyEntity and moneyEntity:IsValid() then
local amount = moneyEntity:getAmount()
Expand Down Expand Up @@ -241,7 +235,7 @@ function GM:CanPlayerTakeItem(client, item)
return false
elseif IsValid(item.entity) then
local character = client:getChar()
if (item.entity.SteamID64 == client:SteamID() and item.entity.liaCharID ~= character:getID()) then
if item.entity.SteamID64 == client:SteamID() and item.entity.liaCharID ~= character:getID() then
client:notifyLocalized("playerCharBelonging")
return false
end
Expand Down Expand Up @@ -369,7 +363,6 @@ function GM:GetGameDescription()
return (lia.config.GamemodeName == "A Lilia Gamemode" and istable(SCHEMA)) and tostring(SCHEMA.name) or lia.config.GamemodeName
end


function GM:PlayerShouldTakeDamage(client)
return client:getChar() ~= nil
end
Expand Down Expand Up @@ -459,11 +452,6 @@ function GM:PlayerInitialSpawn(client)
hook.Run("PostPlayerInitialSpawn", client)
end

function GM:PostPlayerInitialSpawn(client)
net.Start("RequestLiliaContent")
net.Send(client)
end

function GM:PlayerLoadout(client)
local character = client:getChar()
if client.liaSkipLoadout then
Expand Down
2 changes: 0 additions & 2 deletions lilia/gamemode/core/libraries/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ lia.config = lia.config or {}
-- @field AdminConsoleNetworkLogs Specifies if the logging system should replicate to admins' consoles | **boolean**
-- @field TimeToEnterVehicle Time **[in seconds]** required to enter a vehicle | **integer**
-- @field CarEntryDelayEnabled Determines if the car entry delay is applicable | **boolean**.
-- @field ServerWorkshopID Determines the workshop collection for the server. This will enable a prompt asking you to download the collection. | **string**.
-- @field Notify Contains notification sound and volume settings | **table**.
-- @field Notify.Sound Notification sound file path | **string**.
-- @field Notify.Volume Notification volume | **integer**
Expand Down Expand Up @@ -83,7 +82,6 @@ if not ConfigWasInitialized then
AdminConsoleNetworkLogs = false,
TimeToEnterVehicle = 1,
CarEntryDelayEnabled = true,
ServerWorkshopID = "",
Notify = {"garrysmod/content_downloaded.wav", 50, 250},
}

Expand Down
60 changes: 0 additions & 60 deletions lilia/gamemode/core/netcalls/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,66 +94,6 @@ net.Receive("OptionsRequest", function()
end
end)

net.Receive("RequestServerContent", function()
local frame = vgui.Create("DFrame")
frame:SetTitle("Server Content is Missing")
frame:SetSize(400, 200)
frame:Center()
frame:MakePopup()
local label = vgui.Create("DLabel", frame)
label:SetTextColor(color_white)
label:SetText("You do not have the server content mounted.\n\nThis may result in certain features missing.\n\nWould you like to open the Workshop page for the server content?")
label:SizeToContents()
label:SetPos(20, 40)
local buttonYes = vgui.Create("DButton", frame)
buttonYes:SetText("Yes")
buttonYes:SetSize(100, 30)
buttonYes:SetPos(60, 130)
buttonYes.DoClick = function()
gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=" .. lia.config.ServerWorkshopID)
frame:Close()
end

local buttonNo = vgui.Create("DButton", frame)
buttonNo:SetText("No")
buttonNo:SetSize(100, 30)
buttonNo:SetPos(240, 130)
buttonNo.DoClick = function() frame:Close() end
end)

net.Receive("RequestLiliaContent", function()
local isMounted = false
for _, v in ipairs(engine.GetAddons()) do
if v.wsid == "2959728255" and v.mounted then isMounted = true end
end

if not isMounted then
local frame = vgui.Create("DFrame")
frame:SetTitle("Lilia Content is Missing")
frame:SetSize(400, 200)
frame:Center()
frame:MakePopup()
local label = vgui.Create("DLabel", frame)
label:SetTextColor(color_white)
label:SetText("You do not have the Lilia content mounted.\n\nThis may result in certain features missing.\n\nWould you like to open the Workshop page for the Lilia content?")
label:SizeToContents()
label:SetPos(20, 40)
local buttonYes = vgui.Create("DButton", frame)
buttonYes:SetText("Yes")
buttonYes:SetSize(100, 30)
buttonYes:SetPos(60, 130)
buttonYes.DoClick = function()
gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=2959728255")
frame:Close()
end

local buttonNo = vgui.Create("DButton", frame)
buttonNo:SetText("No")
buttonNo:SetSize(100, 30)
buttonNo:SetPos(240, 130)
buttonNo.DoClick = function() frame:Close() end
end
end)

net.Receive("StringRequest", function()
local id = net.ReadUInt(32)
Expand Down
2 changes: 0 additions & 2 deletions lilia/gamemode/core/netcalls/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ util.AddNetworkString("chatNotifyNet")
util.AddNetworkString("FlagList")
util.AddNetworkString("OpenVGUI")
util.AddNetworkString("OpenPage")
util.AddNetworkString("RequestLiliaContent")
util.AddNetworkString("RequestServerContent")
util.AddNetworkString("ModuleList")
util.AddNetworkString("ItemList")
util.AddNetworkString("PlayerList")
Expand Down

0 comments on commit b1ff4d3

Please sign in to comment.