Jump to content

Mal0v

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Mal0v

  1. Hey there,
    I've been struggeling with something. I'm building a website for our "squadron". All our dedicaated DCS servers run with a dedicated account. This way, when you log in with this account, you can see all out servers here https://www.digitalcombatsimulator.com/en/personal/server/. I figured out when you are logged in and access this link https://www.digitalcombatsimulator.com/en/personal/server/?login=yes&ajax=y you get a json object with all servers.
    So I thought I could make a API request to this site, get the json object and then list our servers on our website.

    The problem is the backend needs to log in first to access the API. I figured out you can just call this link https://www.digitalcombatsimulator.com/en/personal/server/?login=yes&ajax=y, fill out the login form and you're in. When using the browser tools it seems like you just need to send a post request with the data from the screenshot.

    Screenshot 2024-05-24 141509.png

    But when doing this with the backend of my website the request returns a 400 Bad Request error. At this point I'm stuck. I tried several different approaches, but couldn't succeed.

    Any help on this would be appriciated.

    Best Regards

     


    The Code (might be still messy):

    const express = require('express');
    const axios = require('axios');
    const qs = require('qs')
    const cheerio = require('cheerio')
    
    const app = express();
    const PORT = 3000;
    
    const DCS_LOGIN_URL = 'https://www.digitalcombatsimulator.com/en/auth/login/';
    const DCS_SERVER_STATUS_URL = 'https://www.digitalcombatsimulator.com/en/personal/server/?login=yes&ajax=y';
    
    // Login credentials
    const username = 'sdhgfhsdb';
    const password = 'auosgfdua';
    
    async function getSessid() {
        try {
            const response = await axios.get(DCS_LOGIN_URL);
            const $ = cheerio.load(response.data);
            const sessid = $('input[name="sessid"]').val();
            return sessid;
        } catch (error) {
            console.error('Error when loading login site:', error);
            throw new Error('Error when loading login site.');
        }
    }
    
    async function loginToDCSAndGetServerStatus(sessid) {
        const payload = {
            sessid: sessid,
            AUTH_FORM: 'Y',
            TYPE: 'AUTH',
            backurl: '/en/personal/server/?ajax=y',
            USER_LOGIN: username,
            USER_PASSWORD: password,
            Login: ''
        };
    
        try {
            const response = await axios.post(DCS_SERVER_STATUS_URL, qs.stringify(payload), {
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded',
                },
                withCredentials: true
            });
            return response;
        } catch (error) {
            console.error('Login failed:', error);
            throw new Error('Login failed.');
        }
    }
    
    app.get('/api/dcs-server-list', async (req, res) => {
        try {
            const sessid = await getSessid()
            const response = await loginToDCSAndGetServerStatus(sessid);
            console.log(response);
            res.json(response.data);
        } catch (error) {
            res.status(500).json({ error: error.message });
        }
    });
    
    app.listen(PORT, () => {
        console.log(`Server runs on port ${PORT}`);
    });
  2. vor 6 Minuten schrieb Rudel_chw:

     

    Thank you so much for this fix ... this was before applying it:

     

    2SL965B.jpg

     

    and this is how it works once the fix is applied:

     

    Ro58I6V.jpg

     

    👍🙏

     

    Still looks a bit strange, maybe I forgot to put the roughmets in the fix, but for me it defenetly looks better:

    Screen_240217_213232.png

    vor 2 Stunden schrieb EA-18G_BlockII:

    Thanks, can you fix the V-22 also?

    Not for now sorry.

  3. Am 16.2.2024 um 07:17 schrieb EA-18G_BlockII:

    can you see if you can fix the V-22 and A400 livery's issue? @Beldin

    Hey,
    I just fixed the A400M issues, took me like 10 min. The alpha channel of almost all .dds files was set to 0 (0% opacity), just changed it to 1 and added MipMaps while exporting.

    Just copy the contents of this folder to the original Mod folder.

    Best regards ^^

     

    Edit: Please also install these files:

    Edit 2: I uploaded the whole fix to Google drive: https://drive.google.com/file/d/1qG5hM3u0YvLBgKcvVBIasV9n5tt15WKr/view?usp=sharing

    Military Aircraft Mod A400M fixed.zip

    • Like 2
    • Thanks 5
  4. Hey,

    I suppose this is a custom livery?

    I had issues whith numbers too after the 2.9 update. They changed some things in the description.lua.

    I can't really recall how I fixed it, but maybe my description.lua can help you figure it out. Note that on my livery I wanted all numbers disabled, because it has the numbers in the .dds file, directly on the livery. I think setting the custom_args at the bottom of the file to 1 did it for me.

    description.lua

  5. Hey there,

    while playing with my friends yesterday I noticed a strange behaviour with the radar/SA page.

    on the screenshot you can see a trackfile behind the aircraft, that was created while the radar was in standby.

    I'm not entirly sure if it was created after I passed the contact or maybe when we were on top of each other.

    On the track file it's mission time 9:46:56. Unfortunatly I can't append the track file because it's to big (87.5MB), so I uploaded it to google drive: https://drive.google.com/file/d/1XqVjWPdwfkp51YqfY8bR9LhZUAP98QZN/view?usp=drive_link.

    Maybe someone can tell me an alternitive to share bigger files, because I would rather not use google drive or any other cloud.

     

    EDIT:

    openbeta 2.9.2.49940 on multiplayer server with multithreading client
    Screen_240217_094342.png

  6. (I hope this text is in understandable english)
    Hey folks!

    I noticed AWACS and other Planes in the datalink network will share track files wether they are set as donor/member or not. AWACS will donate track files at any time, like Wags said in the introduction Video, but on the SA page the AWACS is not visible as donor (left dot on HAFU symbol misses).

    The other Fighters (tested with another F/A-18C) don't share track files, when not engaging the target. However, if enganging the target, track files are shared wether the flight is set as donor/member or not.

    These problems occure in singleplayer and multiplayer.


    I appended a Mission file, where you can test this behaviour. There are some instructions in the Situation text. Also appended the log.

    It's my first bug report ever, so I hope I did everything correctly with reporting.
    Best regards
     

    dcs.log datalinkTest.miz

    • Like 1
×
×
  • Create New...