Opened 9 years ago

Last modified 6 years ago

#3199 closed defect

Clicking "not ready" just before the host starts the game causes a network fsm error — at Initial Version

Reported by: elexis Owned by:
Priority: Should Have Milestone: Alpha 22
Component: Network Keywords:
Cc: Patch:

Description

Sometimes I noticed this error while the game loads:

ERROR: Net client: Error running FSM update (type=7 state=6)

Searching for this error message revealed that it occurs in source/network/NetClient.cpp in the function CNetClient::HandleMessage when updating the finite state machine:

	// Update FSM
	bool ok = Update(message->GetType(), message);
	if (!ok)
		LOGERROR("Net client: Error running FSM update (type=%d state=%d)", (int)message->GetType(), (int)GetCurrState());
	return ok;

As this annotated excerpt from source/network/NetMessages.h shows, NetMessageType 7 is NMT_READY:

enum NetMessageType
{
	NMT_CONNECT_COMPLETE = -256,	// Connection is complete
	NMT_CONNECTION_LOST,
	NMT_INVALID = 0,		// Invalid message
	NMT_SERVER_HANDSHAKE = 1,	// Handshake stage
	NMT_CLIENT_HANDSHAKE = 2,
	NMT_SERVER_HANDSHAKE_RESPONSE = 3,
	NMT_AUTHENTICATE = 4,		// Authentication stage
	NMT_AUTHENTICATE_RESULT = 5,
	NMT_CHAT = 6,		// Common chat message
	NMT_READY = 7,
	/// ...
};

and source/network/NetClient.h indicates that state=6 means that the game is loading.

// NetClient session FSM states
enum
{
	NCS_UNCONNECTED = 0,
	NCS_CONNECT = 1,
	NCS_HANDSHAKE = 2 ,
	NCS_AUTHENTICATE = 3,
	NCS_INITIAL_GAMESETUP = 4,
	NCS_PREGAME = 5,
	NCS_LOADING = 6,
	NCS_JOIN_SYNCING = 7,
	NCS_INGAME = 8
};

I.e. the host receives a not-ready message while the game has already been started.

It is not easily reproducable because of the timing, but after doing this research I could reproduce it by accident in a real game. (Clicked not-ready just before the host started. It didn't have any effect besides throwing this error)


This error occurs for ALL clients (another player in the game had received the same error in the same game), which means that the ready message is being broadcasted. Maybe the message is even broadcasted while the fsm of the host is already in the NCS_LOADING state. If so, don't broadcast ready messages while loading in order to fix the error.

Change History (0)

Note: See TracTickets for help on using tickets.