Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 20:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Small Code Snippet] Local Hosting for Private Server Development

Discussion on [Small Code Snippet] Local Hosting for Private Server Development within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
[Small Code Snippet] Local Hosting for Private Server Development

Hey everyone.

So previously, I was coming up with a few ideas on how to create a dynamic environment for development to simplify network communications (for demonstrations in random locations and such). I came up with a No-IP solution for public connections, but I don't always want my server to be public... so here's a local host solution:

Code:
// If the server is running on the local machine for development, get the 
// ip address that the machine would like to use:
#region Get Local Host
if (server.IPAddress == "localhost" || server.IPAddress.StartsWith("127"))
       foreach (NetworkInterface connection in NetworkInterface.GetAllNetworkInterfaces())
       {
             // If the connection is from the active network adapter, get the IPv4 
             // address of the connection:
             if (connection.OperationalStatus == OperationalStatus.Up)
             {
                   var properties = connection.GetIPProperties();
                   foreach (IPAddressInformation info in properties.UnicastAddresses)
                   {
                         // If the address is of type IPv4, that's the address we're looking for!
                         if (info.Address.AddressFamily == AddressFamily.InterNetwork && info.Address.ToString() != "127.0.0.1")
                         {
                               server.IPAddress = info.Address.ToString();
                               break;
                          }
                    }
             }
        }
#endregion
The only requirement is that your laptop must be connected to a gateway. Obviously, this is perfect for me because I my laptop is always in a location where it can be online. If this is a problem for you guys, use hamachi I guess.

Cheers.
- Spirited Fang
Spirited is offline  
Thanks
3 Users
Old 06/24/2012, 21:25   #2
 
elite*gold: 0
Join Date: Apr 2009
Posts: 101
Received Thanks: 1
Good Idea
koko20 is offline  
Old 06/25/2012, 01:40   #3
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
Quote:
Originally Posted by koko20 View Post
Good Idea
I have a new thread about local hosting here:


There are two different approaches to it in that thread discussed by me and Zeroxelli.
Spirited is offline  
Reply


Similar Threads Similar Threads
[Code Snippet] Save / Load Lists
03/31/2012 - C/C++ - 18 Replies
Falls ihr vor der selben Problemstellung steht wie ich vor einiger Zeit ^^ Hier ist die Lösung :P //Nur eine Beispiel Struktur die ich für ein Programm genutzt habe typedef struct { char szItem ; float fGewicht; } sItem;
[Code Snippet] getFloatFromString [C++
02/15/2012 - C/C++ - 5 Replies
I wrote a small function for getting a float from a string. I know that this function isn't perfect. It isnt very hard to fix it ;) I belive in you guys :P using namespace std; float getFloatFromString (char *szBuffer);
[Code Snippet]Facing Character to X , Y
10/27/2009 - Aion Hacks, Bots, Cheats & Exploits - 4 Replies
Hey community, i want to share some code snippets to you because NCsoft changed a little bit in Aion and now i want to share a new Facting to X Y method. ;) Thanks to PharmerPhale for some help. :) C# Code private double RotNeeded(float X, float Y) {



All times are GMT +1. The time now is 20:35.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.