#plugins-dev-chat

1 messages ยท Page 26 of 1

upper vapor
#

hence the obsolete stuff

#

no conversion though cuz i'm lazy

#

Enum.TryParse(typeof(RoomName), RoomType.Whatever, out var name)

royal mica
#

Doesn't Position have a room method?

#

nvm I should read icant

slate flume
#

So uhhh if I want to implement SSSS what should I do

royal mica
#

You can:

  • Opt to using a Lib, like https://github.com/Misfiy/SecretAPI and implement their SSSS solution (which is easier)
  • Look at an example implementation in UserSettings.ServerSpecific.Examples like SSPrimitiveSpawnerExample
young phoenix
#

Guys should I use pluginapi, labapi or something else, and what is the difference between all of them

mild ice
#

If you're developing anything for the current version of the game and beyond use LabAPI or a supported 3rd party framework of your choice

fresh zenith
young phoenix
mild ice
hearty shard
#

@icy knoll i dont even think id is needed

#

at all

#

to get a setting

icy knoll
#

yeah

#

lol

#

as long as you got the type ig

hearty shard
#
public static bool TryGet<T>(Player player, [NotNullWhen(true)] out T? setting)
            where T : CustomSetting
        {
            setting = null;

            // ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
            if (player is null)
                return false;

            if (!PlayerSettings.TryGetValue(player, out List<CustomSetting>? settings))
                return false;

            foreach (CustomSetting toCheck in settings)
            {
                if (toCheck is T value)
                {
                    setting = value;
                    return true;
                }
            }

            return false;
        }
icy knoll
#

wait no

#

you may

hearty shard
#

no

#

๐Ÿ˜ญ

icy knoll
#

just incase public Setting(int id)

#

and you make multiple

hearty shard
#

you should never do that ๐Ÿ˜ญ

icy knoll
#

or

#

public Setting(string label)

hearty shard
icy knoll
#

and then ID will be different

#

would be useful for smth like a server specific player manager for staff or smth

#

idk

#

or a mute manager for scp prox chat

#

ig you can make a version for with id and without id

#

wont matter really

upper vapor
#

comically long Rider shut up comment

hearty shard
#

i forgot to make it nullable

#

xd

sinful bronze
#

Lol

hearty shard
#

it also shouldnt be null

mild ice
hearty shard
#

so ill prob just remove null check

royal mica
restive turret
hearty shard
#

to prison u go

tribal dagger
#

does hid lab not have its own DoorName?

restive turret
#

nuh uh

#

ye it doesnt

#

cus NW forgot to add it

#

same as other doors

tribal dagger
restive turret
#

if you search with tagname / string you prob find it

tribal dagger
#

yeah i could, but that adds another NW issue onto my project

#

im starting to consider going back to exiled

#

at least enums make sense

icy knoll
#

me when most people resort to searching for doors via their unity name

#

same with rooms too lol

hearty shard
icy knoll
hearty shard
wispy dirge
#

wtf ๐Ÿฅ€

hearty shard
#

idk if prefab store works

restive turret
#

so never

hearty shard
#

exactly

wispy dirge
#

i think 079 broke

#

changed my role to 079 and above happened

hearty shard
#

tf did u do

wispy dirge
#

I DONT KNOW ๐Ÿ˜ญ

#

i just added some 079 cams via PMER ๐Ÿ˜ญ

hearty shard
#

i dont know if i like this

wispy dirge
#

ok the 079 cams i added made 079 autistic

#

cool

#

๐Ÿ˜ญ

worthy rune
#

did you add cams in the void

wispy dirge
#

yeah

#

for my custom map

#

since there is some things

worthy rune
#

thats broken, should be fixed in 14.1.x

wispy dirge
#

wait are you saying ๐Ÿ˜ญ

#

NOOOOO
๐Ÿ˜ญ

#

i added like 20 cameras ๐Ÿฅ€

worthy rune
#

you can spawn them in a room first and teleport them, or just set the room up youself

hearty shard
#

is array or list better to store

#

array right

#

(store as in, no modifying it in the future, just permanent there)

icy knoll
#

yeah

#

array

hearty shard
#

yea

icy knoll
#

if you arent planning on appending or removing

hearty shard
#

!!!

#

ToArray it is

wispy dirge
#

i found the cameras making the server autistic i will remove them for now

#

atleast 079 works now ๐Ÿ˜ญ

tribal dagger
#

why have RoomName enum at all when you can use strings ยฏ_(ใƒ„)_/ยฏ

#

i dont buy this, sry

hearty shard
#

the point was most ppl use string for it

tribal dagger
#

idc what people use for getting that

#

imo NW should try to keep it updated, especially when it's a thing helps developers with searching for rooms

#

everyone can go out there and use unity names, but its just a lil dumb

#

especially when these can change over time and give you no compile issues

#

i think that the fact of people even using unity names in the first place already shows how the system is failing

upper vapor
slate flume
royal mica
#

Which one?

hearty shard
#

i can probably test it rn

slate flume
#

I'm so confused bro

#

I know I'm probably doing something wrong I'm just not smart enough to know what

#

If I can do anything to help resolve this I'll do whatever

hearty shard
#

give me a sec

#

im testing if my example broke

slate flume
#

๐Ÿ‘ I'll be here

#

I'm probably gonna go get a drink or something lmao

hearty shard
#

works for me

#

i click and i die

slate flume
#

Damn so alright

#

Maybe I try again and hope it works

hearty shard
slate flume
#

Will do o7

hearty shard
#

both are required to be updated to that version btw

#

theres some changes to the code

slate flume
#

Well I'm launching my server I'll be testing in a sec

#

Literally what the hell am I doing wrong

#

I feel like it's inevitably the most obvious thing I just can't figure it out

#

I'm having the same thing as before, the menu pops up, just the keybind doesn't kill me, and I can't for the life of me explain what's going on

#

It's the exact same code how is this happening

royal mica
#

Have you sent the code here yet?

slate flume
royal mica
#

I assume you have no other plugins installed right?

slate flume
#

Correct

#

The new folders are just because I moved the other plugins off the list

hearty shard
#

oh

#

secretapi shouldnt be in dependencies btw

slate flume
#

Lemme try with it not there haha

hearty shard
#

it is a dependency but it loads as a plugin

#

thats likely the issue

slate flume
#

It was...

#

