[announcer]Failed to read announce response

Started by KAKAN, Jul 30, 2016, 08:05 AM

Previous topic - Next topic

KAKAN

Quote from: EK.CrystalBlue on Jul 31, 2016, 07:25 AMWhat? Its supposed to be a TCP!
node.js http | express all run on TCP. you might need  to write your own module that http on UDP
@EK.CrystalBlue please do read the documentation before saying something:-
https://nodejs.org/api/dgram.html
oh no

EK.IceFlake

THIS IS NOT A FREAKING HTTP MODULE!
this is a socket. sockets can on tcp and udp in almost all languages

KAKAN

Quote from: EK.CrystalBlue on Jul 31, 2016, 07:41 AMTHIS IS NOT A FREAKING HTTP MODULE!
this is a socket. sockets can on tcp and udp in almost all languages
YOU ARE A FREAKING IDIOT! YOU NEED TO CONNECT TO THE VCMP SERVER USING UDP!
Masterlist is done with HTTP, not the query system -_-
oh no

EK.IceFlake

OKAY I AM NOT A FREAKING IDIOT
the reason I thought it was http was because of slc reply

Thijn

Quote from: KAKAN on Jul 31, 2016, 07:43 AM
Quote from: EK.CrystalBlue on Jul 31, 2016, 07:41 AMTHIS IS NOT A FREAKING HTTP MODULE!
this is a socket. sockets can on tcp and udp in almost all languages
YOU ARE A FREAKING IDIOT! YOU NEED TO CONNECT TO THE VCMP SERVER USING UDP!
Masterlist is done with HTTP, not the query system -_-
The error you posted says your HTTP reply is wrong, which is why any sane person would assume that's where you need help with.

KAKAN

Quote from: Thijn on Jul 31, 2016, 09:42 AM
Quote from: KAKAN on Jul 31, 2016, 07:43 AM
Quote from: EK.CrystalBlue on Jul 31, 2016, 07:41 AMTHIS IS NOT A FREAKING HTTP MODULE!
this is a socket. sockets can on tcp and udp in almost all languages
YOU ARE A FREAKING IDIOT! YOU NEED TO CONNECT TO THE VCMP SERVER USING UDP!
Masterlist is done with HTTP, not the query system -_-
The error you posted says your HTTP reply is wrong, which is why any sane person would assume that's where you need help with.
But I followed the same things as shown in ysc's masterlist. Can you tell me what HTTP reply shall I give? I found nothing in ysc's masterlist.
Anyways, why isn't the server responding to my UDP message?
oh no

Thijn

Quote from: KAKAN on Jul 31, 2016, 02:41 PM
Quote from: Thijn on Jul 31, 2016, 09:42 AM
Quote from: KAKAN on Jul 31, 2016, 07:43 AM
Quote from: EK.CrystalBlue on Jul 31, 2016, 07:41 AMTHIS IS NOT A FREAKING HTTP MODULE!
this is a socket. sockets can on tcp and udp in almost all languages
YOU ARE A FREAKING IDIOT! YOU NEED TO CONNECT TO THE VCMP SERVER USING UDP!
Masterlist is done with HTTP, not the query system -_-
The error you posted says your HTTP reply is wrong, which is why any sane person would assume that's where you need help with.
But I followed the same things as shown in ysc's masterlist. Can you tell me what HTTP reply shall I give? I found nothing in ysc's masterlist.
Anyways, why isn't the server responding to my UDP message?
I'd first enable verbose mode on the plugin.

The error you're getting basically means you're not outputting anything.

KAKAN

#22
Thanks @Thijn, that helped me a lot!
Another question, do I need to have a fixed port for the UDP server or any port will do the work? Currently, random port doesn't work and I can't try the same port for both the apps.
:edit: Having a fixed port doesn't work too( I used port 8192 on UDP server, and 8192 for VCMP server, did it from 2 different PCs )
oh no

Thijn

You don't need to make an UDP server. The VCMP server is one.

