Metastruct / issues

All the issues.
2 stars 0 forks source link

Game coordinator #125

Open Python1320 opened 8 years ago

Python1320 commented 8 years ago

Who wants to make?

Requirements

Whitelist system

...unless allowed specifically

This is required for rp area, dm area, jumpgame, falling platforms, dond, tremble, etc minigames we have.

ghost commented 8 years ago

i'd totally make one because unlike what some people think i have experience with glua (no, this is not me being a narcissitic know-it-all prick)

notcake commented 8 years ago

u spelt narcissistic wrong

ghost commented 8 years ago

good catch :+1:

notcake commented 8 years ago

u spelt "I can't spell" wrong

ghost commented 8 years ago

you spelled "you" and "spelled" wrong i don't care if you can say "spelt", fuck it we'll do it live

notcake commented 8 years ago

im spelling wrong intentionally unlike u

Cynosphere commented 8 years ago

I'll take the risk

notcake commented 8 years ago

Flex will make Metastruct great again. :+1:

ghost commented 8 years ago

oh no non-devs cant have a dream ;~;

Cynosphere commented 8 years ago

edunad commented 8 years ago

MInigames i made use a function to disable all this shizzle stuff (some of them don't work anymore tough). ` function plymeta:RestrainPlayer()

    if self:GetNWBool("RestrictedMg") then return end

    self:Spawn()

    self:SetNWBool("RestrictedMg",true)

    self:ShouldDropWeapon( false )
    self:StripWeapons()
    self:Give("hands")

    self:ExitVehicle()
    self:GodDisable()

    self:ConCommand("pac_enable 0")
    self:ConCommand("playx_enabled 0")
    self:SetSolid(2)

    self.OldPACSize = self:GetModelScale()
    self.OldModel = self:GetModel()

    pac.SetPlayerSize(self,1) // Reset pac size
    pac.SetPlayerModel(self,BeatWar.PlayerModels[math.random(1,#BeatWar.PlayerModels)]) 

    self:SetNWInt("pac_size",self.OldPACSize)
    self:SetColor(Color(255,255,255,255))

    self:SprintDisable()

    self.BoostCD = 0

    self:ExitVehicle()

    // Disable Thirdperson
    self:SendLua([[ctp:Disable()]])

    self:Freeze(true)

    self:ConCommand("r_cleardecals")
    self:SetMoveType(MOVETYPE_WALK)

    self:SetAllowNoclip(false, Tag)
    self:SetAllowBuild(false, Tag)
    self:SetSuperJumpMultiplier(0,false) // Anti-bhop

    self.canWATT = false
    self.nossjump = true
    self.noleap = true
    self.last_rip = 99999999
    self.double_jump_allowed = false
    self.DisableSit = true

    self:SetHealth(100)

    self:StripAmmo()

    Watt.Enabled = false

    self:SetWalkSpeed(400)
    self:SetRunSpeed(400)
    self:SetJumpPower(0)
    self:CrosshairDisable()
    self:SetPointMult(1)
end

`

And

` function plymeta:ReleasePlayer()

    if !self:GetNWBool("RestrictedMg") then return end

    self:SetNWBool("RestrictedMg",false)

    self:SetAllowNoclip(true, Tag)
    self:SetAllowBuild(true, Tag)

    self:SetSuperJumpMultiplier(1.5,false)
    self:SetWalkSpeed(200)
    self:SetRunSpeed(400)
    self:SetJumpPower(200)
    self:CrosshairEnable()

    self.nossjump = false
    self.noleap = false
    self.DisableSit = false

    self:SprintEnable()

    local Oldsize = self.OldPACSize or 1
    pac.SetPlayerSize(self,Oldsize) // Reset pac size
    self.pac_player_size = Oldsize
    self.double_jump_allowed = true

    self.last_rip = CurTime()

    self:ShouldDropWeapon( false )
    self:StripWeapons()

    hook.Call("PlayerLoadout",self)

    self:ConCommand("pac_enable 1")
    self:ConCommand("playx_enabled 1")

    Watt.Enabled = true

    local OldModel = self.OldModel or ""

    if OldModel != "" then
        pac.SetPlayerModel(self,self.OldModel) 
    end
end

`

Hooks : ` hook.Add("NetData",Tag,function(pl,name,io)

        if !BeatWar.IsPlaying then return end

        if IsValid(pl) and pl:IsPlayer() then
            if pl:IsPlaying()  then
                if name == "boxify" or name == "propify" or name == "coh" or name == "NameT" then return false end
            end
        end
    end)

    hook.Add("PrePACConfigApply", Tag, function(ply, outfit_data)
        if ply:IsPlaying() then
            return false, "No PAC Allowed"
        end
    end)

    hook.Add("CanPlayerSuicide",Tag,function(ply)
        if ply:IsPlaying() then
            return false
        end
    end)

    hook.Add("PlayerShouldTakeDamage",Tag,function(ply,attacker)
        if ply:IsPlaying() then
            return false
        end
    end)

    hook.Add( "PlayerShouldTaunt", Tag, function( ply )
        if ply:IsPlaying() then
            return false
        end
    end )

    hook.Add("PlayerCanPickupItem",Tag,function(ply,item)
        if ply:IsPlaying() then
            return false
        end
    end) 

    hook.Add("PlayerCanPickupWeapon",Tag,function(ply,wep)
        if ply:IsPlaying() then
            return false
        end
    end)

    hook.Add("CanDropWeapon",Tag,function(ply)
        if IsValid(ply) and ply:IsPlayer() then
            if ply:IsPlaying() then
                return false
            end
        end
    end)

    hook.Add("CanPlyTeleport",Tag,function(ply)
        if IsValid(ply) and ply:IsPlayer() then
            if ply:IsPlaying() then
                return false,"Teleport Disabled on "..Tag
            end
        end
    end)

    hook.Add("CanPlyGotoLocations",Tag,function(ply)
        if IsValid(ply) and ply:IsPlayer() then
            if ply:IsPlaying() then
                return false,"Goto Disabled on "..Tag
            end
        end
    end)

    hook.Add("CanPlyGotoPly",Tag,function(ply,ent)
        if IsValid(ply) and ply:IsPlayer() then
            if ply:IsPlaying() then
                return false,"Goto Disabled on ".. Tag
            end
        end
    end)

`

Note : ply:IsPlaying() is custom made, and the code tags seem to hate me. And you can probably add something to check the self:ConCommand("pac_enable 1") self:ConCommand("playx_enabled 1")

danielga commented 8 years ago

A warning has been issued because of shitposting. Please refrain from continuing the shitposting.

PotcFdk commented 8 years ago

I just realized that I have an unfinished WIP MetaWorks module (called NodeCapabilityManager) that would have done exactly this, in a generalized way (i.e. "node" is not just players but can also include "things" of other types, such as scripts, achievements, servers, files, ...; also, each "capability context" can specify its own "context descriptor" that includes "director levels" that the "directors" (i.e. registered nodes that have a special flag that permits them to impose rules on the capability context) will be able to use - this would be used when handling things in case there are conflicting rules)... but limited to just the MetaWorks context. Extending it to... everything... is not hard at all, you'd just have to add a new gamemode-wide context and write an apposite context descriptor. So, if nothing else happens, consider this a fallback. :information_desk_person: (Assuming, of course, I ever find the time and motivation to finish this.)

PotcFdk commented 5 years ago

Sounds like we've been considering various variants of permission management and anyone who ever worked on it gave up after some time. Thought I'd update this issue with the little piece of information that, if I'm understanding it correctly, @Earu is working on an LDAP-based system. Go, go, it's your issue now, until you give up.

Earu commented 5 years ago

@PotcFdk I will need your insight on security-wise things, for example regarding authenticating via SSO or other providers. I also think @Lixquid was ok to help with that? (For reference: https://gitlab.com/metastruct/restrictions)

cdr1996 commented 2 years ago

This would still be helpful, I've tried to make minigames before and repeatedly needed to add the same hooks over and over. If we had something that made this easier, it would be fantastic. Going to keep this open as I'd like to see this implemented despite being an old issue, and I might attempt this myself, not making any promises though.

cdr1996 commented 1 year ago

This is probably one of the biggest things we should work on out of all the current posted issues. Would be nice to see the newer developers contribute towards this if they are willing.

Python1320 commented 5 months ago

Meta now has reservation system to prevent overlapping activities, used by !knife and others. Also CFC has something like events now: https://github.com/CFC-Servers/gef/blob/main/lua/autorun/gef_loader.lua