#plugins-dev-chat

1 messages ยท Page 31 of 1

celest thorn
#

doesn't it get modified?

restive turret
#

Magic

celest thorn
#

am i being stupid

#

probably

grand flower
#

wdym modified

celest thorn
#

new position

grand flower
#

it's only cached within one update

#

it won't be changed during that update

#

it's why I clear the cache at the start of the update

celest thorn
#

Ok so

#

you cache the target

#

and from there if they have it just sent it

#

or the reciver?

#

because both could be

grand flower
#

I cache this

#

if we have a relative position for the target's position, we use it

#

else we create & cache it

restive turret
#

RelativePosition more like ComplicatedPosition

celest thorn
#

because there's like thousands of class

#

for this

grand flower
#

I'll be honest

#

I don't like relative positioning

#

I find it somewhat overkill for what it's meant to achieve

celest thorn
#

Like where are you starting to cache this

#

because

restive turret
#

You can always round up to 3rd one in float

grand flower
#

not even necessary

celest thorn
#

Example here i don't even see what you mention

grand flower
#

replace that with the GetOrCreate method that gets cache or creates it

restive turret
#

And isn't big, 12 byte (4,4,4)

grand flower
#

We use doubles in Unreal

restive turret
#

Decimal

grand flower
#

With higher player counts

celest thorn
#

if you check the position is the same instead of clearing it

restive turret
#

16*3 ClassDTroll

grand flower
#

so I opted to cache per-frame

upper vapor
# grand flower

If we could eliminate the transform getter that would be poggies

grand flower
#

safest option which gives huge results anyway

upper vapor
#

Or LabFine

restive turret
grand flower
#

If I get permission from the head honchos at Brights mayhaps

grand flower
#

In the meantime you've got all the info to reproduce it yourself

celest thorn
#

i will try to contribute it

celest thorn
#

because it could be a game changer

grand flower
#

depends on the hardware

#

got ~5-7 TPS at 48 players bonus

celest thorn
#

but wait

#

now that i think about it

#

i did similar thing

#

when i was working on the 100 players for lars

grand flower
#

caching defo helps for 100 players but round robin adds a lot to it as well

celest thorn
#

and i've managed to make a server with 100 player moving randomly to 5 tps to just 40

restive turret
#

I going to try the V3 stuff today

#

Maybe it will work for me

grand flower
#

Doubt the plugin will be open source, but I might be able to get permission for some gists

celest thorn
#

but yea i will try to recreate it

#

and if i do i will make it open

grand flower
#

It's not too complicated

celest thorn
grand flower
#

Next up on my list is adaptive update rates

celest thorn
#

i think i got the idea

#

and i can improve it

grand flower
#

Goal is 30 TPS minimum @ 48 players on a single-core server

random scaffold
grand flower
#

Slowly getting it there bit by bit

grand flower
#

yeah

restive turret
#

Pentium

celest thorn
#

and they are quite a pain

grand flower
restive turret
celest thorn
#

so a win is a win

restive turret
#

Optimize the collisions on the map

#

Easy more fps

celest thorn
#

that is already implemented

restive turret
#

How do u delete a non networked go?

grand flower
#

Object.Destroy?

celest thorn
restive turret
#

I mean

celest thorn
#

100% of all of the primitives are client side

#

only like ServerSide one with Components aren't

grand flower
#

probs a mirror message

celest thorn
restive turret
#

Hey all client, destroy this game object

celest thorn
#

thats it

#

lol

restive turret
#

No fucking way

#

I have to find it

celest thorn
#

i just do alot of more

#

than that

restive turret
celest thorn
#

trust me 90% of the stuff is unknown shit i do

restive turret
#

Gatekeepers

celest thorn
#

and 10% is optimizing

celest thorn
restive turret
#

And 99% you don't know that to do

celest thorn
#

nor talk in a specific way

celest thorn
#

at some point it will be impossible

restive turret
#

Delete the game

#

Best optimalization

celest thorn
restive turret
celest thorn
#

you gave me an idea

#

I NEED those FPS

#

i want to run 100M primitives

#

in one server

#

now im in half

#

so only 50M is the max before ram runs out

#

and server cpu explodes

upper vapor
restive turret
#

Just don't send all at once

celest thorn
restive turret
#

I spawned like 10*RoomCount coins and server froze for like 10sec

celest thorn
#

60 tps

#

stable

#

with 200k primitives in total

#

:3

#

50M makes the server at 50 TPS

restive turret
#

Well those are client side not server

celest thorn
#

and even those are optimized :3

restive turret
celest thorn
#

I just don't have anything else to optimize

#

I optimized it so much

#

that its impossible

restive turret
#

Animations

#

ik

celest thorn
#

Animations

#

never

#

possile

#

BUT

#

i've made a way

#

that i can run a version of them

#

actually with client side ones :3

restive turret
#

Remove animations, easy

#

Also is skeles disguise big still there or

upper vapor
# restive turret Just don't send all at once
public sealed class MapGenerator : IDisposable
{
    private GameObject _mapParent;
    private CoroutineHandle? _handle;
    public event Action OnCompleted;
    public float Progress { get; private set; } = -1;

    private void InvokeCompleted()
    {
        Progress = 1;
        OnCompleted?.Invoke();
    }

    private void SpawnMapInstantly()
    {
        _mapParent = API.SpawnObjects(Map.Objects, MapSpawnPosition);
        Logger.Info($"Successfully loaded map {Map.Name}");
        InvokeCompleted();
    }
    private void SpawnMapPeriodically()
    {
        Logger.Info($"Periodically loading map {Map.Name}");
        _mapParent = API.CreateObjects(Map.Objects, MapSpawnPosition);
        _handle = Timing.RunCoroutine(SpawnPeriodically());
    }

