#plugins-dev-chat
1 messages · Page 2 of 1
I just want to make it say Coolio when i start the server
Why is my class declaration an error
Well if you hower over it then the IDE should help you..
As I said here
?
??
The dark mode really helps me understand 

Anyway am I missing a reference?
oh
is RegisterEventsHandler not RegisterEventHandlers
is UnregisterEventsHandler not UnregisterEventHandlers
no more labapi
This was discussed
It is a custom events handler
Not a custom event handlers
So registercustomeventshandler would be the correct term
but it was actually discussed when it was being implemented 
which is why the docs say event handlers
lol
right click on the error and it will say "Add missing interface members"
or smt like that
Turns out i had to write the Disable function first
Fair enough
there is no nuget plugin
you just need the .dll
Not now, download the beta server build and take the dll from there
Aswell as other required dlls like assembly-csharp and such
Where do i put the dll after that?
just reference it for your plugin lol
ah ok thanks for the help
@foggy ocean cringe furry, also the wiki is here you goof https://github.com/northwood-studios/LabAPI/wiki
(I already told them about the wiki I just wanted to bother them a bit :3)
It will be called something other
What's it called?
I have no idea what im doing
I'm coming! LabAPI
Uhh you have to use one from Labapi namespace
Im using the wrong logger?
yea
I thought as much
One sec
Shit
using Logger = LabApi.Features.Console.Logger;
Istg i was looking through the LabApi stuff for something like that and i couldn't find it
Thank you
I recommend other name (ie CLogger or CL) since UnityEngine.Logger exists
the fact someone called it Logger and not log
Honestly deserve to go to hell
so true
Programmer hell
they should work on yandere simulator
That's too much
Combine it with global usings and problem solved
We might rename it yea
Problem is that its going to break everything for everyone xd
Rename it and make an obsolete Logger class forwarding the methods
it will break everything for everyone if you do it too late
Log clashes with GameCore.Log which is also annoying though less confusing than UnityEngine.Logger
or just break it now and let them fix 
also Log was used in PluginAPI and EXILED and i guess some people are really used to it after years
its better to break something in beta and not when its released
I coped hard when writing this
(The logger alias)
I could've kept it as Log and then I wouldn't have had to change much code
Beta for a reason 
rename everything 
Where's the fun without a few breaking changes every update
just a few?
You could always add a number to each class and increment it each update
Scp049_124163
Brilliant
The benefit of using Logger is it won't collide with Exiled Log and GameCore Log however it will collide with UnrealEngine Logger
Get out
No nuh uh
UnityEngine* 
😭
we are switching to roblox
SCP:SL in roblox no way
finally a game engine i'm familiar with
Tbh any open source engine is way better than unity just because they are open source
untiy crying in the corner rn
Or Cry engine
Isnt it open source
Faring the Cry Engine?
Isnt that the one they forked to make star citizen
crytek one?
aka the most unoptimised game ever
ye, but u need to create account and stuff for like unreal
so i declare that as a half one (as like unreal)
KCD has their own version of CryEngine too
What does connector stop and connector start do?
it is an example
So it does nothing and ill never need it?
if you make a class that initialize stuff and then stop stuff (like connection to your server, or something) then usable
for example when using older EventCalls subscribe on Enable, it is good thing to unsub when disable
like this
also theres hot reloading support if someone didnt notice
you can just replace dlls and reload server
hmm will check that
Keep in mind hot reloading is meant for development purposes)
doing this on live server with players may end badly xd
not for updating your plugins mid round
Unless said plugin doesnt have any stored variables
As it will wipe all your property values clean as if the server just started
But i have some ideas to make it fullproof
How to check if a player has a specific effect active?
No way
Thank you, I'm blind
hi blind im Taj
hi blind, im slejmur
XD
nicht du
germans
🤫
🤫
!langde
Hallo, dies ist ein englischsprachiger Server. Du kannst den lokalisierten deutschen Community-Server hier betreten.
HE TALKED GERMAN FIRST MAN
@late shoal +
ban incoming
And I'm not gonna join trashlab
Nothing against moonlab but I heard that they are doing a ban leaderboard or smth
i know
🥲
me too
Can we register all CustomEventHandlers class events at once?
you mean override all of the handlers?
@carmine prawn ?
nope, I have a lot of class that need to inherit from CustomEventHandlers
not built in, but you can use reflection if you want
ok, I'll try
that just u can use the eventHandlers/Action subscribbe
List<Type> types = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.IsSubclassOf(typeof(CustomEventsHandler)) && !t.IsAbstract).ToList();
foreach (Type type in types)
{
CustomHandlersManager.RegisterEventsHandler((CustomEventsHandler)Activator.CreateInstance(type));
}
you'd want to keep track of the instances though to unregister them later
wait what
has been possible for a while (I mean if you made your own plugin framework or plugin loader)
easier now since the Unity update (the one a couple years ago)
but even before you could read the bytes of the dll directly to then create an Assembly and load that
yup you can do
List<CustomEventsHandler> Handlers = [];
public override void Enable()
{
List<Type> types = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.IsSubclassOf(typeof(CustomEventsHandler)) && !t.IsAbstract).ToList();
foreach (Type? type in types)
{
if (type == null)
continue;
CustomEventsHandler handle = (CustomEventsHandler)Activator.CreateInstance(type);
CustomHandlersManager.RegisterEventsHandler(handle);
Handlers.Add(handle);
}
}
public override void Disable()
{
foreach (CustomEventsHandler handle in Handlers)
{
CustomHandlersManager.UnregisterEventsHandler(handle);
}
Handlers.Clear();
}
exactly
mmm yeah i've done this for my own plugin (they has modules inside)
i trough it was for labapi
yes labapi has built in support
KurvaMainframe is/was my own plugin framework
I called 'Plugins' 'Modules'
me too
when labapi will be added to main thread?
what do you mean
When 14.1 comes out
And at least 1 month from now
from beta to main version
How to get Amount of damage in PlayerHurtingEventArgs
ev.DamageHandler.Damage
cast the damagehandler to StandardDamageHandler
like Axwabo said
if (ev.DamageHandler is StandardDamageHandler standardDamageHandler)
{
float amount = standardDamageHandler.Damage;
}
exactly
(currently every DamageHandler inherits from StandardDamageHandler so the if statement will always be true unless something weird happens)
And can I point out the damage from a specific explosion such as a grenade or scp018?
yeah just check if DamageHandler is ExplosionDamageHandler
then you can check the ExplosionType
imagine if we had hot reload that changed the method bodies instead of replacing the assembly
(i've tried making something like that but failed miserably)


what about PlayerStats.OnAnyPlayerDamage
it's possible
I remember this event would give damage after body armor/resistance
PlayerHurtingEvent / PlayerHurtEvent
oh i see what you mean nvm I didn't remember the context
but if you use OnPlayerHurt you can check the DealtHealthDamage after casting to StandardDamageHandler
yes, I found it, thanks
I tried cleaning the inventroy of users it threw error so i just added MEC to it to wait for a few sec and it worked.
lmao okay, funny, Headless server cant display hints 
headless build doesn't have a hintdisplay 
Jailbird has wrapper for pickup?
lmao, I guess it does not like I setting server to roles
did you call .ToList() or .ToArray() before iterating through the item collection?
also, try player.ClearInventory
I just used
player.ClearInventory(true, true);
I dont think that player.Items return a new iterable
it just returns the dictionary's values
So if any gets deleted during the proccess
what error
bye bye
InvalidCast?
Most likely ConcurrentModificationException I would guess
cause it doesn't work for me, I want to be sure it doesn't work for someone else before trying to fix it
oh
This?
JailbirdPickup is a base-game class
if the namespace doesn't start with LabApi, it's not a LabApi thing
use ev.Pickup.Base to get the base-game pickup
CollectionModifiedException?
it is ConcurrentModificationException indeed
just call .ToArray() after this.Items
foreach(Item item in player.Items)
{
}
this results in exception
Which one
InvalidCast
I think that's the Java version of CollectionModifiedException 
public IReadOnlyCollection<Item> Items => (IReadOnlyCollection<Item>)Inventory.UserInventory.Items.Values.Select(Item.Get);
cuz it's ItemBase
or no?
And the message?
It says what it couldnt cast to something else
#1039316650371068066 message
same problem in OnPlayerShotWeapon
right
you can't convert a Select query to a readonly collection
it should be IEnumerable
steam refused to update the server yayyyy
(IReadOnly<>)(IEnumerable)stuff;
i literally needed to nuke both server and client
cause I had outdated references
(I dont think that is usable tbh so dont try that)
why nullable
check if works firstly before publishing 

Are we allowed to make feature requests on github issues?
Yes
woo
Or in #1274618202227216414
just made a github issue
ill probably find a load more
what about PRs :3
You can make those too :3
Scp049-2 Corpse eating stuff?
damn, no harmony patching
on the dev branch i assume
as there isn't a PR template yet
Yeah on the dev branch
Textures on primitives
What am I doing wrong when checking if a grenade is Scp2176?
Ur checking if a labapi object is a basegame object
No grenade doesn't have wrapper yet
Scp2176Projectile is not a grenade
also that yeah
Its not ExplosionGrenade to be specific
Yeah that's what I meant
I should be more specific
or seperate events
In that case, how to check if Scp2176 was thrown and exploded?
but i think have it work with all
Nah they all share the same base class
.Type
ItemType
yeah
Scp2176Projectile.OnServerShattered
It's a static event
Scp2176Projectile...
yea that
For now. Sorry ill fix the event to work with all projectiles
u stole from me
you stole from ME
YOU STOLE FROM ME

i didnt get it from your dms
good night (it's 8am) stinky heads (I can't smell through my screen so I smell myself)

you are in fact stinky
sob
Okay well I am deleting the labapi beta branch 
do it
rn
exiled ftw
does it matter? 
seems like I already deleted it in your timeline 
try using DD
that failed, too
Itemtype does not work, I will wait for Projectile to be introduced
pff
don't tell me i have to end my streak of
if you ever say here "why does my pc feel so dog shit", i know why
:333333
gotta install the windows update :copium:
xert moment
what the
902 days
I have 5 hours 😭
902 day
days yeah
I have 30 minutes wtf are you guys doing
troll
do you all not turn off fast start up?
that's not what this is
for me it's one of the first things i turn off when i reinstall windows every 3-6 months
its xert being xert
either it's that or you keep your pc on 24/7
ew
Fast Startup is one of those things I disable on every install
Should I keep the event name to GrenadeExploded or rename it to something else now that it will work for other projectiles too
which option is it
works on my matchine
ohhhhhh
ProjectileExploded 
also no I don't hibernate
was about to say
I don't even put it to sleep
fair
nvm
hm, idk why it’s still counting up then
it never counts up for me when it’s off lol
surely I turn it off
not shutting down the pc
because windows moves applications around when you do that
also I just have it bound to Ctrl + Alt + Shift + Win + O
are you guys rocking HDDs from 2005 and it launches for a decade?
to turn off all my monitors
YESSSSSSS
Yes mate
also the monitor in my case doesn't have a power button
nah
we had the same idea
XD
literally exact same time
yep
god unity is SO slow
LMFAO
make your own 
Oh you dont know how painful it is to work with SL in unity
at least you dont manage spaghetti code game 
Godot launches in a microsecond (or two seconds if the project is big)
big fan of that
Its not just sl
😭
switch to unreal 
change a whitespace and wait for recompilation
yeah that's just unity
Any bigger project fair
Its pain
It absolutely is
what doesn't help is the fucking translations thing iykwim
Nah fucking like
My VS intellisense just gives up too
also supports latest .net which is good
I wait 20 minutes for labrat to open
20 minutes later
crash
so now i gotta wait another 20 minutes
or i tab out too long and unity does its "gui refresh"
Unity version (I forgot) will have async loading and won't have everything blocked any time anything is loading or reloading or doing anything at all
Worst are domain reloads
just dont use gui 
need
Someone at Unity Technologies discovered threads 
multithreaded unity games when
when unity use that
Didnt they do like that their
ABSOLUTELY

16 seconds to completely launch it
then I have to close the translations you know what
then I have to wait 8 seconds for Unity to reload and recompile everything which doesn't happen until after I close that popup
I though that was meant to be for multithreading
Fun fact
idk ngl
Unity editor coroutines exist
I notice when doing anything in rider it autosaves which freezes unity for 10 seconds
who have guessed
do y'all have this
Yes
.
😭
i dont cus dont use rider 
go to your settings in Unity and disable auto recompiling
and disable auto reloading during play
^
go to unity hub and press uninstall
this one does help a lot
and now i misspress a key in rider and now the game im running gets reset because unity wants to recompile
im gonna do that omfg 😭
not sure why it's not a default setting
why would it be? we love waiting and using 1 cpu core
I think your Unity broke
r yall high
because all of SL takes less than that
bc its called LCZ_173_TheNutRoom.prefab

who leaked 
or they have a harddrive
no
it only reloads when i save
me
how big even is sl
cause labrat is like
to clone
40 gigs or smth
or once everything is imported
everything imported
yes
I probably have a good 500gb of SL repo clones because I am not going to wait for reimporting switching between major branches
less
we love unused assests!!
6 gig is the SCPSL_Data so prob twice as much atleast
:333333
Same
i was coping hard about a 2-minute reimport, couldn't imagine doing that with SL
rip
well that's way smaller because it's IL2CPP and doesn't have the assets (that's in sharedassets outside of SCPSL_Data) and offsets
does it take 2h to reimport?
just a wild guess
that stuff the client
for me like 15-40 minutes if I am importing fresh
that's not horrible
wat
how long does it take y'all to build lmao
~same
CI
smh!!
CI but I sometimes build the dedicated server myself
Its like 10 minutes faster
local build is like 40 minutes but I hardly do that
what the flip
wake up 9 hour after and you see you have to press ok to start exporting or to continueing it
except if all I need is a quick and dirty assembly file with Mirror syncvars
f
had to delay a release

