#plugins-dev-chat

1 messages · Page 32 of 1

upper vapor
#

exiled is using 60% of servers?

random scaffold
#

yes

#

before labapi, it was ~70-85%

royal mica
#

Has anyone encountered an exception related to Scp049.Scp049MovementModule.UpdateMovement

random scaffold
#

is it excessive to use redis to cache users in the plugin?

icy knoll
#

because anything saved in a dictionary in your plugin is also saved in memory

worn gull
#

How can I reload a plugin's config with a command?

random scaffold
worn gull
random scaffold
#

no way

worn gull
#

In exiled it was possible

#

😦

hearty shard
#

you just gotta write your own command for it

#

Config has a setter cute_uwu

#

@worn gull calll Plugin.LoadConfigs() in a command

worn gull
#

Ah thanks

young phoenix
hearty shard
young phoenix
#

where

hearty shard
#

on github repo

young phoenix
#

alr

#

is there a way to get rid of the player area info text? I want to make a custom one

random scaffold
#

someone have ready T Repository?

unique crane
young phoenix
#

anyone know how to detect when the skeleton changes skin?

buoyant oyster
#

I want to change how respawn mechanics work and how certain teams contribute influence. do I need a Harmony patch to do that?

#

theres a lot of shit to sift through i have no clue what im looking for

buoyant oyster
#

found how to modify what contributes influence but i still need to know how to change the wave mechanics, I want to disable the guaranteed mini waves for the opposing team and have it spawn something else in

random scaffold
#

how i can get it from the player?

wheat flower
#

idk off the top of my head

#

decompile the code and look at what it does

random scaffold
#

it private field

true cedar
random scaffold
#

how i can get it

true cedar
#

huh

#

if you're trying to heal someone don't add regeneration

random scaffold
#

but i wanna use regeneration

#

by this method

true cedar
#

okay well

#

make an animation curve idk

hearty shard
#

Scp330Bag.AddSimpleRegeneration(player.ReferenceHub, 0.2f, 600);

#

@random scaffold

random scaffold
#

ok

#

rate it?

#

health per second?

hearty shard
#

yes

#

i believe so

random scaffold
#

will be works?

#

2 attribute to one class

true cedar
#

yea

#

maybe

#

if not use TargetMethods

terse bone
#

it doesn't work

#

use target methods

random scaffold
#

how

terse bone
#
private static IEnumerable<MethodBase> TargetMethods()
{

}
#

methodbase or methodinfo idk

random scaffold
#

but how implement?

terse bone
#

put it in patch class

#

it needs to return methods to patch

random scaffold
#

attributes must be stayed?

hearty shard
#

nothing else

#

probably..?

celest thorn
#

someone remembers the string max length for mirror?

celest thorn
hearty shard
#

the same amount of UDP - whatever else is needed for your message

random scaffold
#

how to get door from collider / gameobject?

icy knoll
#

either on collider or collider.transform.root.gameObject

terse bone
#

this is how the disruptor get's it

severe cave
#

Can I move dummys around places, like they walk a path between GateA and GateB or something

ionic prawn
#

my friend is hosting a server and i created a plugin and it says BadImageFormatException but when i host it, it works perfectly fine.

hearty shard
ionic prawn
#

oh yeah its mostly likely that cause i was sending thru live share in vsc

hearty shard
#

compile and send through discord or smth

#

discord for me has never failed me

severe cave
random scaffold
#

idk

grand flower
#

Checking if a GameObject is an ammo pickup would just be getting the AmmoPickup component on it right?

worthy rune
#

that should work

teal junco
#

interactable toys are amazing

grand flower
#

Players decided making a pile of ammo and items and then throwing a grenade into it was funny

#

server crashed, no more fun allowed for them

grand flower
#

Is there a place where I can easily hook onto for when a pickup's rb sleeps

#

ammo pickups in particular

plain gazelle
#

Is there an Event for a newly spawned AdminToy?

restive turret
#

Probably inside the AdminToybase as regular C# event not labAPI one

grand flower
#

Is there a way to force a latent action to run now through the CoroutineHandle

#

i.e. something I used Timing.CallDelayed() for, I need it to run immediately

#

although ig I could just extract the code into a method and run it manually nvm

hearty shard
#

What r u doing specifically?

grand flower
#

Nah it's good, solved

#

Just wanted to run a delayed action now if another was being queued

grand flower
#

Am I the only one who has had Rider start to hallucinate when I tab on a completion and just copy/paste a bunch of garbage somewhere random in the file?

rugged laurel
#

Mine wouldnt copy/ paste but would autocomplete a whole line of random garbage

#

There was a setting i turned off

grand flower
#

I disabled AI stuff

#

But like sometimes it decides the things I wanted it to autocomplete should be in a random line of code in the file, sometimes overwriting chunks for no reason

#

idk what's going on but it's annoying

upper vapor
#

Yeah JB AI can be annoying

#

I use Copilot but i have it turned off by default so it only completes code when I press the keybind

true cedar
#

i refuse to use coding ai

#

i don't trust it

grand flower
#

I don't need it mmLul

#

and it makes my job harder at work when I have to do code reviews for devs who used AI

true cedar
#

i've only really used ai to tell me if theres any other way i dont know about to do something

glass karma
#

is there an easy way to get the permissions of a keycard through the itempickupbase?

upper vapor
#

for actual logic and tasks copilot fails almost every time

