RunUo.Korean.Forum RunUo.Korean.Forum
RunUo(·±À¯¿À)¿¡ °üÇÑ Çѱ¹ Æ÷·³ »çÀÌÆ®
 

¾ÆÁ÷µµ ¾ÈÇ®·Á¼­ Áú¹® µå¸³´Ï´Ù ¤Ì¤Ì
Click here to go to the original topic

 
       RunUo.Korean.Forum -> FreeBoard
ÀÌÀü ±Û :: ´ÙÀ½ ±Û  
±Û ¾´ÀÌ ¸Þ¼¼Áö ³»¿ë
notmoney



°¡ÀÔÀÏ: 2003³â 12¿ù 25ÀÏ
°Ô½Ã¹°: 7
ÁÖ ¼Ò: /

±Û ÀÛ¼º½Ã°£ : 2004-01-15 ¸ñ 12:01 am    Á¦¸ñ: ¾ÆÁ÷µµ ¾ÈÇ®·Á¼­ Áú¹® µå¸³´Ï´Ù ¤Ì¤Ì  

Á¦°¡ ¼­¹ö ¸¸µé¾î¼­ Á¦ ¼­¹ö¿¡ Á¢¼ÓÇϴµ¥¿ä
°è¼Ó
"test server is full" À̶õ ¸Þ¼¼Áö°¡ ¶ß³×¿ä...
¼­¹ö ¼±ÅÃÇÑ ´ÙÀ½ ¿ÞÂÊ ÇÏ´Ü¿¡ ÀÌ·± ¸Þ¼¼Áö°¡ ¶ß¸é¼­
´õÀÌ»ó ÁøÇàÀÌ ¾ÈµË´Ï´Ù....
°øÀ¯±â´Â ¾²Áö¸¸ ¹æÈ­º® ´Ù Ç®¾ú°í Æ÷Æ® ¿­¾î³ù½À´Ï´Ù...
Á¦¼­¹ö¿¡ Á¦°¡ µé¾î°¡´Âµ¥µµ ¾ÈµÇ´Â ÀÌÀ¯°¡ ±Ã±ÝÇÕ´Ï´Ù;;;
Ȥ½Ã Àú·± ¸Þ¼¼Áö¸¦ ÇØ°áÇϽǼö ÀִºРÁ» µµ¿ÍÁÖ¼¼¿ä...
¸Ç À§·Î °¡±â  
afkn9



°¡ÀÔÀÏ: 2004³â 01¿ù 10ÀÏ
°Ô½Ã¹°: 10

±Û ÀÛ¼º½Ã°£ : 2004-01-25 ÀÏ 1:39 pm    Á¦¸ñ:  

ÄÚµå :  using System;
using System.Net;
using System.Net.Sockets;
using Server;
using Server.Network;

namespace Server.Misc
{
   public class ServerList
   {
      /* Address:
       *
       * The default setting, a value of 'null', will attempt to detect your IP address automatically:
       * private const string Address = null;
       *
       * This detection, however, does not work for servers behind routers. If you're running behind a router, put in your IP:
       * private const string Address = "12.34.56.78";
       *
       * If you need to resolve a DNS host name, you can do that too:
       * private const string Address = "shard.host.com";
       */

      public const string Address = null;

      public const string ServerName = "¼­¹ö³×ÀÓ";

      public static void Initialize()
      {
         Listener.Port = 2593;

         EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList );
      }

      public static void EventSink_ServerList( ServerListEventArgs e )
      {
         try
         {
            IPAddress ipAddr;

            if ( Resolve( Address != null && !IsLocalMachine( e.State ) ? Address : Dns.GetHostName(), out ipAddr ) )
               e.AddServer( ServerName, new IPEndPoint( ipAddr, Listener.Port ) );
            else
               e.Rejected = true;
         }
         catch
         {
            e.Rejected = true;
         }
      }

      public static bool Resolve( string addr, out IPAddress outValue )
      {
         try
         {
            outValue = IPAddress.Parse( addr );
            return true;
         }
         catch
         {
            try
            {
               IPHostEntry iphe = Dns.Resolve( addr );

               if ( iphe.AddressList.Length > 0 )
               {
                  outValue = iphe.AddressList[iphe.AddressList.Length - 1];
                  return true;
               }
            }
            catch
            {
            }
         }

         outValue = IPAddress.None;
         return false;
      }

      private static bool IsLocalMachine( NetState state )
      {
         Socket sock = state.Socket;

         IPAddress theirAddress = ((IPEndPoint)sock.RemoteEndPoint).Address;

         if ( IPAddress.IsLoopback( theirAddress ) )
            return true;

         bool contains = false;
         IPHostEntry iphe = Dns.Resolve( Dns.GetHostName() );

         for ( int i = 0; !contains && i < iphe.AddressList.Length; ++i )
            contains = theirAddress.Equals( iphe.AddressList[i] );

         return contains;
      }
   }
}


À§ ¼Ò½º¿¡ ¸Â°Ô ¼³Á¤µÇÀÖ´ÂÁö È®ÀÎÇØº¸¼¼¿ä ¹°·Ð ÁÖ¼®Ã³¸®µÈ°÷Àº

- - ´Þ¶óµµ »ó°ü¾ø±¸¿ä

½ºÅ©¸³>misc>serverlist.cs

Çѹø È®ÀÎÇØº¸¼¼¿ä
¸Ç À§·Î °¡±â  
 
       RunUo.Korean.Forum -> FreeBoard
ÇöÀçÆäÀÌÁö : 1/1


Powered by phpBB Search Engine Indexer
Powered by phpBB © 2001, 2002 phpBB Group