ACR_ServerCommunicator.ServerLatencyMeasurer.HandleServerPingResponse C# (CSharp) Method

HandleServerPingResponse() public static method

This when a cross-server ping response is received. Its purpose is to compute the channel latency and send a message to that effect to the requesting player.
public static HandleServerPingResponse ( int SourceServerId, string Arguments, ACR_ServerCommunicator Script ) : int
SourceServerId int Supplies the server id of the server /// that completed the ping request.
Arguments string Supplies the serialized state arguments /// string.
Script ACR_ServerCommunicator Supplies the current script object.
return int
        public static int HandleServerPingResponse(int SourceServerId, string Arguments, ACR_ServerCommunicator Script)
        {
            int Tick = Environment.TickCount;

            try
            {
                PingState RemoteState;

                //
                // Deserialize the remote ping state.  If null, a protocol
                // violation has occurred.
                //

                if ((RemoteState = PingState.FromString(Arguments)) == null)
                {
                    Script.WriteTimestampedLogEntry(String.Format(
                        "ACR_ServerCommunicator.ServerLatencyMeasurer.HandleServerPingResponse({0}, {1}): Invalid request.",
                        SourceServerId,
                        Arguments));
                    return ACR_ServerCommunicator.FALSE;
                }

                string ServerName = Script.GetServerName(SourceServerId);

                if (ServerName == null)
                    return ACR_ServerCommunicator.FALSE;

                Script.SendMessageToPC(RemoteState.PCObjectId, String.Format(
                    "IPC channel latency to {0}: {1}ms", ServerName, Tick - RemoteState.TickCount));
            }
            catch (Exception e)
            {
                Script.WriteTimestampedLogEntry(String.Format(
                    "ACR_ServerCommunicator.ServerLatencyMeasurer.HandleServerPingResponse({0}, {1}): Exception: {0}",
                    SourceServerId,
                    Arguments,
                    e));
                return ACR_ServerCommunicator.FALSE;
            }

            return ACR_ServerCommunicator.TRUE;
        }