Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - drgullen

Pages: [1]
Suggestions to add to VAM and SIM ACARS / CKEditor
« on: September 21, 2019, 08:51:48 AM »
There is an updated version of the WYSIWYG editor that is within the "Web Configurations" section in the Administrator Panel of VAM.  The editor is made by CKEditor and the downloads are here:

I downloaded and installed the full package and now my Web Configurations editor looks like this:

Here's how to install it:

1) Download whichever package you want (I recommend the full one).
2) Make a backup of the current ckeditor folder just in case.  It is located at /vamcore/app/webroot/js.
3) Copy the whole folder somewhere else for safe keeping.
4) Inside the download zip file, you should see another CKEditor folder.
5) Extract the entire contents of that folder into the /vamcore/app/webroot/js/ckeditor folder, overwriting all files.
6) Stop and restart your Apache Web Server.

If you click on the question mark in the editor now, if it says version 4.12.1, you're on the new version!

Support for VAM 2.4 - 2.6 / How to tell if SIM ACARS is connected
« on: January 16, 2018, 07:27:04 AM »

I have experienced something that I believe others have as well.  Today, for the first time, I had a pilot book and fly a regular scheduled flight, but when I went to the Flight Validator to review it, it was listed as a charter flight.  I know for a fact that he had booked this ahead of time because I saw it on the website.  He also confirms that he imported the flight into SIM ACARS, so it should have counted as a regular flight.


I think I know what happened.

There is a hole in the VAM system code as it exists right now that I think affects every VAM user and it is this:  If your pilot is about to fly his booked flight, has launched SIM ACARS, has connected to the website with SIM ACARS, has imported the booked flight into SIM ACARS, but has NOT yet clicked "Start Track" to begin logging his flight and during this period of time, his "booking window" of 24 hours (or in the case of my VA, I changed it to 12 hours) expires, the code within review_reserves.php will null out the route_id in the gvausers table for that pilot if that file is executed (i.e. if someone opens the website which is the trigger for that code).

Later, when the pilot submits the PIREP (since he has no idea anything is wrong), your code to check the route_id in receivevampirep.php does not return any rows when the route_id is null, so because no rows are returned from that query, it thinks it is a charter flight.  I tested this myself here locally by running the query in that file directly against my database, which is this:

select * from gvausers gu, routes r where gu.gvauser_id="' . $gvauser_id . '" and gu.route_id <> 0 and r.departure="' . $dep . '" and r.arrival="' . $arr . '" and gu.route_id=r.route_id;

Sure enough, when I set my route_id to null for my gvauser_id, this query returns no rows.  If the route_id is present for my user, it returns 1 row as expected.

In my case this morning, I logged on to our website as he was setting up his flight which he booked last night, so I myself triggered this error in his case.  Typical CEO screwing everything up, am I right?  :)

This leads me to the title of my post.  The possible solution here would be to have the review_reserves.php code check to see if that pilot has an active SIM ACARS connection to the website.  If he/she is getting ready to fly the flight, we don't want to cancel the booking, even if it is about to expire.  This line of code in review_reserves.php would change from:

if (($diffdays)>$limit)


if (($diffdays)>$limit and {some code here to check if pilot is NOT connected via SIM ACARS})

The removal of the booking and nullifying of the route_id would then only occur if the time is up and the user is not logged on.  After this, when the pilot does connect using SIM ACARS, he would notice that he was not prompted to import his booked flight, which would lead him to log on to the website, where he would see it is no longer booked.  He could then just book it again and all is well.

So, the question is, are we able to check SIM ACARS connections to our websites and if so, how?  I assume when we click the "Login" button on SIM ACARS that some PHP code is executed somewhere on the website to register us in the system as "connected", I'm just not sure which code does that.


New and Announcements / Introducing EventAir
« on: December 17, 2017, 05:40:31 AM »
Built using VAM 2.6.2 as its codebase, EventAir caters to a specific type of plane - the Boeing Business Jet - which we use to deliver our virtual clients to their global events in style!  We were designed with a particular model in mind - the iFly 737NG BBJ3, but if you don't own that aircraft, you are welcome to fly any other plane suitable for the flight.

We are in the final weeks of testing and we plan to launch the airline on Monday, January 1, 2018.  Here are just some of the things we will offer at EventAir:

  • A fully-functional financial system, with parameters based on real-world BBJ operations and a goal of eventually turning a profit at the airline
  • 5 hubs across 4 continents with a mixture of time-dependent event-related scheduled flights across the globe as well as Charter Periods where you can fly our BBJ3 fleet to wherever you like
  • SIM ACARS as our method of filing pilot reports, which supports FS9, FSX, P3D and X-Plane
  • Promotion in rank is based on your abilities as a pilot and not accumulation of hours or points
  • Pilots earn EAD (EventAir Dollars) for each flight, which is our fictional currency used to purchase things like Promotion Exams
  • A Help Desk ticketing system, allowing you to submit and keep track of any issues or requests you have
  • Voice communication using our Discord server

If you are a fan of the 737, you should check us out!  We'll be servicing some interesting events in 2018, including:

  • The 52nd edition of the Super Bowl in Minneapolis
  • The annual ascent up Mount Everest which begins with flights into Kathmandu
  • The Cannes Film Festival in France
  • The FIFA World Cup in Russia

My thanks to Alejandro Garcia for all his hard work over the years in creating VAM and SIM ACARS.  This virtual airline would not exist without his efforts!  Gracias SeƱor!

Glen Brown, CEO, EventAir

At the moment, it seems you have a margin of error of only 500 feet before SIM ACARS will flag you for having the lights either on above 10,000 feet or off below 10,000 feet.

