So, I'm working with code that a previous intern did on a big platform. Most of our networking stuff is handled by an external plugin called GameSparks (IIRC), which you can go buy and use as well. One of the values provided by GS is a constant called GS_TIMEOUT which is the default connection timeout. Every other script that needs to rely on connecting to something uses the GS_TIMEOUT value so it's all consistent.
I was trying to document some cryptic functionality for the menu builder (don't even get me started on that) and in doing so, I noticed that our main menu times out after 6 seconds, instead of the GS_TIMEOUT value of 20. After traveling through about a million scripts to find the one related to the menu connections, I stumbled across this code snippet:
void Update {
// Leaving a check here in case GameSparks connection times out.
float temp = Time.time - startTime;
int constraint = 6;
if ((int) temp == constraint){
string retryButton = "Retry";
PopupSystem.Instance.PopupMessageBox(UT.Lang("GameSparks connection timed out."), retryButton, Restart);
If any of you programmers would like to chime in on why you think this is wrong, I'd love a good laugh right about now.