Get your local IP address in C2

Discussion of tools and resources for game developers

Post » Mon Aug 03, 2015 2:44 am

This was a little tool i wrote for use with the crowdgaming plugin however it might be useful to someone else.

If you need to get the local IP address of your computer running C2 for whatever reason in code

This little tool in adds your local IP address to a txt file and stores it in the same location as where you ran it from.

1) Copy the GetIP.exe file i've included and put it in the same folder as your exported NW.JS project .exe file (https://dl.dropboxusercontent.com/u/403350/LocalIP/GetIP.exe)

Then checkout the capx i've included to see how to execute and read the IP into your project.

Edit: Also, if you are Testing using NW.JS for previewing, put the GetIP.exe also in your C:\Program Files\NWjsForC2\win32 folder

Capx: https://dl.dropboxusercontent.com/u/403350/LocalIP/WorkingMakeIPaddress.capx

Image

Image
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Mon Aug 03, 2015 11:26 am

I have to point out, running an unsigned compiled Windows executable is an incredibly risky thing for anybody to do. I think it's possible for WebRTC to determine the local IP, perhaps there should be a C2 feature for this.
Scirra Founder
B
397
S
236
G
88
Posts: 24,423
Reputation: 194,560

Post » Mon Aug 03, 2015 12:53 pm

@Ashley - I'm all for an easier solution :)
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Mon Aug 03, 2015 5:57 pm

B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Mon Aug 03, 2015 6:10 pm

@noncentz705 - Sweet ! Thanks so much! I knew there had to be an easier way of finding it. Does this work if the computer is offline as well?
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Mon Aug 03, 2015 6:11 pm

It seems to return a 127 address when offline.
B
11
S
2
G
1
Posts: 202
Reputation: 1,580


Return to Tools and Resources

Who is online

Users browsing this forum: No registered users and 1 guest