static unsafe void OnFriendChatMessage(GameConnectedFriendChatMsg_t data)
        {
            if (OnChatMessage == null)
            {
                return;
            }

            var friend = new Friend(data.SteamIDUser);

            var buffer = Helpers.TakeBuffer(1024 * 32);
            var type   = ChatEntryType.ChatMsg;

            fixed(byte *ptr = buffer)
            {
                var len = Internal.GetFriendMessage(data.SteamIDUser, data.MessageID, (IntPtr)ptr, buffer.Length, ref type);

                if (len == 0 && type == ChatEntryType.Invalid)
                {
                    return;
                }

                var typeName = type.ToString();
                var message  = Encoding.UTF8.GetString(buffer, 0, len);

                OnChatMessage(friend, typeName, message);
            }
        }
        static unsafe void OnFriendChatMessage(GameConnectedFriendChatMsg_t data)
        {
            if (OnChatMessage == null)
            {
                return;
            }

            var friend = new Friend(data.SteamIDUser);

            var buffer = Helpers.TakeMemory();
            var type   = ChatEntryType.ChatMsg;

            var len = Internal.GetFriendMessage(data.SteamIDUser, data.MessageID, buffer, Helpers.MemoryBufferSize, ref type);

            if (len == 0 && type == ChatEntryType.Invalid)
            {
                return;
            }

            var typeName = type.ToString();
            var message  = Helpers.MemoryToString(buffer);

            OnChatMessage(friend, typeName, message);
        }