What can cause an Invalid User ID in a message sent from the Multiuser Server?
Issue
After issuing ConnectToNetServer(), the server responds with the following error:
-2147216221 (Invalid User ID)
The server console window displays a black rectangle next to the userID, and it indicates that the connection has been rejected.
Reason
The problem occurs if the RETURN character is included in the #userID string sent via ConnectToNetServer(). This occurs most frequently when users enter their userID into an editable field at runtime, and the RETURN key is pressed.
Solution
Parse and edit the string prior to issuing ConnectToNetServer(). The following code demonstrates one possible approach:
on filter whichField num = member(whichField).char.count repeat with i = num down to 1 if member(whichField).char[i] = RETURN then delete member(whichField).char[i] end if end repeat endAlternatively, for field cast members, the "Limit to Field Size" property may be set to prevent unwanted RETURN entries.
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
