#plugins-dev-chat
1 messages ยท Page 35 of 1
ok i'm just asking if this should be Base o GameObject or something diffrent
thanks man
How does the Custom role type work
bummer
You have to remake sl basically from ground up to be that moddable on server side
sadge
@unique crane when add
In 19.7

This would be dope af
@unique crane where at
You know very well that I cant promise anything..
yes you can!!!
PROMISE IT
-loud buzzer-
Is spawning primitives on a player verboten
verboten
it is not verboten at all
jesus ?!?!!?
hey
hii
I mean if I can't have custom models or colors I'll just fashion it myself 
Yeah saw someone do it
With that furry scp model...
Lmao
But it was like fully animated
I just want some primitives serverside so players can know what flavour custom role it is
Crazy
Yeah that's insane
What I would like to do is to finish labapi for the rest of the base game stuff
Wrappers and such
Fully detailed model
Please make ability const non const ๐ so can edit those and reflect to players
errrr
if you gamble you get to outheal 3 colas and 255% movement boost
errrr
that seems fair!
Mayhem/CT experience
well the downside is
you might explode while doing it
you gotta get lucky
how i can give access or group to ra panel by plugin? If config doesn't have it
Kek
On Mayhem we limit it to 100%
There's a bug that lets you survive a normally deadly effect that gives you 255% though, but it requires luck
We decided to keep it, if you manage it you deserve it hah
mines just modded not even mayhem 
Fair
lucky coins...
its cuz of the change i made
cuz like
the speedster used to be temporary
but now if you get a different one that stacks AND is permanent....
then it overrides....

its funny tho
so i keep it
I program super defensively on Mayhem now
Because if I let a bug go through the community's gonna beg to keep it if it gives an edge
this hurts my head
Make it a command on ct and give me access 
QA does help hah
I'm just used to thinking about all the different edge cases from work
I don't wanna break servers too much
youll be fineee
Nothing could go wrong
How did you go about setting userID? I got the ReferenceHub dummy and tried dummy.authManager.UserId = null; but had no luck
literally that
and also set the instance mode
to like, dedi server iirc
Question do bans do something funky to the player like disconnecting them twice
Just banned a cheater and our dcreplace plugin triggered twice for them
kinda weird
nvm issue on our end
Interesting
I did uh
And it still showed in player list
It does
Oh
But you have to make your own init code
You can't use DummyUtils.Spawn
oh
and you need a patch
sorry forgot about that one
but the patch to work will require you make your own dummy spawning method
Basically you need to block PlayerAuthenticationManager.InstanceMode's setter
And refuse any value other than DedicatedServer for your "custom" dummies
@slate flume
Oh okie
Okie dokie ๐ซก
I have an idea I want to implement but I want to know if it's stupid or not
My plan is: spawn a bunch of invisible dummies to pass voice messages through to make it so SCP prox chat works through the actual proximity chat channel
So I did this to the dummies
Will this still actually have the voice module follow the original player?
You can just use speaker toy
I tried but speaker toy is quiet and makes it sound like the audio is going through like a radio
At least when I tried it
ah
to make the dummy invis btw
Id recommend setting their size as like
0
player.GameObject.transform.localScale or smth
I wish
FYI they'll appear in the spectator list anyway
not in the player list sure, but you'll need more work to make them disappear for spectators
UGH
if you wanna show your support 
would be sweet because the code you'll have to write for that is a little finnicky
Sick
Is there a template for commands, LabApi btw
There's a Drone in this channel, and I can sense it...
Anyways, I'm going to make a coin flip plugin.
I set localScale but they still somehow were killed
Maybe I just make invulnerable and hope for the best?
Just make an event handler that denies any event against your dummies
Okay so here's where I'm at
I need your expertise
This still creates a player on the player list but they're (null)
Did you make the patch
with the mapeditorreborn plugin how do i make it auto load a specific map : #1339593773788958852
Realized I never @ ed you @grand flower
If you're able to take a look at this sometime tomorrow or something and tell me what I did wrong I'd be forever in your debt O Wise One
Make sure to give them a nickname
Also
You still didnt set the instance mode
@slate flume
I've been trying variations of both things you mentioned but I can't crack it
Do you mean FNaF
Did you write the patch
There's an alternative to VerifiedPlayer?
because OnJoined is Before Authentication
OnJoined happens on authentication
are player connections marked as reconnected in some way between round restarts? I'd like to know if a certain player or connection is from a previous round. I know I can keep track of them manually, but I'd like if there's a cleaner way built into labapi or the game itself
i dont think anything like that is built into the game itself let alone the lab api
No, you have to track this yourself
I see, thank you both
it is, its called at the end of PlayerAuthenticationManager.ProcessAuthenticationResponse
Are you sending fake auth packets to the server 

