#why server host disconnect from server

1 messages · Page 1 of 1 (latest)

wary crater
#

what to cause the host and all players disconnect
how to fix it
😭

young ivy
wary crater
misty tide
#

Y'know there is a Server.SendBroadcast?

glass tulip
#

^

wary crater
misty tide
#

Shouldn't

glass tulip
#

yea can u show ur full code

#

where u do that

wary crater
glass tulip
#

It shouldnt make players dicconnect tbh

#

somewhere else broken

wary crater
#

this server host doesnt disconnect every time

#

no pattern

wary crater
#

another error

glass tulip
#

It seems like a NRE error cuz u send broadcast to a null player

#

but i can do nothing without ur code

wary crater
#

this is my code

#

all other code call this

#

maybe the plugin send broadcast to a player who is disconnect or auth🤔

#

i cant think of any other reason😭

#

i cant understand

#

all player disconnect after the log in pic

glass tulip
#

ig it is skill issue so

kind belfry
#

are you using Player.List?

wary crater
#

Server.SendBroadcast(message, duration, Broadcast.BroadcastFlags.Normal, true);

#

im using this

kind belfry
#

Do you have patches or a plugin that possible doing something like that?

#

because you are sending data to the Dedicated Server

wary crater
#

what mean🤔

#

its just send broadcast to all player

kind belfry
#

Do you have a plugin that patches some behavior for that?

wary crater
#

no

misty tide
#

when you call the function check if its a Server.Host then return from it

#

if (ev.Player == Server.Host)
return;

#

or use IsHost

wary crater
#

i tried but its useless

#

Server.SendBroadcast() also make the host disconnect

glass tulip
#

xD

crisp radish
#

there is
referenceHub.Mode

which has mode of host

wary crater
#

what cause the fucking error and make the host and all players disconnect

#

😡

#

why globalbroadcast make the host disconnect

severe sparrow
#

Most likely

wary crater
#

no

#

just authed player

#

players.Add(player) in PlayerJoinedEvent

severe sparrow
#

Yeah skip if it's the host

#

p.IsHost

wary crater
#

🤔like this?

#

ok

severe sparrow
#

Ye

glass tulip
#

^

wary crater
#

😋

#

crash on executing GlobalBroadcast()

#

😋

plush pilot
misty tide
#

it does not crash my game/server so

fallen oriole
wary crater
#

no patch on my server

#

what the ...

severe sparrow
fallen oriole
wary crater
#

so...

#

why this crash the server🤔

severe sparrow
#

do you do any threading stuff

#

async, tasks, threads

wary crater
#

just this

fallen oriole
severe sparrow
#

if you use async void, it can crash the entire process

severe sparrow
# wary crater

please stop using Newtonsoft.Json Heartbreaking
System.Text.Json is included with the game

fallen oriole
glass tulip
severe sparrow
#

Doesn't help

#

You have to make it async Task

glass tulip
#

Run(async
then

glass tulip