    private IEnumerator<float> SpawnPeriodically()
    {
        yield return Timing.WaitForSeconds(1f);
        var components = _mapParent.GetComponentsInChildren<NetworkIdentity>();
        var total = (float) components.Length;
        for (var i = 0; i < components.Length; i++)
        {
            var identity = components[i];
            Progress = i / total;
            var o = identity.gameObject;
            if (!identity.TryGetComponent<slocObjectData>(out var data) || data.ShouldBeSpawnedOnClient)
                NetworkServer.Spawn(o);
            if (i % 100 == 0)
                yield return Timing.WaitForSeconds(0.1f);
        }
        Logger.Info($"Successfully loaded map {Map.Name}");
        InvokeCompleted();
    }
}
#

The illusion of slow loading

#

Looks better with the progressbar though

restive turret
#

Me when i
VAL |DATING

upper vapor
#

What

restive turret
#

The I in validating isn't really shown

#

Same in loading something cuts off cus of the font

grand flower
#

trying something for the luls

#

skipping the update of all dummies

#

p much zero benefits for normal gameplay since you (generally) don't use em

upper vapor
#

dummy.gameObject.SetActive(false)

grand flower
#

but funny

upper vapor
grand flower
#

has no impact

#

good to know lol

restive turret
grand flower
#

wish we had access to a profiler

#

would make hunting and patching performance issues so much easier

restive turret
#

Ask David

#

Imagine profiler branchSteamHappy

grand flower
#

idk why that couldn't be a thing

#

not like PDBs would be an issue considering it's already unobfuscated C#

celest thorn
restive turret
#

Ye its already ifdeffed out

celest thorn
#

if they will make it

#

that shit will be amazing

grand flower
#

gimme a profiler and I'll go ham on fixing stuff for you NW

grand flower
#

I just want my favorite server to run better

#

;-;

celest thorn
#

Honestly

#

you know what we can do

#

Mirror wrapper

restive turret
#

Huh

celest thorn
#

and then make SL Server in another language

restive turret
#

Ah

celest thorn
#

trollfancy c++ scp sl server

restive turret
#

Have fun ClassDTroll

restive turret
#

Make the server in JavaScript

#

: ๐Ÿ”ฅ

celest thorn
grand flower
#

more of a hassle than just patching the oddities out and reporting anything that needs clientside changes to NW

restive turret
#

Remove client

celest thorn
#

Remove Central Server

restive turret
#

It will be server side ๐Ÿ”ฅ

celest thorn
#

no SL

celest thorn
upper vapor
#

๐Ÿ˜ญ ๐Ÿ˜ญ ๐Ÿ˜ญ ๐Ÿ˜ญ

#

Fart night

royal mica
#

No, Portal 2 SCP SL Server

slate flume
#

So uhh which one is the observer and which is the SCP

upper vapor
#

Check docs

#

Quick documentation

#

Idk what it's in vs

slate flume
terse bone
slate flume
#

I appreciate it ๐Ÿ™

grand flower
#

Generally you can see it this way: Player is the player concerned with the event.
PlayerHurt: Player is the one that got hurt.
ScpXXX: Player is the SCP
etc etc

#

bit confusing at first

upper vapor
slate flume
#

It happens so much that I accidentally mistype and forget an exclamation mark and wonder why everything broke

grand flower
#

wut

#

wdym

slate flume
#

Spot the difference:

#

That's what I mean

icy knoll
slate flume
#

The list starts empty

#

In the first nothing ever gets added to it

#

Cause it's never contained

icy knoll
#

yeah because you are checking if the player exists, but it never does

slate flume
#

Exactly

icy knoll
#

so ur either adding a dupe or adding nothing

#

well

#

both actually

slate flume
#

Lmao I was like "why was my code not working" and then I realized I forgot a !

restive turret
normal pawn
#

Is it possible to change door's permission and make panel display new permissions?

wispy dirge
#

is there a way to add a door to door management

#

when you destroy a doors gameobject thats on door management you can remove it

#

but is there a way to add one

upper vapor
upper vapor
#

Not sure if it shows up in RA

#

But with doorTP it works

wispy dirge
#

k

pseudo hawk
#

For my plugin Iโ€™m using a local sqlite database. Currently Iโ€™m using Task.Run to perform non-blocking read/write operations. Should I be using something different like the async system unity provides or Job scheduling?

terse bone
#

you can keep using tasks or use Unity's Awaitable

normal pawn
#

Does the Custom info allow new lines? If I set ci like this

line 1
line 2
``` it says that custom info doesn't match regex
normal pawn
#

I just don't understand regex

hearty shard
#

errrr

#

throw it to ChatGPT "pls explain how this works"

normal pawn
#

Like wth does this mean ^((?![\\[\\]])[\\p{L}\\p{P}\\p{Sc}\\p{N} ^=+|~`<>\\n]){0,400}$?

hearty shard
#

\n is allowed

slate flume
#

Hi @hearty shard I had a quick question if you're available
I got SecretAPI working, but I noticed that the HandleSettingUpdate runs once when the button is pressed, and once when it's depressed
Is there any function or method I can use to run only when the button is pressed, or should I just use a flip-flopping boolean?

slate flume
#

Gotcha

#

Lol

#

Thank you

hearty shard
#

or Base.IsPressed

#

i forgot

#

yea Base

slate flume
#

Sorry bit of a dumb question but I really appreciate it haha

hearty shard
#

yea no worries

icy knoll
hearty shard
#

