This patch moves the check_tcl_event("ident") as close as possible to the connect() call. It was observed that Freenode (perhaps not to standard) sends the ident request earlier than expected in the connection process, sometimes before the client is fully connected/registered. This resulted in incorrect ident information being sent, before it was updated/written by Eggdrop. The write to file was moved up, so that even if we are not fully connected yet, we already have what we need.
This also adds the STAT_SERV entry to the status bitmask, allowing Eggdrop to positively identify this as a server connection, instead of something else (ie, telnet). This could now be used elsewhere in code if it helps