Jump to content

Detect dedicated server with variable


Recommended Posts

Hi,

 

is it possible to detect if a server is using dedicated server mode by lua variable? or from a table information?

 

Thanks

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Hi,

 

is it possible to detect if a server is using dedicated server mode by lua variable? or from a table information?

 

Thanks

 

Really I don't know if ED store this information in a Variable suitable and usable by script, making some test I notice this:

2020-03-10 11:05:34.002 INFO Dedicated Server: Mission list is empty, server not started.

When you start dedicated server without populate server settings like mission etc.

 

Taking a deep look, unfortunately seams this result it's not driven by a variable, but rather seams hard coded in the dedicatedServerGUI.lua and webGUI.lua files, but they are also available on standalone installation and doesn't seems to contain any usable stuff.

 

Going further, on a clean installation of standalone vs dedicated server , what I can see it's some difference on serverSettings.lua, where dedicated server has some specific value that I didn't see when hosting a mission with clean standalone installation.

 

dedicated_server_dcs.png

 

in this example you can see there is the cfg table containing:

["uri"] = "setServerSettings",
and is only present in dedicated server settings.

Unfortunately, cfg seems not accessible via scripting, I try to dump it by MissionScripting.lua but i got nil.

I don't know if someone know how to access it, but if u get the chance to read it, could be the possibile "condition" to understand if it's dedicated server or not.

 

It's still not a real method, since sysadmin can copy/paste the serverSettings.lua file from personal standalone installation and put on dedicated server to make the edit simpler ( I admit I also done it before, and suggest this method as workaround for server description and some other missing feature of the WebGUI for dedicated server )

 

p.s loading serverSettings.lua from standalone to dedicated doesn't prevent the dedicated server to start, it's run normally! :cry:


Edited by Maverick87Shaka

FlighRIG => CPU: RyZen 5900x | RAM: 64GB Corsair 3000Mhz | GPU: nVIDIA RTX 4090 FE | OS Storage: SSD NVMe Samsung 850 Pro 512GB, DCS Storage: SSD NVMe Sabrent 1TB | Device: Multipurpose-UFC, VirPil T-50, TM WARTHOG Throttle, TrackHat, MFD Cougar with screen.

Our Servers => [ITA] Banshee | Krasnodar - PvE | PersianConquest PvE Live Map&Stats | Syria Liberation PvE Conquest

Support us on twitch subscribing with amazon prime account linked, it's free!

Link to comment
Share on other sites

Really I don't know if ED store this information in a Variable suitable and usable by script, making some test I notice this:

 

When you start dedicated server without populate server settings like mission etc.

 

Taking a deep look, unfortunately seams this result it's not driven by a variable, but rather seams hard coded in the dedicatedServerGUI.lua and webGUI.lua files, but they are also available on standalone installation and doesn't seems to contain any usable stuff to.

 

Going further, on a clean installation of standalone vs dedicated server , what I can see it's some difference on serverSettings.lua, where dedicated server has some specific value that I didn't see when hosting a mission with clean standalone installation.

 

dedicated_server_dcs.png

 

in this example you can see there is the cfg table containing:

 

and is only present in dedicated server settings.

Unfortunately, cfg seems not accessible via scripting, I try to dump it by MissionScripting.lua but i got nil.

I don't know if someone know how to access it, but if u get the chance to read it, could be the possibile "condition" to understand if it's dedicated server or not.

 

It's still not a real method, since sysadmin can copy/past the serverSettings.lua file from personal standalone installation and put on dedicated server to make the edit simpler ( I admit I also done it before, and suggest this method as workaround for server description and some other missing feature of the WebGUI for dedicated server )

 

p.s loading serverSettings.lua from standalone to dedicated doesn't prevent the dedicated server to start, it's run normally! :cry:

 

I already edit serversetting in my project, which is running in plugin env. I'll check about that variable consistency between install. Thanks!

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

ok it seems that if someone works with "--server" mode, he has that "uri" variable, while local version does not, even if hosting something. It could be interesting to understand what variable of the DCS.exe does the trick, if the nographic or server. Anyway, I probably found a viable solution.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

ok it seems that if someone works with "--server" mode, he has that "uri" variable, while local version does not, even if hosting something. It could be interesting to understand what variable of the DCS.exe does the trick, if the nographic or server. Anyway, I probably found a viable solution.

I can make some test if you want, i've spare machine to do that, i just don't know how to access cfg table, I still have lot of stuff to learn about coding for DCS :book:

FlighRIG => CPU: RyZen 5900x | RAM: 64GB Corsair 3000Mhz | GPU: nVIDIA RTX 4090 FE | OS Storage: SSD NVMe Samsung 850 Pro 512GB, DCS Storage: SSD NVMe Sabrent 1TB | Device: Multipurpose-UFC, VirPil T-50, TM WARTHOG Throttle, TrackHat, MFD Cougar with screen.

Our Servers => [ITA] Banshee | Krasnodar - PvE | PersianConquest PvE Live Map&Stats | Syria Liberation PvE Conquest

Support us on twitch subscribing with amazon prime account linked, it's free!

Link to comment
Share on other sites

I'll contact you asap (See discord ;) )

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

uri variable worked: it exist only in dedi server loading, for those who need this.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

  • 3 years later...
On 3/17/2020 at 4:21 AM, chromium said:

uri variable worked: it exist only in dedi server loading, for those who need this.

could you explain how you got access to the uri (or anything else in serverSettings.lua) through the scripting engine? I'd like to be able to determine which dedicated server my mission is running on, so I can through script manipulate the SRS port being used in a lua file.

Thanks,

Link to comment
Share on other sites

Il 26/9/2023 at 19:59, Zyll ha scritto:

could you explain how you got access to the uri (or anything else in serverSettings.lua) through the scripting engine? I'd like to be able to determine which dedicated server my mission is running on, so I can through script manipulate the SRS port being used in a lua file.

Thanks,

It's not possibile in SSE, only in plugin env... but now I'm not using anymore cause to detect if it's a server or not I simply launch DCS.getConfigValue("norender"). Always in plugin env, obviously.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...