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 - iL

Pages: [1] 2 3 ... 74
1) Mods & Development / Re: War2 timer beta version has been created
« on: September 06, 2018, 04:47:48 AM »
I'd say need to show some time intervals based on game cycles similar to seconds instead of real seconds. Pause will pause it, speed up/down will increase/decrease speed of that timer, etc.
And it need to be implemented as a separate process (same as war2observe). Then it will be perfect thing to implement. If community will not consider that a hack.

2) Mods & Development / Re: War2 timer beta version has been created
« on: August 31, 2018, 10:52:15 AM »
ddraw.dll means it will conflict with "proper" version of graphics fixing ddraw.dll from aqrit?
For example i use ddraw2 for win7 and old videocard (no shaders), ddraw4 for win7 and new one, ddraw_mini for win8, but when i need timer i need to replace them all to this thing?
I'd say, external .exe with activate option would be better for such functionality.
Not sure if to feel it legal or not. Timer makes disbalance in the game, but maybe we can integrate it into war2 (as warlatency) and it will be ok...

3) Server.War2.ru / Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« on: August 28, 2018, 09:42:39 AM »
Interesting, someone tries to continue that great job!

Need to test that new versions carefully, the main thing is stability.

Well, "unknown" means antihack checked values in "warcraft ii bne.exe" process and that values are not "Ok".
I just checked, looks like DuMaurier's software is at least strange. It shows improper values, not looks like hack, but not like clear.

No idea what is that, maybe an antivirus blocks something, or wrong version of war2 or something else.
War2 on linux under wine? German or war2 with war2ploader attached? Several war2 clients on the same computer?
So, i think need to ask him how he got that effect.

5) Mods & Development / Re: Lat Trick Bot
« on: May 29, 2018, 09:34:19 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!
Well, python script is better for research purposes (quick development) to test how to make it work.
C++ code is better for production. That will be a small birany code with minimal required to work properly. Also that C++ code will be included into final application. But we need experiments before release production.

So, both ways are useful.
But no one is functional right now for me.

6) Mods & Development / Re: Lat Trick Bot
« on: May 29, 2018, 04:07:02 AM »
oh shit it works!!!!!

UDP hole punching for the win, check this out for proof (notice "your port is closed", but abcde joined my game):
I still didn't reach such progress with that UDP Hole thing.
How you reach that? When you sent UDP to abcde? After you host the game? Or before you host the game? Or before you joined BNET? Or when?

Maybe the problem is related to non-standart port somehow. Next step from my side is to stop portforward on router and change port to 6112.

But it doesn't work for me when i send UDP from 6113 to 6112 (even when i send packets once and right atfer hosting the game). I send UDP to 3-5 active players in chat (including one who tried to join).

Also after sending such UDP from my side i haven't been able to join until rejoin bnet on war2.

What's rejoin BNET from networking side? Looks like BNET part is a separate process inside war2 application. It's being restarted when i rejoin bnet? So it closes and recreates all the sockets again or what?

I still think proper way is to use BNET part of war2 to send UDP packets to peers.
Then war2 send packet, so war2 will receive it back. Works fine when you manually try to join someone's game and then he can join your game.

7) Mods & Development / Re: Lat Trick Bot
« on: May 28, 2018, 03:24:19 PM »
Well, checked your things another way:
Changed all the socket code to Lampchops code:

Code: [Select]
    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
        # send some data
        os.system("hostholecmd.exe " + str(player_ip) + " " + str(war2_client_port) + " " + str(war2_remote_port))
      except Exception as e:
        print e

Nothing changed:
my port (war2_client_port) is 6113, not forwarded, remote port is 6112.
Then i hosted the game, then started that script with loop for chat players only, and... they wasn't able to join.
Then i stopped my loop and wasn't able to join any  game until rejoin bnet with war2.

Any other ideas what to do?

8) Mods & Development / Re: Lat Trick Bot
« on: May 28, 2018, 11:02:06 AM »
lance had his bots guess he is gone again.. well carry on
Lance released his bot as opensource, anyone can host it. The only thing required is windows hosting.

Slightly different.
Anyway, need to check your functions, maybe they will work better.
I'll try that when i have time.
All current tries made me impossible to join anyone's game, also nobody can join my one.

9) Mods & Development / Re: Handy PUD bitmap maker.
« on: May 28, 2018, 06:39:49 AM »
Would look cool if @iL added that to the anti hack status page....
Hm, would be very interesting to get that pubpic for UNIX!

To make it possible to build that as ./pudpic file.pud file.bmp (or png).
Then we will be able to make something like maps gallery, similar to ss.war2.ru.
@Lambchops, what do you think about that?

Also, my desire: an option to write amount of gold/oil on mine/patch.
Gold mine with number 60000 or w/e would be very useful as for me.

10) Mods & Development / Re: Lat Trick Bot
« on: May 27, 2018, 05:00:20 PM »
Tried in different options:
repeated UDP packets to all players every 10 sec, 1 single ip to every player, nobody can join my game hosted from unforwarded 6113.

If i keep repeating packets to every player, i can't join any game (i get lat).
If i stop lat trick bot, i still can't join until i restart war2.

What does it mean?
How windows handle that packets? Maybe windows send "answer" to the application sent the request? That is my next idea.
Otherwise i have no explanation what happens.
@Lambchops, i'll try your dll, but i almost sure that will not help as you open sockets the same way as a python script.

I'd say we have to inject sending packets into war2 process somehow.

11) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 11:20:36 AM »
Adding real list of ips:
1. @AHB, can you update your script to add port to each ip into that json?
like that:
{"player_ips": [{"ip":"","port":"6112"},{"ip":"","port":"6112"}]}

