If the server game is started up, I call the the MasterServer.UnregisterHost() to let other clients who don’t join game can’t see the game in list ( PollHostList() ), but the server instance generally always appears on the list of games the client can see.
And when call UnregisterHost() ,I see the master server log appears :
“No table name defined, during query/removal.”
“Failed to remove row for XX.XX.XX.XX:XXX because table lookup failed”
Why?
Unity version 3.0.0f5, Master Server version 2.0.0b1
This is ridiculous, the master server only has 5 functions it can do, and one of its functions does not work. Can a unity network developer please check this bug?
Same problem here. It is really a bad thing, because players can join a game which is already running. It causes a lot of issues and does not make any sense oin my case, as the game is a racing game : joining a race while almost all players are about to reach the finish line is stupid.
You would still need to limit the connections on the hosting server (for the game) because clients can connect at will just by knowing the ip/port. Just hiding them in the master server is not good enough for a production grade game.
I’m running a Master Server of my own and each time a client tries to UnregisterHost(), I’m getting the following error in the Master Server log:
ERROR No table name defined, during query/removal
ERROR Malformed packet from 158.42.12.230:20000, packet size 218.
INFO Failed to remove row for 258.42.12.230:20000, because table lookup failed
MasterServer.UnregisterHost(); does not appear to work.
If you call Network.Disconnect(); before MasterServer.UnregisterHost(); it will seem to work but only on the local machine “the server”. Remote machines will still think the game is up.
I might have found a solution (this will probably only work when using your own MasterServer):
Open the following file: RakNet/Sources/LightweightDatabaseServer.cpp
Add the following at line: 686
inBitstream.IgnoreBits(8);
In total your code should look like this:
void LightweightDatabaseServer::OnRemoveRow(Packet *packet)
{
RakNet::BitStream inBitstream(packet->data, packet->length, false);
inBitstream.IgnoreBits(8);
LightweightDatabaseServer::smile:atabaseTable *databaseTable = DeserializeClientHeader(&inBitstream, packet, 0, true);
// Conditional stuff ... some calls and a bit of logging
}
I’m not yet 100% sure this fixes the MasterServer.UnregisterHost() problem,
but this way, I got rid of the error’s in the logfile
I’m not too sure if I was having the same problem as you guys, but here’s what was happening and here’s what I did:
I would launch a game then do somethings with-in it and whenever the server closed, the client(just a watcher in this case) would disconnect, but when it went to find a game again it could still see the old game. I had tried doing Network.Disconnect() then MasterServer.UnregisterHost() but that still hadn’t worked.
I just tried MasterServer.ClearHostList(); before generating my list and this seems to have fixed the problem. I do still unregister when my server closes as well.
start my game 3 times [1 2 on same PC, 3rd on another one to be able to create 2 servers at the same time]
1st starts server
2nd checks host list and joins server
3rd checks host list and joins server
3rd leaves server
3rd creates server
2nd leaves server and checks host list (2 hosts show up)
2nd rejoins 1st host
1st starts ‘match’ with 2nd and calls “MasterServer.UnregisterHost();”
1st and 2nd can play together
3rd refreshes host list and it shows up empty.
I just hope this little IgnoreBits(8); line doesn’t come with some other unknown bad sideffects.
But for now it seems to work just fine when you have compiled and set up your own MasterServer.
Anyways there should still be an official fix in my opinion.
(Using Unity 4.2.2f1 Master Server 2.0.1f1)
even if his post is quite old and he may never read it:
Thanks supmagc!
and added this (file “RakPeer.cpp”, line 1460, from MasterServer source code)
if(packet->data[0] == ‘M’)
messageHandlerList*->OnClosedConnection(packet->systemAddress, packet->guid, LCR_DISCONNECTION_NOTIFICATION);* PS1: The “MyGame” I pass to the char[ ] in the code is the same string you pass as parameter on MasterServer.RegisterHost(gameTypeName,…) PS2: I HOPE it get fixed (come, this is bugged for OVER 3 YEARS!)… I think it just need a implementation on “Multiplayer.UnregisterHost” to be able to receive a string parameter (gameTypeName).