Commit 012c695a authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Return an uncollated error when sending data to an invalid match ID.

parent a2636cca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Lua runtime tournament reset hooks now contain duration, end active, and end time fields.
- Separate configuration for maximum number of concurrent join requests to authoritative matches.
- New runtime function to kick users from a group.
- Clients sending data to an invalid match ID will now receive an uncollated error.

### Changed
- Rejoining a match the user is already part of will now return the match label.
+8 −0
Original line number Diff line number Diff line
@@ -294,10 +294,18 @@ func (p *Pipeline) matchDataSend(logger *zap.Logger, session Session, envelope *
	// Validate the match ID.
	matchIDComponents := strings.SplitN(incoming.MatchId, ".", 2)
	if len(matchIDComponents) != 2 {
		session.Send(false, 0, &rtapi.Envelope{Message: &rtapi.Envelope_Error{Error: &rtapi.Error{
			Code:    int32(rtapi.Error_BAD_INPUT),
			Message: "Invalid match ID",
		}}})
		return
	}
	matchID, err := uuid.FromString(matchIDComponents[0])
	if err != nil {
		session.Send(false, 0, &rtapi.Envelope{Message: &rtapi.Envelope_Error{Error: &rtapi.Error{
			Code:    int32(rtapi.Error_BAD_INPUT),
			Message: "Invalid match ID",
		}}})
		return
	}