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 » 07 Jan 2017, 08:27

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.
0 x

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

Re: Connecting as spectator after game start

Post by MasterBel2 » 08 Jan 2017, 13:20

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.
0 x

abma
Spring Developer
Posts: 3483
Joined: 01 Jun 2009, 00:08

Re: Connecting as spectator after game start

Post by abma » 12 Jan 2017, 11:58

~ 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
0 x

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

Re: Connecting as spectator after game start

Post by MasterBel2 » 13 Jan 2017, 02:57

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?
0 x

abma
Spring Developer
Posts: 3483
Joined: 01 Jun 2009, 00:08

Re: Connecting as spectator after game start

Post by abma » 13 Jan 2017, 14:36

one of the username + password which is specified in the server script.txt.
0 x

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

Re: Connecting as spectator after game start

Post by MasterBel2 » 14 Jan 2017, 00:21

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.
0 x

abma
Spring Developer
Posts: 3483
Joined: 01 Jun 2009, 00:08

Re: Connecting as spectator after game start

Post by abma » 14 Jan 2017, 02:44

afaik you have to add new players via the autohost udp socket (idk whats the proper name), thats AutohostIP and AutohostPort in the config.
0 x

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

Re: Connecting as spectator after game start

Post by MasterBel2 » 16 Jan 2017, 02:38

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.
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6052
Joined: 29 Apr 2005, 01:14

Re: [SOLVED] Connecting as spectator after game start

Post by FLOZi » 16 Jan 2017, 18:31

How is the game you are trying to join being hosted?
0 x

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

Re: Connecting as spectator after game start

Post by MasterBel2 » 16 Jan 2017, 22:14

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

Post Reply

Return to “Lobby Clients & Server”