#Unity Local Multiplay Server Error

1 messages ยท Page 1 of 1 (latest)

outer flume
#

Hi, i'm trying to start a local build as multiplay server but i get this error

#

by local build i mean a server build on my pc

outer flume
#

Server build is working when loaded on the Unity dashboard for game server hosting

outer flume
#

@unkempt garnet

outer flume
#

I managed to write the correct json:

{
"allocatedUUID": "434af841-586d-4403-939b-db19f77611a6",
"serverID": "12345",
"queryType": "sqp",
"queryPort": "9010",
"ip": "127.0.0.1",
"port": "9000",
"serverLogDir": "12345/logs/"
}

but i get the error:

07/02/2024 16:18:16|Fatal|ThreadPoolWorkQueue.Dispatch|Connection refused
[Wire]: Websocket closed with code: WebsocketAbnormal
UnityEngine.Logger:Log(String, Object)
Unity.Services.Wire.Internal.Logger:Log(Object)
Unity.Services.Wire.Internal.<OnWebsocketClose>d__32:MoveNext()
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(TStateMachine&)
Unity.Services.Wire.Internal.<>c__DisplayClass28_2:<InitWebsocket>b__6()
System.Threading.Tasks.Task:Execute()
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.Tasks.Task:ExecuteWithThreadLocal(Task&)
System.Threading.Tasks.Task:ExecuteEntry(Boolean)
UnityEngine.WorkRequest:Invoke()
UnityEngine.UnitySynchronizationContext:Exec()

Can be the that i'm using the ApiCreateServerClient and it doesn't like it?

#

BTW the correct Json that i'm using is different from your Json in the docs, so i think your doc is wrong

unkempt garnet
#

The error seems to come from wire which should be unrelated to the Api package's functionality.

I'm not sure what you are trying to do exactly locally though. You can't mimic a multiplay server locally

#

Sorry for the delays, it's a crazy day

outer flume
unkempt garnet
#

For a local server, I think the only option right now is to connect your clients to it directly with ip/port. The local server won't be able to mimic all functionality of a multiplay server but some of it should be possible.

Do you have a bit more details on exactly what your server is trying to do?

outer flume
#

That's exactly what i'm trying to do, but if the server doesn't start properly...๐Ÿ˜„, here it is my server logic

#

At the moment my priority is to make it works on the unity multiplay service, and it works, but as you can see i have some issues in local.
There is one thing that make my builds don't work on multiplay service, when after the allocation is made i call MultiplayService.Instance.GetPayloadAllocationFromJsonAs, at this point the serivce gives me this error HttpException: (404) HTTP/1.1 404 Not Found

#

To be clear, it works on multiplay service when i omit the GetPayloadAllocationFromJsonAs

unkempt garnet
#

The MultiplayService is really only made to work when running on a Multiplay server. I'm not sure it's possible to make it work locally.

You could consider having a conditional macro for that part of the code for when you are on multiplay or local, or try catch it knowing it will fail on local.

I'm not sure if there's any part of that functionality that you do need to do for your local one.
It's a workflow we want to improve so i'm curious to learn a bit more

outer flume
unkempt garnet
#

Is this a test allocation?

outer flume
#

oh yes... but i can try with the matchmaking

unkempt garnet
#

I've seen a forum post that mentioned that as a cause, though i'm not 100% sure if that's the reason

outer flume
#

i'm trying with the matchmaking right now

#

The matchmaker is not matching my two build instances with different accounts (NOT ANONYMOUS SIGN IN), is caused by the fact that i'm on the same PC?

#

because with a ticket with one player needed it was working

unkempt garnet
#

On the same pc, you need to use authentication profiles to have different players

#

oh wait

#

it should work if you have different accounts

#

Your ticket shoudl have 2 players or more

outer flume
unkempt garnet
#

Looks fine

outer flume
#

if i use the ticket setted with the maximum player to one, it works

#

only with one player obviously

#

i'm trying to copy the project on another PC

unkempt garnet
#

I do matchmaking on the same pc all the time, it should not be an issue. You can always verify the player ids, project ids and ensure everything is right

Are you using multiplayer play mode (or parrelsync)?

outer flume
#

I'm using Parralelsync

unkempt garnet
#

How is your pool configured

outer flume
#

I can see my tickets here

unkempt garnet
#

Can you let us know your project id?

#

maybe in DM

outer flume
sleek cobalt
#

Hi there, I work on the matchmaker here at Unity, this looks pretty straightforward and I don't see anything wrong with the configuration of the matchmaker. I'll take a look quickly on our side see if I can see anything wrong with the ticket we are receiving

outer flume
#

thank you guys, much appreciated

sleek cobalt
#

so from our point of view, it seems like the tickets are sent with the same playerid in the ticket, but the author are differents.

sleek cobalt
#

Ticket 1:

outer flume
#

what is the difference between the author and the player?

sleek cobalt
#

Ticket 2

unkempt garnet
#

Oh what are you putting in MatchmakerService.Instance.CreateTicketAsync

sleek cobalt
#

we allow for players to include others players than just them to support for party matchmaking

sleek cobalt
#

playerId here should come from the Authentication SDK and should be different on the two instances you are using

outer flume
#

Ok this player ID is indeed identical from the two instancies, but the accounts that sign in is different, is the playerID something not related to which player has logged in?

unkempt garnet
#

Something weird happening here. Is this still with parrelsync or across PCs?

outer flume
#

I'm on multi monitor

sleek cobalt
#

We're looking into it

unkempt garnet
#

Okay I was under the impression that profiles were only required when using Anonymous sign in but it seems required for any type of authentication when running on the same machine.

#

So you'll need to either use SetProfile in your InitializationOptions or AuthenticationService.Instance.SwitchProfile before signing in.

#

With parrelsync, you can put an argument to detect that easily

#

and set a profile for that instance of the editor

#

The player id uses the same playerprefs caching system which is shared by default on the same computer

#

Something like

#if UNITY_EDITOR
if (ParrelSync.ClonesManager.IsClone())
{
profile = ParrelSync.ClonesManager.GetArgument();
}
#endif

outer flume
#

In this case that i have a simple 1v1

unkempt garnet
#

If you only intend on having 2 players, sure

outer flume
#

TOP! everything is working now, even the "HttpException: (404) HTTP/1.1 404 Not Found" is gone now

#

i think i learn a lot of important lesson of the possible errors when testing these services

#

They can be a little tricky to understand at the beginning

#

I also think that in some way there should be a documentation about these things

#

They are indeed very specific cases but most of the time this is the pipeline for developing a multiplayer game, soo i would consider doing something for these cases in term of docs