War2.ru Slogan
News: Don't forget to join Channel: Trivia for trivia!

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Welcome to the forums! We're glad to have you here! :) You can register your account here, then feel free to introduce yourself in the Server.War2.ru board & let us know who you are on the server.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - AHB

Pages: [1] 2 3 4
1) Mods & Development / Re: War2 Analytics Ver2
« on: May 31, 2018, 01:01:08 PM »
Maybe I can provide some examples if I get time

Like this one - get game reports for user "wretcher" where he won

select * from user_game_score inner join game on user_game_score.game_id = game.report_id where user_name = "wretcher" and outcome = "WIN"

2) Mods & Development / Re: War2 Analytics Ver2
« on: May 31, 2018, 12:54:05 PM »
Sorry I dont have any documentation but if you have a specific question I can answer for you here

3) Mods & Development / Re: Lat Trick Bot
« on: May 29, 2018, 08:31:15 AM »
Well luckily it sounds like @Lambchops has everything figured out so I will stop contributing and we can all let him show us how its done!

4) Mods & Development / Re: Lat Trick Bot
« on: May 26, 2018, 04:16:12 PM »
Actually wrong, I came up with it on my own while hacking an IP camera and that is how I learned about UDP hole punching and was the inspiration for the program:


but nice try

By the way here was your response saying it is impossible:

"""There are many ways this could be accomplished, but they all involve some reasonably tricky mods and/or additions to the wc2 exe... one day maybe...""""

"one day maybe" well guess that day is today thanks to my dedicated research and terrible programming skills, neat huh?

5) Mods & Development / Re: Lat Trick Bot
« on: May 26, 2018, 11:34:27 AM »
@Lambchops once again you talk way too much and neither of us have time to keep reading your meaningless replies while we are solving hosting

You "knew" the solution 2 years ago yet never programmed it. Why? Because either you dont actually understand the solution or you don;t know how to program. Probably both.

Why dont you quick talking and go set up a pvpgn server, write the proof of concept, and actually do something useful? Oh wait because you cant. You cant even write psuedo code lol that is a joke

If we want to only send packets to people in channels, that is easy to do. I would just add a few lines to make a request to the server status page and parse it out. The only problem with that is that we would have to tie IP addresses to usernames which isnt exactly desirable, so if we can find a way to not do it that way, it would be better. One solution would be to have iL rewrite player_ips.php to only output IP Addresses of players who in a channel, but that would be some work on the backend that I'm not sure he has time for at the moment

But dont worry about it iL and I have it covered

6) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 12:06:08 PM »
The program is already working the way that I described (not knowing the remote port):

This is the code that is sending data to the wrong port for the player, but it should still trick his router to allow that player to join the game :)
 client.sendto("For the Alliance", (target_host, war2_port))

7) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 12:01:21 PM »

I dont think we need to know the remote player's port at all, just send from your own port, then your router will hold open the connection from your local port to the external IP and allow a response back from external IP to  your game port

Say remote host has port 6113, but person hosting the game has port 6112:

Host sends a packet to remote-host:6112 (it doesnt know that remote player port is actually 6113)
Hosts router opens a connection and listens for player to respond on port 6112
Player's router receives the packet, sees that it is for port 6112 and not 6113, so it drops it and ignores it
Player's War2 client knows to join the host's game on his port, 6112, because pvpgn told him that
So Player sends traffic to Host on port 6112
Host's router has a connection open to Player already on port 6112, so it allows the response traffic to come through

Do you see that we dont need to know the remote port? Only use the local game port as both the source and destination

8) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 10:32:09 AM »

shuts down read and write on the socket

9) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 09:08:36 AM »

I updated the code below to shutdown and close the socket each time. From what I read, shutdown will fix that TIME_WAIT issue, releasing it immediately.

I also implemented a basic error check, and will skip to the next player in the list if an error occurs instead of crashing out

Let me know if this works for you. I will test also

import _winreg
import stun
import requests
import socket
import time
import json