Build failed because of compilation errors.
just dont use il2 then
this one is my favourite too
some guy was in our discord bragging how he was using cheats
i wanted to make his life harder

dumps offsets
forgot a UNITY_EDITOR ifdef and waited for the build just to say "um actually"
nah hes not that good
try re-doing the classes and when buildning radnomize the names , 100% sure it will be hell
from startgame you see r35f2gt4a
just gotta find the new offsets
mogus has obfuscated names
(wrong reply)
its alreayd in il2cpp
havent seen him since
so we're fine
besides itll all be changed in the rework so 
Tarkov too
but thats utf16 i think.
as \uE41 or like that
no they use shit system and simple unity networking, and BE
put the pc to sleep too
no never
it deserves it!
eepy api maintainer 
sleep mode is worse because my backup system wakes up my computer from sleep and turns the screens back on
😭
if I just turn them off using user32 it's fine
Hello, i have a question, because it is possible to remove Test Room (330), as it is probably the only one currently. Will there be options to remove other rooms from the Seed in the future, such as PC-15?
Unless there is some secret method to remove other rooms as well 🤔
you can stop the map from generating
True, but I don't want to delete the entire map, just specific rooms like 330 (which can be removed from the map at the moment) or PC15 (which is impossible, or at least I can't)
It simply opens up a lot of possibilities on RP servers by getting rid of those stupid teleports.
We should Add the ability to remove candy room but doing so removes your real hands
Fr
XD
Fair trade
Is it intended that Player::Items provides ItemBases therefore making it incompatible with the Item wrapper?
I know I can just do Get
i dont think it is, you can use Item.Get on the itemBase in the meantime
but like, EXILED provides them in the wrapper already iirc
yeah something ill look into
👌
Is there a way now to add Player effect by String like i have String named "EffectName" = "MovementBoost" and i want to use EnableEffect() on Player but i don't have any idea how to get effect by name and then use it (sorry for my Bad English)
(this is from NwApi)
either you create a dictionary for itself or you do something that gets the type name from all effects
alright but how i can access now all of the effects? bcs this is my main issue now
probably idk i saw that too in one of the LabApi Files or similar one but i was thinking that i am missing something much easier or something else anyway thanks for help
ye the GetEffectNameFromType results like this so the other should be working ifne
ye and I using like this
I think it works with custom effect too but no idea about that. should support it
i will try this and test it out later now i need to make rest of the code work with LabApi and figure out how i can spawn grenade now or just explosion
but still huge thanks for help
good idea
idk i need to make small research like there some new functions with grenades/explosions ig or im blink and it was in NwApi
nv old one works too(Probably)
lol
You iterate over dictionary
just
foreach(var kvp in sender.GetPermissionsByProvider())
{
...
}```
wdym
labapi
Welllll it compiles for us
Do you have referenced all the assemblies
hm?
No clue to be honest
It was like that when I joined
I simply added 2 system variables no big deal
@harsh thorn :)
I guess someone has them seperated /shrug
noooooooo
me when i forget to fork the repo
and im trying to push to actual repo
😭
am i cooked
It finally happened, a new category
Why did y’all leave the other place tho
It smelled
cuz of u
I was only a small contributor to the overall smell

i assume theres another SL version with this
but smh
😭
There are still some things like this in older scripts
can you change that 😭
so do it 
who thought that was a good idea to have java code here
😭
middle middle
can i rename it from MiddleMiddle => to Center
No thats its official name now
@ hubert
I want a MiddleMiddleMiddle room
I have a very simple code but for some reason it does not work , it does not show any errors. void DisplayTeammates() does not execute at all or the list of players is not foreach
how do you call RegisterEvents
CustomHandlersManager.RegisterEventsHandler
In Main
yea
for example
public override void Enable()
{
CustomHandlersManager.RegisterEventsHandler(Handler);
}
Like that
/// <summary>
/// Internal constructor to prevent external instantiation.
/// </summary>
/// <param name="timeToDetonate"></param>
/// <param name="additionalTime"></param>
internal DetonationScenario(AlphaWarheadController.DetonationScenario detonationScenario, byte id, WarheadScenarioType type)
{
TimeToDetonate = detonationScenario.TimeToDetonate;
AdditionalTime = detonationScenario.AdditionalTime;
Type = type;
Id = id;
}
okay buddy
what is it again
I think thats because it was changed with 14.0?
maybe
yeah type/id was added for DMS
how many errors do you get like this?
um
idk
i have a lot of errors because of NotNullWhen
its internal for me
if its alot, i think steam might have not downloaded the server branch properly
it did it for serveral people including me, try uninstalling the server and reinstall it
i havent seen that before, but yeah for anything related to the assembly c# or game assemblies doublecheck if steam actually downloaded it
ill verify integrity
that doesnt work
you gotta uninstall
kk
Yeah you have to uninstall and install again
both server and client
We dont know why
CLIENT TOO????
but it did cause a lot of confusion already
wtf did client do 😭
yeah it really threw me for a loop, not sure why steam is doing that
are you using vs?
rider
I couldn't add references in rider so I just ditched it all together (tried 1 time) lol
i can reload project
i usually manually do it 
yeah try that
rip
holy shit I spent so much time doing one simply plugin lol I've been coding for like the past 2 hours trying to figure shit out but its pretty fun
it took me around like 4 hour yesterday and 3 hours today to port my plugin from 14.0 exiled to 14.0.1 labapi
hi
hi
?
what's a port based plugin
like
folders for plugins that only work on those specific ports
like nwapi had it
7777
global
oh
7778
network port
ye
idk
the current implementation is incomplete, its something that will be worked on duing the beta
since its a server host thing
ok cool, will be useful for me
it wont be like nwapi, i cant say more than that
ye ik about that, just wanted to know if we are gunna have port specific plugins
hopefully a global plugin system too smh
@worthy rune Shouldn't you have the ApiMaintainer role here?
maybe
nah i should 
let me give it to you then
Go shout at HR 
gimme API Assistant
We aren't allowed to give staff roles :(
Taken down a basement level 
i wish i signed up for api maintainer when it came out, i thought it was web api not labapi :c
API PR nyaaw role for u
@worthy rune r u braydon 😭
One step closer to hell
yeah
i made the PR too 
added it to the big collection of dumb stuff

@lilac jungle miller died
in 1924
btw asked andi to give you the role so you'll get it eventually
yeah its free to get
Yea?
nah you can stay
Yeah you are allowed since nw staff has perms
shhh dont question
hes lurking
hi

zzzz
nom nom
i still cant fix NotNullWhen error

that and System Linq being broken for some reason
cant even add the . between system and linq
just change it to nullwhen false
💔
easy
its internal
wait no
the class is internal
the constructor isnt?
how does that work
no worries
not sure why it isnt working for you, i thought it was apart of .net framework
ah
@queen parrot we are compitas now
mscorlib appears to make it public
but its internal otherwise and i cant fix it
😭
lol
moment
the beauty of coding lmao
absolutely
it works for everyone except me

wait its yaml?
from yaml
from package YamlDotNet v11.0.1
wtf ?
ive had issues with mscorlib just not wanting to load in some projects
but idk why
@restive turret yeah uh thing is
i do point it to that file in SL managed
i added a space
99% of the files have a space between usings and the namespaced
but like 3 of them didnt
oh my favourite romanian hiiii @odd vapor
funny
Anyway I'ma dip goodbye guys have fun (ig)
bye
pff.
nice, prob rider issue
rider doesn't hate it
@unique crane did u like my pr 
rider hates you
checks out
i will remove this from pr rn
alright i head out
mscorlib makes me cry
lel

try running dotnet build next to sln
if works I will laugh my ass off
ill see
SecretAPI succeeded with 1 warning(s) (6,2s) → SecretAPI\bin\Debug\netstandard2.1\SecretAPI.dll
C:\Program Files\dotnet\sdk\9.0.101\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:
Found conflicts between different versions of "System.Net.Http" that could not be resolved.
There was a conflict between "System.Net.Http, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
and "System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
"System.Net.Http, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was
U talk about consistency and then do this
Also early return better in this case tbh
more readable
shh

wait
THAT WAS THE WRONG PROJECT
te' is inaccessible due to its protection level
E:\Coding\LabAPI\LabApi\Features\Wrappers\Pickups\Pickup.cs(215,51): error CS0122: 'NotNullWhenAttribute' is inaccessible due to its protection level
wdym secret api
What is better? (Not riged)
2
2
1
Czech?
🇨🇿
i built the wrong ass project
LabApi failed with 69 error(s) and 8 warning(s) (0,7s)
69 is wild
Who?
2
3
2
hubert
868569689444470844
CoinTails
it is NOT my fault
it just hates mscorlib for me 😭
Blah blah blah
its my pc 💀
61 warning just by downloading

oh yeah
events have Player? player
but the interfaces are just Player
no null
so it complains
I mean instead of 61 warning now only 8 that's good if you don't count the 69 errors
reinstall it
yeah but
it works in some projects
😭
with the exact same line as what i put in labapi
ask it nicely
can't just LabEX or EXLab exist instead of battling through exiled and labapi plugins
to stop hating mscorlib
You reference it from the the server build?
yes
works in 1 project
only 1 tho
VS or rider
rider
Yeah good luck buddy
xDD
rider racism
yes
VS on top as always
will eat my hat
even tho it was like 2 days ago i tried to reference mscorlib and it refused to work there too
I check this (adding logs) and code work but not sending hint to player
Yo. Does LabAPI provide any way to check for a permission string with an ICommandSender rather than just a Player?
The only stuff I can find is using the base game permission enums rather than the custom strings
what do you want to do
check permission?
Player? player = Player.Get(sender);
if (player is null)
{
response = "This command can't be run from server console.";
return false;
}
player.HasPermissions();
you can do something like this
I was trying to avoid needlessly casting it, as quite a lot of my commands that require permissions also can be run via the console 
But if that's the only way, fairs
well having server console access is basically having all permissions, lol
I'm aware. I was just expecting the API to check for that sort of thing, rather than still having to make my own system to check if it's a player then checking the permissions
why is this one on framework 4.8.1
There isnt much difference between net48 and net481
also turns out the reason mscorlib "works" in another project is the project is net standard 2.1
so yeah idk wtf is with mscorlib ngl
it just doesnt like me
lmao
Yeah works on my matchine so
If you moved from net48 to standard i cry too
unless?
erm
so
1>------- Finished building project: LabApi. Succeeded: True. Errors: 0. Warnings: 0
i made it netstandard 2.1
then reverted back to 4.8
and
now it works?
😭
1>------- Finished building project: LabApi. Succeeded: True. Errors: 0. Warnings: 59
(release instead of debug)






how do you


