public void StructTest(ref Core.Util.Buffer b) { b.Reset(); b.SetAlignment(4); b.WriteByte(0xAA); // 0 b.WriteUInt(0xBBCCDDEE); // 4 b.WriteUShort(0xFFAA); // 8 b.WriteByte(0xBB); // 10 b.WriteULong(0xCCDDEEFFAABBCCDD); // 12 }
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()); }
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); }