wiremod / wire

Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.
http://www.wiremod.com
Apache License 2.0
554 stars 331 forks source link

[Suggestion] Make an EGP Hud Transmit to ALL Players (ADMIN ONLY) #268

Closed nexbr closed 11 years ago

nexbr commented 11 years ago

Hi Have an EGP + E2 Bank System, that shows on EGP Emiter, but i want develop more functionalities so i need use as a HUD, but for that happen i need have an EGP HUD that transmit to all Players on Server, and Of Course only Admin can use it.

I can make a LUA Addon to make a Hud and Transmit to all, but then is much much harder to do it.

So Please Add This Feature on Wiremod EGP Hud, I think will be Helpful to All of Us.

Divran commented 11 years ago

EGP Huds already transmit all data to all clients. The system is not very secure, and anyone can pretty easily hack into it using some clientside lua (Possibly even a simple console command, I don't remember exactly how it's done). It's not meant to be used with sensitive admin only data.

nexbr commented 11 years ago

How you remember how do it?

nexbr commented 11 years ago

Ok, its not secure to transmit to all players, but have how Set The Player that will receive the HUD?

Divran commented 11 years ago

what

nexbr commented 11 years ago
Divran commented 11 years ago

I'm not sure what it is you're asking... but you have the user press E on the EGP Hud entity.

nexbr commented 11 years ago

I don't want set Me, I want set another player to se my hud.

Divran commented 11 years ago

Anyone can press E on it

nexbr commented 11 years ago

But i don't want to people to press it, I Wanna create 1 EGP Hud For Each Player on the server and SET The Player on EGP using Wirelink or something like that.

nrlulz commented 11 years ago

I don't think what you're trying to do is really what EGP was made for and you should probably consider making a custom addon for such a thing.

nexbr commented 11 years ago

@nrlulz That is because the title is: [Suggestion]

Divran commented 11 years ago

Sigh.. We're not going to change the way EGP works just so you can use it for an admin mod. EGP was never made to be secure in any way and if you're using it to display sensitive data, you're doing it wrong.

nexbr commented 11 years ago

I'm Not Asking to CHANGE Wiremod, just adding a Suggestion, well you guys changed the E2 To give other players the E2 Code from other players, In my opinion that was Not Safe at All.

Divran commented 11 years ago

I'm Not Asking to CHANGE Wiremod, just adding a Suggestion

What?

well you guys changed the E2 To give other players the E2 Code from other players, In my opinion that was Not Safe at All.

Then you obviously don't know how that works. You can't use it to steal E2s from other people.

Xandaros commented 11 years ago

As far as I can see, he is not asking to allow for sensitive data to be transmitted. In theory that's already possible and it is unlikely anyone would sniff it. (Though not impossible)

What he wants is a way to to make an EGP HUD to display for every player on the server. Am I right, nexbr?

Here's why that is a bad idea: Wiremod does not have any admin-only functionality and we best keep it this way. (Apart from obvious admin functionality like setting limits and stuff) Allowing this for every player could be abused, though holograms can be abused in a similar manner. This is a tad more severe though, I think... (never used EGP...)

I have made a few admin-only extensions myself. I wouldn't want them to be included in the UWSVN, let alone the core repo, but they add some nice enhancements for people who know how to use it.

You can easily make those addons yourself, making an E2 extension is really quite easy. You only need to know basic lua. If you know E2 kinda well, you will manage. (E2 is no Lua, but programming languages tend to be very similar)

Side Note: Making a suggestion is effectively asking to change wiremod. Saying you're not asking to change wiremod but just making a suggestion is bull****, sorry.

nexbr commented 11 years ago

Yes, I Known E2 and EGP and LUA, well on Wire-Extras the Dup Teleporter is ADMIN Only.

The Data it not a"sensitive data", Its a EGP Hud E2 Bank, So its not that sensitive.

I Asked the Feature because it's Very Useful to make HUDs Like: Banks, Speedometers, Gas Engine, Spaceships, Submarines, Airplanes, and etc. The EGP HUD its Self, It's Already Great, I Use a long time ago, I just think adding a Wirelink with the Player to Set it will be great, anyway, you guys will not add this feature on the Wiremod or Wire-Extras anyway, But thanks for your Time. I'll try make this in Lua Addon then.

Divran commented 11 years ago

Looks like I misunderstood what it was you wanted. But if you want a way to show an egp hud for all players, then no, that's not going to be possible, either. That would make it super easy to make a blinder (just draw a black box over the entire screen and set the EGP hud to show for all players). A solution would be to make it admin only, which is what I think you are asking. Sorry, but the answer would still be no. Besides, if you're the host of the server, you can easily write your own small script that does what you ask.

local function useEGPHud( egp, ply )
    umsg.Start( "EGP_HUD_Use", ply )
        umsg.Entity( egp )
        umsg.Char( 1 )
    umsg.End()
end

local function unuseEGPHud( egp, ply )
    umsg.Start( "EGP_HUD_Use", ply )
        umsg.Entity( egp )
        umsg.Char( -1 )
    umsg.End()
end

These two functions will help you. The first one makes the specified EGP entity draw for the specified player. The second one stops the specified EGP entity from drawing for the player. They're the same as clicking Use on an EGP hud.

nexbr commented 11 years ago

Thanks @Divran that worked.

I did a Little addon:

e2function void entity:egpHUDSetPlayer(entity ply) if ply:IsValid() && this:IsValid() then umsg.Start( "EGP_HUD_Use", ply ) umsg.Entity( this ) umsg.Char( 1 ) umsg.End() elseif this:IsValid() then umsg.Start( "EGP_HUD_Use", nil ) umsg.Entity( this ) umsg.Char( -1 ) umsg.End() end end

And the E2:

@name Nexus HUD Test @persist [E2,EGP,O]:entity @persist [EGPw]:wirelink

E2 = entity() EGP = E2:isWeldedTo() EGPw = EGP:wirelink() O = owner()

if(duped() || dupefinished()){ reset() }

if(first()){ runOnTick(1) EGP:egpHudSetPlayer(O) EGPw:egpClear() EGPw:egpRoundedBox(1,vec2(200,200),vec2(200,200))
}

That is what i needed. I'll add this to my E2 Exts Pack. Thanks again.