You know your idea's gonna be good when you start using Desmos to balance things
like health over player count
IStaminaModifier really funny in base game
@hearty shard thanks!
Huh

the i stamina thing theres a property in there you should not use
I think its SprintingDisabled
Or smth idk the name of it
This is the solution for that issue
Im sending cat pictures to the server
so you are wrong
You need to auth the cat properly though
OH MY GOD CAN YOU STOP
AHAHAH
:3
and, has base game any other interfaces that can make custom effects like IStaminaModifier?
damage modifier
Check the namespace
There are multiple modifiers
Like item usage speed modifier etc
they seem to be in a lot of different namespace
Yeah
You could also look at the effect types
Since they are mostly in one namespace
And see what they implement
yep, that would make the client bounce back
Yea
disabling stamina on server = client still has stamina lol
SecretEngine when
Can you send unicode glyphs to players with the hint system
How to enable sounds via SpeakerToy for only one player and not for all?
SpeakerToy speakerToy = SpeakerToy.Create(referenceHub.transform, true);
speakerToy.Play(soundSample, false);
you can set the ValidPlayers filter to only accept the player
hiii riptide
hi
Can I have an example?
toy.ValidPlayers = x => x.Base == hub
Thx
How to make sure that each player has their own SpeakerToy?
internal static IEnumerator<float> SearchScp(ReferenceHub referenceHub)
{
SpeakerToy speakerToy = SpeakerToy.Create(referenceHub.transform, true);
speakerToy.ValidPlayers = x => x.ReferenceHub == referenceHub;
For some reason, all SpeakerToys listen to only one ValidPlayers, which is why only one player out of all of them hears the sounds
have a look at controllerId, each controlerId is on its own "channel"
Why is the controller id a byte? If I have more speaker toys on my server than 256?
nothing is stopping you from having more than 256 speakers? thats just the channel limit
In this case, two or more SpeakerToys will play the same thing
yes

What are you doing that requires playing 256 different sounds at once
His goals are beyond our understanding
I brought back horror sounds and for this each player must have their own SpeakerToy
you can use a single speaker toy for that if your clever about it
Reuse speakers
Get one that isn't currently playing
If there's no such speaker, create a new one
what if i do?
Then your server dies instantly
nah id win
Okay fine Ill give you 50โฌ if do server with 256 real players and play a whole round
oh...
hold on lemme get 256 friends on my 9950x server
You have 256 friends?
๐
clients become to crash
100 its over in scp sl for avg pc
or make validating ev.isAllowed= false;
yeah for sure buddy
who have more?
hold on lemme get 256 friends on my 9950x server
i need a little help i'm making SCP-372 plugin and i need to set his Player info to normal after death from
SCP372player.CustomInfo = "SCP-372";
SCP372player.ReferenceHub.nicknameSync.Network_playerInfoToShow &= ~PlayerInfoArea.Role;
how can i do that?
Register to on dying and set the CustomInfo to an empty string?
i mean to normal string like name role and unit u know what i mean
Oh, set the InfoArea to ~0 (all)
nv i figured it out
That is default value
still thx for help
Alright cool
hi david!!
Haiiii
fix my code
Pay me
no!
No fix then
anyway i think i finally understand the issue
#rueistinks
hm
david
why does COM-15 here not have ammo
but A7 does
nvm it works now
๐
ok so it works if i dont need to role swap

if the SetRole is called then it doesnt work

@unique crane wtf do roles do that affect whether a weapon given has ammo
With ItemAddReason.StartingItem?
yea
Might be
it works when i give it without changing their player role before it
let me see
but only the com15 here is breaking not the A7
It is actually
MagazineModule & CylinderAmmoModule
heh?
Yeah it like insta loads ammo from inventory to the magazine
I did
Oh
so i should give ammo
Yes
Remember to give it what you want + 1 mag
As it autofills it and removes it from the inventory
@grand flower this is the patch I wrote
Setting the instance mode and giving them a nickname did nothing
Well giving them a nickname made that nickname show up in the player list
But it made no significant change from before
They still show up
All the patch did was remove the Dummy player tag
Why is it so hard to just remove a Dummy from the player list 
I even tried doing the patch this way based off of this idea instead of always makes sure it was DedicatedServer
Didn't work 
the synced user id must be null
then you can set _privUserId back to "ID_Dummy"
-# in the authManager of the reference hub
Yes?
Spawn it and then set the synced stuff
Gotcha
oh what i said was for RA
How can I spawn a door where the buttons will display what permission is need to open it?
not possible
what if you don't spawn the dummy 
I need the dummy cause I'm using him as a proxy for audio 
right
Why do I always end up breaking shit lmao
doesn't seem to work
Uuuh let me check the condition for it to be added
i mean
do you need it to have a nickname?
no
@slate flume just don't give it a nick
The mode should do it?
Sure, I only did it cause Cyn told me to haha
if that doesn't work, try this #plugins-dev-chat message
does audioplayerapi handle speaker controllerIds well?
I already have a patch setting instancemode to dedicatedserver
Can you show me your code?
Of course!
wdym
I aint patching expert but shouldnt you return false?
so it doesnt call the normal code
After
Since its prefix
Uhm
I'll change it rq
See if that does it
I had it like that earlier but it wasn't working but maybe that with the other changes will do it
Well I have a helper class that uses audioplayerapi but it seemed to cause issues with scp proximity chat (i think the controller ids conflicted). since audioplayerapi isnt framework specific i thought itd be okay to ask here. Its annoying because I dont have any direct control over it.
@upper vapor
What you think
you'd need the method to execute for the field to be set
they're just changing the input value
i'm not sure if the condition passes though
idk how Killers' player works ๐ญ
lemme look rq

maybe if you use pooled audio players it'll work
So I can use the pool to minimize issues with disposable sounds?
thats actually fire
yea
It should just work
i also just realized i dont know if i dispose the speakers correctly either...

cuz your dummies have no user id
right
Maybe if I set that to null it'll fix ๐คท
what if you set the instance mode to unverified
Uhhh sure let's try it
iirc those show too
reminds me
i gotta test my npc
ive forgotten to do it for the past 2 weeks
๐
Fuck this looks a right pain in the ass
thanks tho
@slate flume alr i can give u working code
YES PLEASE
NOOO
PLEASE
how about they make controller Id a 9 bit int instead
nuh uh
public static Npc Spawn(string nickname, RoleTypeId role)
{
GameObject gameObject = Object.Instantiate(NetworkManager.singleton.playerPrefab);
if (!gameObject.TryGetComponent(out ReferenceHub refHub))
throw new NullReferenceException("[Npc.Spawn] Could not find ReferenceHub");
// TODO: Remove npc from Player List (N)
try
{
refHub.authManager.UserId = null;
refHub.authManager.InstanceMode = ClientInstanceMode.Host;
refHub.nicknameSync.MyNick = nickname;
}
catch (Exception exception)
{
LabApi.Features.Console.Logger.Warn($"[Npc.Spawn] Failed to properly spawn:\n{exception}");
}
Timing.CallDelayed(0.1f, () =>
{
refHub.roleManager.ServerSetRole(role, RoleChangeReason.RemoteAdmin);
});
NetworkServer.AddPlayerForConnection(new DummyNetworkConnection(), gameObject);
return new Npc(refHub);
}
ignore the todo
host
i forgot to remove that
omg
oh and
128 bit int then? :3
nickname doesnt work
Pet = Npc.Spawn($"{Owner.DisplayName ?? Owner.Nickname}'s Pet", Owner.Role);
will always show (null)
๐
not an issue for them cuy it'll be invis
well crap
With this code should I still keep my patch for the InstanceMode setter?
Okay sick
until it doesnt work but sh
Uh oh
heh?
When I set instance mode before connection it fucks me over
mines an error at
[2025-06-02 17:30:54.093 +02:00] [WARN] [EveLabs] [Npc.Spawn] Failed to properly spawn:
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00008] in <069d7b80a3914a08b6825aa362b07f5e>:0
at System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <069d7b80a3914a08b6825aa362b07f5e>:0
at PlayerRoles.Voice.VoiceChatReceivePrefs.GetFlagsForUser (ReferenceHub hub) [0x0000b] in <8db1ca0fe9a6484084cda320b139932c>:0
at PlayerRoles.Voice.VoiceModuleBase.SpawnObject () [0x0003f] in <8db1ca0fe9a6484084cda320b139932c>:0
at PlayerRoles.Voice.StandardVoiceModule.SpawnObject () [0x00000] in <8db1ca0fe9a6484084cda320b139932c>:0
at GameObjectPools.PoolObject.SetupPoolObject () [0x00012] in <50e7962387d5429a9799f24df7973b76>:0
at PlayerRoles.PlayerRoleManager.InitializeNewRole (PlayerRoles.RoleTypeId targetId, PlayerRoles.RoleChangeReason reason, PlayerRoles.RoleSpawnFlags spawnFlags, Mirror.NetworkReader data) [0x0006e] in <8db1ca0fe9a6484084cda320b139932c>:0
at PlayerRoles.PlayerRoleManager.get_CurrentRole () [0x00008] in <8db1ca0fe9a6484084cda320b139932c>:0
at PlayerRoles.PlayerRolesUtils.GetTeam (ReferenceHub hub) [0x00000] in
0.1s delay?
lol
lmfao
namespace CedMod.Patches
{
[HarmonyPatch(typeof(PlayerAuthenticationManager), "InstanceMode", MethodType.Setter)]
public static class NpcInstanceModePatch
{
public static bool Prefix(PlayerAuthenticationManager __instance, ClientInstanceMode value)
{
if (AudioCommand.FakeConnectionsIds.ContainsValue(__instance._hub))
{
if (value != ClientInstanceMode.Unverified && value != ClientInstanceMode.Host && value != ClientInstanceMode.DedicatedServer)
return false;
}
return true;
}
}
}
at PlayerRoles.RoleAssign.RoleAssigner.CheckLateJoin (ReferenceHub hub, CentralAuth.ClientInstanceMode cim) [0x00007] in <8db1ca0fe9a6484084cda320b139932c>:0
at (wrapper delegate-invoke) System.Action`2[ReferenceHub,CentralAuth.ClientInstanceMode].invoke_void_T1_T2(ReferenceHub,CentralAuth.ClientInstanceMode)
at (wrapper dynamic-method) CentralAuth.PlayerAuthenticationManager.CentralAuth.PlayerAuthenticationManager.set_InstanceMode_Patch1(CentralAuth.PlayerAuthenticationManager,CentralAuth.ClientInstanceMode)
huh
What the hell is going on
it's always cedmod
Maybe I need to blank slate it
ok it happens regardless of cedmo
Start from a fresh plugin, no dependencies
and my local server shows the npc...
But I would prefer to avoid that
oh
at PlayerRoles.PlayerRoleManager.InitializeNewRole (PlayerRoles.RoleTypeId targetId, PlayerRoles.RoleChangeReason reason, PlayerRoles.RoleSpawnFlags spawnFlags, Mirror.NetworkReader data) [0x0006e] in <2343be033e9f4e37923f780ece756d8e>:0
it calls that
early
hmm
wait what
hmm
System.NullReferenceException: Object reference not set to an instance of an object
at NicknameSync.SetNick (System.String nick) [0x00079] in <2343be033e9f4e37923f780ece756d8e>:0
wtf is null in there
@unique crane can u help :3
this specifically
possibly connectionToClient is null here
index 00079 in IL
GameObject gameObject = Object.Instantiate(NetworkManager.singleton.playerPrefab);
if (!gameObject.TryGetComponent(out ReferenceHub refHub))
throw new NullReferenceException("[Npc.Spawn] Could not find ReferenceHub");
NetworkServer.AddPlayerForConnection(new DummyNetworkConnection(), gameObject);
try
{
refHub.nicknameSync.MyNick = nickname;
refHub.authManager.UserId = null;
refHub.authManager.InstanceMode = ClientInstanceMode.Host;
}
catch (Exception exception)
{
LabApi.Features.Console.Logger.Warn($"[Npc.Spawn] Failed to properly spawn:\n{exception}");
}
Timing.CallDelayed(0.1f, () =>
{
refHub.roleManager.ServerSetRole(role, RoleChangeReason.RemoteAdmin);
if (position.HasValue)
refHub.TryOverridePosition(position.Value);
});
this works now
no error
but it does show in tab
Motherfucker
Why does setting instancemode before network connection cause everything to break
And why is it the only way rn to get someone to disappear from the player list
I patched it and it still breaks
idk the solution here
@harsh thorn sry for ping
whats the solution to hiding player from N
It's inactive right now but when I implement this patch I get no more errors
or npc ig
But it still kicks me from the game when the dummy is spawned
instancemode dedicatedserver
oh
well setting the userid also sets the instancemode
guh
but if its set to null it might also work
^
ill try with patch
Youuuu might need to destroy the player on client and respawn him again
Looking by the code
(base game one)
works for cedmod apparently

without it idk
but i can try it?
NetworkServer.Respawn(refHub.networkIdentity);
would that do the job
nope
So uh no progress?

Player list is dependant on the InstanceMode
lets see..
doesnt seem to for me
Try setting the basic UserId to null
maybe
My full code is a little cursed
Nope
i do that too but after 0.5s
i do it for my size code
AHA
SHOW ME WHAT YOU GOT
RaPlayerList::ReceiveData(CommandSender sender, string data)
Oh
Just patch it so it doesnt append the if the mode is Dummy
Well it only updates when you change the sorting?
OHHH
This is exactly what was happening to me earlier
david why did u break it ๐
^?
i did
It's interesting cause the thing that does it for me is NetworkServer.Respawn();
Without it I get no fix
But the issue there is on the client
Oh I use no patch
It spawns on client
No patches
yeah but
Do no prevent setting
foreach (Player target in Player.GetAll(PlayerSearchFlags.AuthenticatedPlayers))
NetworkServer.SendSpawnMessage(player.ReferenceHub.networkIdentity, target.Connection);
Trust
On client is just registers to on mode change
Adds it on the first mode change
And then ignores any mode changes
It might change to ReadyClient on the client for a sec
before you receive the Dummy or Dedicated mode
I removed my patches and did NetworkServer.Respawn() and it works
WHAT
Where does actionname enum is being used?

ActionName is client side
no patch = dummy
how do I use it
you dont
like can you give me an example
its client sided
oh
Maybe it's the order I do it in?
use SSSS keybinds
^
no difference
There's this really cool thing called SecretAPI
FUCK
How tf
What happens if I wrap mine in a try-except
Also, how do I refresh the RaPlayerList?
Remove the try-except block teehee
That's the problem
On god
On everything
Its command basically
Doesn't work
console writeline
Does
throw;
Uhhh okay
Fucking
Uh
What if I just spawn a dummy and then immediately destroy it to sync the RA list lmao
Wouldnt be easier to just patch that out
to not send it when the mode is dummy or something?
Since you dont want that
(?)
What if I have other dummies I want to handle in RA
Fax
Lemme try this first lmao
If it works consider me a fuckin genius
No harmony required
trolled
what the freak
oh hey...

[2025-06-02 18:55:18.029 +02:00] [INFO] [EveLabs] 2
[2025-06-02 18:55:18.045 +02:00] [INFO] [EveLabs] Unverified
[2025-06-02 18:55:18.061 +02:00] [INFO] [EveLabs] 2
[2025-06-02 18:55:18.076 +02:00] [INFO] [EveLabs] Unverified
[2025-06-02 18:55:18.091 +02:00] [INFO] [EveLabs] 2
[2025-06-02 18:55:18.106 +02:00] [INFO] [EveLabs] DedicatedServer
[2025-06-02 18:55:18.122 +02:00] [INFO] [EveLabs] Prevented setting to Dummy
[2025-06-02 18:55:18.138 +02:00] [INFO] [EveLabs] Prevented setting to ReadyClient
oh
its setting it to Unverified
do you think thats the issue
Might be
it ws in fact not
[2025-06-02 18:56:47.015 +02:00] [INFO] [EveLabs] Prevented setting to Unverified
[2025-06-02 18:56:47.031 +02:00] [INFO] [EveLabs] Prevented setting to Unverified
[2025-06-02 18:56:47.062 +02:00] [INFO] [EveLabs] DedicatedServer
[2025-06-02 18:56:47.079 +02:00] [INFO] [EveLabs] Prevented setting to Dummy
[2025-06-02 18:56:47.095 +02:00] [INFO] [EveLabs] Prevented setting to ReadyClient
so it only sets to dedicated
and yet
thats an issue
So my fix didn't actually work?
Yes I told you
First time it changes the mode it gets added
and then ignores any other change
but the first time is dedicated

eve moment
client HAS to be recieving smth different
yes
but then its a client sided thing
ill try smth
Perhaps
nope
you can only change type
????
real player -> dedicated
logic what r u on about
Dawg
@unique crane can you see where in client it might be receiving it
or
setting it client
Why the fuck is it so complicated to remove a dummy from the player list
cuz clearly its not server controlled entirely
also, should probably mention
cant remove a player from the list after its already been added (other than despawning)
So cedric
nw moment
We set instancemode before we send NetworkConnection and it breaks everything but works
OH
We set instancemode after and it no work
What do you set the UserId too?
Null
So how do we network the player and change how they register
i also reject it if its not host or dedicated server
the dummy spawn flow is like this
spawn prefab
networkaddconnection
set userid to "ID_Dedicated"
should be it
but i havent touched manually spawning dummies for a while
its ID_Dedicated
not ID_DEDICATED
i mean i copied before from the thing
And if its not one of the predefined ones, it sets it to ReadyClient
yea but i tried that
so what might have happened is

Unverified -> ReadyClient -> Dedicated
Doesn't work ๐คท
you dont use delay on role set anymore?
this is old
damn
apparently so
it could be that the server tries changing it to readyclient because some weird shenanigan
i do have a harmonypatch that prevents InstanceMode from gotten for a dummy as ReadyClient
that errored for me
^
try catch it
It fucked everything up
i also have the patch
Not the actual line
It broke everything else
.IsPlayer breaks
Other code stops function
When I do it that way it causes so much shit that it kicks me from the server
thats when
NetworkServer.AddPlayerForConnection(new DummyNetworkConnection(), gameObject); is called after the user id sets
if that isnt working idk, what i posted worked for me back in 14.0, i havent messed with dummies that need to be hidden since
(note the empty catch)
whhhhhhhhhhhhhyyyyyyyyyyyyyyyy ๐ญ
@unique crane ok so i think NetworkServer.AddPlayerForConnection(new DummyNetworkConnection(), gameObject); when client receives this it sets the instance mode
or SOMETHING
and it has to be before the serveer sets instance mode or errors happen

so im not sure how ur meant to go by that
Why can't this be easy and nice
I did this and I get no errors in the console, but it still kicks me from the server
what are you guys trying to do
Hide a dummy from the player list
legit just hide npc from player list
^
GameObject gameObject = Object.Instantiate(NetworkManager.singleton.playerPrefab);
if (!gameObject.TryGetComponent(out ReferenceHub refHub))
throw new InvalidOperationException("[Npc.Spawn] Could not find ReferenceHub");
NetworkServer.AddPlayerForConnection(new DummyNetworkConnection(), gameObject);
try
{
refHub.authManager.UserId = PlayerAuthenticationManager.DedicatedId;
refHub.authManager.SyncedUserId = PlayerAuthenticationManager.DedicatedId;
refHub.authManager.InstanceMode = ClientInstanceMode.DedicatedServer;
}
catch
{
// ignore
}
refHub.nicknameSync.MyNick = nickname;
NetworkServer.AddPlayerForConnection is probably the issue
cuz it has to be there before we do stuff
but im pretty sure client receives it with instance mode that server didnt set to 
yea
can you just make it so server can set instance mode and sync without it doing this on client ๐
this doesnt work either
try sending a fake syncvar changing the PlayerAuthenticationManager.SyncedUserId only in the player
client only takes the instance mode the first time its changed
apparently
so it wouldnt do anything would it
let me see
this should work, also I would set it to empty so it uses ClientInstanceMode.Unverified as DedicatedServer may break smt
and unverified works fine?
i mean ced says dedicated works fine
wait what
how would this be different from just setting it
actually unverified will break some other stuff
well that also changes it on the server
what's the issue with that
crashes or doesnt work
public static ReferenceHub SpawnDummy(string nickname = "Dummy")
{
GameObject dummy = Object.Instantiate(NetworkManager.singleton.playerPrefab);
if (!dummy.TryGetComponent(out ReferenceHub hub))
return null;
// We set the nickname before adding the dummy to the network.
hub.nicknameSync.MyNick = nickname;
// Then we can spawn the dummy with a DummyNetworkConnection which will mark it as a dummy internally.
NetworkServer.AddPlayerForConnection(new DummyNetworkConnection(), dummy);
return hub;
}
try changing DummyNetworkConnection to a LocalConnectionToClient
and use that to spawn the dummy
this will automatically set the id to ID_Dedicated
so you can also skip manually setting that
something aint working cuz now theres no npc at all
oh
Player (unknown) (localhost) failed to authenticate: authentication timeout exceeded.
Doing this kicked me from the server lmao
err
no crash here
right it will request auth
Well yeah probably because you don't do this:
[2025-06-02 19:41:28.309 +02:00] [STDOUT] NullReferenceException: Object reference not set to an instance of an object
[2025-06-02 19:41:28.310 +02:00] [STDOUT] at Mirror.LocalConnectionToClient.Send (System.ArraySegment`1[T] segment, System.Int32 channelId) [0x00021] in <d73d070e2abb49cd982556c9f692e950>:0
[2025-06-02 19:41:28.310 +02:00] [STDOUT] at Utils.Networking.NetworkUtils.SendToHubsConditionally[T] (T msg, System.Func`2[T,TResult] predicate, System.Int32 channelId) [0x00055] in <2343be033e9f4e37923f780ece756d8e>:0
[2025-06-02 19:41:28.311 +02:00] [STDOUT] at PlayerStatsSystem.SyncedStatBase.Update () [0x0003b] in <2343be033e9f4e37923f780ece756d8e>:0
[2025-06-02 19:41:28.311 +02:00] [STDOUT] at PlayerStatsSystem.PlayerStats.Update () [0x0000b] in <2343be033e9f4e37923f780ece756d8e>:0
oh....
Why it do
lets see, we can try doing a
/// <summary>
/// A dummy network connection that does nothing.
/// </summary>
public class TempDummyNetworkConnection : NetworkConnectionToClient
{
private const string DummyAddress = "127.0.0.1";
private static int _idGenerator = ushort.MaxValue;
/// <summary>
/// Creates a new instance of the <see cref="DummyNetworkConnection"/> class.
/// </summary>
public DummyNetworkConnection()
: base(_idGenerator--)
{
}
/// <inheritdoc />
public override string address { get; } = DummyAddress;
/// <inheritdoc />
public override void Send(ArraySegment<byte> segment, int channelId = Channels.Reliable) { }
/// <inheritdoc />
protected override void SendToTransport(ArraySegment<byte> segment, int channelId = Channels.Reliable) { }
}
try using that connection
but now you have to manually set the id do dedicated
rename it to the proper one
๐๐ผ
ohhhh
WHAT THE FUCK
okay
@limber silo it works
Holy fucking shit
cool
No fucking way
so yeah
I'm gonna test this rn
its cuz the other was a dummy connection
so it set it to dummy type
and then told players "hey this is dummy"
I WANT THE NAME OF THE PERSON WHO WROTE THIS
๐ญ
Why would you check the connection broooooo
Can I see le code 
it is smart and reliable
public static Npc Spawn(string nickname, RoleTypeId role, Vector3? position = null)
{
GameObject gameObject = Object.Instantiate(NetworkManager.singleton.playerPrefab);
if (!gameObject.TryGetComponent(out ReferenceHub refHub))
throw new InvalidOperationException("[Npc.Spawn] Could not find ReferenceHub");
try
{
refHub.authManager.UserId = PlayerAuthenticationManager.DedicatedId;
refHub.authManager.SyncedUserId = PlayerAuthenticationManager.DedicatedId;
refHub.authManager.InstanceMode = ClientInstanceMode.DedicatedServer;
}
catch
{
// ignore
}
NetworkServer.AddPlayerForConnection(new NpcNetworkConnection(), gameObject);
refHub.nicknameSync.MyNick = nickname;
Timing.CallDelayed(0.1f, () =>
{
refHub.roleManager.ServerSetRole(role, RoleChangeReason.RemoteAdmin);
if (position.HasValue)
refHub.TryOverridePosition(position.Value);
});
return new Npc(refHub);
}
They didn't check the connection last update
namespace EveLabs.Npcs
{
using System;
using Mirror;
/// <summary>
/// A dummy network connection that does nothing.
/// </summary>
public class NpcNetworkConnection : NetworkConnectionToClient
{
private const string DummyAddress = "127.0.0.1";
private static int _idGenerator = ushort.MaxValue;
/// <summary>
/// Initializes a new instance of the <see cref="NpcNetworkConnection"/> class.
/// </summary>
public NpcNetworkConnection()
: base(_idGenerator--)
{
}
/// <inheritdoc />
public override string address { get; } = DummyAddress;
/// <inheritdoc />
public override void Send(ArraySegment<byte> segment, int channelId = Channels.Reliable)
{
}
/// <inheritdoc />
public override void SendToTransport(ArraySegment<byte> segment, int channelId = Channels.Reliable)
{
}
}
}
but the auth system has some really old codebase part indeed
they did since dummies were added to the basegame
this is why I was saying the fake syncvar would be better
otherwise the server wont think it is a dummy
Cedric's code used DummyNetworkConnection and that worked in 14.0
and wont show it on RA

Me when
by the way
I think I see the issue
NetworkSyncedId
so it syncs to the client
remove the files
ReferenceHub dummy = SpawnDummy(....
dummy.authManager.NetworkSyncedUserId = PlayerAuthenticationManager.DedicatedId;
dummy.authManager.SyncedUserId = PlayerAuthenticationManager.DummyId;
that should e why it wasnt working for both of you before
try that instead
that should keep the dummy in RA but hide it from the list
@hearty shard try that instead
funny not using the Network variable moment
when mirror compiles SyncVars they generate a property called Network__fieldName__ which is the one used to sync them
add delay
Delay between spawn and setting userID?
ReferenceHub dummy = SpawnDummy(....
Timing.CallDelayed(1, () => {
dummy.authManager.NetworkSyncedUserId = PlayerAuthenticationManager.DedicatedId;
dummy.authManager.SyncedUserId = PlayerAuthenticationManager.DummyId;
}
Didn't work
it wont hide when its already set as a dummy once



