#plugins-dev-chat
1 messages · Page 80 of 1

someone asked me to implement a blacklist on a plugin i was making so an rp server they didnt like couldnt use it
only, i eventually realized, with a few exceptions, all rp servers are exactly the same in terms of morality.
Blacklist? Isn’t it easier to just get a dev to make something similar or better? Unless it’s like some super complicated stuff 
i was making a basic custom item mod
he wanted me to make it so a server he didnt like was not allowed to use it
adding a blacklist to an open-source plugin? 

tbh both servers in this case were in a deficit of plugin devs lol
i held all the cards
also the second server likely wouldnt want my plugin anyway
yep
i never got around to open sourcing it tho
sobbing
making BlacklistLibrary.dll dependency that enables blacklist functionality for my plugins
That is diabolical
Imagine if you could pay for more 173 range
If it wasn't C#
it'd actually be worth it
but since it's C# and it takes 5 seconds to decompile your plugin

That requires you to know how to do it,and if you can, you develop your own plugin instead 
then write it in assembly and execute the assembly in C#
-# then they can just remove the executor
Still kinda dumb, if you make your plugin open source or public, don't try to add blacklists lol
Just use permissions and implement nrgating permissions.yml 
Lmao
Make a C# plugin call a Native dll
You can obfuscate the C# dll and the native with upx and VMP / Denuvo 
SCPSL LabApi Denuvo 💀
exactly why i found it dumb
but honestly like i said earlier, it would probably work enough to stop 99% of people from using your plugin
theyre not gonna know wtf happened and their dev either doesnt exist, doesnt care enough about the provided functionality, or will just make their own inhouse version
What happens with custom keycards in 914?
Nothing I believe
they dont change on processing
I believe
Hi! How can I get from FirearmItem which ammo I need to load that gun?
get the iprimaryammocontainer module
Thanks
np
Custom keycards are not registered in 914, you would need your custom impl for that
How do i get the players who are affeted by flash bang
🔥
FlashbangGrenade uses
Which calls
Patch onto ProcessPlayer right here ->
anyway thx
Or just latch onto UpdatedEffect and do Flashed
Depending on what you need it for
Would be pretty painless to check if a player becomes flashed
Wouldn't need a patch
@slate flumehere is a base hmmmmmmm,should i use Reflection?
yep
And you want to prevent flashbangs when they come from a teammate?
What's the ultimate goal
yea this is the last one i need to do
ok
And prevent the code from running
Something like
public static bool ProcessPlayerPrefix(ReferenceHub hub, FlashbangGrenade __instance)
{
if (__instance.PreviousOwner.Role.GetFaction() == hub.GetFaction()) return false;
return true;
}
Or actually
[HarmonyPrefix]
[HarmonyPatch(typeof(FlashbangGrenade), nameof(FlashbangGrenade.ProcessPlayer))]
public static bool ProcessPlayerPrefix(ReferenceHub hub, FlashbangGrenade __instance)
{
if (__instance.PreviousOwner.Role.GetFaction() == hub.GetFaction()) return false;
return true;
}```
Should work
@tepid sluice
oh thx
Of course!
i think this work perfectly
That's the hope
assassination
If you do not take the publicize route and want to be on the Reflection side:
Cache the GetMethod in a variable that is only reassign on constructing the class. Methods rarely change, so caching them instead of fetching is performance gain. Also make sure you have the correct flags for GetMethod, as it matters
(This is generally for reflection, not for this exact case)
okay,thx for remind
Publicize, makes your job easier
my favorite commit

Have you tried writing meaningful commit messages that reflect the change
i think i just forgot to name the pr

Relfect on your actions, dont touch dependencies
Yes you can
None
How can I create a grenade and set the fuse time for it and spawn it to a pos?
TimedGrenadeProjectile.SpawnActive(player.Position, ItemType.GrenadeHE, player, 0.1f);
Poor guy releases the grenade and instantly blows in their face
if only
thanks
Hiii chat :3
Hi
Use alias
no!
Haiiii
How are you doing!
hiii
Can you review axo change
and coding
Nice
yum
today i will eat a potato gateau
nice
sister was hungry
i love potatos
potatos are amazing
if you want to burry me and make me happy in the middle of a potato farm
xd
potatos are the best food ever
you can just even eat them raw
and they taste good
wtf
have you tried not getting food poisoning
I DON'T EAT THEM RAW
they are gonna taste
probably
e w
;(
i don't eat raw potatos
honestly if you give me just a plate of boiled potatos
you make me happy
just anything + potato and you make me happy
i love air + potato
XDDD
NAH im not joining nw's cult
i get paid more by the gov than working for nw
just staying home
you could get paid extra
No
"i get paid to be lazy"
because who else gets 3.3k for just going to uni
I mean no?
most likely what i will get paid are meds and 3.3k a year
then ur not getting paid just to be home 😭
Yes pratically yes
summer break
I don't need to work
or else lower money
the scholarship pays me more a month than a job
if i now go to work i would get paid 500 euros a month
so do your math is it worth it?
Then just get the fuck out of your country and all of their investments gone
7 days from 7 am to 9 pm

obv i will go away from this dog shit of a country
like everyone
i plan to do classes with italian & english
Move to Tahiti
If I wanted to get a random item from an IEnumerator should I just .ToArray().RandomItem()
Or should I .OrderBy(_ => rnd.Next()).First()
Or something else?
do you mean an IEnumerable
public static T GetRandomValue<T>(this IEnumerable<T> collection)
{
IList<T> list = collection as IList<T> ?? collection.ToList();
return list.Count == 0 ? default! : list[Random.Range(0, list.Count)];
}
benchmark it
i dont remember why i used list
So .ToArray().RandomItem() lol
Gotcha
where
uh
Cause that's built into some C# library
^
Skill issue
guess what
Chicken butt
you're probably better off with ToArray, but benchmark if you really need performance
Fuck
huh
extension methods
I wanted to create an overload for .RandomItem()
extension method
Won't work
why
It'll be recursive
what
?????
name it different
also if you call toarray
Hence why I'm upset
it'll call the array overload
^
You missed the point
I wanted to create an overload for it but I can't
yea ur pointing it to your own method
Yeah
public static T GetRandomValue<T>(this IEnumerable<T> collection) => collection.ToArray().RandomItem();
Which is why I said this
or this
you don't need to use the extension syntax
they're static methods after all
Yall small brains
public static T RandomItem<T>(this IEnumerable<T> enumerable)
{
return enumerable.ElementAt(Random.Range(0, enumerable.Count()));
}
HUGE
then you make nw use this 
Is this more performative?
You dont create a new array
so I guess?
Bet
unless its two billion one hundred forty-seven million four hundred eighty-three thousand six hundred forty-seven long
Is this a problem?
You can theoretically select a random value in a single iteration
Nope
but this is not an issue
it means ur looping multiple times
.Count() enumerates
yes
So like if I did Log(enumerable.Count()) and Log(enumerable.Sum()) that would be a multiple enumeration
are you buta
First because count.
Second because ElementAr
Replying to ThatGuy not david
mb
Ye it iterate 2 times, one for the length/count other because of elementAt
that's not in .net framework
Would boxing to an array and running that code take longer than two enumerations?
whar
thats
an array is a reference type
what i get from the game 
well
using game references and framework 4.8
// Type: System.Linq.Enumerable
// Assembly: System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly location: E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\System.Core.dll
// XML documentation location: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8.1\System.Core.xml
Just which is faster is the question
huh
benchmark it

I'll be honest
I've literally never benchmarked anything in C# a day in my life
do you need maximum performance
No but I'm curious
i forgor
casting my beloved
i opened secretapi for testing but references weren't the same
BenchmarkDotNet
very easy to use
you just gotta know what you're doing
Interesting
How does this work?
i've seen stupid benchmarks
I'm just eager to learn is all
switch expression
I wanna have good practices
Yeah but like
just like a switch statement but easier
checks for the first type
if not that type go to the next one
_ is the fallback
Interesting so it checks IEnumerable casting to 2 different types and runs different code depending on what cast is valid?
kinda
if (a is B b)
return b.shit;
if (a is C c)
return c.shit;
return a.evenMoreShit;
basically
Oh cool
So checking if IEnumerable is something would allow you to use that something to do stuff more performative than if you used the IEnumerable?
if(rat is Rat)
return rat.fat;
yes
That's so cool!

Download the song and the wallpaper for free on my website: https://www.thefatrat.com/
My new song "HONK" is OUT NOW: https://thefatrat.ffm.to/honk
Listen to "Unity" here: https://thefatrat.ffm.to/unity
💜 Subscribe for more FREE MUSIC: https://www.youtube.com/thefatrat
👉 Check out my socials: https://ffm.bio/thefatrat
🌎Support me in ...
how is this not Unity's theme song
or like
intro
Roblox tycoon
Roblox tycoon
😭
how we ended up from roblox tycoon to roblox being for dating
btw i wanna try getting 2k hours
im rn 1.7k
I was testing the language system
translation is so easy for both me and the translators
translators have a website
i just download and drop it
it works
I mean i could do it but i don't want to expose some stuff
and honestly i want alot of logs
for now we just have
Italian, French, Polish and Finnish
(french is done by me)

I mean if someone wants to translate hit me up in dms
lol
can you translate to british
lucid is typing...
Now not
ig
you can
but how would you translate "Loading..."?

Init'in
AHHAHAHAHAHAHA


I'm not British idks
After careful consideration, we ought to include lack of synchronisation at certain points in time...
uwu

uwuify

it should be Release Me!
im having so much fun
it didn't replace Ls
you can just string::Replace for UwUlang
This is so cool
I stole it
What's funny is
Iirc I also stole that gif from you lmao
I've gone full degenerate
https://ratcentral.is-a-good.site/🐀/egt62nio.png
in fortnite terms
this is on exiled 
since when
0_0
they do .ToArray() always no ?
i stole it too
They removed it
fart night
public static T GetRandomValue<T>(this IEnumerable<T> enumerable)
{
if (enumerable is null)
return default;
T[] array = enumerable.ToArray();
return array.Length == 0 ? default : array[Random.Range(0, array.Length)];
}
and the first thing she sees is me
yes
can i just

zero...
what?
you can just copy the text
Ok
instead of making a 10000 line long embed

i dont think theyre capable
my bad
Im capable
like how poly
sob

decent
if you join a server would you understand?
yes
replace hub with elosztó
I mean i wasn't planning to put hungarian
and there's no plural
crazy
i've just put plural for languages like Italian, French and english that have Seconds and Second
then delete it 
chatgpt is a lot better than google translate
i might outsource some translation for some harder languages to find
95% maybe
there are some weird feels in places
with internal people
Everything is better than google translate xd
I mean as of rn having some more languages wouldn't suck
except my classmate 
We have femboy language, baugette language, pasta language and Alcholics language (Finnish)
i mean polish is the best way to describe it
WAIT WAIT
?
hungarian is the alcoholic(s)(') language
Honestly
Nah
like bars where full asf
every night
Someone knows how the region sent by central server
can't you just
add a setting for that
and add a hint to show how to change the language
or text objects
Filthy Europeans
I speak American, thank you very much 
I bleed red, white, and blue 🫡 🛻 🍻 🦅 🇺🇸
french?

Lmao
Me when i visit a Hungarian government website

no permission
No shit
pszaf.hu feels like someone smashed their keyboard
I trying to be against this group that controls what games is available on platforms
isnt that all languages
And this would be the official way
No i want to make when you join it sends you a broadcast in your language if supported saying yo do .language and you will change into that language
Imagine catering to non-English speakers
I hate inclusivity
I mean im the first one
But i know how to speak
it would be interesting to see a non-english speaker see join an english server (not impossible)
at this point you can just send a broadcast in all languages
Yea but it would be amazing
i'm not sure if you can use aut data/IP for that
northwood answer
I mean i will not save it
And nw provides me with it
I just don’t save it so everytime you join you need to apply it
Ig but idk if thats allowed for dnt
yeah
why would region be allowed then
Non dnt automatic
Thats sent by nw

Im just saying its used for geoblock so ig it makes sense i cannot use it for that
8.2. IP addresses of players, the secret part of the authentication token, and the preauthentication
token, must be treated as confidential data and never be disclosed publicly.
Ok then yea
i guess you can geolocate with that
Its such a unique problem
better ask security to make sure
Yea most likely i will
Or else far easier
A message just sent the first time you join “you can change your language if you want”

Or everytime you join
Idk
Its such a unique concept on sl
That i’ve never seen it
i wonder if texttoy can render flags properly
They can
But the problem are alot
I just prefer having a command
Or straight up something in SSSS
why when I try ReferenceHub.aspectRatioSync._savedHeight I get an error that I cannot accsess this value?
show error
unsafe code
calculations
no clue
why the fuck is YScreenEdge static?
Ask nw
@NW help :(
prob a client thing
omfg
Nw please give us hl3
Where do you even take this code from
aspectratiosync
[2025-07-24 15:43:02.968 +02:00] [ERROR] [Exiled.Events] Method "OnVerified" of the class "FunctionalServerSystem.Modules.PointsShow.EventHandler" caused an exception when handling the event "Exiled.Events.Features.Event`1[[Exiled.Events.EventArgs.Player.VerifiedEventArgs, Exiled.Events, Version=9.6.1.0, Culture=neutral, PublicKeyToken=null]]"
System.FieldAccessException: Field `AspectRatioSync:_savedHeight' is inaccessible from method `FunctionalServerSystem.Modules.PointsShow.EventHandler:OnVerified (Exiled.Events.EventArgs.Player.VerifiedEventArgs)'
at Exiled.Events.Features.Event`1[T].InvokeNormal (T arg) [0x00028] in <0bb51ea693474e0b9e0e3cc40480a7c1>:0
u didnt enable unsafe code
exiled
time to do this shit then
did you know
Uninstall exiled
that _savedWidth and _savedHeight aren't know by the server
🤯🤯
oh yeah that too
"aspect ratio sync"
i wonder what that does
sends the exact width & height
nuh uh
100% understand this
guys!!!!!!!!!!!!!!
[2025-07-24 15:46:25.507 +02:00] [INFO] [FunctionalServerSystem] _savedHeight 0
you wouldn't believe it
yeah
now what will you do with 0
nothing it's useless
the more you know
the aspect ratio gives you float like 1.777777778 meaning 16:9, but how the fuck do I get that
AspectRatio property is synced to the server
but it's useless
y can't be larger than x
y don't you support shoutube shorts resolution
yes i spelled it shoutube
you multiply the aspect ratio by the width to get the height
1KB ram
So no mobile sl????
So sad
YOu want SL to run on phone?
that's interesting game theory lemme try it
yes
crazy
Sl cannot run even on my pc
Imagine on a fucking phone
I still laugh
My pc can run cyberpunk, doom dark ages at 180 fps 1080 raytracing but not sl
Maybe if we had budget in millions
SL is heavy on CPU
maybe if it wasn't unity
tell hubert to sell SL to microsoft trust
Maybe if someone knew how to code vulkan on how to not crash your game

Please explode
Yes
But genshin is optimized
That game still exists?
Sadly yes
crazy
Honestly sell sl to some chinese company
💀
Wait sl is in china
yea
Does sl send data to the chinese government
david r u ready to become french
what the fuck are you yapping
it does
Does sl without wifi be able to connect to the chinese servers
Does sl scan my eyes?
I think your going crazy
Crazy you aren’t getting it
no
david is also chineese!
based
Is hubert chinese?
near china trust 

dont look at me like that
Smartest USA senator
Man Ive seen videos them talking about guns too
they are old and clueless
if i pull the trigger, will the gun fire?
no that is the sticker forever forgotten on Exiled's discord
(i added this to exiled)
ofc u did 
Is Eve a femboy?
i hope not
jobophobic
Kinda phobophobic
wat
it doesn't fade out entirely
so after 10 units it's still audible until like 500 units if you use the default logarithmic curve
SL culls speakers but unity doesn't do that natively
but i want the sound to disappear after 10 units
yet it DOESN'T
ah
it's like the one curve that goes infinitely lower, but never touching the other one
Interesting
I'm reading the 106 code rn
If you know off-hand, how are tier flags used?
Like what do they affect for disarming and pocket dimension?
You cant disarm someone while they are holding rare or more item
and the more rare the item is
the more likely it is to get out of pocket dimension
Not me manually assigning rarity to all items literally yesterday
. o 0 (
)
Yeah well
The rarity system is weird
COM-18 is on the same level as FR-MG-0 and SCP-127
Literally haha
I'm gonna have to do my own system as well for a feature some players are asking for
I wanted to see what was available in the code
Is the zombie attack not a UNIVERSAL damage handler?
its Scp049DamageHandler
or smth
it uses AttackType.Scp0492
^
Soooo guys
I learned
If you have PlayerHurting and then say ev.IsAllowed = false; and then hit the overcharge button, 079 doesn't die
💀
me when not letting 079 die
me when 079 just takes damage
That's probably why
yea
just check if damagehandler is RecontainmentDamageHandler
or the death translation is Recontained
ig should be easier
But then I'd have to do that in EVERY OnPlayerHurting
I could just patch it
Bro why
Modules?
So much shit
It's mostly custom item stuff
I do too
so do events that are virtual method
I do
🧠
😁
SKILL ISSUE
I have like 50 custom items
Only like 15 of them modify onplayerhurting
And they all do different clauses and things
and the internal check and then calls the virtual
I have no reason to put it in the abstract class
...
OnPlayerHurting is used by less than half of my items
But
exiled is mildly pissing me off Zer0
Putting it in the abstract class does nothing for me
uninstall then
Because majoritarily they all do different shit
i cant
Some of them increase damage, some do crazy shit, some heal
uninstall it
@celest thorn There is no point in abstracting that
do like everyone else here
The only common denominator is the initial check
i would say make a common stuff and just check if they have like IDamageMultiplier
Port it
that already simpliefies it
i cant just rewrite 102 hours of code from the past week to be strictly labapi
Wdym
you could
you create an interface
LUCID
Not with that attitude!!
its custom roles specifically that piss me off
and do in your plugin a check for that
Hi Eve
TryGet returns none
when damage is done
oh hi lucid lol
it is ur favorite eve
fr it took me 2 hours to migrate everything
For like four custom items out of dozens?
probably
That's so much extra work
For what
You're telling me to cram 15 quadrillion things into my abstract class for a small subset of items
what
That's dumb
not sure how you can port something that uses exiled custom roles, seems like alot of work
does labapi come with its own custom roles system?
no
nah
No
I don't know any others...
okay lol
you just gotta make ur own
NOOO
see im ur favorite
not too difficult to start w exiled as a base
i mean thats what i did for my own
This is essentially my whole point @celest thorn
Yeah :D
and now here i am rewriting it after ages to be not stinky
;D
It's extra bloat that's unnecessary and removes like 1 line from 4 modules
let me take as an example sl
It doesn't matter that it's easy
if you make it
It matters that it's unnecessary
i just need exiled ppl to fix
CustomRole.TryGet(player, out var CustomRoles)
then im good
fix it urself 
For the 2 extra items I make bro?
I'm not a game dev
I'm a plugin dev
This is one small server
I don't need to make everything scalable
This plugin is private
that doesn't mean
you shouldn't
future you will thank you
don't become pirate software
Bro you sound insane
You're saying create an interface to do a damage multiplier in my abstract custom item class so I can abstract the hurting event for like 4 items and because it'll be "Easier for future me"
It's literally
4 lines right now
Because it's unnecessary
If I follow that modo I'll have like 15 interfaces for all my shit
I don't need that
you are complaning that you have 15k stuff
I'm not complaining
I can simplify them by 1 line
By creating an interface
And an abstract
That ends up being more lines
I feel like the point is completely going over your head

If I have one custom item that heals someone you'd tell me to abstract it in an interface in case I make more
That's so absurd
no
I cant fix something i dont have the solution to, i dont even know why the problem is.
There's little point
It's 4
I don't have 10 custom items modifying damage
At least not in that way
Which is my WHOLE POIINT
bro 10 is an example number
If I had a bunch of items that used it, I'd make it into an interface
^^^^^^
My whole point is that it's unnecessary
But you don't get that
The point of abstracting is for shared behavior
If 5% of my derived classes use that behavior, and that 5% is not a large subset, there's no point in further abstraction
I think that's called what
I heard it somewhere
Shared responsibility principle or something
No no
Single-responsibility principle
My abstract class has the job of maintaining all the custom items, not running the specific logic for a small subset of modules
So it handles the spawning, giving, pickup logic, etc.
And then the specific unique parts are left to the derived classes
Whatever bro
idk at this point don't do it lol
If you wanna learn more about it I read a cool book for it
I can't seem to find where it is
But uh http://principles-wiki.net/collections:robert_c._martin_s_principle_collection this is the gist of it
honestly
i've never read a book
or seen a video regarding on how to code
i just learned
the only thing i've ever ready were the stuff for java like the base rules among dev
That's my bad
nah don't worry
like i was an asshole a bit :3
It happens lol
ig
I have like 3 things I know about for coding and the SOLID principles is one I'm proud of
Haha it's dope
This guy was fr kinda smart
im going to uni
I know like nothing about C# but I know a bit about programming generally
without ever studying programming
It'll be fire trust
You got it though
You're a highly competent dev
You've been schooling people for a long time in these chats haha
ME???
Ong

idk why everyone thinks so
Impostor syndrome, also known as impostor phenomenon or impostorism, is a psychological experience in which a person suffers from feelings of intellectual and/or professional fraudulence. One source defines it as "the subjective experience of perceived self-doubt in one's abilities and accomplishments compared with others, despite evidence to su...
You're the GOAT you just have to believe in yourself
Programmers by and large love to be perfectionists
i know what it is
I figured but I thought it'd be more poignant to link it
idk im not competent enough
im a noobie