negative

icy knoll
#

yeah just looked

#

why not bruh

hearty shard
#

cuz i didnt make it

#

yet

restive turret
hearty shard
upper vapor
#

Pretty helpful if you need to understand regexes in the future

normal pawn
upper vapor
#

Omg i could post a link

#

-# chatgpt can also probably explain it

hearty shard
#

you have to resend when setting these

#

so maybe i should make my settings resync when changed?

#

idk

#

id have to rework my thing since it would send the default options

#

idk

#

i hate this

#

im just gonna obsolete the setters

#

thats the solution atp

#

nw pls rework SSSS

#

this shit SUCKS

agile oasis
#

where you got CallNextFrame ?

upper vapor
#

you can just do Timing.CallDelayed(0.1f, () => {})

#

also it's fixed i think

icy knoll
#

does the exact same thing btw LOL

upper vapor
restive turret
#

set to (1/60)

upper vapor
#

what if the tps is not 60

#

as in the configured value

restive turret
#

skill issue

#

set to 144

royal mica
#

120 tick, just like cs lule

buoyant oyster
#

does changing ev.Items in PlayerReceivingLoadoutEvent cause the loadout to change?

random scaffold
#

how to fix fucking micro freezing in visual studio while inputting text or press buttons?

#

used gpu

upper vapor
#

stop using vs

#

try disabling GPU acceleration

random scaffold
upper vapor
#

driver issue maybe?

random scaffold
#

latest

#

oh

terse bone
#

latest doesn't mean the best

random scaffold
#

freezing only when im choosen youtube in browser

#

lol

upper vapor
terse bone
#

windows moment

young phoenix
#

is there a way to get the displayname of the player that left, when I use PlayerLeft event it returns null

terse bone
#

Patch CustomNetworkManager.OnServerDisconnect can't check rn what to patch exactly

random scaffold
#

Im too lazy to search so

#

how i can make [No Reports] or other custom text in RA Players?

restive turret
#

Making custom
[FakePlayers]

hearty shard
#

dont show them anywhere except RA

random scaffold
hearty shard
royal mica
#

Using my solution requires no additional deps mmLol

upper vapor
royal mica
#

using the CommandSystem is much easier to maintain though

#

since this way, the system can break any time

upper vapor
#

wait until NW breaks a patch by compiling the game on another machine and thereforce changing a local indextoomuchtrolling

royal mica
#

lmao

#

that would break the whole RA

#

cause wrong class

upper vapor
#

the patch would likely fail

#

so you wouldn't see RA options

#

-# has happened before with commands

true cedar
#

and then search for the index

upper vapor
#

won't help if the local index changes

true cedar
#

u can search for the index to use

restive turret
#

If u replace the whole function u dont need it

true cedar
#

like match a section of code around a ldarg.1 / 2 / 3

#

then get what instruction it is (and the operand)

upper vapor
#

too complicated

#

i might write extensions for it

true cedar
#

yea but its futureproof

upper vapor
#

but for now, not worth it

true cedar
#

make a .GetLoadLocal method that returns a new codeinstruction that loads the localindex and a .StoreLoadLocal and whatnot

hearty shard
# upper vapor too complicated
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
        {
            CodeMatcher codeMatcher = new CodeMatcher(instructions)
                .MatchEndForward(
                    new CodeMatch(OpCodes.Ldloca_S),
                    new CodeMatch(OpCodes.Call),
                    new CodeMatch(OpCodes.Isinst))
                .SetInstruction(new CodeInstruction(
                    OpCodes.Call,
                    Method(typeof(Allow3114SpawnableScpPatch), nameof(IsValidSpawnableRole))));

            return codeMatcher.InstructionEnumeration();
        }
#

i match the 3 instructions and now im on Isinst instuction
then i set that instruction

#

its rly not that much effort

true cedar
#

no they're talking about copying the index

hearty shard
#

hm?

upper vapor
#

i need to extract the local index to use it

true cedar
#

1 sec

upper vapor
#

btw i'm definitely not gonna get to it soon

true cedar
#

i wish opcodes weren't dumb

upper vapor
#

um

true cedar
#

yea.

#

wait for that u can just do

hearty shard
#

what the fuck

#

๐Ÿ˜ญ

true cedar
#

oh you can't FUCk

upper vapor
hearty shard
upper vapor
#

did i ever cook?

hearty shard
#

u right

upper vapor
#

i can (maybe) make fried chicken

#

that's it

