Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Querying program port

by jcb (Deacon)
on Aug 11, 2019 at 06:21 UTC ( #11104273=note: print w/replies, xml ) Need Help??


in reply to Re^2: Querying program port
in thread Querying program port

Has your friend tried the netstat command, probably as netstat -a to check listening ports, to confirm that the game server is listening at all? (Run that on the same machine as the server.) It has been a long time since I have used Windows, so you may want to check the output of netstat /? or netstat -? for other hints on using that command.

Your descriptions sound suspiciously like a series of keystrokes entered at some prompt. What are you typing those keystrokes into? The best solution here may involve Expect rather than Perl if you are trying to automate interacting with a simple shell program. Perl will work much better if you are wanting to actually send network packets directly.

Replies are listed 'Best First'.
Re^4: Querying program port
by CougarXR7 (Acolyte) on Aug 11, 2019 at 07:04 UTC

    My friend and others have tried everything. That is why I am asking if this script can be done.

    This script will be ran on a terminal on a Ubuntu system.

    I can do this manually, changing the port each time, but to automate it with a script would be gold!

    I could run this auto script until it returns player stats.

    Sir, thank you for your time. However it seems that you are not comfortable with doing this.

    I will never ask anyone to do anything they are uncomfortable with.

    Thank you so very much for your replies!

      I did not say that I am uncomfortable with this. At this point I'm asking exactly what steps are involved. The descriptions that you have given appear to be incomplete. As I understand, most game servers speak various binary protocols, so simply sending "status" to a UDP(!) port is unlikely to do anything useful. What program are you typing "status" into?

      Please read carefully and ask your friend if he has tried netstat.


        "What program are you typing "status" into?"< status is not being typed into a program
        but a Ubuntu terminal after the ip&port has been entered.
        The same terminal that would run this script.
        Sir, I owe you 2 apologies,
        1. I was told the query was UDP but they are wrong it's TCP.
        2. It's a game server status query and not player stats.
        I ran a different game on my main computer with win10.
        To my right is my Ubuntu box, accessing a terminal I typed in my ip and game's UDP port,
        it returned nothing, changed port to TCP and got server info:
        \status\
        \gamename\JetFighter\gamever\0.9\location\1\hostname\Cats Lair\hostport\8181\mapname\Armed Bandits
        \gametype\Deathmatch\numplayers\1\maxplayers\16\gamemode\openplaying\timelimit\240\fraglimit\50\
        teamplay\0\player_0\Cougar\frags_0\0\deaths_0\0\skill_0\0\ping_0\0\team_0\Team 0\final\\queryid\3.1
        Do you have access to a terminal? , "nc 333networks.com 27900 -u" enter without quotes, then enter \status\ , you'll get game server info.
        I used netstat, comparing before running my friend's game server and while running the game server.
        Using the ports that showed up while running the server still returned nothing.
        Having a terminal run script named, severstatus.pl (script name, example:)
        Script runs with printing data on terminal to show terminal is running script.
        "ip port"/ enter
        \status\ enter
        Server returns/replies, exiting script, printing info on terminal.
        NO return/reply, script must access "ctrl+c" to start a terminal new session.
        inc port by 1.
        Now with the same ip and a new port number (inc by 1) entered in a new terminal session followed by \status\
        This continues until game server replies to the query.
        I hope I cleared up anymore questions you have, if not please ask away!
        Friday I ordered the book from amazon "Learning Perl", not sure how many years it will take me but I will try!
        Sir, I cannot thank you enough for helping me! Thank you!
        Should you decide to write this script, you can use "333networks" query to test it. Starting with port 27895, watch it inc on terminal until it incs to 27900, and get a return/reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11104273]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2019-12-14 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?