#plugins-dev-chat

1 messages · Page 173 of 1

wary gust
#

so labapi github was a bad place to make a bug report

#

where else do I do it???

upper vapor
#

i genuinely do not know

restive turret
#

huh what

wary gust
mild ice
wary gust
#

i guess I don't have to write an email then

wary gust
upper vapor
restive turret
#

AH i know why

upper vapor
#

that's why

restive turret
#

two cookies

wary gust
upper vapor
#

bruh

mild ice
#

What reaction lowresolutiontroll

tribal dagger
#

same as i

wary gust
#

so peak

mild ice
wary gust
mild ice
wary gust
#

like Home > Help & Support > More Help & Emails (which has 1 link, 1 singular link, like damn) > My question isn't listed or I need more help! (also 1 link) > https://scpslgame.com/contact-us/ > Scroll all the way down

wary gust
icy knoll
#

@tribal dagger did you give organisation access to this?

#

Here is what my org looks like (which is on the plugins website)

tribal dagger
#

well i received an email for the integration being added and the checkmark was there when i was adding it

#

but maybe something went wrong

#

ill check

magic gate
#

You must have administrator permissions in the organization

icy knoll
#

so

tribal dagger
#

well i have an owner

magic gate
#

oh, you do

tribal dagger
#

oh

#

my server got delisted

#

yummy

magic gate
magic gate
restive turret
magic gate
#

labapi portal doesn't use cookies

hearty shard
#

yum yum

magic gate
#

biscuits

upper vapor
magic gate
#

.

hearty shard
plain gazelle
#

I attempt to summon the almighty Harmony patching gods and beg for help in figuring out why my fake positioning patch no longer works

#

This used to correctly move an NPC Player i have vertically according to its fake scale, so that it always touches the ground (Since Player models scale from the hip...)

#

Now it no longer does anything at all

#

(It worked in the version before christmas event iirc)

#

This is the decompiled method GetNewSyncData

sweet flax
#

.

#

when

hearty shard
#

Nw should pay me tbh

slate flume
#

I fixed it the cool way instead 😎
No delay

vast canopy
plain gazelle
plain gazelle
#

Nvm its definitely cedmod

#

:c

static meteor
#

Cedmod moment

plain gazelle
#

I will grab my pitchfork and storm the cedmod discord

restive turret
#

Or just disable the patch they do

plain gazelle
#

TLDR
It was cedmod
ced777ric told me to set something to false but i had to set it to true to fix it

#

works now

#

It was the ESP anticheat fake syncing

restive turret
#

Ye could have guessed

unique crane
#

silly eve

plain gazelle
#

How do i set the Unit text of Guards/MTFs?
And does this text have any direct connection to the Unit names on the top right of the screen? Can those units be customized? Can the unit "selection" be customized for a player?

#

Also, can the "Follow Orders"/"Same rank"/"Give orders" stuff be customized?

halcyon folio
warped prairie
upper pike
halcyon folio
#

Assign it to yourself, push up your changes and deploy, test it and get QA verification.. $

upper vapor
upper vapor
#

Though you can only use built-in combinations, no custom text

hearty shard
#

i quit sl lmao

#

i mean i make secretapi and nw dont pay ppl to make plugins

slate flume
#

CedMod had a prefix that was returning false and preventing yours from running

#

This is why CedMod should be using transpilers

#

Maybe I'll make a PR for it sometime

slate flume
#

If I convert all the prefixes to transpilers will I get a high five from Cedric

upper vapor
#

Zero has done some of those

slate flume
#

Okay question

#

I did a spawn wave thing where I replaced the base-game system

#

But for some reason wave animations aren't playing for clients

#
var field = typeof(WaveManager).Field(nameof(WaveManager.OnWaveTrigger));
var handler = (Action<SpawnableWaveBase>)field.GetValue(null);
handler?.Invoke(wave);

This correctly starts the animation for the server, which I know because the server recognizes that the animated wave animation is playing

#

It gets the duration right and everything

#
WaveManager.OnWaveTrigger += (Action<SpawnableWaveBase>) (wave =>
{
  float duration = wave is IAnimatedWave animatedWave2 ? animatedWave2.AnimationDuration : 1f;
  foreach (TimeBasedWave wave1 in WaveManager.Waves)
    wave1.Timer.Pause(duration);
  if (!NetworkServer.active)
    return;
  WaveUpdateMessage.ServerSendUpdate(wave, UpdateMessageFlags.Trigger);
});

This section from the Init for the WaveManager should mean that it gets sent to the client

slate flume
#

The client logs don't show any rejection of the network message

#

I'm a little confused

#

Is there some other network message or something I need to send clients to play the wave animation

#

I'm just a little bewildered atm

unique crane
#

@narrow wagon sorry wrong ping

#

FUCK

#

wrong person

restive turret
#

Lmao

unique crane
#

@slate flume

#

Have you modified WaveManager.Waves?

slate flume
#

But I've modified the waves themselves

#

The odd thing was the system I had was working seemingly until the Christmas update but it might just be coincidence

restive turret
#

I dont think xmas update changed any wave related stuff

slate flume
#

This is what I did to waves

#

I didn't want them to happen anymore

restive turret
#

I think you might need to send message to pause the wave on client too

slate flume
#