If, for example, you are flying a plane such as the PMDG or iFly 737 and you have VNAV enabled, you can literally pass through 500 feet of altitude in a matter of just a few seconds.  I have had it where my co-pilot says to me "Passing 10,000 feet, Captain" but we are climbing at such a fast vertical speed that I'm through 10,500 before I have a chance to look up in my VC and flick the light switches off and at that point, SIM ACARS penalizes me.

This seems a bit harsh to me, so if possible, I suggest an internal timer that begins counting for perhaps 60 seconds.  So, if climbing for example, once you are through 10,000 feet, you have 60 seconds to turn off the landing lights before you get penalized.  The same for descending below 10,000 feet when the lights should be turned on.  This way, it doesn't matter how fast or slow you are climbing or descending, you'll have time to operate the light switches.

Support for VAM 2.4 - 2.6 / Crashed or Abandoned Charter Flights
« on: November 09, 2017, 04:57:32 AM »
I did a test to see what would happen in this scenario:

I have a charter flight that is not completed -- in my example, I abandoned the flight while I was still at the gate boarding, but this would also apply if your sim or computer crashed during any portion of your flight prior to being able to file a PIREP for it.

After the abandonment or crash, that plane is still listed as Booked on the Fleets page.  I waited more than 24 hours to see if it would free itself, but it didn't.  I have added this code to the WELCOME_VA section of main_index.php to account for this:

                     $db = new mysqli($db_host , $db_username , $db_password , $db_database);
                     if ($db->connect_errno > 0) {
                        die('Unable to connect to database [' . $db->connect_error . ']');
                     $sql = "select welcome_text from web_configurations";
                     if (!$result = $db->query($sql)) {
                        die('There was an error running the query [' . $db->error . ']');
                     while ($row = $result->fetch_assoc()) {
                              echo $row["welcome_text"];
// ---------------------------NEW CODE STARTS HERE ----------------------------------------------------------------------
                     $sql2 = "select * from vam_live_flights where gvauser_id in (select gvauser_id from fleets where booked=1)";

                     if (!$result2 = $db->query($sql2)) {
                        die('There was an error running the query  [' . $db->error . ']');

                     $row_cnt = $result2->num_rows;

                     if ($row_cnt == 0) {

                        $sql = "update fleets set booked=0 ,gvauser_id=NULL , booked_at=NULL where booked=1 and hangar=0 and fleet_id not in (select fleet_id from reserves) and (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(booked_at)) > 3600";

                        if (!$result = $db->query($sql)) {
                           die('There was an error running the query [' . $db->error . ']');
// ---------------------------NEW CODE ENDS HERE ----------------------------------------------------------------------

For those of you who don't speak PHP/SQL, essentially what this does is free up any booked aircraft, so long as that aircraft is not currently being flown by the person who booked it, wasn't booked via the website (i.e. it's a charter flight and not a regular flight) and isn't currently in the hangar for maintenance.

The number 3600 near the end there represents the time in seconds, so I have it set to 1 hour.  So, on my system, if your flight ends prematurely for whatever reason, you have 1 hour to restart it, otherwise the plane is freed up for somebody else to use.  If you want to free it up sooner or later than 1 hour, just change the 3600 to whatever amount (in seconds) you want.

I hope this helps someone.



I did a flight today from Moscow (UUDD) to Saint Petersburg (ULLI).  After I landed and shut down the engines, I clicked "End Flight" in SIM ACARS.  It then generated my Flight Report as normal.  When I clicked on the "Send Report" button however, it first gave me an error saying "Report from logbook.  This flight is already reported to the web system" and then after I click OK to that message, another pop up shows up saying "During data transmission some data inconsistency was found.  Please close any program consuming huge bandwidth of your network and report again."  No matter what I do, even with all other programs closed, I get those two messages each time I try and send the report.

On the website, it shows my location and the plane's location now as ULLI, but in my Pilot Log, the flight is not listed.  There is also nothing listed in the Flight Validator menu on the Administration panel.  So, the Fleet menu and my location field show that I flew the flight, but there is no flight data for it in my profile.

I have several questions about this:

1)  What causes this error?
2)  What is SIM ACARS looking at for it to believe that the log was already sent?
3)  Is there a row in some table that I can delete to allow the log to be sent again?  If not, how do I get this flight reported properly?

FYI, I am on SIM ACARS 1.4.0 with VAM 2.5.2 using Apache 2.2 and PHP 5.6


Support for SIM ACARS / Connect to DEMO25?
« on: September 04, 2016, 05:48:16 AM »
I was wondering if I can use the VAM DEMO25 website to test SIM ACARS with?  If so, what callsign and password do I use and also what do I put for the VA ACARS URL in that case?


Support for Installation / Currency Error after login attempt
« on: August 28, 2016, 06:31:07 AM »

I have just installed VAM locally on my computer with Windows 7 / IIS 7.5 / MySQL 5.7 / PHP 7.

Everything seems to work except when I try to login as the default VAM100 pilot, I get these messages displayed on http://localhost/vam/vam/index_vam.php:

PHP Notice:  Undefined variable: currency in C:\inetpub\wwwroot\vam\vam\pilot_profile_row1.php on line 79
PHP Notice:  Undefined offset: 0 in C:\inetpub\wwwroot\vam\vam\pilot_flights_map.php on line 205
PHP Notice:  Undefined offset: 0 in C:\inetpub\wwwroot\vam\vam\pilot_flights_map.php on line 205

I did not see any reference in the manual of having to define a currency anywhere.  I ran all 6 of the SQL script files in the right order (schema first, then 1 through 5).  Was I supposed to run something else?

I am unable to view any of the admin functions until I get past this error.  Does anyone know how to resolve this?


Pages: [1]