I won't lie I'm embarrassed a bit

slate flume
#

๐Ÿคฆ

#

Making an absolute fool of myself is my favorite passtime

young phoenix
hearty shard
#

there is no PluginEntryPoint

slate flume
#

@hearty shard I apologize for the trouble thanks for being such a huge help

hearty shard
#

no worries

#

i try

young phoenix
hearty shard
#

deleted

#

gone

#

obliterated

young phoenix
#

ah I see, thanks

hearty shard
young phoenix
#

lol

hearty shard
#

wrong thumbs

young phoenix
#

XD

royal mica
#

I assume there is still no lazy way to position multiple hints right?

royal mica
#

Kind of want to avoid using deps :\

hearty shard
#

create ruei urself

royal mica
#

lol

#

Yeah probably need to implement something like this, but more scoped

young phoenix
#

how can I broadcast a message to all players, like the one from remote admin panel

#

not cassie

upper vapor
#

Server.Broadcast maybe

hearty shard
#

Server.SendBroadcast();

upper vapor
#

almost

young phoenix
#

thanks

#

where is the list of all the events I can override?

hearty shard
upper vapor
#

your IDE should be able to suggest methods to override

young phoenix
#

ah alr thnx

upper vapor
#

also the event methods are in PlayerEvents.cs, ServerEvents.cs etc

hearty shard
#

also if you have Rider you can just go to the original method

young phoenix
#

yeah ok found it after using F12

hearty shard
#

and view teh code

royal mica
#

It might inherit the doc, not sure

young phoenix
hearty shard
young phoenix
#

do I have to call the base method?

upper vapor
#

in CustomEventsHandler, no

#

since the base method is empty

young phoenix
#

I can'st access the Broadcast.BroadcastFlags enum (I presume), how can I reference the assembly?

hearty shard
#

Assembly-CSharp.dll

upper vapor
#

duh

#

right click "dependencies" in the project and "add reference"

#

or something similar

random scaffold
upper vapor
#

the question was how to reference the assembly

young phoenix
wispy dirge
young phoenix
#

or do I need a different one

hearty shard
#

that is microsoft

#

not sl

random scaffold
#

why cant find DoorPermissionFlags?

hearty shard
#

sl references can be found in server files

upper vapor
wispy dirge
#

wtf ๐Ÿ˜ญ

young phoenix
#

I used NuGet to set up the project, did I miss something perhaps

hearty shard
#

nuget includes labapi and its docs

#

does not include every single reference

random scaffold
hearty shard
#

Works for me

young phoenix
hearty shard
#

go to SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed

#

reference Assembly-CSharp.dll file in there

young phoenix
#

on github or through steam?

hearty shard
#

Dedicated is on steam

young phoenix
#

got it

#

it worked thank you!

#

any special things I need to do before building? e.g. target platform or debug/release

solid mica
#

Can the jailbird charged attack be disabled?

static meteor
#

youll need to edit this but it works

    [HarmonyPatch(typeof(JailbirdItem), nameof(JailbirdItem.ServerProcessCmd))]
    internal static class JailbirdItemChargePatch
    {
        [HarmonyPrefix]
        public static bool Prefix(JailbirdItem __instance, NetworkReader reader)
        {
            try
            {
                reader.ReadByte();
                reader.Position -= 1;
                JailbirdMessageType messageType = (JailbirdMessageType)reader.ReadByte();
                reader.Position -= 1;

                if (messageType == JailbirdMessageType.ChargeLoadTriggered || messageType == JailbirdMessageType.ChargeStarted)
                {
                    if (API.Utilities.TryGetSummonedCustomItem(__instance.ItemSerial, out var customItem))
                    {
                        if (customItem.Item.Type == ItemType.Jailbird && customItem.HasModule(CustomFlags.NoCharge))
                        {
                            __instance.SendRpc(JailbirdMessageType.ChargeFailed);
                            return false;
                        }
                    }
                }
                return true;
            }
            catch (Exception ex)
            {
                LogManager.Error($"{nameof(JailbirdItemChargePatch)}: {ex.Message}\n{ex.StackTrace}");
            }
            return true;
        }
    }
solid mica
#

oh god

upper vapor
#

reader.ReadByte();
reader.Position -= 1;

JailbirdMessageType messageType = (JailbirdMessageType)reader.ReadByte();

#

bruh what the hell boi

#

the lines i highlighted are completely redundant

hearty shard
#

๐Ÿ˜ญ

#

never cook again

brisk matrix
#

[2025-05-21 14:52:00.469 +02:00] [STDOUT] Couldn't create a Convex Mesh from source mesh, within the maximum polygons limit (256). The partial hull will be used. Consider simplifying your mesh. Source mesh name: Sphere what ๐Ÿ™

#

Why this even happens

royal mica
#

ok im so fucking confused.
Upon creating the Primitive, the Collider exists in my component

#

Later when I do Raycast, get my Component, the Collider is null?!

#

ok manually toggling the isTrigger doesn't work either. What the fuck is going on

teal junco
#

Show code

main zenith
celest thorn
#
player.SendFakeSyncVar(primitiveInstance.netId, "PrimitiveObjectToy.NetworkMaterialColor", 64, Color.blue);
    public static void SendFakeSyncVar<T>(
        this Player   target,
        uint          netId,
        string        syncVarKey,
        ulong behaviourMask,
        T             value)
    {
        var owner    = NetworkWriterPool.Get();
        var observer = NetworkWriterPool.Get();
        
        Compression.CompressVarUInt(owner, behaviourMask);

        int   headerPos   = owner.Position;
        owner.WriteByte(0);
        int   payloadStart = owner.Position;
        
        if (!SyncVarDirtyBits.TryGetValue(syncVarKey, out ulong syncVarMask))
        {
            Debug.LogError($"Unknown SyncVar key: {syncVarKey}");
            goto CLEANUP;
        }
        owner.WriteULong(syncVarMask);
        
        var writerDel = WriterExtensions[typeof(T)];
        if (writerDel == null)
        {
            Debug.LogError($"No WriterExtension for type {typeof(T)}");
            goto CLEANUP;
        }
        writerDel.Invoke(null, new object[]{ owner, value });
        Debug.Log($"[FakeSyncVar] {syncVarKey} โ† {value} (mask=0x{syncVarMask:X})");
        
        int payloadEnd = owner.Position;
        owner.Position = headerPos;
        owner.WriteByte((byte)((payloadEnd - payloadStart) & 0xFF));
        owner.Position = payloadEnd;

        observer.WriteBytes(owner.ToArraySegment().Array, headerPos, payloadEnd - headerPos);

        target.Connection.Send(new EntityStateMessage {
            netId   = netId,
            payload = owner.ToArraySegment()
        });
        Logger.Debug($"[FakeSyncVar] Sent netId={netId}, {syncVarKey}");

    CLEANUP:
        NetworkWriterPool.Return(owner);
        NetworkWriterPool.Return(observer);
    }

