Client.writeClientData C# (CSharp) Method

writeClientData() protected method

protected writeClientData ( ) : void
return void
    protected void writeClientData()
    {
        lock (clientDataLock)
        {

            if (lastClientDataChangeTime > lastClientDataWriteTime
                || (stopwatch.ElapsedMilliseconds - lastClientDataWriteTime) > CLIENT_DATA_FORCE_WRITE_INTERVAL)
            {
                byte[] username_bytes = encoder.GetBytes(clientSettings.username);

                //Build client data array
                byte[] bytes = new byte[9 + username_bytes.Length];

                bytes[0] = inactiveShipsPerUpdate;
                KLFCommon.intToBytes(screenshotSettings.maxHeight).CopyTo(bytes, 1);
                KLFCommon.intToBytes(updateInterval).CopyTo(bytes, 5);
                username_bytes.CopyTo(bytes, 9);

                sendClientInteropMessage(KLFCommon.ClientInteropMessageID.CLIENT_DATA, bytes);

                lastClientDataWriteTime = stopwatch.ElapsedMilliseconds;
            }
        }
    }