public FurnitureData() { name = ""; furniture_id = ushort.MaxValue; worth = 0; flags = new bool[6]; flags[(int)FFLAGS.PASSABLE] = true; message = ""; actions_proximity = ""; actions_time = ""; actions_click = ""; actions_power = ""; image_frames = new Dictionary <int, FrameFurniture>(); facets = new List <FrameFacet>(); //state power production and usage remain uninstantiated... null means there is none! power_storage = 0; max_power_storage = 0; materials = new Dictionary <string, byte>(); //craft_require can also be uninstantiated... null means there is none! state_item_draw = 0; share_power = 255; timeout = 0; craft_require = new string[0]; complexity = 0; default_connection_make = ItemConnectionType.Default; vehicle_properties = ""; }
public ItemConnector(Lidgren.Network.NetIncomingMessage r) { conn_type = (ItemConnectionType)r.ReadByte(); target_type = (TargetType)r.ReadByte(); target_id = r.ReadInt32(); data_one = r.ReadInt32(); data_two = r.ReadInt32(); }
public ItemConnector(System.IO.BinaryReader r) { conn_type = (ItemConnectionType)r.ReadByte(); target_type = (TargetType)r.ReadByte(); target_id = r.ReadInt32(); data_one = r.ReadInt32(); data_two = r.ReadInt32(); }
public ItemConnector(int ptarget_id, TargetType t, ItemConnectionType ict, int d1, int d2) { conn_type = ict; target_type = t; target_id = ptarget_id; data_one = d1; data_two = d2; }
public void receive_furniture_connection(NetIncomingMessage p, Display d, World w) { int player_id = p.ReadByte(); if (!Exilania.game_server && w != null && w.players.Count > player_id) { int furn_from = w.map[p.ReadUInt16(), p.ReadUInt16()].furniture_index; int furn_to = w.map[p.ReadUInt16(), p.ReadUInt16()].furniture_index; ItemConnectionType t = (ItemConnectionType)p.ReadByte(); w.furniture[furn_from].connections.Add(new ItemConnector(furn_to, TargetType.Furniture, t, 0, 0)); } }
public void send_furniture_connection(Point furn_from, Point furn_to, ItemConnectionType t) { NetOutgoingMessage p = udp_client.CreateMessage(); p.Write((byte)15); p.Write((byte)Exilania.game_my_user_id); p.Write((ushort)furn_from.X); p.Write((ushort)furn_from.Y); p.Write((ushort)furn_to.X); p.Write((ushort)furn_to.Y); p.Write((byte)t); udp_client.SendMessage(p, NetDeliveryMethod.ReliableOrdered, 4); }
public void receive_furniture_connection(NetIncomingMessage p, Display d, World w) { int player_id = p.ReadByte(); int furn_from = w.map[p.ReadUInt16(), p.ReadUInt16()].furniture_index; int furn_to = w.map[p.ReadUInt16(), p.ReadUInt16()].furniture_index; ItemConnectionType t = (ItemConnectionType)p.ReadByte(); if (player_id != Exilania.game_my_user_id) { w.furniture[furn_from].connections.Add(new ItemConnector(furn_to, TargetType.Furniture, t, 0, 0)); } NetOutgoingMessage i = udp_server.CreateMessage(); i.Write((byte)15); i.Write((byte)player_id); i.Write((ushort)w.furniture[furn_from].top_left.X); i.Write((ushort)w.furniture[furn_from].top_left.Y); i.Write((ushort)w.furniture[furn_to].top_left.X); i.Write((ushort)w.furniture[furn_to].top_left.Y); i.Write((byte)t); udp_server.SendToAll(i, p.SenderConnection, NetDeliveryMethod.ReliableOrdered, 4); }