true cedar
#
public static CodeMatcher ExtractIndex(this CodeMatcher matcher, out int index)
{
    OpCode opcode = matcher.Instruction.opcode;
    if (opcode == OpCodes.Ldloc_0 || opcode == OpCodes.Stloc_0)
    {
        index = 0;
    }
    else if (opcode == OpCodes.Ldloc_1 || opcode == OpCodes.Stloc_1)
    {
        index = 1;
    }
    else if (opcode == OpCodes.Ldloc_2 || opcode == OpCodes.Stloc_2)
    {
        index = 2;
    }
    else if (opcode == OpCodes.Ldloc_3 || opcode == OpCodes.Stloc_3)
    {
        index = 3;
    }
    else if (opcode == OpCodes.Ldloc || opcode == OpCodes.Stloc || opcode == OpCodes.Ldloca ||
        opcode == OpCodes.Ldloc_S || opcode == OpCodes.Stloc_S || opcode == OpCodes.Ldloca_S)
    {
        index = (int)matcher.Instruction.operand;
    }
    else
    {
        throw new InvalidOperationException("Current instruction must be a opcode that uses a local index";
    }

    return matcher;
}
upper vapor
#

yeah i've thought of that

true cedar
#

if the geniuses behind microsoft just made the opcodes a fucking enum

upper vapor
#

um

#

no

#

:3

true cedar
#

literally u can give enums specific values

#

and add extensions to them

#

so there is no reason to make them structs wtf

hearty shard
#

sob

true cedar
#

thats kinda why i want to rewrite harmony

#

would be wonderful to make my own not stupid opcode class

#

OR BETTER YET IF THEY HAD FUCKING PROPER UNION TYPES

true cedar
#

oh ik

#

problem is that if they ever added union types

#

it'd probably be like f#'s union types

upper vapor
#

you can hack them with records

true cedar
#

which are incredibly fucked

upper vapor
#

where did you get that number from

restive turret
#

from my ass

#

@upper vapor

upper vapor
#

sob

icy knoll
upper vapor
#

oh

#

lol

true cedar
hearty shard
icy knoll
#

i wish you could do switches based on that kind of stuff, or based on what flags exist inside of smth also

random scaffold
# true cedar u cant do switch
public static CodeMatcher ExtractIndex(this CodeMatcher matcher, out int index)
{
    switch (matcher.Instruction.opcode)
    {
        case OpCodes.Ldloc_0:
        case OpCodes.Stloc_0:
            {
                index = 0;
                break;
            }

        case OpCodes.Ldloc_1:
        case OpCodes.Stloc_1:
            {
                index = 1;
                break;
            }

        case OpCodes.Ldloc_2:
        case OpCodes.Stloc_2:
            {
                index = 2;
                break;
            }

        case OpCodes.Ldloc_3:
        case OpCodes.Stloc_3:
            {
                index = 3;
                break;
            }

        case OpCodes.Ldloc:
        case OpCodes.Stloc:
        case OpCodes.Ldloca:
        case OpCodes.Ldloc_S:
        case OpCodes.Stloc_S:
        case OpCodes.Ldloca_S:
            {
                index = (int)matcher.Instruction.operand;
                break;
            }
        default:
            {
                throw new InvalidOperationException("Current instruction must be a opcode that uses a local index";
            }
    }

    return matcher;
}
#

fully can

true cedar
#

nah

#

at least in my c# version

#

tested it and it doesn't work on latest either

unique crane
#

Thats just a static property no?

true cedar
#

yea

grand flower
#

Can't do a pattern matching switch?

true cedar
#

nope

#

afaik

grand flower
#

F

unique crane
#

GPT once again did not cook well...

random scaffold
#

lol

hearty shard
icy knoll
#

i thought OpCodes was an enum myself lol

#

unless enums arent constants

hearty shard
#

OpCodes is not however

icy knoll
#

hmm

#

why arent they enums?

hearty shard
grand flower
vagrant lantern
#

guys I need auto round lock

#

Where I can found it

grand flower
#

if it isn't there, it'd take 10 mins to make from scratch

vagrant lantern
#

guys What PlayerRoles ฤฐs deleted ?

#

or exiled problem?

#

or I'm dumb?

#

sorry for plugin name

olive falcon
vagrant lantern
#

thx

vagrant lantern
hearty shard
#

base..ctor() isnt a valid call

#

where did you get this from

vagrant lantern
#

from a guy

hearty shard
#

Also

#

You shouldnt be doing stuff in plugin constructor

vagrant lantern
#

Idk what to do

#

nvm fixed

true cedar
#

is that because some opcodes are made up of effectively two parts

#

they didn't want opcodes that weren't to be made up of two parts too

restive turret
#

It's OpCode.

young phoenix
#

is there a way to detect when scp-3114 changes skin?

true cedar
grand flower
#

through patching, probs

restive turret
true cedar
restive turret
#

Yes i know but there is an enum too

true cedar
#

is it a harmony one

true cedar
restive turret
#

Not on pc ask tomorrow

true cedar
#

harmony has a method to do this lol

#

GeneralExtensions.LocalIndex

grand flower
#

also

#

you can defo make a switch with the right enum

#

OpCodeValues

#

if you publicize it heh

true cedar
grand flower
#

System.Reflection.Emit

true cedar
#

yeaaaa

#

im not publicizing the standard lib

hearty shard
#

๐Ÿ’€

true cedar
#

although i would love some very specific dictionary methods

#

IN PARTICULAR

#

why is there no swap method

#

for stuff like this

#
if (dictionary.Swap(key, value, out var oldValue))
{
    oldValue.CleanUp();
}
grand flower
#

being able to wipe out an entire method and overwrite it with the IL I want is bliss

true cedar
grand flower
#

just needed to return a value instead of conditionally multiplying it first

#

once I'm done with actual work I'll probably hunt down other ways to make 48 player servers run @ 30TPS minimum on limited resources

true cedar
true cedar
#

unsafe operations on collections

hearty shard
#

Oh

#

ur not safe

hearty shard
#

I want to murder you!

true cedar
#

WHAT THE HELL

hearty shard
#

UwU

upper pike
#

Text toys aren't detected by raycasts or RaycastHit are they?

grand flower
#

shouldn't be

unique crane
upper vapor
#

On NWAPI you couldn't say that

upper pike
unique crane
#

You can.. just add the layer to the raycast mask

#

I guess?

upper pike
#

Ngl, i forgot layermask was a thing

random scaffold
#

how i can using .net 8 for .dll?

#

server written error about System.Collections

grand flower
unique crane
#

Any higher version than 4.8.X is not guarantee to work

grand flower
#

might be able to get away with using .net standard 2.1 max for a dependency but I doubt you can make a plugin in anything but 4.8

random scaffold
unique crane
#

Edit csproj

random scaffold
#

each times find project in files and edit csproj

unique crane
#

Then make project template for SL plugins

unique crane
grand flower
#

Outside of the FpcServerPositionDistributor are there any known hot paths for servers

grand flower
#

although I do have an idea I wanna try next

#

tick aggregation

#

probably more around the time I run out of other avenues I can try though

worn gull
#
public static bool HasKeycardPermission(
        this Player player,
        DoorPermissionFlags permissions,
        bool requiresAllPermissions = false)
    {
        if (player.HasEffect<AmnesiaVision>())
            return false;

        return requiresAllPermissions
            ? player.Items.Any(item =>
                item is KeycardItem keycard && keycard.Base.GetPermissions(player as IDoorPermissionRequester)
                    .HasFlag(permissions))
            : player.Items.Any(item =>
                item is KeycardItem keycard &&
                (keycard.Base.GetPermissions(player as IDoorPermissionRequester) & permissions) != 0);
    }```
Hi! Why is that if I have a ChaosKeycard then it returns false but with anything else keycard true?
grand flower
#

chaoskeycard doesn't derive from the same stuff iirc

#

for some reason

worn gull
#

And how can I fix it?

restive turret
#

item.Base

worn gull
#

Found it ๐Ÿ˜„

icy knoll
#

C# should have a has keyword to get properties that you know may exist smh

restive turret
icy knoll
upper vapor
upper vapor
#

I don't understand what you mean

royal mica
#

so like in JS you can just do keycard[AmmoType]

#

and just ball it keycard has { AmmoType: AmmoType.Something }

#

which is obviously false cause keycard doesn't have AmmoType

grand flower
#

mfw C# is a statically typed language and doesn't have dynamically typed language features

restive turret
#

Just use dynamic thenFear

icy knoll
royal mica
#

I do not think it'll be tbh, as others stated, it is a dynamic language feature

#

You should type check and cast

unique crane
#

30 dummies

#

Note that this is dev build sooo

#

Yea

worthy rune
#

btw is that creategame or dedicated server

unique crane
#

Dedicated build

worthy rune
#

interesting that the cullingSubcontroller is that expensive

unique crane
#

yeah its the IK animations

grand flower
#

on the server?

unique crane
worthy rune
#

its required to animate the hitboxes

unique crane
#

^

worthy rune
#

but i think it might be skinning the meshes still?

#

which isnt required

unique crane
#

0 clue

#

Never worked with animations

#

and especially IK

grand flower
#

considering the fact cheaters clearing don't give a damn about the hitboxes, I'm being brutally honest: why?

#

SL isn't a competitive esports shooter

#

Why not stop at a simple capsule collider check

unique crane
#

@worthy rune also uhhhh

worthy rune
#

uuh

unique crane
#

Perhaps we should add check if there is any event handler registered before firing "every frame events"

worthy rune
#

Eves fault

grand flower
#

can I just like

#

patch out the whole hitbox animations on the server

worthy rune
# unique crane

do you still have that open, how expensive is the animator if you change the role of all the dummies to SCP049

#

iirc scp049s hitbox is a single capsule

unique crane
#

sec

#

There isnt any wildcard for all players

#

is there

worthy rune
#

no i think you just have todo 1.2.3.4.5

grand flower
#

any gain is a good gain atp

#

if it doesn't affect gameplay i'm pretty much throwing it out

unique crane
worthy rune
#

it depends i know for humans you will have to deal with head hitboxes and what not

grand flower
#

does the client let the server know what hitbox it hit

worthy rune
#

dont think so

unique crane
icy knoll
unique crane
#

wtf

#

How is getSpeed slower than raycast

#

(pretty sure that grounded use raycast)

#

Oh I see why

grand flower
#

because it's wildly overkill for a casual game like SL

#

games like Valorant don't even simulate animations on the server until a shot is made in the direction of the player

worthy rune
grand flower
#

fair enough

#

just that i'm looking through it all and just thinking that the codebase would fit a more competitive game better than SL

#

and SL's needs don't justify the performance hits

worthy rune
#

i had a look and hitreg is fully server side, client only sends their pos/rot and main target pos/rot

grand flower
#

bummer

#

I can probably still simplify the logic

#

calculate where the player's head would be approximately based on their pitch

#

additionally the backtracker stuff actually moves players which does transform updates etc

#

would be cheaper to just use the saved backtracked position/rotation and bounds to determine if it would plausibly hit

#

and then the player would just report the hit (like it already does) giving the server a very cheap way to check

grand flower
#

Just so I can take note and put it on my optimization patches list

worthy rune
#

ShotBacktrackData

grand flower
#

ty

#

my new goal is pretty much gonna be dumbing down the entirety of that stuff

random scaffold
# grand flower send the error
[ERROR] [LabApi] System.TypeLoadException: Could not load type of field 'Sex.Core.Plugin:_handlers' (1) due to: Could not load file or assembly 'System.Collections, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
                                   at (wrapper managed-to-native) System.RuntimeType.GetConstructors_native(System.RuntimeType,System.Reflection.BindingFlags)
                                   at System.RuntimeType.GetConstructors_internal (System.Reflection.BindingFlags bindingAttr, System.RuntimeType reflectedType) [0x00008] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.RuntimeType.GetConstructorCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[] types, System.Boolean allowPrefixLookup) [0x00047] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.RuntimeType.GetConstructors (System.Reflection.BindingFlags bindingAttr) [0x00000] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.RuntimeType.GetDefaultConstructor () [0x0002c] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00000] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00020] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at System.Activator.CreateInstance (System.Type type) [0x00000] in <069d7b80a3914a08b6825aa362b07f5e>:0 
                                   at LabApi.Loader.PluginLoader.InstantiatePlugins (System.Type[] types, System.Reflection.Assembly assembly, System.String filePath) [0x0001c] in <bea7f403b90e4786abd99fa819db9853>:0 
                                   at LabApi.Loader.PluginLoader.LoadPlugins (System.Collections.Generic.IEnumerable`1[T] files) [0x000ed] in <bea7f403b90e4786abd99fa819db9853>:0
grand flower
#

nice plugin name

#

make sure you put System.Collections.dll into your LabAPI\dependencies\global folder

random scaffold
grand flower
#

Build your plugin it'll be in your build folder

#

if you use it

#

uh wait

#

what .NET version are you using

random scaffold
#

all files

random scaffold
grand flower
#

yeah nah

random scaffold
#

?

grand flower
#

that won't work

#

you gotta target .NET Fx 4.8 or potentially .NET Standard 2.1 (and that's already unsure)

royal mica
#

(You do not need to change from dotnet8, just change target)

random scaffold
royal mica
#

Edit the .csproj and just add <TargetFramework>net48</TargetFramework> in the PropertyGroup

grand flower
# grand flower my new goal is pretty much gonna be dumbing down the entirety of that stuff

alright todo list:

  • Throw out the whole animation stuff on the server (CullingSubcontroller)
  • Patch the backtracker stuff not to move players, but instead use some sort of proxy capsule/bounds check. Idk how I'll patch it yet but I'll figure it out. This sort of thing is easier done in the original codebase lol.
  • Patch hitreg to determine if it was headshot or not based on approximate position of the player's head instead of hitting the hitboxes directly. As well as using capsule bounds for plausibility. Don't care about being accurate or not, not an esports shooter.
  • FpcMotor.GetSpeed is evil
random scaffold
#

magic

grand flower
#

also open ended question but do grenades affect the same gameobject multiple times in ExplosionGrenade.Explode

#

Physics.OverlapSphere returns Collider[] but some pickups seem to have multiple colliders?

upper vapor
#

Uhhhhh

#

Doesn't it have a

random scaffold
#

how can I make it possible to open csproj by double-clicking on the project name as in net 8?

upper vapor
#

Damageable cache list or something

random scaffold
#

no

upper vapor
#

Actually that doesn't work

grand flower
#

hmmm it does

#

although not for rigidbodies, it doesn't check for those mmLul

random scaffold
upper vapor
#

Just select it and press the keybind

grand flower
#

so it can trigger multiple times per pickup if it has multiple colliders

#

fun

unique crane
#

funny

grand flower
#

I can patch it on the server but not client

#

plz fix

random scaffold
#

someone making factories for modules in the plugin?

#

xd

upper pike
#

How come my Ubuntu installation of JetBrains Rider only goes up to C# 9.0 while my Windows laptop has the latest version if they're both 2025.1.2

upper vapor
#

Doyou have the new sdk

random scaffold
#

how i can change .net framework 4.8 c# version for all projects?

random scaffold
#

impossible

frail zinc
random scaffold
#

choosen automatically

frail zinc
#

Wdym ?

terse bone
#

just modify .csproj <LangVersion>latest</LangVersion>

upper pike
upper vapor
#

No .0

upper pike
#

Thing is, if i set it to c# 11, then both c#11 and #10 show up as an option in the IDE

#

But it just refuses to compile

random scaffold
#

it works

#

magic lol

#

reflection one love

upper vapor
#

Try dotnet build in the terminal

upper pike
#

No I don't

upper vapor
#

Cam you show your csproj?

upper vapor
restive turret
#

Bruh

#

If you dont have the sdk why would you think targeting to that langLevel would work

upper pike
#

Because I forgot I had to delete it earlier

#

And Linux doesn't exactly work perfectly with dotnet

upper vapor
#

that happens

unique crane
#

I would create rawest windows VM for c#

#

If I used Linux as primary OS

unique crane
#

ยฏ_(ใƒ„)_/ยฏ

#

Why not

upper vapor
#

seems like a bit of a stretch

unique crane
#

Hmmm

#

Maybe

icy knoll
#

me when i make sl plugins on macos

upper vapor
#

macos in general

unique crane
restive turret
unique crane
#

Whyyy

icy knoll
icy knoll
restive turret
#

nah

icy knoll
icy knoll
#

i use macos daily

#

so much nicer to code on than windows

#

lol

restive turret
#

eh

#

its same editor no?

#

u use rider

icy knoll
#

only problem is i cant test til im on windows lol

icy knoll
#

just idk

#

feels nicer

restive turret
#

then there is no diff

#

duh

icy knoll
#

it feels nicer ok

restive turret
#

because you paid for it?

icy knoll
#

no

#

work did

restive turret
icy knoll
#

does the word job scare you by chance? /j

restive turret
#

nah

icy knoll
#

ok good

upper vapor
icy knoll
#

so many people tell me to censor it smh

restive turret
#

but it feels nicer to woke up at 13

upper vapor
restive turret
unique crane
icy knoll
heady turret
#

Can I use different fonts

#

In text toy

random scaffold
teal junco
random scaffold
#

where i can get it?

modern lark
#

Found this file in C:\Windows\WinSxS\amd64_system.valuetuple_cc7b13ffcd2ddd51_4.0.15912.0_none_d1891ed46ba50223

#

not sure if it's still compatible

hearty shard
random scaffold
#

im used sqlite

random scaffold
restive turret
restive turret
#

or might be your issue

#

mixin net8 and net48

random scaffold
#

no

#

new project on 4.8

random scaffold
#

any example or something

celest thorn
#

Im honestly loosing my mind

    - name: Download SCP SL References
      uses: killers0992/scpsl.downloadfiles@master
      with:
        branch: 'public'
        filesToDownload: "UnityEngine.dll,UnityEngine.AnimationModule.dll,UnityEngine.AssetBundleModule.dll,UnityEngine.CoreModule.dll,UnityEngine.IMGUIModule.dll,UnityEngine.PhysicsModule.dll,Mirror.dll,LabApi.dll,CommandSystem.Core.dll,Assembly-CSharp.dll,Unity.TextMeshPro.dll"

It doesn't find LabApi even tho it should, only missing one

random scaffold
#

public static void AddSeason(DB_Season season)
{
using var database = new LiteDatabase(DataBaseName);
var SeasonCollection = database.GetCollection<DB_Season>(DB_SeasonName);
if (SeasonCollection == null)
return;
SeasonCollection.Upsert(season);
}

#

why here null check?

#

how then i can make from null to exists

restive turret
#

it automaticly creates a new I think

upper vapor
restive turret
#

creates new ye, null check for that doesnt need

acoustic cosmos
#

How do you check if a player died cause of PocketCorroding

#

It's just UniversalDamageHandler, this was the only solution I found lol

foreach (var effect in args.Player.ActiveEffects)
{
    if (effect.name == "PocketCorroding")
    {
        
    }
}
#

But this is not 100% accurate

upper vapor
#

if (effect is PocketCorroding)

acoustic cosmos
#

True but isn't there a better way

acoustic cosmos
#

Yes

random scaffold
#

then why im implemented it myself

#

bruh

#

!nwmoment

regal lakeBOT
acoustic cosmos
#

I suppose I can go

if (args.DamageHandler is not FirearmDamageHandler)
{
    foreach (var effect in args.Player.ActiveEffects)
    {
        if (effect is PocketCorroding)
        {
            
        }
    }
}
#

You might die getting shot in the pocket dimension

hearty shard
#

if (args.Player.ActiveEffects.Any(ef => ef is PocketCorroding))

#

could also do the job

acoustic cosmos
#

True

soft turtle
acoustic cosmos
#

It basically does the same yeah

#

Thanks though

brisk matrix
#

How to disable 939's aoe claw and lunge damage?

acoustic cosmos
#

?```cs
public void OnScp939Attacking(Scp939AttackingEventArgs args)
{
args.Damage = 0f;
}

tribal dagger
#

is the returning of the Dedicated Server player object intended for Player.List?

#

ive been using it for a long time and i havent seen it return the server itself

#

but now im starting to get the object

hearty shard
#

or Player.Get()

tribal dagger
#

thanks

#

idk how i havent realized that before

acoustic cosmos
unique crane
#

You can use ReadyList or Players.Get()

acoustic cosmos
#

Okay

#

Doesn't really make sense but okay

grand flower
#

You'll probably end up patching a handful of stuff dealing with the host player

hearty shard
grand flower
#

It does reduce it by a lot but we still got some exceptions that kicked the dedicated server player

#

Ended up just patching out anything that could kick the dedicated server player

#

Been running good ever since

grand flower
#

no idea

#

couldn't figure it out, so I just patched the methods that were throwing exceptions to ignore the host player

severe cave
#

Is there a method for a player to check if it is in a specified room or not?

grand flower
#

Player.Room?

severe cave
grand flower
#

What room are you looking for

severe cave
#

GateA or GateB

grand flower
#

Also got a question about voice chat, sending voice packets to/from "human" SCPs to actual SCPs, but the voice ends up being very saturated/garbled. Any idea what would cause that? I'm literally just taking the VoiceMessage and sending it back to other players.

hearty shard
#

Its fine for me

#

R u modifying it

grand flower
#

if (Player.Room is {Name: RoomNames.GateA or RoomNames.GateB}) probs works

hearty shard
#

Or delaying it or anything

grand flower
hearty shard
#

Show

#

Why r u copying it?

#

why not use the existing message

severe cave
hearty shard
severe cave
#

Didn't work

grand flower
#

yeah guess I could use the existing message, was just that way when I saw the code

hearty shard
#

Well

#

Copying

grand flower
#

That wouldn't cause the static though right

hearty shard
#

no clue

#

It works for me

#

But not for you

#

and i dont copy i just change the type to proximity rather than scpchat

grand flower
#

for human SCPs I send it via roundsummary to SCPs

#

actually I sent it via roundsummary both ways

severe cave
hearty shard
#

Talking to the other guy

grand flower
#

@severe cave send your code

severe cave
hearty shard
#

and yea show code

severe cave
#

no good?

severe cave
hearty shard
#

Room can be null

grand flower
#

Room can be null

#

kek

hearty shard
#

jynx

#

You owe me 1000 bucks

severe cave
languid temple
hearty shard
languid temple
#

playing games again

grand flower
#

ahh I think I might know why

hearty shard
#

Ur a gamer?

grand flower
#

I don't prevent the regular voice packet from being received

#

maybe it's causing garbled nonsense from being duplicated

hearty shard
languid temple
grand flower
#

easy fix

hearty shard
languid temple
#

I'm only posing as one

hearty shard
#

So sad

#

ยฟโ€ฝ

languid temple
#

what the

hearty shard
#

whats up

languid temple
#

Oh I thought that was one char

#

nvm

grand flower
#

yeah that was it

#

works fine now

#

dunno why prox chat affects this even when the SCP isn't in proximity of the player but w/e

severe cave
#

Can someone tell me what these all mean? What is a hazardous environment?

restive turret
#

939 cloud, peanut shit

#

And 106 goo

severe cave
#

thanks

normal pawn
#

Is there now a way to send multi line hints? Iโ€™ve tried several ways but none of them worked

restive turret
#

xx\nhh

hearty shard
#

yea just \n

icy knoll
#

also if you want hints to overlap for whatever reason you can just do <line-height=0%>\n</line-height>

gilded thicket
#

fWHO WANT 10K DOLLAR

hearty shard
severe cave
restive turret
hearty shard
grand flower
#

anyone else get a weird bug with 173 sometimes moving silently?

terse bone
#

haven't seen that

#

those restrictions on custominfo are wild, no wonder i haven't done something with it in like 2 years

#

this just shouldn't reject Xname\n<color=#DC143C>disappointed</color>

grand flower
#

They're pretty useless

gilded thicket
hearty shard
#

^

#

you have to use very specific colors

grand flower
#

pretty annoying when you can just apply a server tag with color

hearty shard
#

Exiled has a list

grand flower
#

arbitrary restrictions be like

hearty shard
#

you realize those colors are allowed

#

or should be

grand flower
#

oh right

#

server tags also have that restriction

#

nvm

hearty shard
#

u need to use the hex

#

or should idk

grand flower
#

did NW say why it was restricted

hearty shard
#

its fair

grand flower
#

why am i not surprised

hearty shard
#

do you think its bad?

#

should they allow u to fake it?

grand flower
#

Obviously not

#

I just have very specific views on the whole global badges & VSR and more

#

off topic for this channel anyway so I won't bring them here heh

hearty shard
#

So stuff can be allowed more

#

While still keeping nw stuff special

grand flower
#

fair

hearty shard
#

(aka they wanna make it the background instead of the color of the text)

#

although

#

Its been in work for a while so idk when that happens

grand flower
#

I'm just mostly not impressed when vanity stuff like this impacts modding

hearty shard
#

at least imo idrc

#

can still use the group colors + black and white

#

(just no group colors for ne specific ones)

#

thats mostly fine

grand flower
#

My POV is that SL is a game inspired from a gamemode on a sandbox moddable game, so it stings when modding is affected by certain choices like this

true cedar
grand flower
#

Doesn't mean I don't appreciate some of the stuff we get with SL

terse bone
#

The problem is with rejection rules, you can't mix untagged text (text with role color) with tagged text (text with custom allowed color) in custominfo ig

#

And role colors aren't allowed in custominfo...

grand flower
#

Has anyone succeeded in patching the Player ctor to get rid of the duplicate key exception spam

grand flower
#

nvm got it

unique crane
upper vapor
#

Dummies for example

grand flower
#

Nah

upper vapor
#

Huh

grand flower
#

Basically it seems like Player.AddPlayer is called multiple times

#

Which is called by ReferenceHub.Start

#

I'm trying to figure out why that's the case

#

ReferenceHub.GetHashCode is the gameObject so the only way I see this happening is if the game object had multiple reference hubs applied to it

#

Either way, the way I fixed it was replacing new Player() in Player.AddPlayer with Player.Get()

#

Player.Get will call the player ctor if it doesn't exist in the player dictionary

#

I might have a hunch as to why it happens, gimme ten mins

grand flower
#

I can't see a reason why it'd happen, but it does

#

The exception is mostly on player connection

#

Don't have any specific repro steps

#
[log] ArgumentException: An item with the same key has already been added. Key: ReferenceHub (Name='Player [connId=22]', NetID='58326', PlayerID='54')
[log] at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x0015a] in <069d7b80a3914a08b6825aa362b07f5e>:0
[log] at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <069d7b80a3914a08b6825aa362b07f5e>:0
[log] at LabApi.Features.Wrappers.Player..ctor (ReferenceHub referenceHub) [0x0000b] in <bea7f403b90e4786abd99fa819db9853>:0
[log] at LabApi.Features.Wrappers.Player.AddPlayer (ReferenceHub referenceHub) [0x00008] in <bea7f403b90e4786abd99fa819db9853>:0
[log] at (wrapper delegate-invoke) System.Action`1[ReferenceHub].invoke_void_T(ReferenceHub)
[log] at ReferenceHub.Start () [0x00009] in <8db1ca0fe9a6484084cda320b139932c>:0
worthy rune
#

it was something i looked into and i believe it could be caused by calling Player.Get() before the ReferenceHub.Start(). theres an internal PR for implementing away that avoids recreating the wrapper for those cases

grand flower
worthy rune
#

that might be awake

upper vapor
#

Start is called on the first frame after the object is enabled

#

leaving time to set properties on components

grand flower
#

fun

unique crane
#

Hmmmmm

unique crane
#

Like that one that fires when player wants to join

royal mica
#

I encounter this as well and my suspicion lies in fetching the Player CustomDataStore in OnPlayerJoined

grand flower
unique crane
#

Yes

royal mica
#

I was on a train at the time so I cannot test it

grand flower
#

Yes

#

Looking for something in particular?

unique crane
#

Perhaps it has to do something with it

grand flower
#

hmmm it doesn't give a reference hub

unique crane
#

Do you get the Player object some other way?

grand flower
#

don't think so

upper vapor
royal mica
#

it was a great experience

#

sun was shining and of course the AC wasn't turned on

upper vapor
#

bruh moment

normal pawn
#

Okay so line 1\nline 2 doesn't work in custom info. Any other ideas?

#

Also pasting this text from notepad even not matching regex

brisk matrix
#

idk, but everything works for me

random scaffold
#

already <60% servers using exiled

upper vapor
#

what