Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 10 11 12 13 14 … 18 Next »
Spawning from the shared area
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pages (2): 1 2 Next »
Threaded Mode
Spawning from the shared area
08-11-2015, 03:11 PM,
#1
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
Spawning from the shared area
I've added a new feature for Starfall which lets you spawn a chip using code directly from the shared area (i.e. no uploading involved). To load a shared file onto your tool, right click it and choose "Load to Tool":
   

Then, pressing use and primary fire will spawn a chip/screen/HUD/emitter using the selected file as its mainfile, and all included files directly from the shared area.

Alongside this, is a new shared area permission type, execute permissions. Anyone granted execute permissions to a file can spawn them from the shared area, but cannot read the source code. Granting these permissions works the same way as the existing read/write.
   
Note that you only need to grant execute permissions for the main file of your code. Includes will be loaded regardless of whether the player has access to them or not.

Strict mode
Note however, that because players are unable to view the source code, code run from the shared area in this way runs in a more secure mode. In this mode, certain actions (such as spawning/removing entities and changing the owner's position) are locked behind user-granted permission rights. Note that chips spawned from the source code do not run in this mode, only those run from the shared area directly that you are not the author of.

Permission control
To grant/revoke these rights, there's a new tab under the shield button at the top right of the editor window.
   

In this tab, a list of current players and entities are available.
   
You can see a list of possible rights that can be granted to the entity/player. For the moment, only server-side permissions exist. In the future there may be client-side permissions too.

Granting rights
Granting rights under your player entry grants them for every chip you spawn. Granting for a specific chip grants it only to that entity. Rights granted to your player are saved, while those granted to entities are only valid for the entity's life, and are not connected to the code on it.

Requesting rights
If you are making a chip, then in order to be granted rights to perform actions, you must first register which rights you need. This is accomplished using the "permissions" library.
-- Register the need for the SPAWN_ENTITY permission.
permissions.register( permissions.SPAWN_ENTITY )
If you do not register access, you cannot be granted it, and the button to grant in the permissions control tab will be disabled.

To check if you have been granted access, do the following:
if permissions.canPerformAction( permissions.SPAWN_ENTITY ) then
-- Spawn props
end
If you attempt to perform an action without permission, then generally the action will silently fail. For example, attempting to spawn a prop without permission will just return nil. You should always check for permission to avoid confusion.
Find
Reply
08-11-2015, 03:32 PM,
#2
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: Spawning from the shared area
Nice, though I'd suggest a permission for channels usage to prevent people adding 'hidden' backdoors.

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
08-11-2015, 03:43 PM,
#3
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Spawning from the shared area
(08-11-2015, 03:32 PM)T-17 Wrote: Nice, though I'd suggest a permission for channels usage to prevent people adding 'hidden' backdoors.
Backdoors can be added regardless of channels or not. You could happily include commands that run for the author that change everything without needing a channel.

The only things that need permissions are the actual actions these "backdoors" would perform. If you can think of anything that's potentially bad that's not spawning/removing entities or setting the player's position, then I can add rights for those.
Find
Reply
08-11-2015, 04:04 PM,
#4
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: Spawning from the shared area
True, at the moment I can only think of printColor() because of impersonation.
Most of the possible exploits i come up with require wirelinks to function but requiring permission for that is pointless given that's what almost all chips use.

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
08-11-2015, 04:35 PM,
#5
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Spawning from the shared area
I'll just add an "<SF>" tag to the front of printColor output, rather than a permission.
Find
Reply
08-11-2015, 04:51 PM,
#6
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: Spawning from the shared area
Cool new feature, gonna try that when i am on next. But one thing that should be blocked is the error() because you could crash a chip on purpose.
Find
Reply
08-11-2015, 05:14 PM,
#7
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Spawning from the shared area
I don't think the chip "crashing" because of the error function is really a bad thing. It's more about actions that are not easily reversible and can affect things outside the chip, rather than just randomly shutting the chip off.
Find
Reply
08-11-2015, 05:14 PM,
#8
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: Spawning from the shared area
well you couldn't crash another chip with it

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
09-11-2015, 03:11 PM,
#9
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: Spawning from the shared area
Just had an idea, is it possible to add people to the white/black list via Steam ID?

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
09-11-2015, 07:02 PM,
#10
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Spawning from the shared area
There's no way to do it through the UI at the moment. I'll add a way when I get the chance.
Find
Reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.