Ejemplo n.º 1
0
        public int BufferTest(ref Core.Util.Buffer b)
        {
            // Reset the buffer
            b.Reset();

            // Write raw chars here as that is what the test expects
            // Writing typeof(string) will write the length of the string first
            // (which is useful for deserialization but isnt what this is testing for)
            b.Write("13 characters".ToCharArray());

            return(b.Length());
        }
Ejemplo n.º 2
0
        public int GetChatMessage(ulong steam_id, int msg_index, ref Core.Util.Buffer b, ref uint msg_type)
        {
            var id = new SteamKit2.SteamID(steam_id);
            var cm = f.GetChatMessage(id, msg_index);

            if (cm != null)
            {
                var total_wrote = Math.Min(b.Length(), cm.Message.Length);

                b.Reset();

                b.Write(cm.Message.ToCharArray());
                msg_type = (uint)cm.Type;

                return(total_wrote);
            }

            return(0);
        }