Beispiel #1
0
        static unsafe void OnGameConnectedClanChatMessage(GameConnectedClanChatMsg_t data)
        {
            if (OnClanChatMessage == null)
            {
                return;
            }

            var friend = new Friend(data.SteamIDUser);

            var     buffer  = Helpers.TakeMemory();
            var     type    = ChatEntryType.ChatMsg;
            SteamId chatter = data.SteamIDUser;

            var len = Internal.GetClanChatMessage(data.SteamIDClanChat, data.MessageID, buffer, Helpers.MemoryBufferSize, ref type, ref chatter);

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

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

            OnClanChatMessage(data.SteamIDClanChat, friend, data.MessageID, typeName, message);
        }