1. You load the announce plugin on your vcmp server
2. That will do an HTTP post to the announce server
3. That announce server (Which is basically an web server/something listening on TCP port 80) will do an UDP request to the VC:MP server using the following protocol: http://wiki.vc-mp.org/wiki/Query_Mechanism
4. If the VC:MP server is online, you add it to your list

Stormeus

Quote from: Thijn on Aug 01, 2016, 04:13 PMYou don't need to make an UDP server. The VCMP server is one.

You do need a UDP socket, though, because you can't tell if the VC:MP server is online unless it sends you a good response back. That response is another UDP packet.

You shouldn't need a full-fledged UDP server, though. A socket is sufficient.

ysc3839

Quote from: EK.CrystalBlue on Jul 30, 2016, 04:55 PMTry using Wireshark to capture the packets
[or any other pakit snifer]
and host the masterlist on another PC so it can check network traffic.
if you find that it successfully reply then fuck your pc otherwise find out why it isn't making the pakits
Wireshark(WinPcap) doesn't support loopback capture on Windows. Unless you install Npcap instead of WinPcap.

KAKAN

#26
Quote from: Stormeus on Aug 01, 2016, 04:53 PM
Quote from: Thijn on Aug 01, 2016, 04:13 PMYou don't need to make an UDP server. The VCMP server is one.

You do need a UDP socket, though, because you can't tell if the VC:MP server is online unless it sends you a good response back. That response is another UDP packet.

You shouldn't need a full-fledged UDP server, though. A socket is sufficient.
I can't get replies back if I create only a socket.
:edit: Here's the code which I'm using to send the UDP packets:-
var dgram = require('dgram');
function checkUDP( ip, port )
{
    //Split the IP.
    var ip2 = ip.split('.');
    //This are the packets to be sent.
    var packets = "VCMP";
    ip2.forEach(function(value){
        packets += String.fromCharCode( value );
    });
    packets += String.fromCharCode( port & 0xFF );
    packets += String.fromCharCode( port >> 8 & 0xFF );
    packets += "i";
    console.log( packets );

    //Create the UDP client.
    var udp = new dgram.createSocket('udp4');
    udp.on('message',(msg,rinfo) => {
        console.log("recieved message from: " + rinfo + ". Message: " + msg );
        if( msg == "MP04" ){
            udp.close();
            return 1;
        }
        else {
            udp.close()
            return 0;
        }
    } );
    udp.on('listening', function () {
        var address = udp.address();
        console.log('UDP Server listening on ' + address.address + ":" + address.port);
    });
    //Send the message
    udp.send(packets, 0, packets.length, Number(port), ip, function(err, bytes) {
        if (err) return console.log( err );
        console.log('UDP message sent to ' + ip +':'+ port + "  " + bytes);
        //client.close();
    });
}
checkUDP( "127.0.0.1", "8192" );
I see it prints that it sent the message successfully, but I never receive it back. I think it's a problem between NodeJS and C++. I did another test, with another nodejs server, which worked out fine. It didn't work with any C/++ script though.
oh no

Thijn

http://paste.thijn.ovh/oqitederaz.coffee

That seems to work fine.

Quotethijn@fatcow ~/tmp % node node-vcmp-query.js
UDP message sent to 91.121.134.5:8192  11
{ passworded: 0,
  players: 12,
  maxplayers: 100,
  hostname: '[0.4] littlewhitey\'s VC-MP Server',
  gamemode: 'LW\'s v2.1 (006) (C++)' }

KAKAN

#28
Quote from: Thijn on Aug 01, 2016, 09:45 PMhttp://paste.thijn.ovh/oqitederaz.coffee

That seems to work fine.

Quotethijn@fatcow ~/tmp % node node-vcmp-query.js
UDP message sent to 91.121.134.5:8192  11
{ passworded: 0,
  players: 12,
  maxplayers: 100,
  hostname: '[0.4] littlewhitey\'s VC-MP Server',
  gamemode: 'LW\'s v2.1 (006) (C++)' }
Awesome. Thanks! Going to test it
:edit: Ah, I found the mistake, anyways, thanks a lot! The error was with String.fromCharCode Thanks again!
Topic locked.
oh no