#

(inline completion)

icy knoll
#

Room::Name

#

or if you want unity name

#

Room::name

#

:: means that you need the instance of that yourself

#

so

#

get the room

#

.Name

#

get the room that you want the name for

#

and use .Name on it

#

to get the name

#

RT console?

restive turret
#

RA*

icy knoll
#

oh

#

yeah uh

#

you need a plugin for that

#

lol

restive turret
#

Usually the name is the name shown

icy knoll
#

what about it?

restive turret
#

GATE_B is GateB and etc

icy knoll
#

I legit gave it to you

#

Room::Name

restive turret
#

Get a room

#

Room.Get(FacilityZone.Surface).FirstOrDefault().Name
This give you the Surface zone room name

icy knoll
#

no

#

you need to make one

upper vapor
#

List of room names

grand flower
#

Does LabAPI let you make custom 914 item processors

worthy rune
#

yes

#

should be on Scp914 iirc

grand flower
#

ty

#

getting weird bugs with one of our plugins making a disruptor which ends up having no ammo and softlocking players

upper vapor
restive turret
#

LabApi.Features.Wrappers.Scp914.SetItemProcessor

restive turret
upper vapor
#

Yeah

grand flower
#

Happens for items on the ground too

grand flower
upper vapor
#

Check how the uh

#

Disruptor sets its ammo on give

restive turret
#

u need to impl IScp914ItemProcessor

#

why is my pc purring?

