#Unity Local Multiplay Server Error
1 messages ยท Page 1 of 1 (latest)
Server build is working when loaded on the Unity dashboard for game server hosting
@unkempt garnet
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
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
I'm trying to start a local server as i was doing with playfab, but if it is not possible or overcomplicated i can just load builds on multiplay and test; Don't worry for the delays, i understand.
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?
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
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
ok got it, now..., looking at when the builds is running on Multiplay server, can you help me understrand why is giving me the "HttpException: (404) HTTP/1.1 404 Not Found" when calling "MultiplayService.Instance.GetPayloadAllocationFromJsonAs" after the build is allocated?
Is this a test allocation?
oh yes... but i can try with the matchmaking
I've seen a forum post that mentioned that as a cause, though i'm not 100% sure if that's the reason
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
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
Yes i know, look at that
Looks fine
i'm using two different game accounts logged by sign in with username and password
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
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)?
I'm using Parralelsync
How is your pool configured
Done in DM
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
thank you guys, much appreciated
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.
how is that possible?
Ticket 1:
what is the difference between the author and the player?
Ticket 2
Oh what are you putting in MatchmakerService.Instance.CreateTicketAsync
we allow for players to include others players than just them to support for party matchmaking
playerId here should come from the Authentication SDK and should be different on the two instances you are using
I'm adding a debug log to convalidate it
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?
Something weird happening here. Is this still with parrelsync or across PCs?
Still Parallelsync
I'm on multi monitor
We're looking into it
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
Or i can simple set another profile if it is a clone, instead of Getting the arguments
In this case that i have a simple 1v1
If you only intend on having 2 players, sure
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