I tried sending a pause message but either I didn't do it right or it didn't work cause it didn't change anything

slate flume
#

You'd think getting a single animation to play would be easier than this lmao

unique crane
rough tundra
#

Hey guys, I just made a nuget package to generate an sl plugin template, would anyone be interested in testing it for me? In case this would count as advertisment, can anyone in the staff lmk?

unique crane
hearty shard
#

what the flip

#

-# sounds like a skill issue....

rough tundra
unique crane
hearty shard
#

hi david

unique crane
#

hi eve

hearty shard
#

i was gonna add smth to secret api and then i looked in #1336031121699377213 and the first thing i see is literally a plugin doing that

#

💔

unique crane
#

rip

#

which one

hearty shard
#

making exceptions actually yk...

#

log

#

and not just die without anything

#

i could add it anyway for the fun of it

#

but im not sure theres much point with an existing one doing just that lmao

halcyon folio
#

Just a joke

hearty shard
#

!csg

regal lakeBOT
restive turret
hearty shard
upper vapor
hearty shard
#

valid argument

restive turret
hearty shard
#

good point

warped prairie
#

He’s the guy

slate flume
unique crane
#

Does that code actually run?

slate flume
#

Yeah lol I did all the basic debugging

unique crane
#

Are the network messages created correctly, is the wave id in the message correct?

slate flume
#

Everything works except the animation

#

The reinforcement interface fake-syncing works, the spawning works, everything works

#

The server even recognizes that the animation is playing

unique crane
#

No hidden exceptions in localadmin log?

#

Player log

slate flume
#

Correct

#

I checked the client log

#

It's just a matter of getting the client to actually play the animation

#

It's probably something really obvious that I'm completely overlooking

unique crane
#

There is only 1 client-side check for these

#

and that one throws argument exception

#

Which you would see in the logs

slate flume
unique crane
slate flume
#

Oh well the wave index isn't invalid lmao

#

Unless you want me to make it invalid on purpose to make sure the network message is sent

#

Because currently I get no errors from it in my client log and I know that the messages are being sent because the reinforcements interface works and that uses the same messages

barren pasture
#

Where does a players current item sync?

slate flume
hearty shard
#

when does client tell server its item swap or when does server tell client about the item force

barren pasture
#

I can change what RoleTypeId is synced using FpcServerPositionDistributor.RoleSyncEvent, is there anything similar for current item?

hearty shard
#

not natively

#

no

barren pasture
#

Damn

hearty shard
#

Inventory::ServerSelectItem

barren pasture
#

Hmm

hearty shard
#

Inventory::NetworkCurItem

#
[HideInInspector]
  public ItemBase CurInstance
  {
    get => this._curInstance;
    set
    {
      if ((UnityEngine.Object) value == (UnityEngine.Object) this._curInstance)
        return;
      ItemBase curInstance = this._curInstance;
      this._curInstance = value;
      bool flag = (UnityEngine.Object) this._curInstance == (UnityEngine.Object) null;
      if ((UnityEngine.Object) curInstance != (UnityEngine.Object) null)
      {
        curInstance.OnHolstered();
        curInstance.IsEquipped = false;
        if (this.isLocalPlayer)
        {
          curInstance.ViewModel.gameObject.SetActive(false);
          if (flag)
            SharedHandsController.UpdateInstance((ItemViewmodelBase) null);
        }
      }
      if (!((UnityEngine.Object) this._curInstance != (UnityEngine.Object) null))
        return;
      if (this.isLocalPlayer)
      {
        this._curInstance.ViewModel.gameObject.SetActive(true);
        SharedHandsController.UpdateInstance(this._curInstance.ViewModel);
        this._curInstance.ViewModel.OnEquipped();
      }
      this._curInstance.OnEquipped();
      this._curInstance.IsEquipped = true;
    }
  }
upper vapor
#

@hearty shard not gonna necro on the issue but like

Currently, we require an API
in the labapi repo
pretty sure they want something related to LabAPI

hearty shard
#

they said

#

within the game,

#

which is why i said what i said

upper vapor
#

then it wouldn't be a labapi issue

hearty shard
#

and they also just replied to me

#

that its right

hearty shard
#

i just clarified what i thought was the case of their request

upper vapor
#

that's it

#

closing it as wontfix

hearty shard
#

lel

upper vapor
#

okay but like

#

the "api" is already there

#

in the base game

#

and if they wanted a command, they would've said "command" probably

hearty shard
#

im going off just the

#

"in the game"

upper vapor
#

braincell fight

hearty shard
#

yes

#

also

#

ax

#

did u see the new minecraft animals

#

the babies specifically

#

like

#

most adorable shit ever

#

i want to eat them

upper vapor
#

i HATE CHANGE

#

revert NOW

hearty shard
#

cant tell me this isnt the cutest ever

upper vapor
#

i will tell you otherwise

hearty shard
#

i will kill you

#

that being said

#

i need to actually find workers

#

ew

upper vapor
#

exiled discord -> commissions

#

or whatever it's called

hearty shard
#

i do NOT trust it

upper vapor
#

xd

hearty shard
#

hell nahhh

upper vapor
#

okay you were right

hearty shard
#

id rather try my luck finding actual devs to work with 😭

upper vapor
#

check the github issue

hearty shard
#