2. my stuff becomes to know UDP port only when player hosts the game. Looks like there's no way to know Game Data port from the server side until he hosts the game.
Now let's suppose some fixed value (like 6112 or w/e) for every client.

So, for future, our logic should be more complicated. Looks like we have to read game data port for each client or check the port from hosted game.
Sad, but looks like there's no way to know UDP port for original client with no lat bots even if his ports are fine.

I mean, lets consider:
- i'm good old player with all ports forwarded/configured, i have no problems with hosting games at all. And my port is modified, not 6112. Everything works for me. I don't want to run any additional software on my side.
- you have problems with ports forwarding, you want to use UDP hole punch to host the game.
You have no way to know my Game Data Port if i didn't host the game. You have to enforce me to run some kind of software to send my port to you.

12) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 10:39:01 AM »
Well, no errors now.
I'll check how it will work on the server

13) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 10:27:44 AM »
My code (with local and remote ports and debug prints):

Code: [Select]
    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_client_port))

        # send some data
        client.sendto("For the Alliance", (target_host, war2_remote_port))
        print "Shutting down socket"
        print "Closing socket"
        print "Sent data to " + str(player_ip) + " from port" + str(war2_client_port) + " on port " + str(war2_remote_port)
      except Exception as e:
        print e

Code: [Select]
getting ips
[u'', u'', u'']
Shutting down socket
shutdown() takes exactly one argument (0 given)
[Errno 10048] Обычно разрешается только одно использование адреса сокета (протокол/сетевой адрес/порт)
Shutting down socket
shutdown() takes exactly one argument (0 given)
getting ips
[u'', u'', u'']
[Errno 10048] Обычно разрешается только одно использование адреса сокета (протокол/сетевой адрес/порт)
Shutting down socket
shutdown() takes exactly one argument (0 given)
[Errno 10048] Обычно разрешается только одно использование адреса сокета (протокол/сетевой адрес/порт)
getting ips
[u'', u'', u'']
Sorry for russian windows, that means soemting like:
"Usually only 1 usage of socket address allowed (protocol/network address/port)".

No idea what command it related to.

14) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 05:03:57 AM »
One more: i didn't try to host the game from internal ip behind NAT. What i just tried is to join and play the game from NAT'ed network.
Usually i can't host with closed ports, but i can join and play.
When i tried to join and play after running udp_hole_punch.exe, i got disconnected after about 1-2 min after game start.
Tried twice.
Then i stopped udp_hole_punch.exe, tried next time, and played successfully.
So, the problem is not related to wrong ports or w/e, it means udp_hole_punch.exe crashes existing connections.

15) Mods & Development / Re: Lat Trick Bot
« on: May 25, 2018, 04:29:14 AM »
You don't need STUN. This is just the noob getting excited about stuff he read online that he doesn't actually understand.
Of course STUN is not something necessary, it's just an option to check the NAT type. Not a big deal as i said.

You don't need to reverse the NAT address translation, just allow NAT to function the way it is designed.

You only need to send packets from host before game starts.

You only need to send packets to people in the channel.
That will be a plan for future, as a 1-st step it's easier to send packets all the time.

And it causes disconnect, no idea why, but that's unacceptable behavior even if i sent them in wrong time and to wrong ips.

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
I didn't understan your logic, well:
my Game Data Port is 6113, your Game Data Port is 6112, my external ip is, your external ip is
I host the game behind NAT on my local computer internal ip, i need to make you connect from your to my
How to do that? I apply lat trick: send UDP packet to the opposite side: from my to, right?
Then my (full cone) NAT translates it: you receive packet from my to Also my router keeps temporary rule: to wait answers to that packet.
When you try to connect from your to my, my router thinks it's the answer to that packet and NAT's it to my internal host:, right?

So, you offer to send packet from my to your Though your client listens on Looks senseless for me.

Another idea:
We open the socket:  client.bind(('', war2_client_port))
Also, war2 client opens the same socket.

Who will receive packets incoming to war2_client_port? Our script or war2? Who will be more lucky?
Maybe we should close our socket right after we sent our packets?
What do you think about that?

Not a guarantee (as we can get packets while sending packets), but should become much better as for me.
Code: [Select]
      client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
      client.bind(('', war2_client_port))
      client.sendto("For the Alliance", (target_host, war2_remote_port))
      client.close() # or how to write that on python, i don't know it's syntax

just got that:
Socket close is not closing the socket immediately or something like that, it goes into the TIME_WAIT instead: https://stackoverflow.com/questions/22549044/why-is-port-not-immediately-released-after-the-socket-closes
They say about SO_REUSEADDR, but that is not we need. Our task is not to catch even sinlge packet destined to war2.
How to do that? I'm not so good in network technologies. I'd say the proper way is to inject into war2 network functions. Or probably to listen our Game Data Port and copy all these traffic to war2 process (also, how to do that?)
additional info:
socket abort should guarantee to free the socket immediately. Depends on OS/language. Sometimes you have to set "linger off" or w/e and then repeat close.
Not sure if it's actual for UDP, maybe for TCP only.

Anyways, we have to control every socket function succeeded. In our situation you can never be sure your client.bind or sendto succeeded.
@AHB, can you add checking all the possible return errors in your code?
Something like:
Code: [Select]
        client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
      except Exception as e:
        print e
        client.bind(('', war2_client_port))
      except Exception as e:
        print e
Fix the code plz, i'm not good in programming and don't know python at all.

Pages: [1] 2 3 ... 74