Board index FlightGear Support Multiplayer

Delete MP contacts with timeout?

Trouble getting online, setting up a server?
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- copy&paste your commandline.

Please, also see Requesting Technical Help.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

Delete MP contacts with timeout?

Postby Manus » Fri Dec 14, 2018 11:55 pm

Is there a way to automatically delete old, no longer updated multiplayer contacts from /ai/models/ ?

I work on a FG to DIS (Distributed Interactive Simulation) Server which transfers contacts from FG to DIS and back. A DIS scenario contains about 100 contacts (Air, Land and Sea) All are transfered to FG as multiplayer contacts.

Currently contacts which are no longer be send by a player are staying in the property tree till reload of FG. I a DIS environment this behavior is cause some problems because all contacts are staying in the tree, including missiles bombs and so on.

So, a way to delete these contacts would be nice.
Posts: 6
Joined: Thu Jun 07, 2018 9:20 am

Re: Delete MP contacts with timeout?

Postby wkitty42 » Sat Dec 15, 2018 5:08 pm

this is normal and how the AI system works... you need to check/set the "valid" property true or false when the contacts are ""live"" or not... if you're reading them for other work (eg: in a script) and the "valid" property is false then just skip to the next one...

these records are kept around to prevent memory fragmentation, AFAICT... once allocated, the record is retained and used over and over... sometimes, when i leave my fg running for days, i see AI property records with tens of uses as different craft/callsigns over that time period... count the number of "type" properties each model has and you can tell how many times that record has been reused over the time period the AI manager has been running ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
Posts: 7051
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Return to Multiplayer

Who is online

Users browsing this forum: No registered users and 1 guest