Connecting as spectator after game start

Connecting as spectator after game start

Discuss development of lobby clients, server, autohosts and auto-download software.

Moderators: Moderators, Lobby Developers

Post Reply
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Connecting as spectator after game start

Post by MasterBel2 »

I've finally got my lobby client (SpringPort) to be able to join a multiplayer game successfully, however, that is providing that I'm there from the start. If I first try to connect to a game that started without me, I'm not added as a spectator but refused connection. ("user is not authorised to connect" as seen from in-game)

The start script I'm using is as follows

Code: Select all

[GAME]
{
	HostIP=xxx.xxx.xxx.xxx; 
	HostPort=xxx;       
	SourcePort=0;      

	MyPlayerName=somename;
	MyPasswd=secretpassword;
	IsHost=0;          
}
as taken from https://github.com/spring/spring/blob/1 ... Format.txt.

I can connect to a game hosted by SL on another computer on the same network, but my username appears as ~Username. But that also happened when I tried to connect to it with SL. Explanations?
Last edited by MasterBel2 on 16 Jan 2017, 22:15, edited 2 times in total.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: Connecting as spectator after game start

Post by MasterBel2 »

Update: I don't seem to be able to reconnect after I've quit the game, even if I was originally a spectator. Still no ideas.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Connecting as spectator after game start

Post by abma »

~ is prefixed for users who didn't supply a correct password.

the "server" and the clients password must match, so maybe the password are either not set or just missmatch.

https://github.com/spring/spring/blob/d ... .cpp#L2630
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: Connecting as spectator after game start

Post by MasterBel2 »

abma wrote:the "server" and the clients password must match, so maybe the password are either not set or just missmatch.
I think I'm sending the wrong password. But I've tried sending the player's password both raw and encoded, and neither work. What password am I supposed to send?
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Connecting as spectator after game start

Post by abma »

one of the username + password which is specified in the server script.txt.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: Connecting as spectator after game start

Post by MasterBel2 »

Ok, I've made sure that the username + password specified match, and so now I can join as another player. And I can reconnect to a game I left. But I still can't spectate a game that started without me. I get the error "User name not authorised to connect". Yet I know I'm definitely using the password I sent in with the JOINBATTLE command.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Connecting as spectator after game start

Post by abma »

afaik you have to add new players via the autohost udp socket (idk whats the proper name), thats AutohostIP and AutohostPort in the config.
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: Connecting as spectator after game start

Post by MasterBel2 »

I have no idea what I changed (git tells me I didn't change anything) but suddenly it's working. Thanks for the help!

EDIT: Not working anymore. I don't know why. Again, nothing changed. :/

I've investigated the UDP path, but after studying the protocol and how SL connects to a host not using NAT transversal, it doesn't use a UDP connection - it's only Spring itself that initiates that.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: [SOLVED] Connecting as spectator after game start

Post by FLOZi »

How is the game you are trying to join being hosted?
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Re: Connecting as spectator after game start

Post by MasterBel2 »

I'm trying to connect to a SPADS autohost at the moment, which, according to my lobby, does not use a NAT transversal technique.
Post Reply

Return to “Lobby Clients & Server”