Someone knows whats wrong because at this point i don't really know
[2025-05-21 13:14:58.846 +00:00] [STDOUT] [FakeSyncVar] PrimitiveObjectToy.NetworkMaterialColor โ† RGBA(0.000, 0.000, 1.000, 1.000) (mask=0x40)
[2025-05-21 13:14:58.873 +00:00] [DEBUG] [FakeSyncVar] Sent netId=584, PrimitiveObjectToy.NetworkMaterialColor

upper vapor
#

goto ClassD_Hollow

celest thorn
royal mica
celest thorn
celest thorn
celest thorn
#

like primitives don't really change at all

upper vapor
celest thorn
#

no error in the client nor console

celest thorn
#

and i don't really know if that is happening nor if mirror even takes it

royal mica
main zenith
#

btw i have a question does anybody know if its possible and how to set class name via server for something else (i mean the display text of the living player)

upper vapor
celest thorn
celest thorn
#

i don't think i am

upper vapor
#

you have to

celest thorn
main zenith
celest thorn
#

Magic

#

i love mirror

upper vapor
#

it's not that simple

celest thorn
#

;( why life is hard

#

wait im writing them

#

just one time tho

upper vapor
celest thorn
#

owner.WriteULong(syncVarMask);

hearty shard
#
var writerDel = WriterExtensions[typeof(T)];
        if (writerDel == null)
        {
            Debug.LogError($"No WriterExtension for type {typeof(T)}");
            goto CLEANUP;
        }
celest thorn
hearty shard
#
public static void ProperWrite(NetworkWriter writer, object obj)
        {
            Type genericType = typeof(Writer<>).MakeGenericType(obj.GetType());
            FieldInfo? writeField = genericType.GetField("write", BindingFlags.Static | BindingFlags.Public);
            if (writeField == null)
            {
                Logger.Warn($"Tried to write type: {obj.GetType()} but has no NetworkWriter!");
                return;
            }

            object? writeDelegate = writeField.GetValue(null);
            if (writeDelegate is not Delegate del)
            {
                Logger.Warn($"Writer<{obj.GetType()}>.write is not a delegate!");
                return;
            }

            del.DynamicInvoke(writer, obj);
        }
#

thats my proper write thing

celest thorn
# upper vapor

if (!SyncVarDirtyBits.TryGetValue(syncVarKey, out ulong syncVarMask))
{
Debug.LogError($"Unknown SyncVar key: {syncVarKey}");
goto CLEANUP;
}
owner.WriteULong(syncVarMask);

If magically i just do

    owner.WriteULong(syncVarMask);
    owner.WriteULong(syncVarMask);
upper vapor
#

if you only modify the primive's props then it should work

celest thorn
#

for now

celest thorn
upper vapor
#

for the data, write

  1. dirty bits (AdminToyBase)
  2. AdminToyBase properties
  3. same dirty bits as before (derived toy)
  4. derived toy's properties
celest thorn
#

and then the one from the toy

#

owner.WriteULong(syncVarMask);
owner.WriteULong(syncVarMask);

I tried this but nope

upper vapor
#

weird

#

what's your syncvarmask

celest thorn
#

let me log it

#

could it be the behaviormask?

upper vapor
#

maybe..?

celest thorn
upper vapor
#

idk if that's correct since it depends on component order

celest thorn
#

its a primitive

#

so

#

it should be right

celest thorn
#

is the syncvarmask

upper vapor
#

either patch Start() or delay the isTrigger modification

royal mica
#

The strange is that I spawn the primitive at RountStart event, add custom component there and not change the type or anything

restive turret
#

It only gets the networkbehavior component

restive turret
#

If u not using that than the component list should be fine

celest thorn
#

honestly i don't know why that is a problem

royal mica
#
        
        var collider = SpawnUtil.SpawnObject(
            new Vector3(0, 102, 5),
            Quaternion.identity,
            new Vector3(.5f, 3f, .3f),
            new Color(1f, 0.92156863f, 0.015686275f, .7f)
        );
        
        var customCollider = collider.GameObject.AddComponent<CustomColliderBehaviour>();
        customCollider.Init(collider);

and

        public void Init(PrimitiveObjectToy baseObject)
        {
            Base = baseObject;
            baseObject.IsStatic = true;
            baseObject.GameObject.GetComponent<Collider>().isTrigger = true;
            Logger.Info("Custom Collider Inited");
        }
#

Which actually returns true

upper vapor
#

but the collider gets destroyed one frame later by the call to SetPrimitive in Start

#

-# Start is called on the first frame of the object being active

restive turret
#

Ye unity

#

Lovely

#

Timing.CallDelayed(0.2f, () => .. );

celest thorn
#

@upper vapor you know what i can do instead of calling fakesyncvar deleting and spawning it back trolling

#

i just cannot figure it out on why like its a week

#

YOOO i got

upper vapor
#

what was it

celest thorn
# upper vapor what was it

PrimitiveObjectToy(Clone) (netId=601): AdminToys.PrimitiveObjectToy OnDeserialize size mismatch. It read 24 bytes, which caused a size hash mismatch of 18 vs. 20. Make sure that OnSerialize and OnDeserialize write/read the same amount of data in all cases.

upper vapor
#

you need to store the writer start before writing the data

#

oh wait

#

nvm you uh

celest thorn
#

Like idk at this point

celest thorn
restive turret
#

owner.WriteULong(0); before SyncVarDirtyBits if condition

random scaffold
#

how i can check scp can open a door or not?

random scaffold
#

KeycardPermissionFlags doesnt exists in assembly lol

hearty shard
#

update your references

upper vapor
# celest thorn so yea this is code at this point idk
public static void SendFakeSyncVar<T>(
    this Player target,
    uint netId,
    string syncVarKey,
    T value
)
{
    using var observer = NetworkWriterPool.Get();

    ulong behaviourMask = 1UL;
    Compression.CompressVarUInt(observer, behaviourMask);

    int headerPos = observer.Position;
    observer.WriteByte(0);
    int payloadStart = observer.Position;

    if (!SyncVarDirtyBits.TryGetValue(syncVarKey, out ulong syncVarMask))
    {
        Debug.LogError($"Unknown SyncVar key: {syncVarKey}");
        return;
    }

    observer.WirteULong(0); // sync objects
    observer.WriteULong(syncVarMask);
    observer.WriteULong(syncVarMask);

    if (!WriterExtensions.TryGetValue(typeof(T), out var writerDel))
    {
        Debug.LogError($"No WriterExtension for type {typeof(T)}");
        return;
    }

    writerDel.Invoke(null, new object[] {observer, value});
    Debug.Log($"[FakeSyncVar] {syncVarKey} โ† {value} (mask=0x{syncVarMask:X})");

    int payloadEnd = observer.Position;
    observer.Position = headerPos;
    observer.WriteByte((byte) ((payloadEnd - payloadStart) & 0xFF));
    observer.Position = payloadEnd;

    target.Connection.Send(new EntityStateMessage
    {
        netId = netId,
        payload = observer.ToArraySegment()
    });
    Logger.Debug($"[FakeSyncVar] Sent netId={netId}, {syncVarKey}");

}

try this

hearty shard
restive turret
upper vapor
#

no need for two writers

random scaffold
hearty shard
#

mine works PI_Shrug

random scaffold
#

server too show same error

#

if it compiled

upper vapor
restive turret
#

He does not writr fake sync object

upper vapor
#

right

restive turret
#

Thats the position

upper vapor
#

i had it in my code but didn't notice it missing in zero's

restive turret
#

Serializing writing SyncObject but admintoy doesn't have any

celest thorn
restive turret
#

The first is writing the size temp

upper vapor
celest thorn
#

and no error

#

in the client

restive turret
#

Code updated use that

celest thorn
upper vapor
#

copy it again and try

#

i've updated the message

celest thorn
#

and the best to say it

#

is

#

IT WORKS

random scaffold
#

last version

#

try check it

hearty shard
#

Oh

#

KeycardPermissionFlags

#

i thought you meant the other one

#

yeah no that doesnt exist

#

i also sent code for it already

hearty shard
#

DoorPermissionCheck is a custom enum

#

you can remove it if u dont need it

random scaffold
#

requester it who

#

um

hearty shard
random scaffold
hearty shard
upper vapor
#

IDoorPermissionRequester

#

door

restive turret
#

ye cus its a interface

random scaffold
#

PermissionsPolicy doesnt exists*

hearty shard
#

this is an example and is not valid code

random scaffold
#

in a door

hearty shard
#

you need IDoorPermissionRequester in your check

#

you call the method

#

with the door

#

also door DOES have it

restive turret
#

not the labapi door

hearty shard
restive turret
#

but the basegame

hearty shard
#

Reminder it has to be SL door

#

yes

random scaffold
hearty shard
#

you cant = new()

#

but it works for me just fine

#

latest version

random scaffold
#

um same

#

im too have latest dependencies

hearty shard
upper vapor
random scaffold
#

it doesnt exists in source too

#

lol

hearty shard
hearty shard
upper vapor
random scaffold
hearty shard
random scaffold
#

no SteamHappy

hearty shard
#

logic

upper vapor
hearty shard
#

ur not on the 14.1 update

#

i dont believe it

random scaffold
#

latest version of the server

upper vapor
#

if using steamcmd add -beta public to the install command

hearty shard
random scaffold
#

server works with client

hearty shard
#

remove beta

#

well actually

#

its in the beta too

random scaffold
#

it doesnt have beta

#

its base version

hearty shard
#

well ur clearly not on 14.1 ๐Ÿ˜ญ

random scaffold
#

but server works with 14.1 client lol

upper vapor
#

then you haven't copied the DLLs

hearty shard
#

then reference the correct server dll

#

not the old one

random scaffold
hearty shard
#

yes but

random scaffold
hearty shard
#

you clearly arent using that

random scaffold
#

lmao

hearty shard
#

Publicized isnt the one included with SL

#

Re do the publicize

#

or reference the non publicized

upper vapor
#

yea

random scaffold
#

then why it exists there

#

lol

hearty shard
#

because thats where you put it

#

?

random scaffold
#

no

#

i didnt put it

hearty shard
#

you did...

upper vapor
#

you keep the publicized one in the managed directory

#

how do you expect it to update

hearty shard
upper vapor
#

you're better off using BepinEx.AssemblyPublicizer.MSBuild

hearty shard
#

idk about u

#

but i dont see publicized there

#

exiled usually has publicized, which means you downloaded exiled references

#

and threw them in managed folder

#

@restive turret i hate nuget

#

๐Ÿ˜ญ

restive turret
#

skill issue

hearty shard
#

they look identical to me ๐Ÿ˜ญ

restive turret
#

wdym

#

what did u do

#

๐Ÿ˜ญ

hearty shard
#

it hasnt worked for a while

#

oh

#

why did the pr one work ???

#

bad timing?

#

idk

restive turret
#

how would i know

#

they said it gonna get removed

#

you are in exiled dc how could you not read about that

hearty shard
#

ok but

#

where does it say that

#

"read about that"

#

theres links to it and forwards

#

๐Ÿ’€

#

i pinged u cuz one worked and the other didnt

upper vapor
#

yeah uh

hearty shard
#

but yes

upper vapor
#

it's exslmod

#

not exmod

#

cuz things happen

hearty shard
#

oh yeah

#

that too

#

however

restive turret
#

YOU NOT UNZIPPING

#

you animal

hearty shard
#

and tell me

#

where does the pr one unzip

#

correct?

#

they both do that

restive turret
#

well idk

#

skill issue?

hearty shard
random scaffold
hearty shard
#

or when you wait for nw to make it

random scaffold
restive turret
#

you my lib

#

copied things from exiled and mirror

random scaffold
restive turret
hearty shard
#

you literally compared diff

#

and showed it being close

#

other than yk

#

nuget pushing to nuget

random scaffold
hearty shard
random scaffold
#

But if you send it to existing users, what size will be visible to those who enter?

upper vapor
#

instead of 3x

restive turret
#

What if I cache it by player with a dict to able to show fake scale to new joined players?

#

hmmm

restive turret
#

There's nothing as permanent as a temporary solution.

random scaffold
restive turret
#

also I busy studiing how networking works

#

with my own soltuion

royal mica
upper vapor
#

gotta unset Collidable

#

make sure to enable the collider in calldelayed

royal mica
#

That straight up disabled the Collider

restive turret
#

collide with deez

restive turret
upper vapor
#

yeah

#

they want a trigger though

#

so no collider on the client

#

but a collider on the server

#

if the collider is disabled then trigger does nothing

royal mica
#

eh I gave up

#

I'll just add another collider

upper vapor
royal mica
#
        public void Init(PrimitiveObjectToy baseObject)
        {
            Base = baseObject;
            baseObject.Flags = PrimitiveFlags.Visible;
            Collider = baseObject.GameObject.AddComponent<BoxCollider>();
            Collider.isTrigger = true;
            Collider.enabled = true;
            
            Initialized = true;
        }

icant

upper vapor
#

r/tihi

royal mica
#

I lost the will to debug why SpawnToy kills it, but prefab spawn works

#

I mean, I somewhat know

#

but even now it doesn't work

upper vapor
#

because GameObject.CreatePrimitive is simple

#

PrimitiveObjectToy sets the primitive based on network data

#

in Start, it calls SetPrimitive which reassigns the collider

royal mica
#

Right, but that is bypassed by doing a Timing.RunDelayed and then set Trigger, would that work in theory, right?

upper vapor
#

can you show the code you had

#

you gotta do toy._collider in the delayed call

royal mica
#
...

        public Collider Collider => _collider ??= Base.GameObject.GetComponent<Collider>();
        private PrimitiveObjectToy Base { get; set; }

        private Collider? _collider;

        private bool _skippedFrame;
        
        public void Init(PrimitiveObjectToy baseObject)
        {
            Base = baseObject;
            baseObject.IsStatic = true;
            Timing.CallDelayed(
                .2f,
                () =>
                {
                    Collider.isTrigger = true;
                }
            );
            Logger.Info("Custom Collider Inited");
            Initialized = true;
        }
...
#

Yeah, that might not do it then

upper vapor
#

you can't do ??=

#

give it a private setter and assign it in CallDelayed

upper vapor
#

so is null or ?. or ?? don't work on them

royal mica
#

THONK I should learn unity first before doing cursed stuff

#

Thank you, rewrote it so it is assigned

upper vapor
#

you gotta use == null to check for null
or !unityObject

upper vapor
upper vapor
royal mica
#

its just another "this is how the framework works, read the docs" moment

upper vapor
#

ye

royal mica
#

Transparent primitives are cut off by the fog LULE

royal mica
#

OH THE CLIENT DOESN'T KNOW ABOUT IT

#

The existing collider doesn't sync to the Client

#

the isTrigger

#

i love networking

upper vapor
#

yeah

#

hence the Collidable flag

#

it just enables or disables the collider

royal mica
#

Yeah but that completly disabled the collider and that makes the custom copmponent not work

#

aaaa

upper vapor
#

just enable it

royal mica
#

did you try to say this the whole time and it just went woosh over my head?

upper vapor
#

perhaps

royal mica
#

sometimes I even surprise myself

#

next step is figuring out if the player is pressing space

#

that is going to be fun

upper vapor
#

do i spoiler it

royal mica
#

you can't

upper vapor
#

why couldn't i

royal mica
#

oh I meant you cannot chekc if player is actively pressing space

#

inb4 SSSS

upper vapor
#

you can't check if they're holding it down

#

without SSSSSSSSSSSSSSSSSSSSSSS

royal mica
#

yeah that is what I need dang it

#

and they can just simply rebind that

upper vapor
#

but there's FpcMotor.JumpRequested

#

or WantsToJump

royal mica
#

i guess implementing cs water will be harder

hollow pewter
#

rq AddingObserver is called when someone looks at 173 for the first time or everytime someone looks at 173?

upper vapor
upper vapor
royal mica
#

something closely related

upper vapor
random scaffold
#

.isTrigger = true;
.Scale *= 1.1f;

#

ready

royal mica
#

Didn't want to add a component when there is one alread

#

since I assume there will be 100 of these

#

damn Velocity is not synced like Gravity is

random scaffold
random scaffold
royal mica
restive turret
#

I love when setting Footprint as defualt it has the role of 173 too

#

๐Ÿ˜ญ

young phoenix
#

is there a command to clear the server console?

young phoenix
upper vapor
#

cls maybe

young phoenix
#

what is the difference between Started and starting, or spawned and spawning?

young phoenix
upper vapor
#

Ing runs before (usually means you can cancel), ed runs after the action

young phoenix
#

so is -ing only to cancel an action?

#

or does it also provide more information?

upper vapor
#

Check the event args

#

Events should give you some context

young phoenix
upper vapor
#

Yep

young phoenix
#

thnx

upper vapor
#

Np

young phoenix
#

does it cancel on the next tick or immediately?

restive turret
#

what do you mean by that

upper vapor
young phoenix
#

I guess I misunderstood how it works

upper vapor
#
  1. the event args are created
  2. the event is invoked with the event
  3. the game checks if IsAllowed is false
    since the event args are reference types, you can set parameters which will be reflected at the call site
    the event itself is just an action, it doesn't return anything
#

hopefully that clears it up

young phoenix
#

hmm I see

upper vapor
young phoenix
#

yeah I thought that it would be like the source 2013 sdk where you can set a "think" function that would get called every tick until it was overridden

#

idk why lol

buoyant oyster
#

is there an event that triggers whenever a player gains health or hume shield?

grand flower
#

nope, you have to patch it in yourself

#

Is there a way to check if a player is opting out of SCP pick

grand flower
#

yeah just found it in the scp preferences stuff

#

i kinda thought it'd just be on the Player class

#

would be nice to have it there

unique crane
#

@random scaffold No issues on my side (a is logged when Escaping is trigger)

young phoenix
#

how can I disable the game from setting roles? do I set IsAllowed to false on the playerchangingrole event?

static meteor
#

I believe so

young phoenix
#

I want to determine the roles on serverroundstarted

young phoenix
young phoenix
#

guys does a plugin get reloaded (and thus all of its memory get wiped) when a round restarts or does the data persist?

hearty shard
#

Unless you have it set to soft restart server

#

Then everything is fully restarted

#

(such as rnr in console)

young phoenix
#

roundrestart (rr) doesn't clear it right?

hearty shard
#

it shouldnt no

#

its just a new round

young phoenix
#

hmm then I guess it's an issue on my end

#

thanks

teal junco
#

Thank you, this worked!

arctic zinc
#

I will can get ASN-player with "OnPlayerPreAuthenticating"?

warped prairie
#

hey, need a tiny bit of help. Im having an issue with server specific settings when trying to use it as a spectator.

right now im doing this:

    private static void ServerOnSettingValueReceived(ReferenceHub hub, ServerSpecificSettingBase @base)
    {
        CL.Error("ServerOnSettingValueReceived called");
     ... ...

but that error will never appear in my console so im assuming the ServerOnSettingValueReceived just isnt being called for spectator?

static meteor
#

It gets called when your a spectator

warped prairie
#

but im not reciving it back in my console. what would cause it not to call when im a spectator but work fine when im any other class?

static meteor
#

It is registered right?

warped prairie
#

yup.

carmine prawn
#

ssss for spectator?

warped prairie
#

yea thats what im trying to get atm

carmine prawn
#

check

/// <param name="preventInteractionOnGui">Prevents key from being pressed when any popup window is active. Recommended to leave as "true" to prevent misinput.</param>

warped prairie
#

mm ok. ill look into that

warped prairie
random scaffold
#

but here nothing

#

bruh

#
public override void OnPlayerEscaping(PlayerEscapingEventArgs ev)
{
    Logger.Info("escaping");
}
worthy rune
#

what plugins do you have installed

random scaffold
#

exiled

worthy rune
#

try removing it and try again

random scaffold
#

customevents handler labapi in exiled big plugin

#

try later then clearly labapi

worthy rune
#

not sure i understand what you are saying

random scaffold
worthy rune
worthy rune
unique crane
#

If you want to use it, you will have to remove exiled

#

Dedicated or create game

random scaffold
#

lol

random scaffold
#

in door name

unique crane
#

I have 0 clue what you mean by that

grand flower
#

Some rooms/doors are missing names ig

random scaffold
#

^

unique crane
#

Okay but what is 049newgate?

#

There is no new 049 gate

random scaffold
grand flower
#

Where's is the player's armor visual handled? Found WearableSync

glass karma
#

does the disconnect event fire on any reason for disconnecting? banning, kicking, etc

#

I know they have their specific events too, but I'd like to be able to do something on disconnect without needing to check in every single one

random scaffold
#

cool name 173 gate

heady turret
#

why custom info now have symbols limit??

random scaffold
#

because that need

unique crane
heady turret
unique crane
#

Its been like that before

heady turret
#

like in 14.0 we can use too many symbols in custominfo and [ ] in 14.1 we dont

unique crane
#

As I said, there was no change to custom info in 14.1 except for making validation methods visible for server

#

So you see whats wrong with it

upper vapor
royal mica
#

People use the Hint system to display additional info about a player

hearty shard
#

yes but

#

400+ characters?

royal mica
#

maybe they want to play bad apple on player info

hearty shard
#

๐Ÿ˜ญ

royal mica
#

Also it is kinda inconvinient that formatting is also accounted for the 400

#

(not that you would need raw 400 chars displayed)

hearty shard
#

i mean its this amount

#

you dont rly need that

#

unless ur overriding every detail of a player

#

then adding some custom stuff thats 3x what basegame does

#

@heady turret wtf do you need that much characters for

heady turret
hearty shard
#

r u making someones tag a gradient or what

heady turret
#

RP

hearty shard
#

so every detail of a player

#

๐Ÿ˜ญ

#

yeah okay

#

makes some sense ig

#

but yeah limits always been there afaik

icy knoll
#

me when custom info

unique crane
worn gull
#

Hi! Is it possible to add here custom symbols, if yes how?

royal mica
#

Yes, two ways:

  • Harmony patch RemoteAdmin.Communication.RaPlayerList function GetPrefix
  • Decompile the RaPlayerList, copy everything into a new class and override it like this:
                CommunicationProcessor.ServerCommunication[0] = new CustomRaPlayerList();
#

Second is cursed and might break next update, but it's harmonyless

fresh zenith
icy knoll
fresh zenith
#

yea its understandable tho. NWAPI was ass ngl

#

And until servers fully switch to LabAPI it will take some time

icy knoll
#

exiled will be around forever atp

#

because some old plugins still work

restive turret
#

20.0

icy knoll
#

and those are only on exiled as NWAPI was shit

random scaffold
#

so not

upper vapor
fresh zenith
upper vapor
fresh zenith
#

No need for the base game and harmony if you don't code an plugin trollhd

obsidian wharf
young phoenix
#

how can I make a multiline description for a key in my plugin config?

young phoenix
#

I mean property

#

when I used \n it gave me yaml errors

hearty shard
#

and \n does not generate a # on the new line created

young phoenix
#

so should I place \n# or is there a better way?

hearty shard
#

try and see idk

young phoenix
#

is there a way to give players a specific candy or will it give a random one when I give them SCP-330?

royal mica
#

There is a givecandy command, you can look at the impl there, also there is a wrapper for it I think?M

hearty shard
#
public static Scp330Bag GrantCandy(
      this ReferenceHub hub,
      CandyKindID candyId,
      ItemAddReason itemAddReason)
    {
      bool flag = false;
      Scp330Bag bag;
      if (!Scp330Bag.TryGetBag(hub, out bag))
      {
        bag = hub.inventory.ServerAddItem(ItemType.SCP330, itemAddReason) as Scp330Bag;
        flag = true;
      }
      if ((UnityEngine.Object) bag == (UnityEngine.Object) null)
        return (Scp330Bag) null;
      if (flag)
      {
        bag.Candies = new List<CandyKindID>() { candyId };
        bag.ServerRefreshBag();
      }
      else if (bag.TryAddSpecific(candyId))
        bag.ServerRefreshBag();
      return bag;
    }
#

player.ReferenceHub.GrantCandy

young phoenix
#

thanks

worn gull
royal mica
#

You need to check your client console, cause that could mean that the serialization failed

plain gazelle
#

How can i use NetworkServer.SpawnObject without having a player to reference their Connection?
Can i reference the servers connection?

plain gazelle
#

oh

#

lol

#

what is the difference to SpawnObject o.O

royal mica
slate flume
#

Pro tip, trying to set someone's role at the beginning of the round WILL crash your server

restive turret
random scaffold
#

joke

royal mica
#

I need to learn how to read icant

#

Look at code, you can just throw null in SpawnObject as well

plain gazelle
#

Hm, for my use case i am saving the "Creator" of an object as a value of 'Player'
What should i do if i want to save noone in specific here, and instead just the server?
-# Or should i rewrite it to not need a Player saved ._.

upper vapor
upper vapor
#

NetworkServer.Spawn spawns the object for every connection

plain gazelle
#

Thank you

upper vapor
#

Np

celest thorn
#

but on SL

#

lol

#

The structure looks the same

brazen dune
#

Wait

#

There is a problem in snake game, cuz if you play too much it overflows the AutosyncMessage Buffer when player joins, we also believe it's causing lags on servers

[2025-05-22 14:53:44.204 +03:00] [STDOUT] ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds
[2025-05-22 14:53:44.204 +03:00] [STDOUT] Parameter name: destinationArray
[2025-05-22 14:53:44.204 +03:00] [STDOUT]   at System.Array.Copy (System.Array sourceArray, System.Int32 sourceIndex, System.Array destinationArray, System.Int32 destinationIndex, System.Int32 length) [0x000cb] in <13c0c460649d4ce49f991e2c222fa635>:0
[2025-05-22 14:53:44.204 +03:00] [STDOUT]   at System.Array.Copy (System.Array sourceArray, System.Array destinationArray, System.Int32 length) [0x0002c] in <13c0c460649d4ce49f991e2c222fa635>:0
[2025-05-22 14:53:44.205 +03:00] [STDOUT]   at InventorySystem.Items.Autosync.AutosyncMessage..ctor (Mirror.NetworkWriter writer, InventorySystem.Items.ItemIdentifier itemId) [0x0004e] in <2343be033e9f4e37923f780ece756d8e>:0
[2025-05-22 14:53:44.205 +03:00] [STDOUT]   at InventorySystem.Items.Autosync.AutosyncWriterBase.Send () [0x00010] in <2343be033e9f4e37923f780ece756d8e>:0
[2025-05-22 14:53:44.205 +03:00] [STDOUT]   at InventorySystem.Items.Autosync.AutosyncWriterBase.Dispose () [0x00000] in <2343be033e9f4e37923f780ece756d8e>:0
[2025-05-22 14:53:44.205 +03:00] [STDOUT]   at InventorySystem.Items.Autosync.AutosyncItem.ServerSendTargetRpc (ReferenceHub receiver, System.Action`1[T] extraData) [0x00020] in <2343be033e9f4e37923f780ece756d8e>:0
[2025-05-22 14:53:44.205 +03:00] [STDOUT]   at InventorySystem.Items.Keycards.ChaosKeycardItem.ServerOnNewPlayerConnected (ReferenceHub hub) [0x00007] in <2343be033e9f4e37923f780ece756d8e>:0
[2025-05-22 14:53:44.205 +03:00] [STDOUT]   at InventorySystem.Items.Keycards.KeycardItem.<OnTemplateReloaded>b__46_0 (ReferenceHub hub) [0x00008] in <2343be033e9f4e37923f780ece756d8e>:0
[2025-05-22 14:53:44.206 +03:00] [STDOUT]   at (wrapper delegate-invoke) System.Action`1[ReferenceHub].invoke_void_T(ReferenceHub)
[2025-05-22 14:53:44.206 +03:00] [STDOUT]   at ReferenceHub.Start () [0x00009] in <2343be033e9f4e37923f780ece756d8e>:0
static meteor
worn gull
upper vapor
#

Oh

#

Well yeah that should be a fairly simple patch

#

Can you show your code?

upper vapor
#

I think they're more convenient though

#

Not sure if the framework you mentioned has a feature similar to resolvers

#

And it most definitely doesn't have RA options

#

I'm impressed and a bit annoyed at the same time cuz this #1371227450025050123 is much more extensible compared to my RA options implementation
Though when I made RA options, dummy actions didn't exist yet

plain gazelle
#

Is there any way to access the server name as it appears on the server list?
I only know of Server.ServerListName but it appears empty, or maybe i did something wrong ._.

plain gazelle
#

hm, seems its something from my team, not exactly sure when it fires

hearty shard
#

you cant do it that early probably

plain gazelle
#

hm okay

upper vapor
#

You could check how ConfigurationLoader does it

upper vapor
#

Isn't it an entry in the gamellay config

hearty shard
#

oh

#

yeah

upper vapor
#

ConfigSomething

#

Can't recall the class name exactly

hearty shard
#

yeah i was gonna say ConfigurationLoader is for labapi

slim rose
upper vapor
#

It uses request data

#

So it's limited to 4 buttons

#

I made it like

#

2 years ago

#

Never realized the potential of dummy actions until I saw your plugin

#

It's pretty cool

slim rose
young phoenix
#

guys why does player.AddItem() not work in OnPlayerSpawned event? does the class inventory overwrite it?

slim rose
plain gazelle
#

When i delete a gameobject using NetworkServer.Destroy it doesnt seem to actually be destroyed..?

I put a regular BoxCollider on the gameobject and after the NetworkServer.Destroy call
Raycasts can still hit the collider, and scripts on the object stay running.....

young phoenix
#

or is that what you mean

worn gull
upper vapor
young phoenix
#

alr thnx

upper vapor
#

Is it a networked object?

#

You should probably use Object.Destroy for those without a network identity

restive turret
#

networked object?
use NetworkServer.Destroy
normal object?
Use Object.Destroy (specifically from UnityEngine namespace)

grand flower
#

our dedi player keeps disconnecting leading to weird bugged servers ;-;

#

so im just patching out the Disconnect() functions for it

#

tired of that bug

thin shuttle
hearty shard
thin shuttle
#

<color <size ect..

hearty shard
#

add tag is more

thin shuttle
#

Take a lot of char

hearty shard
#

yes

#

oh you mean increase

#

not decrease

thin shuttle
#

So yeah 400 isn't a lot

hearty shard
thin shuttle
#

Anyways kinda no happy mood so don't really care

plain gazelle
# wheat flower bitch thats mine

I used LabAPIs RoundStarted to execute my script.
Your Init is called too early or something.... MER wont spawn my cube this early :v

wheat flower
#

the map hasnt loaded at that point

#

lmao

#

it literally says in the doc

#

"called when the plugin is first enabled"

#

my bad bro, idk why im acting like this ๐Ÿ’€

plain gazelle
#

my disappointment is immeasurable and my day is ruined

thin shuttle
thin shuttle
restive turret
#

just skill issue

tulip kiln
#

Reworked my speaker system to use batches with duplicate controller ids and it works like a charm

#

Thank you guys ๐Ÿ™

royal mica
#

I've noticed a very interesting bug

#

not sure where to report as it is VERY niche

unique crane
royal mica
#

but Chaos keycards which are originate from Dummies does not update the SnakeEngine

#

like score and length stays 5-0

#

Keycards from real players gets updated

young phoenix
#

how can I clear someones inventory?

grand flower
#

Player.ClearInventory

young phoenix
#

thanks

hearty shard
#

i swear dog when attacking would go visible

#

have i gone schizo

#

is that not how it used to be

young phoenix
#

is there a way to lock a specific door on the map e.g. surface gate

grand flower
#

check the overloads

#

Question to NW, is there any reason why the dedicated player should be able to be disconnected?

#

I completely patched it out, just making sure I'm not breaking anything doing so. But so far it doesn't seem to be the case.

#

It doesn't get disconnected on round restart

#

or on server shutdown

#

Wouldn't it just be easier if you just made it not disconnect at all

unique crane
#

so dummies dont do anything on it

royal mica
#

Nono, I mean the Dummy drops the keycard

#

I pick it up

unique crane
#

Oooooh

royal mica
#

I play and it doesn't get updated

worthy rune
grand flower
#

yes and no

#

hang on actually

#

oh yeah nvm, thought NW wrote the connection that the dedi uses

hearty shard
celest thorn
#

Players.Remove(ev.Player);

Is it normal that if i do this the player doesn't get removed from the list in the event PlayerLeftEventArgs because normally it works except here

hearty shard
#

or is that SL moment

worthy rune
#

sort of a SL moment

celest thorn
#

sl moment

hearty shard
#

also

Intercom

public bool CheckPlayer(ReferenceHub hub)
    {
      PlayerRoleBase currentRole = hub.roleManager.CurrentRole;
      if (!this.CheckRange(hub) || !(currentRole as HumanRole).VoiceModule.ServerIsSending || VoiceChatMutes.IsMuted(hub, true))
        return false;
      PlayerUsingIntercomEventArgs ev = new PlayerUsingIntercomEventArgs(hub, Intercom.State);
      LabApi.Events.Handlers.PlayerEvents.OnUsingIntercom(ev);
      return ev.IsAllowed;
    }

Make it possible to have non human role trigger (with event ofc)

grand flower
#

Mostly annoyed that the host player can spawn if you're not careful, and the whole bag of issues that happen when the dedi player is disconnected

#

moving, reloading, interacting, talking, a ton of stuff randomly breaks

#

and sometimes not for everyone heh

celest thorn
grand flower
#

Although there's a lot of bugs with Player

celest thorn
grand flower
#

Stuff like players trying to be added multiple times to the list or something

celest thorn
#

but it doesn't if its disconnecting

grand flower
#

I'd use the userid maybe

celest thorn
#

lol

grand flower
#

Why not

#

It won't change

celest thorn
#

[2025-05-22 19:54:03.014 +00:00] [STDOUT] NullReferenceException: Object reference not set to an instance of an object.
[2025-05-22 19:54:03.014 +00:00] [STDOUT] at UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) [0x00018] in

    if(Players.Count > 0)
        Players.RemoveAll(x => x.GameObject == null);

If i even try to do this it explodes

#

so i just don't know

celest thorn
#

all of the time

#

and its just annoying

grand flower
#

since ReferenceHub is a NetworkBehaviour I'm guessing it's null

#

NW should really make GameObject nullable in this case and do this.ReferenceHub?.gameObject

celest thorn
grand flower
#

yup

#

you shouldn't hold players that way tbh, but checking that should fix your issue

hearty shard
#
PlayerRoleBase currentRole = hub.roleManager.CurrentRole;
      if (!this.CheckRange(hub) || !(currentRole as HumanRole).VoiceModule.ServerIsSending || VoiceChatMutes.IsMuted(hub, true))
        return false;
#

am i stupid

grand flower
#

did you write that or

hearty shard
#

no its basegame

#

OH

#

IK

grand flower
#

decompiler probs

hearty shard
#

nono

#

it cant be null

grand flower
#

it makes pattern matching funky

worthy rune
#

im confused about what you guys are talking about are you removing a player from a list inside the PlayerLeft event?

hearty shard
#

cuz CheckRange checks for HumanRole

#

i was so confused why intercom didnt throw null ref

#

๐Ÿ’€

grand flower
#

seems like that's what they're doing

#

holding a list of Player

worthy rune
#

i dont think we override equality on the player wrapper, so im guessing they must be adding back the player somewhere

teal junco
celest thorn
#

that should be fine

grand flower
#

You screw up somehow and you end up with a ghost player

worthy rune
#

oh thats known about

#

yes its going to be fixed

grand flower
#

good to know

#

it's the bane of our existance atm

worthy rune
#

player should be the only one that does it iirc

celest thorn
worthy rune
#

im not sure how it relates to your issue

#

if i understand it correctly

celest thorn
#

Like my issue

#

i have a list

#

when the event playerleft gets called and i try to remove the player

#

it says its removed

#

but in reality its not

worthy rune
#

yeah thats unrelated

celest thorn
#

but still this is strange lol

worthy rune
#

i think you are adding the player back somehow

celest thorn
#

i checked that

worthy rune
#

did you try logging when ever you add a player

celest thorn
#

i can try again lol

worthy rune
#

btw your using the Player wrapper and not reference hub correct

celest thorn
worthy rune
#

alright, ill take alook into it then

celest thorn
#

yep its not getting added its like staying there

#

because when i join back it sanitize itself

#

removing the null players

#

this only happens tho on the left others work fine

grand flower