im always right

upper vapor
#

i'm quitting (not gonna be specifying what i'm quitting)

#

oh i misunderstood the text

#

bruh

hearty shard
#

nerd

hearty shard
upper vapor
celest thorn
#

does Itemspawned integrate even dropped items, or just at the round start?

restive turret
#

Only specific stuff

#

Only distribution stuff

celest thorn
restive turret
#

Ye but not all those, some isnt which wierd

celest thorn
#

there's one more universal

#

I need to do spawn chances for a custom item

#

so thats why

restive turret
#

What i did is replace after generated

celest thorn
restive turret
#

Well depends

#

Usually pickup.list.where x yz . random

celest thorn
#

Im rn doing it to the ServerEvents.ItemSpawned

#

But then in that case that would go to actually the OnRoundStart or OnWaitingForPlayers

#

the one you mentioned

restive turret
celest thorn
#

bruh

#

so yea i need to do it OnWaitingForPlayers

#

which i think is the same one you are doing?

#

with the list of Pickups?

restive turret
#

Ye

#

You might also wanna do smth like locker. All. Wher xyz and remove the item and add yours

#

(or just register it's serial

cyan crown
#

i cloned Outlast lmao

barren pasture
#

What is the command to create a server in the game?

static meteor
#

cst

barren pasture
#

Right, thanks

urban robin
#

How to make SERVER SPECIFIC binds? I can't find anything api docs for this quest.

static meteor
# urban robin How to make SERVER SPECIFIC binds? I can't find anything api docs for this quest...

When enabling the plugin do this

        internal List<ServerSpecificSettingBase> _settings;

                _settings =
                [
                    new SSGroupHeader(Config.KeybingSettingHeaderName),
                        new SSKeybindSetting(Config.KeybindSettingId, Config.KeybindSettingName, KeyCode.K, hint: Config.KeybindSettingHint, allowSpectatorTrigger: false)
                ];

                ServerSpecificSettingsSync.DefinedSettings = _settings.ToArray();
                ServerSpecificSettingsSync.SendToAll();

Event:

        private static void OnValueReceived(ReferenceHub referenceHub, ServerSpecificSettingBase settingBase)
        {
            if (!Player.TryGet(referenceHub.gameObject, out Player player))
                return;

            if (settingBase is SSKeybindSetting keybindSetting && keybindSetting.SettingId == Plugin.Instance.Config.KeybindSettingId && keybindSetting.SyncIsPressed)
            {
                if (Utilities.TryGetSummonedCustomItem(player.CurrentItem.Serial, out SummonedCustomItem item))
                    item.HandleEvent(player, ItemEvents.SSSS, player.CurrentItem.Serial);
            }
        }
urban robin
static meteor
#

Just what i had open

urban robin
static meteor
upper vapor
#

Also, the code above would nuke other plugins' settings

mild ice
#

Who needs those

upper vapor
warped prairie
#

who needs other settings when you have THE setting

#

smh

mild ice
#

Back in my day we didn't have SSS

#

Don't need any of these new fangled systems

true cedar
#

back in my day we didn't have

warped prairie
#

back in my day we didnt have SCPSL

upper vapor
cyan crown
upper vapor
#

Dang they've remove that emoji

sinful bronze
#

Btw i like playing with wave system in sl

#

Its so fucking weird

#

Im changed time of mtf and ci respawn and made new custom squads

#

Mini waves at 2 min just respawns BlobSheesh

sinful bronze
#

Why?
Idk

But i will just change mini wave time

upper vapor
sinful bronze
#

And i hate how now wave size work

#

Server online and spectators / number = wave size precent

#

Plz kill programmer of this

upper vapor
sinful bronze
upper vapor
#

@restive turret

restive turret
#

Lel

hearty shard
#

what the flip

#

if theres C sharp wheres C blunt

unique crane
hearty shard
#

yk what

#

thats a valid point

upper vapor
sacred sierra
upper vapor
wary gust
#

Random question: Why do some errors only show up in the LocalAdminLogs and not in stdout? Is there something that prevents them from writing to stdout? if so, why can they still write to the log file?

upper vapor
#

You can enable writing standard output to the LA console with a config setting, though it's gonna spam a lot of unnecessary things

upper vapor
wary gust
#

thanks anyway, I was just wondering it is the way it is

upper vapor
#

Well you can't catch unity event exceptions such as Update

#

And yeah it's annoying when stuff silently fail and make the log file hundreds of MB

hearty shard
#

i mean

#

try Application.logMessageReceived

#

that should run for exceptions even from unity

#

dunno tho

sacred sierra
upper vapor
hearty shard
#

damn

cyan crown
#

i tried fmod yesterday its so cool and awesome of how fucking insane it is i tried building the banks but none of them build for some reason

#

i love fmodSteamHappy

upper vapor
cyan crown
upper vapor
#

If you're confined to a game engine then you can't use SoundFlow

inner citrus
upper vapor
#

FartMod

waxen kayak
#

why nw make it private and make me use reflection???if(npc.CurrentItem != null) { if(npc.CurrentItem is Firearm firearm) { if(firearm.Base is AutosyncItem autosync) { var p = typeof(AutosyncItem).GetProperty("DummyEmulator", BindingFlags.NonPublic); var DKE = (DummyKeyEmulator)p.GetValue(autosync, null); if(DKE != null) { var AE = typeof(AutosyncItem).GetMethod("AddEntry", BindingFlags.NonPublic); AE.Invoke(DKE, new object[] { ActionName.Shoot, false }); yield return MEC.Timing.WaitForSeconds(1); var DE = typeof(AutosyncItem).GetMethod("RemoveEntry", new Type[1] {typeof(ActionName) }); DE.Invoke(DKE, new object[] { ActionName.Shoot }); } } } }

hearty shard
#

just publicize the assembly

#

and if you are going reflection you should cache it

#

also afaik you dont even need to manually remove entry

#

it does that when its been used

#

or so i think

cyan crown
restive turret
#

nvm it doesnt have "this T item"

slate flume
#

Oh I see

#

That's what you do

#

I didn't look at the function lmao

#

My bad

slate flume
#

Also won't that code error if the player isn't holding an item

#

You don't null check player.CurrentItem

static meteor
#

There is in the original

slate flume
#

You can make some optimizations and readability changes here

static meteor
#

Havnt touched it in like 6 months ¯_(ツ)_/¯

slate flume
#

When you check player.CurrentItem you do player.CurrentItem is null when you could do player.CurrentItem is not { Serial: var serial }
That way in the else if you can just use the serial variable instead of reusing player.CurrentItem for the serial both times

#

Since you do the break condition, there's no reason to have an else as it's already implicit

#

Also you could linq the items loop like

foreach (var customItem in player.Items.Where(item => item.Type.IsArmor())
                     .Select(item => Utilities.TryGetSummonedCustomItem(item.Serial, out SummonedCustomItem customItem) ? customItem : null)
                     .OfType<SummonedCustomItem>())
#

It looks messy on discord cause of line wrapping

#

The select could be made much simpler if you introduce a function with a nullable return type like SummonedCustomItem? GetSummonedCustomItem(ushort serial) because then it just becomes .Where(item => item.Type.IsArmor()).Select(GetSummonedCustomItem).OfType<SummonedCustomItem>()

#

Sorry I don't mean to be hyper critical I'm just procrasinating my own work

#

The stuff I'm doing right now is mostly trial/error and I hate it

slate flume
#

First thing is that I don't know why you imported FirearmItem as Firearm, but that's a minor point

#

The biggest thing immediately is the 3 nested if statements

#

You can simplify it be doing if (npc.CurrentItem?.Base is Firearm firearm) where Firearm is not the LabAPI FirearmItem wrapper, it's the InventorySystem.Items.Firearms.Firearm

#

Firearms are always an AutosyncItem which is why I didn't include that in the checks

#

It means your third if statement always returns true

#

Also, it appears you're doing this reflection in a coroutine
It would be better to store the FieldInfo somewhere static so you don't do reflection every time the coroutine runs that part of the loop, or anytime the coroutine runs generally

slate flume
#

It makes sense that you have to publicize the base-game assembly, because no one should be making an entire game with only public fields

#

What doesn't make sense is that there are private fields in the public-facing extension meant for modders

#

I mean in some cases it may make sense but there are fields that shouldn't be private that are

#

Question

#

Gravity is persistent across respawns

#

So if I set a player's gravity, and then they die and respawn, their gravity is still set to the modified value

#

The issue is then that if they die, I have no way to actually reset their gravity

#

The LabAPI Gravity field doesn't actually account for this, and seemingly runs under the assumption that gravity resets when a player dies

warped prairie
#

thats what we do bc we do grav shiz

slate flume
#

The thing is right

#

If the game knows the gravity is changed on respawn, then it has to be storing it somewhere

#

Somewhere it knows there's modified gravity

#

I just don't know where it does

#

And it has to be stored somewhere on the server, not the client

#

So I know I have access to it

warped prairie
#

ye. that do be the question

upper vapor
#

GravityController.DefaultGravity is probably a thing you're looking for

slate flume
upper vapor
#

Ah

slate flume
#

My whole point is that LabAPI doesn't account for this

upper vapor
#

Umm

#

Well

slate flume
#

They depend on the player being alive

upper vapor
#

Yeah that makes server

upper vapor
#

Sense

#

Feel free to make an issue

#

I hate this system of having instance properties that reference static fields

upper vapor
#

Sure it's cool for persistence but it's a headache to work with

#

The expected approach is to get an instance to modify something static skullbutreal

#

Like
new Calculator().Add(a, b)
Where the add method calls a private static method

spare zodiac
#

for future reference (if someone will use ctrl+f) and you are stuck at ServerOnSettingValueReceived, remember setting won't be called if it's not present in defined settings SteamHappy

upper vapor
spare zodiac
#

it's pain

slate flume
slate flume
#

My transpiler stack is growing haha

#

I used to only have like 2

#

Now I have like 8 or something

#

Well at least in terms of bug fixes

#

I have some others too

#

I'm aiming for a dozen

spare zodiac
upper vapor
#

xdd

#

15.0 boutta be lit

#

literally

unique crane
#

Something huge is coming

slate flume
spare zodiac
#

I have no clue where to start making plugin compability for SSS

#

it's not created for that

unique crane
slate flume
spare zodiac
upper vapor
#

"let's make a standard fr this time"

slate flume
#

Wait where's that one image

unique crane
slate flume
unique crane
#

Why are you wasting your time when there is 14 plugins that already do this

#

eg

#

secretapi

slate flume
#

SecretAPI is already goated

unique crane
#

doesnt matter

#

Point is that your doing something that already exists

upper vapor
#

literally javascript frameworking

spare zodiac
#

I didn't really see much of SSS that would allow dynamicly create another settings (or have not looked enough)

upper vapor
#

"i don't like this one thiing"
*creates a whole new framework*

unique crane
#

Shitscript is another case

spare zodiac
upper vapor
unique crane
upper vapor
#

SecretAPI can do this already

unique crane
#

afaik secret api has per-player settings no?

upper vapor
#

yea

spare zodiac
slate flume
#

I remember I had this conversation a while back about ASS cause not many people use ASS and I was saying "Man, I use SecretAPI because it was first, and it works cleanly with no issues"

slate flume
upper vapor
#

with a few additions

slate flume
#

Piling more on top isn't helping anyone

#

There's no demand for another SSSS plugin

spare zodiac
#

wasted 4 hours gg

upper vapor
#

sooooo not too late to give up toomuchtrolling

unique crane
#

Could be worse

slate flume
#

Is ts just gonna be a clone of SecretAPI with a few additions

spare zodiac
#

SecretAPI overrides settings that are not from SecretAPI

upper vapor
#

it doesn't override them

spare zodiac
#

so I thouht I would look into that

upper vapor
slate flume
spare zodiac
slate flume
#

They're an addon to the code

slate flume
spare zodiac
#

mb

upper vapor
#

poor saskyc ngl

slate flume
# spare zodiac mb

The only time a patch overrides something is

  1. It's a transpiler
  2. It's a prefix with a bool return value that returns false
spare zodiac
upper vapor
#

yes

slate flume
upper vapor
#

but it runs after returns

slate flume
#

Right

#

But the original code is still intact

#

All the original code still runs and any additional handling is skipped by the postfix if it's not a SecretAPI setting

#

Bro does SL use Mathf.Ceil when displaying health

#

I multiplied a player's max health by .6 and it displayed 61

#

So I decided to log 60 - maxHealth and got -3.814697E-06

upper vapor
#

welcome to float precision

slate flume
#

The max health is less than 4 millionths greater than 60, and yet that causes it to display as 61

slate flume
#

Ts pmo

upper vapor
#

i would assume we do because if you had 0.4 HP then it would display 1 HP

slate flume
#

Right I get that but you'd think there would be some kind of tolerance check

upper vapor
#

i just can't find the code for it

#

nice

restive turret
#

It sent with ushort

#

Just pass as that

slate flume
slate flume
#

I'm just gonna patch the max value setter and have it set the float to the "pure" version if it's considered in range by Mathf.Approximately

upper vapor
unique crane
#

Thats a percentage

#

Value healthbar doesnt

wary gust
#

@unique crane (I hope https://github.com/davidsebesta1 is you), I need to create an exact copy of an item and the easiest way is to create it with the same serial. Otherwise I would have to copy everything over, including the syncinfo and all other properties. The bugs do not affect me since the previous item does not exist when a copy is created. Yes there are ways I could rewrite the whole thing, but this would lead to my plugin being less compatible with other plugins.

That being said, I understand that you don't want to add this as it is in fact unsafe if you don't know what you're doing (and is still unsafe even if you do know).

This was a response to: https://github.com/northwood-studios/LabAPI/issues/335

hearty shard
#

i mean

#

if its the same item basically

#

why not just

#

use the existing item

unique crane
wary gust
unique crane
#

And then link them together after they are all created

wary gust
unique crane
wary gust
unique crane
#

I mean

#

You need to use serial for tracking, but you cant copy them over rounds

wary gust
hearty shard
#

why not store item instead of destroying

#

i dont quite understand

restive turret
#

I don't even understand the whole thing

unique crane
#

me neither, honestly

wary gust
#

I am also now realizing how much worse of an idea this is

unique crane
#

Can you explain what are you trying to do?

#

We can help you with finding a better solution

restive turret
#

With code example too

#

That would help too

wary gust
restive turret
#

example not said paste here all

wary gust
#

but, I have a plugin which records all action in-game for filmmaking (the thing I'm working on)
and I want to support custom items among other things

#

those are tracked via the serial most of the time,
Secondly, I use the same ushort since I can't really store the whole item each frame / on change (still a lot)

unique crane
#

How do you store them

wary gust
# unique crane How do you store them
public struct VanillaItemRefence(ItemType itemType, ushort serial = 0, bool tryFindPickup = true) : IGivableItemReference
{
    public ItemType ItemType = itemType;
    public readonly ushort Serial => serial;
    private readonly bool TryFindPickup = tryFindPickup;

    private readonly bool MatchesSerial(Pickup pickup)
    {
        return pickup.Serial == Serial;
    }

    private readonly bool MatchesSerial(Item item)
    {
        return item.Serial == Serial;
    }

    public readonly void GiveItem(Player target)
    {
        if (target.Items.Any(MatchesSerial))
            return;

        ItemPickupBase pickup = null;
        if (TryFindPickup)
        {
            pickup = Pickup.List.FirstOrDefault(MatchesSerial)?.Base;
        }
        target.Inventory.ServerAddItem(ItemType, InventorySystem.Items.ItemAddReason.Undefined, Serial, pickup);
    }
}


public struct CustomItemReference(ushort serial, CustomItemReference.GiveItemWithSerial giveItemMethod) : IGivableItemReference
{
    public delegate void GiveItemWithSerial(Player player, ushort itemSerial);
    public delegate bool CheckCustomItem(ushort itemSerial);

    public readonly ushort Serial => serial;
    public GiveItemWithSerial GiveItemAction = giveItemMethod;

    public readonly void GiveItem(Player target)
    {
        GiveItemAction(target, Serial);
    }
}

#

ushort reference

unique crane
#

When storing the data, map the items to your own unique identifiers

#

your id <-> current serial

#

If you store the data somewhere, for example json

#

Load all items

#

take their serials

#

make the map again

#

And use that

#

So you bind your actions to your item ids, which can be fixed

upper vapor
#

shameless plug

restive turret
#

Removed

upper vapor
#

cuz i'm lazy :3

#

also it doesn't include literally everything unfortunately

wary gust
upper vapor
#

and then i have to upload it

upper vapor
#

yep

#

and some states that are stored in static dictionaries also aren't stored by this

restive turret
#

Skrill sissue

upper vapor
#

i fucking hate the instance-tied static variables approach

restive turret
upper vapor
#

an instance property gets its data from a static dictionary

#

it's so stupid

restive turret
#

Uhh

upper vapor
#

such as this one

wary gust
#

@upper vapor what's the license?

upper vapor
#

cuz there is no license

upper vapor
restive turret
#

Anyway time to eat and write my own Demo playback 🔥

upper vapor
#

anotha one

restive turret
#

There is zero public one

upper vapor
#

#

there's at least 2 public ones

restive turret
#

Or I didn't see anyone posted it

upper vapor
#

i know uhhhhh

#

icedchai made one

restive turret
#

I aint seen he posted any of it

upper vapor
slate flume
#

The client needs to be aware of the gravity change, otherwise there would've been desync

#

The game only sends a gravity message when the gravity is changed, which doesn't happen on role changes

#

The client would just continue to believe there was a modified gravity

slate flume
#

I'm a LabAPI man myself

restive turret
#

I think it is the same stuff with the scale

restive turret
#

Both are not reset on class change

slate flume
#

I'm a little lost

#

Do you mean for yourself?

#

I don't know the context here

restive turret
#

Scale and Gravity not change back to default after role change

slate flume
#

Yeah

#

That's the entire point of the static dictionary

#

The uh FpcGravityThing.SyncedValues shit

restive turret
#

Ye then Im out of loop then

slate flume
#

I just made a transpiler to fix LabAPI's Gravity setter

restive turret
#

I reset the value on role changing by hand but only if the player had custom role

#

Sometimes its great

#

Sometimes its not

slate flume
#

Because I reset gravity after the player dies

restive turret
#

For example we use this as our advantage when someone for example get an effect from coin and become small, so it will be small for the entire round

upper vapor
#

if only we didn't bind the setter to an instance (which ends up in a static context anyway)

slate flume
#

I made a transpiler that does pretty much the exact same shit

upper vapor
slate flume
#

The order is just get player -> change dictionary -> send new message

upper vapor
#

actually

#

2 PRs away

#

cuz the base game needs to be changed as well

restive turret
#

Actually you can take it and make a PR

#

Fuck

slate flume
upper vapor
#

you know what i will

slate flume
#

How far do Do Not Track guidelines extend? I'm making some features that prioritize a player for certain things if they perform well that round
Everything is stored on a per-round basis

hearty shard
slate flume
#

Sick

hearty shard
#

so youd have to explain what ur actually doing it for

#

!csg

regal lakeBOT
slate flume
#

I already read the CSG

#

I just needed elaboration

#

Cause I'm doing some spawn wave stuff and I wanted to put players on different teams based on stats

upper vapor
hearty shard
#

8.3. Server Sta, the Game Server and its Modifications must respect the Do Not Track (DNT), an
opt-out from any data processing that is not needed for gameplay or server security purposes.
It is forbidden to kick, ban, or otherwise punish players for using any of the described opt-outs.

slate flume
hearty shard
slate flume
#

Does it extend to an end of round leaderboard

hearty shard
#

that imo isnt gameplay related

slate flume
#

Yeah that's what I feared

hearty shard
#

and thus would prob not be allowed

slate flume
#

I don't have it set up that way currently

#

It's kind of a grey area

hearty shard
#

you could have it so that the leaderboard only shows the ppl without DNT

true cedar
slate flume
hearty shard
#

so like

#

oh

#

ok!

slate flume
#

I've never encountered this issue before cause I didn't care to store player information

#

Now I have a thing that needs it and I'm overhauling the system I used

#

End of round leaderboard just didn't even touch DNT players

#

I don't know if I'm making much sense it's like 8am and I haven't slept

hearty shard
#

i meannn

#

the issue with not being able to track it is that by not tracking u dont know whether someone is actually first or if its a DNT person

#

does kinda suck to not be able to show the correct spots

#

oh well

#

it be like that

slate flume
#

Zero-based and all that

upper vapor
#

change your password broski

#

@languid temple :3

warped prairie
#

lol

languid temple
#

nvm handled

upper vapor
#

yeah someone nuked them already

hearty portal
#

Does anyone have map editor plugin labApi or know where i can find it ?

upper vapor
#

your options are ProjectMER, sloc and MapForge

hearty portal
#

Alright thanks

ashen hound
#

mapforge still works?

#

( bruh author asks this )

upper vapor
upper vapor
unique crane
slate flume
#

I know a lot of you guys here use the bepinex assembly publicizer nuget package to automatically publicize imports

#

And I also know a lot of you guys also use rider

#

Is there a way to prevent these annoying ass duplicated results when searching usages and things

#

It checks both the publicized and non-publicized assemblies and it's going to make me crash out

restive turret
#

Idunno i don't use rider so @upper vapor maybe

upper vapor
#

Erm

#

I don't have this issue with SL plugins

#

I have it sometimes when I launch the debugger in a Unity project

#

Check all the imported references

#

(Right click csproj, properties something?)

#

Or just restart rider toomuchtrolling

slate flume
terse bone
slate flume
#

The only difference now is I use the Publicize="true" instead of referencing a manually publicized assembly

#

And now doing it this way I get duplicated usages

slate flume
#

Bruh

upper vapor
slate flume
#

Sure but I don't see how it's going to make a difference

#

My csproj is clean

upper vapor
#

Also, check Rider's references view

#

Btw, which version of the publicizer are you using?

slate flume
slate flume
slate flume
#

Only Assembly-CSharp

upper vapor
#

Your csproj is not clean 😭

slate flume
#

What is wrong with it man

upper vapor
#

Relative hintpaths

slate flume
#

Okay?

#

That's how rider formatted it for me

upper vapor
#

You're not a knower

slate flume
#

It's not like I hand-crafted it lmao

upper vapor
slate flume
slate flume
#

It prevents my name and shit from getting doxxed when people ask to see my csproj

#

Like right now

upper vapor
slate flume
#

For something that already works

upper vapor
upper vapor
#

Though if nobody is gonna see it then yeah it doesn't make a lot of server

#

Serve

#

Sense

slate flume
#

Also relative paths are dope because when I go on vacation I can port my project a lot easier

slate flume
#

Onto my laptop

upper vapor
#

That's

slate flume
#

I don't take my PC with me on vacation

upper vapor
#

An interesting approach to put your project in the correct folder so the relative path works

slate flume
#

I mean I use the default folders

#

Which means the path doesn't change because I don't customize the install

#

No need to overcomplicate everything

upper vapor
#

Ah

slate flume
#

The only thing that needs to be accounted for is installing the server in a folder on my desktop but I'd be doing that anyways

slate flume
#

I think it works now

upper vapor
#

Nice

#

Ts causes the weirdest behavior sometimes

restive turret
#

TeamSpeak?

upper vapor
#

TeamShutup

warped prairie
#

Or really anything

dapper apex
#

peepoopepoo

warped prairie
#

Real

upper vapor
warped prairie
#

Ty

#

15 mins later 🥀

upper vapor
#

my cellbrains are slow

warped prairie
upper vapor
#

never existed in the first place

#

firts

#

flirts

#

FLIRT

restive turret
#

@celest thorn I remember u did twitch integration, is it public?

restive turret
#

:(

celest thorn
#

The only other one who has it is ghost

restive turret
#

Well after 2 hours I say fuck async and fuck microslop dependency injection

restive turret
#

In unity?

teal junco
#

maybe im weird cus it seems like most people i know use their irl name or nickname for computer user folder

soft depot
icy knoll
restive turret
soft depot
#

You sound like Yamato Trolley

#

Anyways, you can always use MainThreadDispatcher to get back onto the main thread. It’s worked well for me the few times I’ve had to use async

teal junco
#

genuine

restive turret
#

Or something

restive turret
#

Its not me who create async shit!! Its the other party

icy knoll
#

ur being silly now

restive turret
#

Ye ik

#

My async skill basically zero as we established months ago

unique crane
#

Asillysync

restive turret
#

Real and true

spring swan
restive turret
#

2 hours went by just to see how would that thing work

soft depot
restive turret
#

Maybe

#

I did some basic async stuff but that wasnt really much

#

But since this is unity stuff it is hell to understand

static meteor
#

I question visual studio sometimes

restive turret
#

Slopilot

teal junco
shut nebula
#

Where do I install labapi?

static meteor
#

Comes with the Dedicated Server on steam

shut nebula
#

There's no need to install labapi, right? It says it's the default folder.

static meteor
#

Its automaticly installed

shut nebula
#

thank you

halcyon folio
#

Yeah. More efficient to use that over Task

#

depending on your use case

upper vapor
upper vapor
rough tundra
#

way more straight forward

upper vapor
#

society if people stopped using visual fosdio

glad pagoda
restive turret
#

So I can just use async and dont care about the consequences as in other place?

upper vapor
#

After that you should be fine

#

If you wanna mess with unity stuff then go back with MainThreadAsync

icy knoll
#

or, just hear me out

#

Task.Run

#

uses a diff thread

#

woah

#

so wicked

upper vapor
#

But that's not gonna let you interact with unity

#

So you need a queer

#

Queue

#

Eh, either works

hearty shard
upper vapor
#

You are

#

Queerer than I am

hearty shard
#

um

#

nuh uh

icy knoll
upper vapor
languid temple
upper vapor
#

Lmfao

#

IQueerable<T>

glad pagoda
upper vapor
#

Ppl who use .GetAwaiter().GetResult()

median edge
#

is it posible to modify a player camera axis?

upper vapor
#

You can't change the roll though (Z axis)

icy knoll
#

ive come a long way

restive turret
#

Well then suggest me how to interact the best way with websockets and my life is yours

restive turret
#

Huh

#

Super Secret explorer

icy knoll
restive turret
#

What does that even mean

icy knoll
#

basically, just connect your server to that, and have api endpoints instead

#

but the sl server uses sse

icy knoll
#

there will likely be some c# implementation examples somewhere

restive turret
#

no i dont want to run server I want to connect to a websocket

icy knoll
restive turret
#

i connect to already existing server

#

ie: twitch

icy knoll
#

ohhhhh

#

ok

#

you should have said that initially dummy

restive turret
#

or can be my own websocket server

restive turret
#

and lumi disapeeared

icy knoll
#

just, suffering

#

waiting

restive turret
#

for me?

icy knoll
#

nah

restive turret
#

or you waiting for that async task to be done TrollDespair

icy knoll
#

made a feature request

#

for a repo

#

takes them like a couple hours to read it and do it

#

so gotta wait for it to be done before i can progress

#

lol

glad pagoda
#

Websockets are broken in Unity

pallid galleon
#

So many stinky NW staff in this channel ew

#

^Plugin devs being kidnapped to work for NW for eternity

halcyon folio
#

Not good

halcyon folio
spring swan
#

I remember when one of my devs got kidnapped to work for NW

upper vapor
#

you should do this every time you wanna fetch data from a website toomuchtrolling

halcyon folio
#

I did work there before so.. maybe

upper vapor
pallid galleon
lucid yarrow
#

My server is currently under a botnet attack. What solutions are available to protect or mitigate this issue?

upper vapor
lucid yarrow
#

Not DDoS. SYN floods don’t affect me — it’s bots spamming normal protocol connections.

upper vapor
#

um

halcyon folio
restive turret
#

its rabbit season, no its duck season

halcyon folio
upper vapor
#

and btw, he's taken all the tasks already Kek

restive turret
#

those that I think I capable of fixing and doing it ye

halcyon folio
halcyon folio
#

Tough times

upper vapor
#

XDDD

#

W

upper vapor
halcyon folio
#

You caught me, I am a former programmer, not the team lead

#

Solved the case

unique crane
#

Salute for former colleague then

upper vapor
#

invisible emoji on my screen

halcyon folio
#

It’s a salute emoji

upper vapor
#

yeah i clicked it

halcyon folio
#

Beryl told me he wanted me to work on the API stuff but sadly that never happened

upper vapor
#

@berly is this true?

halcyon folio
#

Was like a year back

#

When LabAPI was still in planning or so

#

All roads lead to Rome

burnt hearth
#

Cedric the goat

slate flume
#

Because I have windows and when it sets up user accounts with your Microsoft account that's the default

restive turret
#

idiotic MS ye

warped prairie
#

THANK YOU MICROSFT!

teal junco
#

Oh i dont use ms account

#

bc my microsoft account locks me out of my computer after 1 hour of being on per day

slate flume
#

Why does Server.PlayerCount return Player.Count and not LiteNetLib4MirrorCore.Host.ConnectedPeersCount

slate flume
#

So I can't use it anymore

slate flume
#

@restive turret I love you

slate flume
warped prairie
#

good question

#

maybe an obsolete method idk

slate flume
#

You know what was really epic to learn today

#

AdminFlags are stored as a float

#

I get why it exists that way but it's stupid

soft depot
warped prairie
#

Yo admin flag 3.408245 please

#

🤺

upper vapor
slate flume
#

So what should I do to make sure primitives are optimized

#

Now that I'm like actually using them

upper vapor
#

Make them client side

#

At zer0two

#

On a serious note, make non-moving primitives static

slate flume
slate flume
#

Every primitive I use is static

#

I have no moving primitives as of yet

upper vapor
slate flume
#

It's not my fault NW's only way to add map objects is unoptimized garbage

#

I'm doing the best I can with the tools provided to me

#

I don't gatekeep the things I do or find out, it's why I'm active on this Discord

upper vapor
#

"90% is unknown shit I do"
That's not optimizations, that's probably editor shit (idk why they made it like that)

#

I've seen the basics of the editor's workings, it's weird

slate flume
#

I wouldn't know

#

It was just heavily implied to me that some of the optimizations were "under wraps"

slate flume
#

I just haven't found anyone around here actually talk about what you should do to optimize primitives

#

Are primitive colliders synced with the client? Would it be better for more complex models to disable their colliders?

sinful bronze
#

U can desync primitive flags

upper vapor
#

If you can use a box collider for a complicated mesh, use an invisible primitive for collision

upper vapor
sinful bronze
#

Yeah

#

I made once flags desync to make "collision" for players

#

It was fun but not very stable

slate flume
# upper vapor Yes and yes

Can I disable the collider just by doing primitive.Base._collider.enabled = false; or is there something else I need to do