def get_war2_port():
    # Open the key and return the handle object
    hKey = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, "Software\Battle.net\Configuration")
    # Read the value
      result = _winreg.QueryValueEx(hKey, "Game Data Port")
    # If not found, set to default
    except Exception as e:
      print e
      result = [6112]
    # Return port
    return result[0]

war2_port = get_war2_port()
nat_type, external_ip, external_port = stun.get_ip_info("", war2_port)
req = requests.get('https://war2.info/nat_stats.php?nat_type=' + str(nat_type))

if nat_type != "Sytmmetric NAT":
  while True:
    req = requests.get('https://war2.info/player_ips.php')
    json_obj = json.loads(req.content)
    player_ip_list = json_obj["player_ips"]
    print player_ip_list
    for player_ip in player_ip_list:
        # Target host is IP of player you want to be able to join your game
        target_host = player_ip

        # create a socket object
        client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        client.bind(('', war2_port))

        # send some data
        client.sendto("For the Alliance", (target_host, war2_port))
        print "Sent data to " + str(player_ip) + " on port " + str(war2_port)
      except Exception as e:
        print e

10) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 08:57:32 AM »

Your definition of how remote port and local port is correct actually, you are right that is how it works.

So we are able to port forward now, but possibly the problem is that Python is intercepting packets destined for War2 causing the game to disconnect. I will have to think about this...

My first idea is to try changing the "binding" IP address. means to listen on all interfaces, but we don't actually want to listen on any interfaces.. not sure what to do. I will keep testing

I can add error checking so that if a socket fails it keeps trying instead of crashing

11) Mods & Development / Re: Lat Trick Bot
« on: May 24, 2018, 07:29:56 PM »

Thanks for checking it out! I know we are close. Just ignore @Lambchops hes a dumbass

I think I see your problem ! I think it is because you are sending traffic to the REMOTE port. The "remote port" variable should actually be your LOCAL port, not remote port.

I know its confusing but there is a reason -- you need to send traffic to the remote host:local port, that way the connection is opened for the remote host to reply on your LOCAL port. They dont need to reply on their own port. Also, the traffic we are sending them we dont care that they dont ever receive it, we are just tricking out own firewall (not theirs) make sense? Try again with that and let me know if it works

Like this

war2_client_port = 6113
# war2_remote_port = 6112 -- this is not needed at all
      client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
      client.bind(('', war2_client_port))
      client.sendto("For the Alliance", (target_host, war2_client_port))

12) Mods & Development / Re: Lat Trick Bot
« on: May 23, 2018, 09:44:13 PM »
Nice work tupac

13) Mods & Development / Re: Lat Trick Bot
« on: May 22, 2018, 09:47:25 PM »
dude you need to chill Mr., read a Berk on how the internets work, U cant get sql access when u give someone some code that filteRs sql injection and the db username and password are changed before being uploaded ... oK?

bEsides the nat stats arent even a necessary component of the program so take it or leave it who cares. you already gave access to install war2combat in your pc so you should know we know much more than just your nat type lmao jeez quit trippin. no need for the nasty Gram

14) Mods & Development / Re: Lat Trick Bot
« on: May 21, 2018, 09:15:52 AM »
You do know that the definition of a script kiddie is someone who uses code that other people write, and cant write their own code right?

So by definition I wrote the code, and you know nothing about programming as youve made apparent, so that would make you a script kiddie lol

I know this is really hard for you to understand, but the part of the PHP code where it says "username=username" and "password=password" is intended to be changed by iL to his own credentials which I wont know what they are, so no I dont have SQL access. Sorry no time to keep explaining how these basic things work.

15) Mods & Development / Re: Lat Trick Bot
« on: May 20, 2018, 02:16:01 PM »
Everyone knows me in in real life here, and anyone with a brain can read the code and see there is no backdoor in it...

Keep telling yourself you solved hosting lol congrats to you

Pages: [1] 2 3 4