User Tag List

Results 1 to 5 of 5

Thread: The way how to retrieve local IP?

  1. #1
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    903
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    The way how to retrieve local IP?

    I know there was post about it but solution I posted there isnt suitable for all situations.

    Also Im working on some program for snake-keepers. There is also direct CHAT part (MooSock)

    Those people usually dont know how to retrieve their IP and thats the problem. If there is "ENTER IP TO CONNECT" they all wont know where to find it out. The person who would host cant see his IP <img src="/center/images/graemlins/frown.gif" alt="" />

    Is there any way which could lead to simple text: Your IP is... ? I tried hosting and retrieving IP, connecting to localhost (retrieves 127.0.0.1 of course :/) without success... Any advice is welcome, thank you

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The way how to retrieve local IP?

    The only way is to connect to another computer and then ask moosock what your ip is. This is because a pc can have more than one IP, so it does this to find out which IP the connection you need is on. Of course if the chat is over the internet and the host is behind router / NAT it won't work unless they forward the port on their router themself. So, better to both connect to another dedicated server on the internet for internet chat.

    Another tip is you can use a pc's name instead of an IP if you're on lan, just like how you can use a server address like www.google.com on the internet.

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    903
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: The way how to retrieve local IP?

    Yes, I was affraid about this <img src="/center/images/graemlins/frown.gif" alt="" /> Thank you anyway

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: The way how to retrieve local IP?

    You could use a PHP script, host it on a webserver and then retrieve it using MooSock. Downsides to this are that if your site goes down then you can't retrieve the IP, but it's the best way I've found to do it.

    Open notepad, and type in

    &lt;? $ip=@$REMOTE_ADDR; echo("[del]$ip[del]"); ?&gt;

    Save the file as ip.php and then upload it to your webserver (e.g. www.myserver.com/ip.php)

    In MMF2, use similar to the following:

    + Start of frame
    - String parser: Add delimeter "[del]"
    - Connect to www.myserver.com on port 80

    + On connect
    - Send text line "GET /ip.php HTTP/1.1"
    - Send text line "Host: www.myserver.com"
    - Send text line ""

    + On received
    - String parser: Set source string to Recv$( "MooSock", 1024)

    + On disconnect
    - Edit box: Set text to listGetAt$( "String Parser", 2)


    If you find that your webserver doesn't disconnect after receieving the text, then try changing the HTTP/1.1 to HTTP/1.0. I recently bought new webspace, and it seems that it'll only disconnect when I use HTTP/1.0 for some reason..

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    903
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: The way how to retrieve local IP?

    Yes, I absolutely forgot about that! Thank you Flava, its the best way I think too.

Similar Threads

  1. Browse local network LAN computers / Trouver et explorer les machines du réseau local
    By duwayy in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd October 2013, 09:28 AM
  2. ICP - Retrieve Licence Key
    By madmac in forum Install Creator and Patch Maker
    Replies: 2
    Last Post: 2nd March 2011, 07:05 AM
  3. Roll & Yaw = local, Pitch = not local????
    By Gibbon in forum OpenGL
    Replies: 1
    Last Post: 19th August 2010, 02:05 AM
  4. Any way to retrieve the icon of a .exe?
    By Wra1thus in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th September 2009, 03:50 AM
  5. Retrieve Artist from ID3 tag
    By teddyq in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th October 2007, 05:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •