public void SendUserDialog(string first, string last, string objectName, string message, string[] buttons) { Random rand = new Random(); ScriptDialogPacket packet = new ScriptDialogPacket(); packet.Data.ObjectID = UUID.Random(); packet.Data.FirstName = Utils.StringToBytes(first); packet.Data.LastName = Utils.StringToBytes(last); packet.Data.ObjectName = Utils.StringToBytes(objectName); packet.Data.Message = Utils.StringToBytes(message); packet.Header.Reliable = true; packet.Type = PacketType.ScriptDialog; packet.Data.ChatChannel = (byte)rand.Next(1000, 10000); packet.Data.ImageID = UUID.Zero; ScriptDialogPacket.ButtonsBlock[] temp = new ScriptDialogPacket.ButtonsBlock[buttons.Length]; for (int i = 0; i < buttons.Length; i++) { temp[i] = new ScriptDialogPacket.ButtonsBlock(); temp[i].ButtonLabel = Utils.StringToBytes(buttons[i]); } packet.Buttons = temp; proxy.InjectPacket(packet, Direction.Incoming); }
private void SendUserDialog(string first, string last, string objectName, string message, string[] buttons) { Random rand = new Random(); ScriptDialogPacket packet = new ScriptDialogPacket(); packet.Data.ObjectID = UUID.Random(); packet.Data.FirstName = Utils.StringToBytes(first); packet.Data.LastName = Utils.StringToBytes(last); packet.Data.ObjectName = Utils.StringToBytes(objectName); packet.Data.Message = Utils.StringToBytes(message); packet.Data.ChatChannel = (byte)rand.Next(1000, 10000); packet.Data.ImageID = UUID.Zero; ScriptDialogPacket.ButtonsBlock[] temp = new ScriptDialogPacket.ButtonsBlock[buttons.Length]; for (int i = 0; i < buttons.Length; i++) { temp[i] = new ScriptDialogPacket.ButtonsBlock(); temp[i].ButtonLabel = Utils.StringToBytes(buttons[i]); } packet.Buttons = temp; proxy.InjectPacket(packet, Direction.Incoming); }