Skip to content

Instantly share code, notes, and snippets.

@scottstamp
Created May 2, 2021 03:00
Show Gist options
  • Save scottstamp/bfc7482530373988ca78f839aac9fc7d to your computer and use it in GitHub Desktop.
Save scottstamp/bfc7482530373988ca78f839aac9fc7d to your computer and use it in GitHub Desktop.
Furnidata schema auto-definition
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
// This source code was auto-generated by xsd, Version=4.7.2558.0.
//
namespace Antidote
{
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.2558.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class furnidata
{
private furnitype[] roomitemtypesField;
private furnitype[] wallitemtypesField;
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("furnitype", IsNullable = false)]
public furnitype[] roomitemtypes
{
get
{
return this.roomitemtypesField;
}
set
{
this.roomitemtypesField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("furnitype", IsNullable = false)]
public furnitype[] wallitemtypes
{
get
{
return this.wallitemtypesField;
}
set
{
this.wallitemtypesField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.2558.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class furnitype
{
private string revisionField;
private string defaultdirField;
private string xdimField;
private string ydimField;
private string[] partcolorsField;
private string nameField;
private string descriptionField;
private string adurlField;
private string offeridField;
private string buyoutField;
private string rentofferidField;
private string rentbuyoutField;
private string bcField;
private string excludeddynamicField;
private string customparamsField;
private string specialtypeField;
private string canstandonField;
private string cansitonField;
private string canlayonField;
private string furnilineField;
private string classnameField;
private string idField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string revision
{
get
{
return this.revisionField;
}
set
{
this.revisionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string defaultdir
{
get
{
return this.defaultdirField;
}
set
{
this.defaultdirField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string xdim
{
get
{
return this.xdimField;
}
set
{
this.xdimField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string ydim
{
get
{
return this.ydimField;
}
set
{
this.ydimField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("color", IsNullable = false)]
public string[] partcolors
{
get
{
return this.partcolorsField;
}
set
{
this.partcolorsField = value;
}
}
/// <remarks/>
public string name
{
get
{
return this.nameField;
}
set
{
this.nameField = value;
}
}
/// <remarks/>
public string description
{
get
{
return this.descriptionField;
}
set
{
this.descriptionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "anyURI")]
public string adurl
{
get
{
return this.adurlField;
}
set
{
this.adurlField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string offerid
{
get
{
return this.offeridField;
}
set
{
this.offeridField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string buyout
{
get
{
return this.buyoutField;
}
set
{
this.buyoutField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string rentofferid
{
get
{
return this.rentofferidField;
}
set
{
this.rentofferidField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string rentbuyout
{
get
{
return this.rentbuyoutField;
}
set
{
this.rentbuyoutField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string bc
{
get
{
return this.bcField;
}
set
{
this.bcField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string excludeddynamic
{
get
{
return this.excludeddynamicField;
}
set
{
this.excludeddynamicField = value;
}
}
/// <remarks/>
public string customparams
{
get
{
return this.customparamsField;
}
set
{
this.customparamsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string specialtype
{
get
{
return this.specialtypeField;
}
set
{
this.specialtypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string canstandon
{
get
{
return this.canstandonField;
}
set
{
this.canstandonField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string cansiton
{
get
{
return this.cansitonField;
}
set
{
this.cansitonField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "integer")]
public string canlayon
{
get
{
return this.canlayonField;
}
set
{
this.canlayonField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(DataType = "NCName")]
public string furniline
{
get
{
return this.furnilineField;
}
set
{
this.furnilineField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string classname
{
get
{
return this.classnameField;
}
set
{
this.classnameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(DataType = "integer")]
public string id
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.2558.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class roomitemtypes
{
private furnitype[] furnitypeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("furnitype")]
public furnitype[] furnitype
{
get
{
return this.furnitypeField;
}
set
{
this.furnitypeField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.2558.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class wallitemtypes
{
private furnitype[] furnitypeField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("furnitype")]
public furnitype[] furnitype
{
get
{
return this.furnitypeField;
}
set
{
this.furnitypeField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.7.2558.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class partcolors
{
private string[] colorField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("color")]
public string[] color
{
get
{
return this.colorField;
}
set
{
this.colorField = value;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Antidote
{
static class Program
{
static void Main()
{
using (var wc = new WebClient())
{
if (!File.Exists("furnidata.xml"))
{
wc.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36");
wc.DownloadFile("https://www.habbo.com/gamedata/furnidata_xml/x", "furnidata.xml");
}
}
var furnidata = File.ReadAllText("furnidata.xml").XmlDeserializeFromString<furnidata>();
var chairs = furnidata.roomitemtypes.Where(f => f.cansiton == "1").ToArray();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment