diff --git a/clients/unity/simple_sample/Assets/RemoteClient/Basic.cs b/clients/unity/simple_sample/Assets/RemoteClient/Basic.cs
new file mode 100644
index 000000000..146df0232
--- /dev/null
+++ b/clients/unity/simple_sample/Assets/RemoteClient/Basic.cs
@@ -0,0 +1,968 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from: Basic.proto
+namespace dfproto
+{
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EnumItemName")]
+ public partial class EnumItemName : global::ProtoBuf.IExtensible
+ {
+ public EnumItemName() {}
+
+ private int _value;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int value
+ {
+ get { return _value; }
+ set { _value = value; }
+ }
+
+ private string _name = "";
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ private int _bit_size = (int)1;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"bit_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)1)]
+ public int bit_size
+ {
+ get { return _bit_size; }
+ set { _bit_size = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicMaterialId")]
+ public partial class BasicMaterialId : global::ProtoBuf.IExtensible
+ {
+ public BasicMaterialId() {}
+
+ private int _type;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int type
+ {
+ get { return _type; }
+ set { _type = value; }
+ }
+ private int _index;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"index", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
+ public int index
+ {
+ get { return _index; }
+ set { _index = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicMaterialInfo")]
+ public partial class BasicMaterialInfo : global::ProtoBuf.IExtensible
+ {
+ public BasicMaterialInfo() {}
+
+ private int _type;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int type
+ {
+ get { return _type; }
+ set { _type = value; }
+ }
+ private int _index;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"index", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
+ public int index
+ {
+ get { return _index; }
+ set { _index = value; }
+ }
+ private string _token;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"token", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string token
+ {
+ get { return _token; }
+ set { _token = value; }
+ }
+ private readonly global::System.Collections.Generic.List _flags = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(4, Name=@"flags", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public global::System.Collections.Generic.List flags
+ {
+ get { return _flags; }
+ }
+
+
+ private int _subtype = (int)-1;
+ [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"subtype", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int subtype
+ {
+ get { return _subtype; }
+ set { _subtype = value; }
+ }
+
+ private int _creature_id = (int)-1;
+ [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"creature_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int creature_id
+ {
+ get { return _creature_id; }
+ set { _creature_id = value; }
+ }
+
+ private int _plant_id = (int)-1;
+ [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"plant_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int plant_id
+ {
+ get { return _plant_id; }
+ set { _plant_id = value; }
+ }
+
+ private int _histfig_id = (int)-1;
+ [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"histfig_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int histfig_id
+ {
+ get { return _histfig_id; }
+ set { _histfig_id = value; }
+ }
+
+ private string _name_prefix = "";
+ [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"name_prefix", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string name_prefix
+ {
+ get { return _name_prefix; }
+ set { _name_prefix = value; }
+ }
+ private readonly global::System.Collections.Generic.List _state_color = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(10, Name=@"state_color", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
+ public global::System.Collections.Generic.List state_color
+ {
+ get { return _state_color; }
+ }
+
+ private readonly global::System.Collections.Generic.List _state_name = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(11, Name=@"state_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List state_name
+ {
+ get { return _state_name; }
+ }
+
+ private readonly global::System.Collections.Generic.List _state_adj = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(12, Name=@"state_adj", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List state_adj
+ {
+ get { return _state_adj; }
+ }
+
+ private readonly global::System.Collections.Generic.List _reaction_class = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(13, Name=@"reaction_class", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List reaction_class
+ {
+ get { return _reaction_class; }
+ }
+
+ private readonly global::System.Collections.Generic.List _reaction_product = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(14, Name=@"reaction_product", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List reaction_product
+ {
+ get { return _reaction_product; }
+ }
+
+ private readonly global::System.Collections.Generic.List _inorganic_flags = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(15, Name=@"inorganic_flags", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public global::System.Collections.Generic.List inorganic_flags
+ {
+ get { return _inorganic_flags; }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"Product")]
+ public partial class Product : global::ProtoBuf.IExtensible
+ {
+ public Product() {}
+
+ private string _id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string id
+ {
+ get { return _id; }
+ set { _id = value; }
+ }
+ private int _type;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int type
+ {
+ get { return _type; }
+ set { _type = value; }
+ }
+ private int _index;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"index", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
+ public int index
+ {
+ get { return _index; }
+ set { _index = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicMaterialInfoMask")]
+ public partial class BasicMaterialInfoMask : global::ProtoBuf.IExtensible
+ {
+ public BasicMaterialInfoMask() {}
+
+ private readonly global::System.Collections.Generic.List _states = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"states", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public global::System.Collections.Generic.List states
+ {
+ get { return _states; }
+ }
+
+
+ private int _temperature = (int)10015;
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"temperature", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)10015)]
+ public int temperature
+ {
+ get { return _temperature; }
+ set { _temperature = value; }
+ }
+
+ private bool _flags = (bool)false;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"flags", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue((bool)false)]
+ public bool flags
+ {
+ get { return _flags; }
+ set { _flags = value; }
+ }
+
+ private bool _reaction = (bool)false;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"reaction", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue((bool)false)]
+ public bool reaction
+ {
+ get { return _reaction; }
+ set { _reaction = value; }
+ }
+ [global::ProtoBuf.ProtoContract(Name=@"StateType")]
+ public enum StateType
+ {
+
+ [global::ProtoBuf.ProtoEnum(Name=@"Solid", Value=0)]
+ Solid = 0,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"Liquid", Value=1)]
+ Liquid = 1,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"Gas", Value=2)]
+ Gas = 2,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"Powder", Value=3)]
+ Powder = 3,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"Paste", Value=4)]
+ Paste = 4,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"Pressed", Value=5)]
+ Pressed = 5
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"JobSkillAttr")]
+ public partial class JobSkillAttr : global::ProtoBuf.IExtensible
+ {
+ public JobSkillAttr() {}
+
+ private int _id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int id
+ {
+ get { return _id; }
+ set { _id = value; }
+ }
+ private string _key;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"key", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string key
+ {
+ get { return _key; }
+ set { _key = value; }
+ }
+
+ private string _caption = "";
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"caption", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string caption
+ {
+ get { return _caption; }
+ set { _caption = value; }
+ }
+
+ private string _caption_noun = "";
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"caption_noun", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string caption_noun
+ {
+ get { return _caption_noun; }
+ set { _caption_noun = value; }
+ }
+
+ private int _profession = default(int);
+ [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int profession
+ {
+ get { return _profession; }
+ set { _profession = value; }
+ }
+
+ private int _labor = default(int);
+ [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"labor", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int labor
+ {
+ get { return _labor; }
+ set { _labor = value; }
+ }
+
+ private string _type = "";
+ [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string type
+ {
+ get { return _type; }
+ set { _type = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ProfessionAttr")]
+ public partial class ProfessionAttr : global::ProtoBuf.IExtensible
+ {
+ public ProfessionAttr() {}
+
+ private int _id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int id
+ {
+ get { return _id; }
+ set { _id = value; }
+ }
+ private string _key;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"key", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string key
+ {
+ get { return _key; }
+ set { _key = value; }
+ }
+
+ private string _caption = "";
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"caption", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string caption
+ {
+ get { return _caption; }
+ set { _caption = value; }
+ }
+
+ private bool _military = default(bool);
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"military", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool military
+ {
+ get { return _military; }
+ set { _military = value; }
+ }
+
+ private bool _can_assign_labor = default(bool);
+ [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"can_assign_labor", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool can_assign_labor
+ {
+ get { return _can_assign_labor; }
+ set { _can_assign_labor = value; }
+ }
+
+ private int _parent = default(int);
+ [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"parent", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int parent
+ {
+ get { return _parent; }
+ set { _parent = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UnitLaborAttr")]
+ public partial class UnitLaborAttr : global::ProtoBuf.IExtensible
+ {
+ public UnitLaborAttr() {}
+
+ private int _id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int id
+ {
+ get { return _id; }
+ set { _id = value; }
+ }
+ private string _key;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"key", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string key
+ {
+ get { return _key; }
+ set { _key = value; }
+ }
+
+ private string _caption = "";
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"caption", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string caption
+ {
+ get { return _caption; }
+ set { _caption = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NameInfo")]
+ public partial class NameInfo : global::ProtoBuf.IExtensible
+ {
+ public NameInfo() {}
+
+
+ private string _first_name = "";
+ [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"first_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string first_name
+ {
+ get { return _first_name; }
+ set { _first_name = value; }
+ }
+
+ private string _nickname = "";
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"nickname", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string nickname
+ {
+ get { return _nickname; }
+ set { _nickname = value; }
+ }
+
+ private int _language_id = (int)-1;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"language_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int language_id
+ {
+ get { return _language_id; }
+ set { _language_id = value; }
+ }
+
+ private string _last_name = "";
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"last_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string last_name
+ {
+ get { return _last_name; }
+ set { _last_name = value; }
+ }
+
+ private string _english_name = "";
+ [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"english_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string english_name
+ {
+ get { return _english_name; }
+ set { _english_name = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NameTriple")]
+ public partial class NameTriple : global::ProtoBuf.IExtensible
+ {
+ public NameTriple() {}
+
+ private string _normal;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"normal", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string normal
+ {
+ get { return _normal; }
+ set { _normal = value; }
+ }
+
+ private string _plural = "";
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"plural", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string plural
+ {
+ get { return _plural; }
+ set { _plural = value; }
+ }
+
+ private string _adjective = "";
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"adjective", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string adjective
+ {
+ get { return _adjective; }
+ set { _adjective = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UnitCurseInfo")]
+ public partial class UnitCurseInfo : global::ProtoBuf.IExtensible
+ {
+ public UnitCurseInfo() {}
+
+ private uint _add_tags1;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"add_tags1", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
+ public uint add_tags1
+ {
+ get { return _add_tags1; }
+ set { _add_tags1 = value; }
+ }
+ private uint _rem_tags1;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"rem_tags1", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
+ public uint rem_tags1
+ {
+ get { return _rem_tags1; }
+ set { _rem_tags1 = value; }
+ }
+ private uint _add_tags2;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"add_tags2", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
+ public uint add_tags2
+ {
+ get { return _add_tags2; }
+ set { _add_tags2 = value; }
+ }
+ private uint _rem_tags2;
+ [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"rem_tags2", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
+ public uint rem_tags2
+ {
+ get { return _rem_tags2; }
+ set { _rem_tags2 = value; }
+ }
+
+ private dfproto.NameTriple _name = null;
+ [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(null)]
+ public dfproto.NameTriple name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"SkillInfo")]
+ public partial class SkillInfo : global::ProtoBuf.IExtensible
+ {
+ public SkillInfo() {}
+
+ private int _id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int id
+ {
+ get { return _id; }
+ set { _id = value; }
+ }
+ private int _level;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"level", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int level
+ {
+ get { return _level; }
+ set { _level = value; }
+ }
+ private int _experience;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"experience", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int experience
+ {
+ get { return _experience; }
+ set { _experience = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UnitMiscTrait")]
+ public partial class UnitMiscTrait : global::ProtoBuf.IExtensible
+ {
+ public UnitMiscTrait() {}
+
+ private int _id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int id
+ {
+ get { return _id; }
+ set { _id = value; }
+ }
+ private int _value;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int value
+ {
+ get { return _value; }
+ set { _value = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicUnitInfo")]
+ public partial class BasicUnitInfo : global::ProtoBuf.IExtensible
+ {
+ public BasicUnitInfo() {}
+
+ private int _unit_id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"unit_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int unit_id
+ {
+ get { return _unit_id; }
+ set { _unit_id = value; }
+ }
+ private int _pos_x;
+ [global::ProtoBuf.ProtoMember(13, IsRequired = true, Name=@"pos_x", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int pos_x
+ {
+ get { return _pos_x; }
+ set { _pos_x = value; }
+ }
+ private int _pos_y;
+ [global::ProtoBuf.ProtoMember(14, IsRequired = true, Name=@"pos_y", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int pos_y
+ {
+ get { return _pos_y; }
+ set { _pos_y = value; }
+ }
+ private int _pos_z;
+ [global::ProtoBuf.ProtoMember(15, IsRequired = true, Name=@"pos_z", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int pos_z
+ {
+ get { return _pos_z; }
+ set { _pos_z = value; }
+ }
+
+ private dfproto.NameInfo _name = null;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(null)]
+ public dfproto.NameInfo name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+ private uint _flags1;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"flags1", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
+ public uint flags1
+ {
+ get { return _flags1; }
+ set { _flags1 = value; }
+ }
+ private uint _flags2;
+ [global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"flags2", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
+ public uint flags2
+ {
+ get { return _flags2; }
+ set { _flags2 = value; }
+ }
+ private uint _flags3;
+ [global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"flags3", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
+ public uint flags3
+ {
+ get { return _flags3; }
+ set { _flags3 = value; }
+ }
+ private int _race;
+ [global::ProtoBuf.ProtoMember(6, IsRequired = true, Name=@"race", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int race
+ {
+ get { return _race; }
+ set { _race = value; }
+ }
+ private int _caste;
+ [global::ProtoBuf.ProtoMember(7, IsRequired = true, Name=@"caste", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int caste
+ {
+ get { return _caste; }
+ set { _caste = value; }
+ }
+
+ private int _gender = (int)-1;
+ [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"gender", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int gender
+ {
+ get { return _gender; }
+ set { _gender = value; }
+ }
+
+ private int _civ_id = (int)-1;
+ [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"civ_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int civ_id
+ {
+ get { return _civ_id; }
+ set { _civ_id = value; }
+ }
+
+ private int _histfig_id = (int)-1;
+ [global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"histfig_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int histfig_id
+ {
+ get { return _histfig_id; }
+ set { _histfig_id = value; }
+ }
+
+ private int _death_id = (int)-1;
+ [global::ProtoBuf.ProtoMember(17, IsRequired = false, Name=@"death_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int death_id
+ {
+ get { return _death_id; }
+ set { _death_id = value; }
+ }
+
+ private uint _death_flags = default(uint);
+ [global::ProtoBuf.ProtoMember(18, IsRequired = false, Name=@"death_flags", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(uint))]
+ public uint death_flags
+ {
+ get { return _death_flags; }
+ set { _death_flags = value; }
+ }
+
+ private int _squad_id = (int)-1;
+ [global::ProtoBuf.ProtoMember(19, IsRequired = false, Name=@"squad_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int squad_id
+ {
+ get { return _squad_id; }
+ set { _squad_id = value; }
+ }
+
+ private int _squad_position = (int)-1;
+ [global::ProtoBuf.ProtoMember(20, IsRequired = false, Name=@"squad_position", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int squad_position
+ {
+ get { return _squad_position; }
+ set { _squad_position = value; }
+ }
+
+ private int _profession = (int)-1;
+ [global::ProtoBuf.ProtoMember(22, IsRequired = false, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue((int)-1)]
+ public int profession
+ {
+ get { return _profession; }
+ set { _profession = value; }
+ }
+
+ private string _custom_profession = "";
+ [global::ProtoBuf.ProtoMember(23, IsRequired = false, Name=@"custom_profession", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string custom_profession
+ {
+ get { return _custom_profession; }
+ set { _custom_profession = value; }
+ }
+ private readonly global::System.Collections.Generic.List _labors = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(11, Name=@"labors", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public global::System.Collections.Generic.List labors
+ {
+ get { return _labors; }
+ }
+
+ private readonly global::System.Collections.Generic.List _skills = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(12, Name=@"skills", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List skills
+ {
+ get { return _skills; }
+ }
+
+ private readonly global::System.Collections.Generic.List _misc_traits = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(24, Name=@"misc_traits", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List misc_traits
+ {
+ get { return _misc_traits; }
+ }
+
+
+ private dfproto.UnitCurseInfo _curse = null;
+ [global::ProtoBuf.ProtoMember(16, IsRequired = false, Name=@"curse", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(null)]
+ public dfproto.UnitCurseInfo curse
+ {
+ get { return _curse; }
+ set { _curse = value; }
+ }
+ private readonly global::System.Collections.Generic.List _burrows = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(21, Name=@"burrows", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public global::System.Collections.Generic.List burrows
+ {
+ get { return _burrows; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicUnitInfoMask")]
+ public partial class BasicUnitInfoMask : global::ProtoBuf.IExtensible
+ {
+ public BasicUnitInfoMask() {}
+
+
+ private bool _labors = (bool)false;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"labors", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue((bool)false)]
+ public bool labors
+ {
+ get { return _labors; }
+ set { _labors = value; }
+ }
+
+ private bool _skills = (bool)false;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"skills", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue((bool)false)]
+ public bool skills
+ {
+ get { return _skills; }
+ set { _skills = value; }
+ }
+
+ private bool _profession = (bool)false;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue((bool)false)]
+ public bool profession
+ {
+ get { return _profession; }
+ set { _profession = value; }
+ }
+
+ private bool _misc_traits = (bool)false;
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"misc_traits", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue((bool)false)]
+ public bool misc_traits
+ {
+ get { return _misc_traits; }
+ set { _misc_traits = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicSquadInfo")]
+ public partial class BasicSquadInfo : global::ProtoBuf.IExtensible
+ {
+ public BasicSquadInfo() {}
+
+ private int _squad_id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"squad_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int squad_id
+ {
+ get { return _squad_id; }
+ set { _squad_id = value; }
+ }
+
+ private dfproto.NameInfo _name = null;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(null)]
+ public dfproto.NameInfo name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ private string _alias = "";
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"alias", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string alias
+ {
+ get { return _alias; }
+ set { _alias = value; }
+ }
+ private readonly global::System.Collections.Generic.List _members = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(4, Name=@"members", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
+ public global::System.Collections.Generic.List members
+ {
+ get { return _members; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UnitLaborState")]
+ public partial class UnitLaborState : global::ProtoBuf.IExtensible
+ {
+ public UnitLaborState() {}
+
+ private int _unit_id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"unit_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int unit_id
+ {
+ get { return _unit_id; }
+ set { _unit_id = value; }
+ }
+ private int _labor;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"labor", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int labor
+ {
+ get { return _labor; }
+ set { _labor = value; }
+ }
+ private bool _value;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public bool value
+ {
+ get { return _value; }
+ set { _value = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+}
\ No newline at end of file
diff --git a/clients/unity/simple_sample/Assets/RemoteClient/BasicApi.cs b/clients/unity/simple_sample/Assets/RemoteClient/BasicApi.cs
new file mode 100644
index 000000000..3f9f97984
--- /dev/null
+++ b/clients/unity/simple_sample/Assets/RemoteClient/BasicApi.cs
@@ -0,0 +1,460 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from: BasicApi.proto
+// Note: requires additional types generated from: Basic.proto
+namespace dfproto
+{
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetWorldInfoOut")]
+ public partial class GetWorldInfoOut : global::ProtoBuf.IExtensible
+ {
+ public GetWorldInfoOut() {}
+
+ private dfproto.GetWorldInfoOut.Mode _mode;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"mode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public dfproto.GetWorldInfoOut.Mode mode
+ {
+ get { return _mode; }
+ set { _mode = value; }
+ }
+ private string _save_dir;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"save_dir", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string save_dir
+ {
+ get { return _save_dir; }
+ set { _save_dir = value; }
+ }
+
+ private dfproto.NameInfo _world_name = null;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"world_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(null)]
+ public dfproto.NameInfo world_name
+ {
+ get { return _world_name; }
+ set { _world_name = value; }
+ }
+
+ private int _civ_id = default(int);
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"civ_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int civ_id
+ {
+ get { return _civ_id; }
+ set { _civ_id = value; }
+ }
+
+ private int _site_id = default(int);
+ [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"site_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int site_id
+ {
+ get { return _site_id; }
+ set { _site_id = value; }
+ }
+
+ private int _group_id = default(int);
+ [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"group_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int group_id
+ {
+ get { return _group_id; }
+ set { _group_id = value; }
+ }
+
+ private int _race_id = default(int);
+ [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"race_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int race_id
+ {
+ get { return _race_id; }
+ set { _race_id = value; }
+ }
+
+ private int _player_unit_id = default(int);
+ [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"player_unit_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int player_unit_id
+ {
+ get { return _player_unit_id; }
+ set { _player_unit_id = value; }
+ }
+
+ private int _player_histfig_id = default(int);
+ [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"player_histfig_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int player_histfig_id
+ {
+ get { return _player_histfig_id; }
+ set { _player_histfig_id = value; }
+ }
+ private readonly global::System.Collections.Generic.List _companion_histfig_ids = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(10, Name=@"companion_histfig_ids", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public global::System.Collections.Generic.List companion_histfig_ids
+ {
+ get { return _companion_histfig_ids; }
+ }
+
+ [global::ProtoBuf.ProtoContract(Name=@"Mode")]
+ public enum Mode
+ {
+
+ [global::ProtoBuf.ProtoEnum(Name=@"MODE_DWARF", Value=1)]
+ MODE_DWARF = 1,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"MODE_ADVENTURE", Value=2)]
+ MODE_ADVENTURE = 2,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"MODE_LEGENDS", Value=3)]
+ MODE_LEGENDS = 3
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListEnumsOut")]
+ public partial class ListEnumsOut : global::ProtoBuf.IExtensible
+ {
+ public ListEnumsOut() {}
+
+ private readonly global::System.Collections.Generic.List _material_flags = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"material_flags", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List material_flags
+ {
+ get { return _material_flags; }
+ }
+
+ private readonly global::System.Collections.Generic.List _inorganic_flags = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(2, Name=@"inorganic_flags", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List inorganic_flags
+ {
+ get { return _inorganic_flags; }
+ }
+
+ private readonly global::System.Collections.Generic.List _unit_flags1 = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(3, Name=@"unit_flags1", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List unit_flags1
+ {
+ get { return _unit_flags1; }
+ }
+
+ private readonly global::System.Collections.Generic.List _unit_flags2 = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(4, Name=@"unit_flags2", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List unit_flags2
+ {
+ get { return _unit_flags2; }
+ }
+
+ private readonly global::System.Collections.Generic.List _unit_flags3 = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(5, Name=@"unit_flags3", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List unit_flags3
+ {
+ get { return _unit_flags3; }
+ }
+
+ private readonly global::System.Collections.Generic.List _unit_labor = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(6, Name=@"unit_labor", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List unit_labor
+ {
+ get { return _unit_labor; }
+ }
+
+ private readonly global::System.Collections.Generic.List _job_skill = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(7, Name=@"job_skill", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List job_skill
+ {
+ get { return _job_skill; }
+ }
+
+ private readonly global::System.Collections.Generic.List _cie_add_tag_mask1 = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(8, Name=@"cie_add_tag_mask1", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List cie_add_tag_mask1
+ {
+ get { return _cie_add_tag_mask1; }
+ }
+
+ private readonly global::System.Collections.Generic.List _cie_add_tag_mask2 = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(9, Name=@"cie_add_tag_mask2", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List cie_add_tag_mask2
+ {
+ get { return _cie_add_tag_mask2; }
+ }
+
+ private readonly global::System.Collections.Generic.List _death_info_flags = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(10, Name=@"death_info_flags", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List death_info_flags
+ {
+ get { return _death_info_flags; }
+ }
+
+ private readonly global::System.Collections.Generic.List _profession = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(11, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List profession
+ {
+ get { return _profession; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListJobSkillsOut")]
+ public partial class ListJobSkillsOut : global::ProtoBuf.IExtensible
+ {
+ public ListJobSkillsOut() {}
+
+ private readonly global::System.Collections.Generic.List _skill = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"skill", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List skill
+ {
+ get { return _skill; }
+ }
+
+ private readonly global::System.Collections.Generic.List _profession = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(2, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List profession
+ {
+ get { return _profession; }
+ }
+
+ private readonly global::System.Collections.Generic.List _labor = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(3, Name=@"labor", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List labor
+ {
+ get { return _labor; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListMaterialsIn")]
+ public partial class ListMaterialsIn : global::ProtoBuf.IExtensible
+ {
+ public ListMaterialsIn() {}
+
+
+ private dfproto.BasicMaterialInfoMask _mask = null;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"mask", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(null)]
+ public dfproto.BasicMaterialInfoMask mask
+ {
+ get { return _mask; }
+ set { _mask = value; }
+ }
+ private readonly global::System.Collections.Generic.List _id_list = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(2, Name=@"id_list", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List id_list
+ {
+ get { return _id_list; }
+ }
+
+
+ private bool _builtin = default(bool);
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"builtin", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool builtin
+ {
+ get { return _builtin; }
+ set { _builtin = value; }
+ }
+
+ private bool _inorganic = default(bool);
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"inorganic", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool inorganic
+ {
+ get { return _inorganic; }
+ set { _inorganic = value; }
+ }
+
+ private bool _creatures = default(bool);
+ [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"creatures", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool creatures
+ {
+ get { return _creatures; }
+ set { _creatures = value; }
+ }
+
+ private bool _plants = default(bool);
+ [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"plants", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool plants
+ {
+ get { return _plants; }
+ set { _plants = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListMaterialsOut")]
+ public partial class ListMaterialsOut : global::ProtoBuf.IExtensible
+ {
+ public ListMaterialsOut() {}
+
+ private readonly global::System.Collections.Generic.List _value = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List value
+ {
+ get { return _value; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListUnitsIn")]
+ public partial class ListUnitsIn : global::ProtoBuf.IExtensible
+ {
+ public ListUnitsIn() {}
+
+
+ private dfproto.BasicUnitInfoMask _mask = null;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"mask", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(null)]
+ public dfproto.BasicUnitInfoMask mask
+ {
+ get { return _mask; }
+ set { _mask = value; }
+ }
+ private readonly global::System.Collections.Generic.List _id_list = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(2, Name=@"id_list", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public global::System.Collections.Generic.List id_list
+ {
+ get { return _id_list; }
+ }
+
+
+ private bool _scan_all = default(bool);
+ [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"scan_all", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool scan_all
+ {
+ get { return _scan_all; }
+ set { _scan_all = value; }
+ }
+
+ private int _race = default(int);
+ [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"race", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int race
+ {
+ get { return _race; }
+ set { _race = value; }
+ }
+
+ private int _civ_id = default(int);
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"civ_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(default(int))]
+ public int civ_id
+ {
+ get { return _civ_id; }
+ set { _civ_id = value; }
+ }
+
+ private bool _dead = default(bool);
+ [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"dead", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool dead
+ {
+ get { return _dead; }
+ set { _dead = value; }
+ }
+
+ private bool _alive = default(bool);
+ [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"alive", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool alive
+ {
+ get { return _alive; }
+ set { _alive = value; }
+ }
+
+ private bool _sane = default(bool);
+ [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"sane", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue(default(bool))]
+ public bool sane
+ {
+ get { return _sane; }
+ set { _sane = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListUnitsOut")]
+ public partial class ListUnitsOut : global::ProtoBuf.IExtensible
+ {
+ public ListUnitsOut() {}
+
+ private readonly global::System.Collections.Generic.List _value = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List value
+ {
+ get { return _value; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListSquadsIn")]
+ public partial class ListSquadsIn : global::ProtoBuf.IExtensible
+ {
+ public ListSquadsIn() {}
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListSquadsOut")]
+ public partial class ListSquadsOut : global::ProtoBuf.IExtensible
+ {
+ public ListSquadsOut() {}
+
+ private readonly global::System.Collections.Generic.List _value = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List value
+ {
+ get { return _value; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"SetUnitLaborsIn")]
+ public partial class SetUnitLaborsIn : global::ProtoBuf.IExtensible
+ {
+ public SetUnitLaborsIn() {}
+
+ private readonly global::System.Collections.Generic.List _change = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"change", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List change
+ {
+ get { return _change; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+}
\ No newline at end of file
diff --git a/clients/unity/simple_sample/Assets/RemoteClient/ColorText.cs b/clients/unity/simple_sample/Assets/RemoteClient/ColorText.cs
new file mode 100644
index 000000000..c98941b01
--- /dev/null
+++ b/clients/unity/simple_sample/Assets/RemoteClient/ColorText.cs
@@ -0,0 +1,119 @@
+using System;
+using UnityEngine;
+using AT.MIN;
+using dfproto;
+
+namespace DFHack
+{
+ public enum color_value
+ {
+ COLOR_RESET = -1,
+ COLOR_BLACK = 0,
+ COLOR_BLUE,
+ COLOR_GREEN,
+ COLOR_CYAN,
+ COLOR_RED,
+ COLOR_MAGENTA,
+ COLOR_BROWN,
+ COLOR_GREY,
+ COLOR_DARKGREY,
+ COLOR_LIGHTBLUE,
+ COLOR_LIGHTGREEN,
+ COLOR_LIGHTCYAN,
+ COLOR_LIGHTRED,
+ COLOR_LIGHTMAGENTA,
+ COLOR_YELLOW,
+ COLOR_WHITE,
+ COLOR_MAX = COLOR_WHITE
+ };
+
+ public class color_ostream
+ {
+ string buffer;
+ public void printerr(string Format, params object[] Parameters)
+ {
+ Debug.LogError(Tools.sprintf(Format, Parameters));
+ }
+ public void print(string Format, params object[] Parameters)
+ {
+ Debug.Log(Tools.sprintf(Format, Parameters));
+ }
+ public void begin_batch()
+ {
+ buffer = "";
+ }
+ public void end_batch()
+ {
+ Debug.Log(buffer);
+ buffer = null;
+ }
+
+ public void add_text(color_value color, string text)
+ {
+ //Debug.Log(text);
+ buffer += text;
+ }
+
+ }
+ public class buffered_color_ostream : color_ostream
+ {
+ //protected:
+ public new void add_text(color_value color, string text)
+ {
+ if (text.Length == 0)
+ return;
+
+ if (buffer.Length == 0)
+ {
+ buffer = text;
+ }
+ else
+ {
+ buffer += text;
+ }
+ }
+
+
+
+ // buffered_color_ostream() {}
+ // ~buffered_color_ostream() {}
+
+ // const std::list &fragments() { return buffer; }
+
+ protected string buffer;
+ }
+ public class color_ostream_proxy : buffered_color_ostream
+ {
+ protected color_ostream target;
+
+ //virtual void flush_proxy();
+
+ public color_ostream_proxy(color_ostream targetIn)
+ {
+ target = targetIn;
+ }
+
+ public virtual color_ostream proxy_target() { return target; }
+
+ public void decode(dfproto.CoreTextNotification data)
+ {
+ int cnt = data.fragments.Count;
+
+ if (cnt > 0)
+ {
+ target.begin_batch();
+
+ for (int i = 0; i < cnt; i++)
+ {
+ var frag = data.fragments[i];
+
+ //color_value color = frag.has_color() ? color_value(frag.color()) : COLOR_RESET;
+ target.add_text(color_value.COLOR_RESET, frag.text);
+ //target.printerr(data.fragments[i].text);
+ }
+
+ target.end_batch();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/clients/unity/simple_sample/Assets/RemoteClient/CoreProtocol.cs b/clients/unity/simple_sample/Assets/RemoteClient/CoreProtocol.cs
new file mode 100644
index 000000000..e5536da04
--- /dev/null
+++ b/clients/unity/simple_sample/Assets/RemoteClient/CoreProtocol.cs
@@ -0,0 +1,311 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from: CoreProtocol.proto
+namespace dfproto
+{
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreTextFragment")]
+ public partial class CoreTextFragment : global::ProtoBuf.IExtensible
+ {
+ public CoreTextFragment() {}
+
+ private string _text;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"text", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string text
+ {
+ get { return _text; }
+ set { _text = value; }
+ }
+
+ private dfproto.CoreTextFragment.Color _color = dfproto.CoreTextFragment.Color.COLOR_BLACK;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"color", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ [global::System.ComponentModel.DefaultValue(dfproto.CoreTextFragment.Color.COLOR_BLACK)]
+ public dfproto.CoreTextFragment.Color color
+ {
+ get { return _color; }
+ set { _color = value; }
+ }
+ [global::ProtoBuf.ProtoContract(Name=@"Color")]
+ public enum Color
+ {
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_BLACK", Value=0)]
+ COLOR_BLACK = 0,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_BLUE", Value=1)]
+ COLOR_BLUE = 1,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_GREEN", Value=2)]
+ COLOR_GREEN = 2,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_CYAN", Value=3)]
+ COLOR_CYAN = 3,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_RED", Value=4)]
+ COLOR_RED = 4,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_MAGENTA", Value=5)]
+ COLOR_MAGENTA = 5,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_BROWN", Value=6)]
+ COLOR_BROWN = 6,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_GREY", Value=7)]
+ COLOR_GREY = 7,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_DARKGREY", Value=8)]
+ COLOR_DARKGREY = 8,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTBLUE", Value=9)]
+ COLOR_LIGHTBLUE = 9,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTGREEN", Value=10)]
+ COLOR_LIGHTGREEN = 10,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTCYAN", Value=11)]
+ COLOR_LIGHTCYAN = 11,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTRED", Value=12)]
+ COLOR_LIGHTRED = 12,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTMAGENTA", Value=13)]
+ COLOR_LIGHTMAGENTA = 13,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_YELLOW", Value=14)]
+ COLOR_YELLOW = 14,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"COLOR_WHITE", Value=15)]
+ COLOR_WHITE = 15
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreTextNotification")]
+ public partial class CoreTextNotification : global::ProtoBuf.IExtensible
+ {
+ public CoreTextNotification() {}
+
+ private readonly global::System.Collections.Generic.List _fragments = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"fragments", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List fragments
+ {
+ get { return _fragments; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreErrorNotification")]
+ public partial class CoreErrorNotification : global::ProtoBuf.IExtensible
+ {
+ public CoreErrorNotification() {}
+
+ private dfproto.CoreErrorNotification.ErrorCode _code;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"code", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public dfproto.CoreErrorNotification.ErrorCode code
+ {
+ get { return _code; }
+ set { _code = value; }
+ }
+ [global::ProtoBuf.ProtoContract(Name=@"ErrorCode")]
+ public enum ErrorCode
+ {
+
+ [global::ProtoBuf.ProtoEnum(Name=@"CR_LINK_FAILURE", Value=-3)]
+ CR_LINK_FAILURE = -3,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"CR_WOULD_BREAK", Value=-2)]
+ CR_WOULD_BREAK = -2,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"CR_NOT_IMPLEMENTED", Value=-1)]
+ CR_NOT_IMPLEMENTED = -1,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"CR_OK", Value=0)]
+ CR_OK = 0,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"CR_FAILURE", Value=1)]
+ CR_FAILURE = 1,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"CR_WRONG_USAGE", Value=2)]
+ CR_WRONG_USAGE = 2,
+
+ [global::ProtoBuf.ProtoEnum(Name=@"CR_NOT_FOUND", Value=3)]
+ CR_NOT_FOUND = 3
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EmptyMessage")]
+ public partial class EmptyMessage : global::ProtoBuf.IExtensible
+ {
+ public EmptyMessage() {}
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"IntMessage")]
+ public partial class IntMessage : global::ProtoBuf.IExtensible
+ {
+ public IntMessage() {}
+
+ private int _value;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int value
+ {
+ get { return _value; }
+ set { _value = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"IntListMessage")]
+ public partial class IntListMessage : global::ProtoBuf.IExtensible
+ {
+ public IntListMessage() {}
+
+ private readonly global::System.Collections.Generic.List _value = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public global::System.Collections.Generic.List value
+ {
+ get { return _value; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StringMessage")]
+ public partial class StringMessage : global::ProtoBuf.IExtensible
+ {
+ public StringMessage() {}
+
+ private string _value;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string value
+ {
+ get { return _value; }
+ set { _value = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StringListMessage")]
+ public partial class StringListMessage : global::ProtoBuf.IExtensible
+ {
+ public StringListMessage() {}
+
+ private readonly global::System.Collections.Generic.List _value = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List value
+ {
+ get { return _value; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreBindRequest")]
+ public partial class CoreBindRequest : global::ProtoBuf.IExtensible
+ {
+ public CoreBindRequest() {}
+
+ private string _method;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"method", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string method
+ {
+ get { return _method; }
+ set { _method = value; }
+ }
+ private string _input_msg;
+ [global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"input_msg", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string input_msg
+ {
+ get { return _input_msg; }
+ set { _input_msg = value; }
+ }
+ private string _output_msg;
+ [global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"output_msg", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string output_msg
+ {
+ get { return _output_msg; }
+ set { _output_msg = value; }
+ }
+
+ private string _plugin = "";
+ [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"plugin", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ [global::System.ComponentModel.DefaultValue("")]
+ public string plugin
+ {
+ get { return _plugin; }
+ set { _plugin = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreBindReply")]
+ public partial class CoreBindReply : global::ProtoBuf.IExtensible
+ {
+ public CoreBindReply() {}
+
+ private int _assigned_id;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"assigned_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
+ public int assigned_id
+ {
+ get { return _assigned_id; }
+ set { _assigned_id = value; }
+ }
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+ [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreRunCommandRequest")]
+ public partial class CoreRunCommandRequest : global::ProtoBuf.IExtensible
+ {
+ public CoreRunCommandRequest() {}
+
+ private string _command;
+ [global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"command", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public string command
+ {
+ get { return _command; }
+ set { _command = value; }
+ }
+ private readonly global::System.Collections.Generic.List _arguments = new global::System.Collections.Generic.List();
+ [global::ProtoBuf.ProtoMember(2, Name=@"arguments", DataFormat = global::ProtoBuf.DataFormat.Default)]
+ public global::System.Collections.Generic.List arguments
+ {
+ get { return _arguments; }
+ }
+
+ private global::ProtoBuf.IExtension extensionObject;
+ global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
+ { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
+ }
+
+}
\ No newline at end of file
diff --git a/clients/unity/simple_sample/Assets/RemoteClient/RemoteClient.cs b/clients/unity/simple_sample/Assets/RemoteClient/RemoteClient.cs
new file mode 100644
index 000000000..f23faa761
--- /dev/null
+++ b/clients/unity/simple_sample/Assets/RemoteClient/RemoteClient.cs
@@ -0,0 +1,720 @@
+/*
+https://github.com/peterix/dfhack
+Copyright (c) 2009-2012 Petr Mrázek (peterix@gmail.com)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+*/
+
+using dfproto;
+using System;
+using System.Net;
+using System.Net.Sockets;
+using System.IO;
+using System.Text;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Collections.Generic;
+using System.Diagnostics;
+
+namespace DFHack
+{
+ using message_type = ProtoBuf.IExtensible;
+
+ public enum command_result
+ {
+ CR_LINK_FAILURE = -3, // RPC call failed due to I/O or protocol error
+ CR_NEEDS_CONSOLE = -2, // Attempt to call interactive command without console
+ CR_NOT_IMPLEMENTED = -1, // Command not implemented, or plugin not loaded
+ CR_OK = 0, // Success
+ CR_FAILURE = 1, // Failure
+ CR_WRONG_USAGE = 2, // Wrong arguments or ui state
+ CR_NOT_FOUND = 3 // Target object not found (for RPC mainly)
+ }
+
+ public enum DFHackReplyCode
+ {
+ RPC_REPLY_RESULT = -1,
+ RPC_REPLY_FAIL = -2,
+ RPC_REPLY_TEXT = -3,
+ RPC_REQUEST_QUIT = -4
+ }
+
+ class RPCHandshakeHeader
+ {
+ public string magic;
+ public int version;
+
+ public static string REQUEST_MAGIC = "DFHack?\n";
+ public static string RESPONSE_MAGIC = "DFHack!\n";
+ }
+
+ struct RPCMessageHeader
+ {
+ public const int MAX_MESSAGE_SIZE = 8 * 1048576;
+
+ public Int16 id;
+ public Int32 size;
+
+ public byte[] ConvertToBtyes()
+ {
+ List output = new List();
+ output.AddRange(BitConverter.GetBytes(id));
+ output.AddRange(new byte[2]);
+ output.AddRange(BitConverter.GetBytes(size));
+ return output.ToArray();
+ }
+ string BytesToString(byte[] input)
+ {
+ string output = "";
+ foreach (byte item in input)
+ {
+ if (output.Length > 0)
+ output += ",";
+ output += item;
+ }
+ return output;
+ }
+ }
+
+ /* Protocol description:
+ *
+ * 1. Handshake
+ *
+ * Client initiates connection by sending the handshake
+ * request header. The server responds with the response
+ * magic. Currently both versions must be 1.
+ *
+ * 2. Interaction
+ *
+ * Requests are done by exchanging messages between the
+ * client and the server. Messages consist of a serialized
+ * protobuf message preceeded by RPCMessageHeader. The size
+ * field specifies the length of the protobuf part.
+ *
+ * NOTE: As a special exception, RPC_REPLY_FAIL uses the size
+ * field to hold the error code directly.
+ *
+ * Every callable function is assigned a non-negative id by
+ * the server. Id 0 is reserved for BindMethod, which can be
+ * used to request any other id by function name. Id 1 is
+ * RunCommand, used to call console commands remotely.
+ *
+ * The client initiates every call by sending a message with
+ * appropriate function id and input arguments. The server
+ * responds with zero or more RPC_REPLY_TEXT:CoreTextNotification
+ * messages, followed by RPC_REPLY_RESULT containing the output
+ * of the function if it succeeded, or RPC_REPLY_FAIL with the
+ * error code if it did not.
+ *
+ * 3. Disconnect
+ *
+ * The client terminates the connection by sending an
+ * RPC_REQUEST_QUIT header with zero size and immediately
+ * closing the socket.
+ */
+
+ public class RPCFunctionBase
+ {
+
+ public message_type p_in_template;
+ public message_type p_out_template;
+
+ public message_type make_in()
+ {
+ return (message_type)Activator.CreateInstance(p_in_template.GetType());
+ }
+
+ public message_type input()
+ {
+ if (p_in == null) p_in = make_in();
+ return p_in;
+ }
+
+ public message_type make_out()
+ {
+ return (message_type)Activator.CreateInstance(p_out_template.GetType());
+ }
+
+ public message_type output()
+ {
+ if (p_out == null) p_out = make_out();
+ return p_out;
+ }
+
+ public void reset(bool free = false)
+ {
+ if (free)
+ {
+ p_in = null;
+ p_out = null;
+ }
+ else
+ {
+ if (p_in != null)
+ p_in = (message_type)Activator.CreateInstance(p_in.GetType());
+ if (p_out != null)
+ p_out = (message_type)Activator.CreateInstance(p_out.GetType());
+ }
+ }
+
+ public RPCFunctionBase(message_type input, message_type output)
+ {
+ p_in_template = input;
+ p_out_template = output;
+ p_in = null;
+ p_out = null;
+ }
+ ~RPCFunctionBase()
+ {
+ p_in = null;
+ p_out = null;
+ }
+
+ message_type p_in;
+ message_type p_out;
+ }
+
+ public class RemoteFunctionBase : RPCFunctionBase
+ {
+ public bool bind(RemoteClient client, string name,
+ string proto = "")
+ {
+ return bind(client.default_output(), client, name, proto);
+ }
+ public bool bind(color_ostream output,
+ RemoteClient client, string name,
+ string proto = "")
+ {
+ if (isValid())
+ {
+ if (p_client == client && this.name == name && this.proto == proto)
+ return true;
+
+ output.printerr("Function already bound to %s::%s\n",
+ this.proto, this.name);
+ return false;
+ }
+
+ this.name = name;
+ this.proto = proto;
+ this.p_client = client;
+
+ return client.bind(output, this, name, proto);
+ }
+
+ public bool isValid() { return (id >= 0); }
+
+ public RemoteFunctionBase(message_type input, message_type output)
+ : base(input, output)
+ {
+ p_client = null;
+ id = -1;
+ }
+
+ protected color_ostream default_ostream()
+ {
+ return p_client.default_output();
+ }
+
+ bool sendRemoteMessage(Socket socket, Int16 id, MemoryStream msg)
+ {
+ List buffer = new List();
+
+ RPCMessageHeader header = new RPCMessageHeader();
+ header.id = id;
+ header.size = (Int32)msg.Length;
+ buffer.AddRange(header.ConvertToBtyes());
+ buffer.AddRange(msg.ToArray());
+
+ int fullsz = buffer.Count;
+
+ int got = socket.Send(buffer.ToArray());
+ return (got == fullsz);
+ }
+
+ protected command_result execute(color_ostream outString, Input input, Output output)
+ where Input : message_type, new()
+ where Output : message_type, new()
+ {
+ if (!isValid())
+ {
+ outString.printerr("Calling an unbound RPC function %s::%s.\n",
+ this.proto, this.name);
+ return command_result.CR_NOT_IMPLEMENTED;
+ }
+
+ if (p_client.socket == null)
+ {
+ outString.printerr("In call to %s::%s: invalid socket.\n",
+ this.proto, this.name);
+ return command_result.CR_LINK_FAILURE;
+ }
+
+ MemoryStream sendStream = new MemoryStream();
+
+ ProtoBuf.Serializer.Serialize(sendStream, input);
+
+ long send_size = sendStream.Length;
+
+ if (send_size > RPCMessageHeader.MAX_MESSAGE_SIZE)
+ {
+ outString.printerr("In call to %s::%s: message too large: %d.\n",
+ this.proto, this.name, send_size);
+ return command_result.CR_LINK_FAILURE;
+ }
+
+ if (!sendRemoteMessage(p_client.socket, id, sendStream))
+ {
+ outString.printerr("In call to %s::%s: I/O error in send.\n",
+ this.proto, this.name);
+ return command_result.CR_LINK_FAILURE;
+ }
+
+ color_ostream_proxy text_decoder = new color_ostream_proxy(outString);
+ CoreTextNotification text_data;
+
+ output = new Output();
+ //return command_result.CR_OK;
+
+ while (true)
+ {
+ RPCMessageHeader header = new RPCMessageHeader();
+ byte[] buffer = new byte[8];
+
+ if (!RemoteClient.readFullBuffer(p_client.socket, buffer, 8))
+ {
+ outString.printerr("In call to %s::%s: I/O error in receive header.\n",
+ this.proto, this.name);
+ return command_result.CR_LINK_FAILURE;
+ }
+
+ header.id = BitConverter.ToInt16(buffer, 0);
+ header.size = BitConverter.ToInt32(buffer, 4); //because something, somewhere, is fucking retarded
+
+ //outString.print("Received %d:%d.\n", header.id, header.size);
+
+
+ if ((DFHackReplyCode)header.id == DFHackReplyCode.RPC_REPLY_FAIL)
+ if (header.size == (int)command_result.CR_OK)
+ return command_result.CR_FAILURE;
+ else
+ return (command_result)header.size;
+
+ if (header.size < 0 || header.size > RPCMessageHeader.MAX_MESSAGE_SIZE)
+ {
+ outString.printerr("In call to %s::%s: invalid received size %d.\n",
+ this.proto, this.name, header.size);
+ return command_result.CR_LINK_FAILURE;
+ }
+
+ byte[] buf = new byte[header.size];
+
+ if (!RemoteClient.readFullBuffer(p_client.socket, buf, header.size))
+ {
+ outString.printerr("In call to %s::%s: I/O error in receive %d bytes of data.\n",
+ this.proto, this.name, header.size);
+ return command_result.CR_LINK_FAILURE;
+ }
+
+ switch ((DFHackReplyCode)header.id)
+ {
+ case DFHackReplyCode.RPC_REPLY_RESULT:
+ output = ProtoBuf.Serializer.Deserialize