spice hatch
#
[05-29-2025 07:37:00.135 +00:00] [ERROR] [LabApi] 'NullReferenceException' occured while invoking 'OnPlayerJoined' on 'LaboratoryMayhem_UserInterfaceImprovements.EventHandlers.LaboratoryMayhemEventHandlers': 'Object reference not set to an instance of an object', stack trace:
                                   at LaboratoryMayhem_UserInterfaceImprovements.EventHandlers.LaboratoryMayhemEventHandlers.OnPlayerJoined (LabApi.Events.Arguments.PlayerEvents.PlayerJoinedEventArgs ev) [0x00006] in <3a8918fc562f431ab0e2fa27208897ed>:0 
                                   at LabApi.Events.EventManager.InvokeEvent[TEventArgs] (LabApi.Events.LabEventHandler`1[TEventArgs] eventHandler, TEventArgs args) [0x0001d] in <bea7f403b90e4786abd99fa819db9853>:0

can someone help me with this, ive tried enough already

grand flower
#

You have a null ref at LaboratoryMayhem_UserInterfaceImprovements.EventHandlers.LaboratoryMayhemEventHandlers.OnPlayerJoined

#

(send code for more help)

spice hatch
#
namespace LaboratoryMayhem_UserInterfaceImprovements.EventHandlers
{
    using LabApi.Events.CustomHandlers;
    using LabApi.Features.Wrappers;
    using LabApi.Events.Arguments.PlayerEvents;
    
    public class LaboratoryMayhemEventHandlers : CustomEventsHandler
    {
        public override void OnPlayerJoined(PlayerJoinedEventArgs ev)
        {
            if (Main.ConfigValues.ServerJoinMessageIsEnabled)
            {
                if (Main.ConfigValues.ServerJoinMessage.Contains("{User}"))
                {
                    var ServerJoinBroadcast = Main.ConfigValues.ServerJoinMessage.Replace("{User}", $"{ev.Player.Nickname}");
                    
                    Server.SendBroadcast(ev.Player, $"{ServerJoinBroadcast}", Main.ConfigValues.ServerJoinMessageDuration, 0, Main.ConfigValues.ServerJoinMessageShouldClearBroadcasts);
                }
                else
                {
                    Server.SendBroadcast(ev.Player, $"{Main.ConfigValues.ServerJoinMessage}", Main.ConfigValues.ServerJoinMessageDuration, 0, Main.ConfigValues.ServerJoinMessageShouldClearBroadcasts);
                }
            }
        }
    }
}
grand flower
#

Nickname might be null at that time

spice hatch
#

i tried

#

removing it

#

entirely

grand flower
#

what about Main.ConfigValues

spice hatch
#

shouldnt be null

grand flower
#

test it

spice hatch
#

it just refers to this

    [Description("Server Join Messages")]
    public bool ServerJoinMessageIsEnabled { get; set; } = true;
    public string ServerJoinMessage { get; set; } = "T";
    public ushort ServerJoinMessageDuration { get; set; } = 1;
    public bool ServerJoinMessageShouldClearBroadcasts { get; set; } = false;
restive turret
#

you migth can do is delay by 0.1 or more

grand flower
#

never had to do it in PlayerJoined

#

there's definitely some broken code

royal mica
#

Oh, Server.Broadcast issues LULE

spice hatch
#

this is my first time

royal mica
restive turret
#

OHH

#

because it just joined and might not be AUTH-ed

royal mica
#

yes

worthy rune
#

you shouldnt have to add any delay in PlayerJoined

royal mica
#

also the Player class is not built up yet

worthy rune
#

PlayerJoined happens after auth

spice hatch
#

yeah

restive turret
#

oh

spice hatch
#

thats what i thought too

restive turret
#

well

spice hatch
#

im probably just writing wrong code

royal mica
#

Server.Broadcast was broken in PluginAPI as well for me

spice hatch
#

or somrhing

restive turret
#

then you can try
CL.Info(SomethingThatCanBenull == null);

#

CL is Console.Logger i think

worthy rune
spice hatch
#

well maybe its null or something idk

#

if i didnt make an instance for it

restive turret
#

there is no set for ConfigValues

#

you missed the = new();

spice hatch
#

i have to add that to properly reference it?

restive turret
#

what

worthy rune
#

why is there a seperate config prop in the first place?

#

just use the one the LabAPI loads for you

royal mica
spice hatch
restive turret
spice hatch
#

in the custom event handler

#

idk how to

worthy rune
#

i dont see you using it

restive turret
#

he is

#

only the configprop

#

make an instance for the Main

#

set to this in Enable set to null in Disable

spice hatch
#

so this?

restive turret
#
public class Main : Plugin<Config>
{
        public static Main Instance { get; private set; }
        
        private static LaboratoryMayhemEventHandlers Events => new();
        
        public override string Name => "Laboratory Mayhem: User Interface Improvements";
        public override string Description => "Various improvements to SCP: Secret Laboratory's user interface.";
        public override string Author => "Dr. B";
        public override Version Version => new Version(1, 0, 0);
        public override Version RequiredApiVersion => new Version(1, 0, 2);
        
        public override void Enable()
        {
            Instance = this;
            CustomHandlersManager.RegisterEventsHandler(Events);
        }

        public override void Disable()
        {
            Instance = null;
            CustomHandlersManager.UnregisterEventsHandler(Events);
        }
    }
}
restive turret
#

and for the config stuff use Main.Instance.Config

spice hatch
royal mica
royal mica
#

I can give the PluginAPI one if I dig the files, but that is useless now

restive turret
#

re-read what i sent

worthy rune
#

dw about the pluginAPI one, NwAPI is history at this point

spice hatch
#

can i name the instance anything

#

or does it have to be instance

restive turret
#

u can name to be anything

spice hatch
#

k

restive turret
#

but u cannot name to same as the classname

worthy rune
#

if you do encounter any issues in the future with Server.Broadcast do make an issue on the LabAPI github

restive turret
#

see? I use instance for it

royal mica
#

Notepad MonkaS

restive turret
#

faster to get the info than opening the whole project in any IDE

spice hatch
#

why doesnt it show

restive turret
#

are you using it right?

spice hatch
#

yeah

#

its just not showing it

restive turret
#

Main.somethingyounamedto.Config.ServerJoinMessage

spice hatch
#

and then im doing this

restive turret
#

guh

spice hatch
#

and at the end ServerJoinMessageIsEnabled

restive turret
#

?? wat

#

show the main again

#

😭

restive turret
#

Main.ConfigValues.Config.ServerJoinMessage

#

THATS why most of us use the name Instance

#

since the instance of the Main entry point of the plugin

spice hatch
#

fair point

#

i didnt know i had to hop this many files

#

to achieve one thing

worthy rune
#

You might want to learn the basics of c#

restive turret
#

istn instancing on the Examples?

spice hatch
#

making plugins

#

ba dum dum

worthy rune
#

not saying you shouldnt ask questions, you can always do that here. just that if you knew the basics of c# it wouldnt have taken so long for you to figure out what people were saying to you

restive turret
#

since config gets made if not exists ye

icy knoll
#

i usually just override the Config var

#

also, does TryLoadConfig make it if it doesn't exist?

restive turret
#

prop

worthy rune
#

i think so

restive turret
#

ye

worthy rune
#

there was a PR about making config not null

restive turret
#

only fails if the edited yml is not parsable

#

like u set a bool value to int or smth

spice hatch
#

guys you wont believe it

#

it works now!!!

#

thank you

restive turret
#

110 paypal

grand flower
#

uh question about the 914 item processors

#

How does one set the new pickup's position?

#

in inventory works fine now, but anything on the ground seems to stay back in 914's input

#

oh okay so seems like the game's code calculates the position but... doesn't set it

worthy rune
#

base game seems to just add Scp914Controller.MoveVector to the position

grand flower
#

i don't see it being set

#

just a calculation

worthy rune
#

im looking at AmmoProcessor now and its a +=

grand flower
#

oh right i could just do it that way

#

sweet ty

worthy rune
#

going to put that on IItemProcessor as a static prop so its not so obfuscated in the future

spice hatch
#

im trying to replace a string if it has a certain piece of text but it isnt working

#

i dont think

worthy rune
#

oh actually IItemProcessor should of been deleted lol

#

i guess i forgot

spice hatch
#

its private set in the instance

#

which means i cant edit it

#

nvm still cant do anything

#
namespace LaboratoryMayhem_UserInterfaceImprovements.EventHandlers
{
    using LabApi.Events.CustomHandlers;
    using LabApi.Features.Wrappers;
    using LabApi.Events.Arguments.PlayerEvents;
    
    public class LaboratoryMayhemEventHandlers : CustomEventsHandler
    {
        public override void OnPlayerJoined(PlayerJoinedEventArgs ev)
        {
            if (Main.Instance.Config.ServerJoinMessageIsEnabled)
            {
                Main.Instance.Config.ServerJoinMessage.Contains("{User}");
                {
                    Main.Instance.Config.ServerJoinMessage.Replace("{User}", $"{ev.Player.Nickname}");
                }
                    
                Server.SendBroadcast(ev.Player, $"{Main.Instance.Config.ServerJoinMessage}", Main.Instance.Config.ServerJoinMessageDuration, 0, Main.Instance.Config.ServerJoinMessageShouldClearBroadcasts);
            }
        }
    }
}
grand flower
#

You should probably learn C# a little more, but strings are immutable (meaning they can't get modified in-place by methods)

spice hatch
#

so i just make a variable for the new broadcast

#

and use that

#

?

restive turret
# spice hatch ``` namespace LaboratoryMayhem_UserInterfaceImprovements.EventHandlers { usi...
namespace LaboratoryMayhem_UserInterfaceImprovements.EventHandlers
{
    using LabApi.Events.CustomHandlers;
    using LabApi.Features.Wrappers;
    using LabApi.Events.Arguments.PlayerEvents;
    
    public class LaboratoryMayhemEventHandlers : CustomEventsHandler
    {
        public override void OnPlayerJoined(PlayerJoinedEventArgs ev)
        {
            if (Main.Instance.Config.ServerJoinMessageIsEnabled)
            {
                string message = Main.Instance.Config.ServerJoinMessage;
                if (message.Contains("{User}"))
                {
                    message = message.Replace("{User}", $"{ev.Player.Nickname}");
                }
                    
                Server.SendBroadcast(ev.Player, message, Main.Instance.Config.ServerJoinMessageDuration, 0, Main.Instance.Config.ServerJoinMessageShouldClearBroadcasts);
            }
        }
    }
}
grand flower
#
if (Main.Instance.Config.ServerJoinMessageIsEnabled)
{
    var message = Main.Instance.Config.ServerJoinMessage.Replace("{User}", ev.Player.Nickname);
    Server.SendBroadcast(ev.Player, message, Main.Instance.Config.ServerJoinMessageDuration, 0, Main.Instance.Config.ServerJoinMessageShouldClearBroadcasts);
}
restive turret
#

or ye that

#

idk if the replace works if not exists in string

spice hatch
#

shouldnt it just skip it

#

if it doesnt exist

grand flower
#

yes

fresh zenith
upper vapor
#

Guard clauses 🗣️

merry copper
#

hey is there a way to hotreload LapAPI permission file ?

random scaffold
#

how i can check if player have permission from permissions.yml?

royal mica
royal mica
#

Or you could Unregister the provider and then reregister it

#

Though not sure if that is a good idea

merry copper
royal mica
#

Cause LabApi is not Exiled

#

and is an oversight

merry copper
#

yeah i know

royal mica
#

Also maybe an encouragement to do a self implementation where you control how it is reloaded?

#

dunno the reason behind it

merry copper
#

just a suggestion cause its REALLY practical my staff tells me all the time they need stuff so hotreload and not having to wait for round to restart is game changer

unique crane
random scaffold
#

hardcode bruh

pseudo hawk
#

I currently have a separate thread to handle SQL operations by using a ConcurrentQueue. I was wondering if there is any event I could use to join it since it will block the main thread for up to a few seconds?

pseudo hawk
#

It works in the background

hearty shard
#

yes but wdym join it

pseudo hawk
pseudo hawk
#

Too costly because it’ll be running commands every few seconds

hearty shard
pseudo hawk
#

I really don’t

hearty shard
#

Task also uses a thread pool

#

its better than new Thread()

#

Wait why r u running it every few seconds?

#

what r u doing

pseudo hawk
#

It’s a leveling system that writes xp to a SQLite database

hearty shard
#

Don't do it every time xp is earned

pseudo hawk
#

???

hearty shard
#

???

pseudo hawk
#

Then how am I going to save it?

hearty shard
#

dont do it every time it happens, save it every x times

#

so you build up a queue of xp?

#

idk

pseudo hawk
#

That’s what I’m doing, every 1 second it writes to the database

upper pike
#

Every second?
That seems very costly

hearty shard
#

yeah

pseudo hawk
#

And it’s fine because it’s on a separate thread

random scaffold
#

create field or property

#

and save all data after end of the round

pseudo hawk
restive turret
#

what others happen?

#

cleared

random scaffold
restive turret
#

you dont gain anything

random scaffold
#

or you need make rabbitMQ / kafka

#

and send each change to rabbit

upper pike
pseudo hawk
random scaffold
upper pike
#

At least make it a longer interval because surely people aren't gaining a sizeable amount of XP every single second

random scaffold
random scaffold
restive turret
#

idk dont ask me

#

i not making this

upper vapor
unique crane
#

Add stuff to the concurrent queue

upper vapor
#

Native unity thing

pseudo hawk
unique crane
#

Well then it shouldnt block the main thread?

#

If its on seperate one

upper vapor
#

They're trying to get back to the main thread

pseudo hawk
#

The main issue I’m facing is when to sever the connection and how to handle non queries when the round ends without blocking the main thread. I could abort it in the background thread but it would be unreliable

#

Also it’s not guaranteed to actually stop the thread according to MSDN

#

(Thanks Microsoft) /s

upper vapor
#

Why not keep the connection while the server is running

unique crane
#

Yeah

upper vapor
#

And close it when Shutdown.OnQuit is fired

pseudo hawk
upper vapor
#

Buffer XP gains to a dictionary and send them every x seconds or when the round ends

unique crane
#

I had no issues with keeping MySQL connection open on local server

pseudo hawk
upper vapor
pseudo hawk
#

Oh wait nvm

#

Got confused for a second

upper vapor
#

Otherwise unity will say bye bye and the connection won't be closed "properly" and it'll be up to the DB to handle

#

So don't close the connection on round end

pseudo hawk
upper vapor
#

In OnQuit, yes

pseudo hawk
#

👍

upper vapor
#

Otherwise the server may shut down quicker

buoyant oyster
#

if I wanted to disable the guaranteed mini waves (where if a spawn wave fails to get points, a mini wave spawns for the opposite team) what method(s) would I want to modify? I can't find what I'm looking for

unique crane
#

IsAllowed = false

#

Also make sure to reset the timer for the wave

buoyant oyster
#

thought i'd need a harmony patch ty

soft turtle
#

Does anyone know what causes this error?

hearty shard
#

dummies in lobby does that

icy knoll
#

just dummies being well... dummies!

soft turtle
hearty shard
#

just start round and itll work

soft turtle
hearty shard
#

only have the issue in lobby

#

and ive never seen it outside lobby

icy knoll
#

i have

soft turtle
soft turtle
hearty shard
soft turtle
#

I went to make a patch to fix this XD

unique crane
#

I made internal pr that fixes that

#

Should be in game next update?

soft turtle
unique crane
#

¯_(ツ)_/¯

unique crane
hearty shard
#

can i see :3

unique crane
#

Sure

pseudo hawk
#

Does OnPlayerLeft get called for every player when the round ends?

unique crane
#

You leave the server, it restarts and then you auto join back

pseudo hawk
#

I can just use that then for the sql thing

unique crane
#

ofc

young phoenix
#

guys I have a weird problem
when I subscribe to the InventoryExtensions.OnItemRemoved event I can detect when an item is dropped. However when the jailbird runs out of charges and the player drops it the function only partially executes.

private void OnItemRemoved(ReferenceHub rh, ItemBase ib, ItemPickupBase ip)
{
    Info($"removed item {ib.ItemTypeId}, {ib.ItemTypeId == ItemType.Jailbird}");
    if (ib.ItemTypeId == ItemType.Jailbird)
    {
        Info("hey!");
        Pickup bird = Pickup.Get(ip);
        Info($"jailbird removed, was it destroyed: {bird.IsDestroyed}");
        //bird.Destroy();
        Item item = Player.Get(rh).AddItem(ItemType.Jailbird);
        Player.Get(rh).CurrentItem = item;
        Info("after hey!");
    }
    Info("just to be sure");
}

when I drop it when pressing T the function runs normally and I see the "removed item" and "just to be sure" log, HOWEVER when the jailbird runs out of charges and does the dropping animation the function only logs "removed item" and nothing else, not even "just to be sure" log
anyone any idea?

unique crane
hearty shard
#

oh

#

lol

unique crane
#

QA approved fix

#

¯_(ツ)_/¯

#

It was that simple XD

hearty shard
#

💀

young phoenix
unique crane
#

Check LocalAdminLogs

young phoenix
unique crane
#

No thats folder for server logs

#

Some things (especially exceptions) are not logged in the server console

#

And are instead written in the log file

young phoenix
#

oh I see now, it says object reference not set to an instance

unique crane
unique crane
#

I assume the ip is null

#

As it doesnt drop

#

it gets destroyed

young phoenix
#

ah I see now, thank you

#

also what is the difference between ItemBase and ItemPickupBase?

restive turret
#

item vs pickup

unique crane
#

ItemBase is item in your inventory

#

Pickup is well.. pickup

restive turret
#

one in your inv other in the ground

unique crane
#

on the ground

young phoenix
#

I see thanks

restive turret
#

120 paypee

young phoenix
#

D:

restive turret
#

anyway, david, for roles make the cooldown and stuff be non const please

upper vapor
young phoenix
#

ok I have found another issue regarding OnItemRemoved. When the jailbird runs out of charges OnItemRemoved gets called twice

soft turtle
hearty shard
#

i saw

soft turtle
#

XD

hearty shard
#

yea

soft turtle
pseudo hawk
#
public struct PlayerAttributes
{
    public int STR = 10;
    public int DEX = 10; 
    public int INT = 10;
    public int CON = 10;
    public int WIS = 10;
    public int CHA = 10; // Rizz up 939????
}

idk wtf charisma will do yet

#

combining dnd + scp:sl

unique crane
#

💀

random scaffold
random scaffold
#

is this redundant for the plugin? (its only for modules and interact with db)

true cedar
#

um

#

are you only using mysql

#

that seems extremely excessive

random scaffold
#

and why too

true cedar
#

why do you have so many interfaces

#

is only one class implementing them

random scaffold
#

make readonly or writeonly

#

or both

true cedar
#

what

#

it doesn't seem like you have many classes implementing them

#

i do question why not just use a BaseRepository

#

and derive from that

true cedar
#

yeah there's no reason to have like

#

any of those interfaces

#

lol

upper vapor
#

no reason for those interfaces if you're gonna use the hbase class anyway

random scaffold
upper vapor
#

IMySqlConnection makes sense

true cedar
#

like ALL of them

random scaffold
#

its all

#

not fully ready

true cedar
#

why is baserepository generic

random scaffold
true cedar
#

like?

random scaffold
#

User / IpAddresses / Session

#

and something

#

there is a separate table for each type

true cedar
#

and what kinds of classes will be derived from BaseRepository

random scaffold
#

all but from cached

#

may in future need read only access xd

true cedar
#

huh

true cedar
#

tables is a lot more clear

random scaffold
#

repositories better

true cedar
#

no...?

random scaffold
#

its not just tables

#

add / get / update and something

true cedar
#

wha

random scaffold
#

idk how to explain why repository

true cedar
#

these just seem like columns

upper vapor
#

and you're gonna handle the DB stuff in the plugin?

random scaffold
random scaffold
upper vapor
#

interesting design choice to say the least

random scaffold
#

its possible will be use in other plugins on same server

#

so its to lifetime

true cedar
#

yea

#

um

#

i don't think u should be like using this model

random scaffold
#

then how?

true cedar
#

this seems like a way to abstract away "low-level" database calls

#

if im correct

random scaffold
#

just make method for each request bad idea

true cedar
#

well

#

you're going to be doing that no matter what lol even if you use this pattern

upper vapor
#

EF core

#

dappr

unique crane
#

Overengineering 101

upper vapor
#

you must have 4 microservices for each service!!1!1!

true cedar
unique crane
random scaffold
unique crane
random scaffold
#

he dont works in plugin

true cedar
#

if people want to implement BaseRepository<T> they still have to make the low level database calls

upper vapor
#

yeah cuz you wouldn't really do this in the plugin imo

true cedar
#

^

upper vapor
#

wouldn't you need the data elsewhere?

unique crane
#

I had 0 issues with just making facade of sql queries

unique crane
#

it works fine

#

If you have the db on same machine as the dedicated server

random scaffold
random scaffold
upper vapor
#

a new system to consume the same data

random scaffold
#

I need a convenient framework and a shared database between the servers

random scaffold
true cedar
#

never get between a c# dev and their desire to create 50 unnecessary interfaces and classes

random scaffold
#

now me need it only for scp sl plugin

upper vapor
#

but you know you'll have other uses of it?

icy knoll
random scaffold
icy knoll
#

it does in fact make my work 1000x better and i do stuff a lot faster lol

true cedar
#

a really good question to ask yourself whenever u make literally anything in c# is

#

"do i REALLY need this"

random scaffold
#

on typescript

random scaffold
#

so i just made it

random scaffold
#

for future

icy knoll
true cedar
#

um

#

fuck i hate typescript

icy knoll
#

i love it

true cedar
#

#1 typescript hater

#

dumb type system

#

only good thing to come out of typescript is mixins

random scaffold
#

il code better

upper vapor
icy knoll
#

it’s so easy to use and types have a lot more options then in c# lol

true cedar
#

you don't want like 50 options for types

icy knoll
#

me when c# still doesn’t have union types

true cedar
#

typescript's type system is so fucked up

icy knoll
#

it’s really not

true cedar
icy knoll
#

it’s very simple

true cedar
#

what the fuck is this.

icy knoll
#

nobody writes that

true cedar
#

why is a type a new() => {}

#

WHY CAN YOU DO IT???

icy knoll
#

ig

upper vapor
#

wait until you have to do that with JSDoc

true cedar
#

structural typing is also fucked

icy knoll
random scaffold
icy knoll
#

i setup eslint to shut up about jsdoc types

upper vapor
true cedar
#

also

unique crane
true cedar
#

typescript doesn't have like actual actual union types just type intersections doesn't it

icy knoll
#

me when i wrote a simple api route for work in 2 minutes because of typescripts insane type inheritance system

true cedar
#

i mean like

icy knoll
true cedar
#

yeah so that's fucked up

icy knoll
#

makes sense to me

#

|| means or

true cedar
#

i know

icy knoll
#

so to not conflict with base js

#

|

true cedar
#

but in

#

normal languages

#

data Union = Hi | Hello

icy knoll
#

never seen that in my life

#

i love unions tho

true cedar
#

its haskell

#

but ITS NOT EVEN GOOD UNIONS

icy knoll
true cedar
#

me occassionally and my friend who is obsessed with programming languages

unique crane
random scaffold
#

but

true cedar
#

but you can't even properly do this

random scaffold
#

now one remained question

#

really why i made so hard system for the plugin

#

bruh

icy knoll
#

also i am a full time worker that is actually happy in life working with typescript, and im earning good, so i dont think any of your points are relevant when the language just works, and well, which it does, when you know how to use it

#

and i know how to use typescript

true cedar
#

its Evil

#

its an evil language

#

like java

icy knoll
#

don’t compare it to java

true cedar
#

i will compare it to java

#

it is evil in the same way java is evil

icy knoll
#

c# is closer to java than ts will ever be

true cedar
#

c# and typescript were designed by the same person

#

just saying

icy knoll
#

i know

upper vapor
true cedar
#

what the fuck.

icy knoll
#

i try to use interfaces wherever possible now tho

true cedar
#

i just prefer the functional type system so much more

hearty shard
#

holy yap

#

?!?!

icy knoll
#

i really like typescripts type inheritance, saves me writing “public bool Method()”

true cedar
#

how do u write in typescript

icy knoll
#

wdym

unique crane
#

You type

#

in typescript

hearty shard
#

david...

true cedar
#

i mean

unique crane
true cedar
#

how do you do type inheritance in typescript then

icy knoll
random scaffold
#

assembler better in anyway

icy knoll
#

will return string as the return type

true cedar
#

wh

hearty shard
#

never cook again

icy knoll
#

there is also

function func() { return “string” }

#

that will return string too

#

i just did lambda as easier to type on a phone

true cedar
#

structural inheritance should be illegal

#

what the hell

icy knoll
#

it works

#

you can also set a specific return type

#

function func(): string { return “string” }

upper vapor
true cedar
#

i just don't get it

#

the type system is sooo weird

icy knoll
#

once you get used to it, it just makes sense

#

i’m a full time worker working only in typescript and it’s lush

true cedar
#

still evil!!!

#

makes c# look like it was crafted by the hands of god personally

icy knoll
#

eh c# has its issues, and that’s why i only use it for c# plugins

#

won’t use it for anything else

true cedar
#

i mean yeah c# is a fucking awful language

icy knoll
#

especially not fucking apis or web apps

#

what the fuck

true cedar
#

today i learned

#

ICollection<T> does not inherit from IReadOnlyCollection<T>

icy knoll
#

how does someone make a website in blazor, it just doesn’t make sense, it always is pretty shit imo lol

random scaffold
true cedar
#

because IReadOnlyCollection<T> represents a collection that can be read from

#

and ICollection<T> represents a collection that can be written to or read from

spice hatch
#

how can i seperate event files

#

but register them all at once

random scaffold
hearty shard
#

why do you do it like that

random scaffold
hearty shard
#

this is NOT okay

#

😭

spice hatch
#

this is very much okay!

hearty shard
#

why r u doing it like that

spice hatch
#

idk to organize it

hearty shard
#

you dont need to organise it by having every event by itself

random scaffold
hearty shard
#

depends how big ur project is but for smth small just have 1 file

#

for smth medium 2-3

#

ofc it depends

random scaffold
#

PlayerHandler
ServerHandler

random scaffold
#

all what need

hearty shard
spice hatch
#

then it becomes messy

hearty shard
#

but for smth like

#

5 events

#

thats not very messy

spice hatch
#

ya so i want to future proof it

#

if it does get big

true cedar
#

thats

hearty shard
true cedar
#

you break it up LATER

hearty shard
#

thats not future proofing

#

yeah

random scaffold
#

@spice hatch

#

check file

#

and how works customeventshandler

#

register example here

#

30$?

#

im agree

#

xd

#

write in dm

true cedar
#

this is not the place

random scaffold
#

what you want

true cedar
#

he said he'd go higher

random scaffold
#

im agree on order

#

price later

unique crane
#

IGenericRemoteAdminOptionInstanceBasedPermissionResolver<in TOption>

random scaffold
#

..

unique crane
restive turret
restive turret
#

no i mean really nice one

stuck peak
#

also it's what Logic wanted, and now that DataStores don't automatically register if they haven't been there's no reason not to have them

restive turret
#

maybe a Tryget ?

stuck peak
#

I actually dislike the TryGet pattern (mostly because Async code can't have out parameters)

#

but sure

restive turret
#

bool TryGet(Player, out TStore? store);

stuck peak
#

yeah I know what you meant

restive turret
#

ah ye bc i can just skip the body if there is no store for that player

stuck peak
restive turret
restive turret
#

i can see both implementation being used for different things

#

fire

#

thanks!

#

might be more dicky requist but usable with just type? ClassDTroll

restive turret
#

Cus idk how would I do smth like that without the typelist

#

If you dont want to add it, thats alright too, I can do that work easily

stuck peak
restive turret
#

(on my own thing)

#

If u have other idea how would I do what shown above would be happy :)

true cedar
#

why don't players store their own datastores...?

stuck peak
#

meaning you don't get to access any of its custom fields/properties/methods unless you cast it

true cedar
#

but

#

you still do that with

#

the current way

#

Dictionary<Type, Dictionary<Player, CustomDataStore>>

stuck peak
#

I don't iterate over all of the players' stores and cast them
you are suggesting

foreach(CustomDataStore store in player.DataStores) {
  if (store is not SomeStore someStore) 
     continue;
  someStore.SomeMethod();
}

which is more expensive than just a single lookup and cast

#

but I guess in the case where multiple stores use an interface it can be useful Hmm

true cedar
#

i mean

#

you can still do Dictionary<Type, CustomDataStore>

#

or something

grand flower
#

Is there an easy way to check if a player is grounded?

#

oh fpcrole right nvm

glass karma
# upper vapor this is how base-game does it

I'm needing to access them to copy the permissions for a custom keycard based off a given normal keycard. is that what GetTemplate/TryGetTemplate could do if I provided a normal keycard instead of one of the custom types?

#

sorry if this question's gibberish, I'm not exactly sure how to put it

grand flower
#

Is there a way to check if a relative position's waypoint id is an elevator?

#

or well, if a player is in an elevator

worthy rune
#

you could try

if (WaypointBase.TryGetWaypoint(id, out WaypointBase wp) && wp is ElevatorWaypoint)
    ...
grand flower
#

And the player would only use it as a waypoint if they were inside right

#

or well no

worthy rune
#

using the waypoint would be the same as checking if they are inside yes

grand flower
#

ah okay

#

cool ty

#

so wait

#

what waypoint does it use on surface

#

gate doors?

worthy rune
#

im not sure, there might be multiple on surface

grand flower
#

well as long as the elevator waypoint isn't ever used while the player is outside an elevator that's fine

worthy rune
#

yeah it wont be used while outside the elevator

grand flower
#

hmmm

#

do players have a cached relative position? like last relative position or something, or even just waypoint id

#

would make it easy to add a cheap extension method to check if the player is an elevator that way

worthy rune
#

if your still doing the cached thing from before i would use that

grand flower
#

I suppose I could

#

would be one frame late but cheap

teal junco
#

is there a basegame way to track footprints from damage?

hearty shard
#

Or wdym

teal junco
hearty shard
teal junco
#

well i can cast it right

hearty shard
#

Cast exiled?

#

or what

teal junco
#

cast the damagehandler to attackerhandler?

grand flower
#

yes

hearty shard
#

yes

grand flower
#

the frame delay isn't an issue for how cheap certain things get

#

uh

#

nvm

#

it doesn't work @worthy rune

#

wait sorry im stupid

#

didn't see the patch errored

#

my bad

worthy rune
#

xD all good

grand flower
#

gets drowned in all the logs from plugins on init rip

#

ah yeah oops, removed the wrong instructions

grand flower
#

sweet ty

limpid fjord
#

:/

grand flower
limpid fjord
#

public:

grand flower
#

wat

teal junco
#

how do I get the victim for a damagehandelr?

worthy rune
#

how did you obtain the damange handler in the first place

teal junco
#

Oh fuck, the thing I wanted to patch actually has the victim

#

dumb question sorry

true cedar
#

not the dumbest question someone here has asked

upper vapor
dull temple
random scaffold
severe cave
#

is there any event like onSentConsoleCommand?

random scaffold
#

patch CommandProcessor

icy knoll
worthy rune
#

theres the CommandExecute event

unique crane
restive turret
#

What if original author no longer devs for sl

royal mica
#

You can still contact for permission

unique crane
#

or there is license on the repo

royal mica
#

was about to ask if it is MIT, can someone just fork and post

unique crane
#

If license allows that

#

yea

dull temple
unique crane
severe cave
#

Is there a method to activate the alpha warhead?

random scaffold
#

Warhead.Start

severe cave
#

thanks

carmine prawn
#

Can I make a player consume less or no stamina?

#

guess I need patch

hearty shard
#
 public class StaminaUsageDisablerEffect : CustomPlayerEffect, IStaminaModifier
    {
        /// <inheritdoc />
        public bool StaminaModifierActive => IsEnabled;

        /// <inheritdoc />
        public float StaminaUsageMultiplier => 0;

        /// <inheritdoc />
        public override EffectClassification Classification => EffectClassification.Positive;
    }
#

me when i

slate flume
#

Hi Eve

hearty shard
#

hi there

slate flume
#

How're you doing

hearty shard
#

im good

slate flume
#

That's good

severe cave
#

what does rawNumber means in Cassie.CalculateDuration?

slate flume
#

You know you've been like my hero for these past weeks cause it seems like you're the only person talking about things I actually have a problem with @hearty shard lmao

hearty shard
#

im goated

slate flume
#

You are!

#

Like recently I was dicking around with voice messages and you were one of the few people who actually was talking about voice channel stuff

hearty shard
slate flume
#

Though it doesn't help that Discord search sucks really badly

#

I have to search for a while to find shit lmao

restive turret
#

me patching out exiled events just because i want to set certain things

slate flume
hearty shard
#

real

restive turret
#

other mods req it

severe cave
#

can somebody pls tell me what rawNumber means in Cassie.CalculateDuration?

hearty shard
slate flume
#

Then don't use those mods 🤷

hearty shard
restive turret
#

we moving to labapi but waiting on projMER

severe cave
random scaffold
#

lol

restive turret
#

converting numbers to thousands

random scaffold
#

already 642 servers with exiled

restive turret
#

hundred

random scaffold
#

3 days ago was 666

restive turret
#

etc

hearty shard
#

holy

#

have to upload it as a file

#

cuz its that long

slate flume
carmine prawn
restive turret
hearty shard
severe cave
hearty shard
#

rawNumber is used here

restive turret
#

ye

slate flume
restive turret
#

when its false it runs that

hearty shard
#

oh

#

thats

#

what u mean

restive turret
#

?? read?

slate flume
#

It's just used for number parsing

#

If I read it correctly lol

hearty shard
slate flume
#

@severe cave tl;dr: you have no reason to fuck with rawNumber

#

Leave it alone

#

Don't touch it

severe cave
#

I just needed to pass it in a coroutine like waiting seconds or something like that

#

bro

restive turret
restive turret
#

OHH nice one

severe cave
restive turret
#

you reg the effects into the prefab GO

slate flume
#

Don't

#

You'll fuck up the number parsing

restive turret
#

isnt you need to run the init after you regged all?

severe cave
slate flume
restive turret
#

he getting touched

#

so sad

slate flume
#

You guys like my plugin entry?

severe cave
carmine prawn
slate flume
carmine prawn
hearty shard
slate flume
hearty shard
slate flume
#

I did Harmony.PatchAll() and had all my attributes and it ended up completely just not registering my patches for some reason

random scaffold
carmine prawn
#

and maybe you can RegisterEventsHandler with Reflection

random scaffold
#

better make IModule system

carmine prawn
random scaffold
#

void Enable();
void Disable();

hearty shard
#

do you guys like my entry trolling

random scaffold
#

why wrong naming

slate flume
random scaffold
hearty shard
#

is an interface

#

not named wrong

random scaffold
#

you cant configurable it

hearty shard
#

mscorlib.dll adds functionality from standard 2.1

hearty shard
slate flume
random scaffold
#

and register it from config