|
||
|
|||||||
| Custom Script Release Archive This is a pre-script database archive of what our users had released. |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Novice
|
Just put this together to make it easyer to list multiple servers that are hosted by the same ip and keep the features of mr fixits serverlist.
I DO NOT SUPPORT THIS RELEASE ANYMORE Ive made changes to make it even more simple to add multiple servers. This Submission is a ServerList 2.2 Pack. CONTAINS: Packs for 3 different types of installations: 2 Servers 3 Servers 4 Servers And other resources: READ ME! ServerList 2.2 src folder with Original ServerList.cs 2.2 Please do enjoy ![]() I might put together alittle webpage to show working examples of the script but this should be good enough. Last edited by Deraj_88; 07-20-2006 at 03:12 AM. |
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Jan 2004
Location: UK, Essex
Age: 20
Posts: 1,166
|
do I need to have both my servers using this server list?
And also there was a bug where if you used one server but then logged out and went to use the other the slient crashed. Has this been fixed? Also could you please provide a bit more info on how to set this up correctly? Thanks, this could be what I've been looking for for ages ![]() EDIT: Ok I've got it setup to show more than one server entry. There are a couple of problems already. One is that I can't log in to the server over my LAN the other is that the sixth char slot doesn't show up.
__________________
It is not the hand that creates worlds, It is the mind controlling it ! The New Dawn Network |
|
|
|
|
#3 (permalink) |
|
Account Terminated
|
1) You have to enable the 6th slot
2) Don't use this script use Fixit's if you can't connect to your server over your lan network. Please note the only reason I say just use Fixit's Serverlist.cs is because it does what you need to do automaticly. The directions are clear and unless you have more then one sever ( which I doubt ) there isn't really a valid reason to use this. |
|
|
|
|
#4 (permalink) | |
|
Forum Expert
Join Date: Jan 2004
Location: UK, Essex
Age: 20
Posts: 1,166
|
Quote:
2. It said that this script is supposed to keep Fixits features. I thought he should know because it's not working.
__________________
It is not the hand that creates worlds, It is the mind controlling it ! The New Dawn Network |
|
|
|
|
|
#5 (permalink) |
|
Forum Novice
|
yes both your servers need the serverlist.cs i left instructions inside it.
thoe im sorry if there not clear enough. I havent had any prob. logging in over my LAN. also i didnt really find the 6th char slot prob. cause i usally just have three chars if not just one it might have to do with one server has it on and other doesnt. *shrugs* I agree that only people with more than one server use this other wise you really have no use for it unless you have a test server that you only want up when you need it to be and mr fixit's features still work just fine. |
|
|
|
|
#6 (permalink) | |
|
Account Terminated
|
Quote:
2) It can only auto-detect one serve's ip which is why I said just use the original code since you don't seem to understand it. |
|
|
|
|
|
#12 (permalink) |
|
Account Terminated
|
This is lack saying, you stole my Mega Weapon of Death script.
This script although does something helpful, isn't that special, the only code he wrote is the packet. Guess what he looked at the core to be able to write it, most likely. Either way, who cares if he "Stole" it, its not worth fighting over so drop that lame act. This community is based on sharing, if people won't even share a simple script like this whats the point. |
|
|
|
|
#13 (permalink) |
|
Forum Novice
|
I tried to add 2 sever's and i still seem to have problems i do not understand it how he wrote it and i have tried to get help but no one seems to answer i was woundering if someone out there could help me if you can please email me at turleysnake@yahoo.com or talk to me at turleysnake1@aol.com.Thank you
|
|
|
|
|
#14 (permalink) | |
|
Account Terminated
|
Quote:
Post your Serverlist.cs so the author can help you. |
|
|
|
|
|
#18 (permalink) |
|
Yep its possible.
Its programming, these programs were made with programming. Anything is theoretically possible. This is more than theoretically possible though. Just have 2 listings in serverlist.cs to your main shard, and have the other point to different servers' IP addresses. -Zaroff |
|
|
|
|
|
#20 (permalink) |
|
Forum Novice
|
post your code so i can see what you have wrong.
ill be leaving in less than a week (The Internet) so if i dont see it in time im sorry. also ive tryed using just the script to connect two different IPs (Without 3rd Party Program)....Doesnt work! itd prob work if you used some server programming but ive bearly tap't the start of my studys so im of no use in this department. p.s. yuk i think the area im moving to only has dial-up if i return ![]() |
|
|
|
|
#21 (permalink) |
|
Code:
// ==================================================================================
// YOUR SERVERS NAME
// ==================================================================================
public const string ServerName = "Test1"; //Home Server's Name
/*//Server A
public const string ServerNameA = "Test"; //Server A's Name*/
/*//Server B
public const string ServerNameB = "Server B"; //Server B's Name*/
/*//Server C
public const string ServerNameC = "Server C"; //Server C's Name*/
// ==================================================================================
// YOUR INTERNET IP OR DNS NAME
// Here you can select to autodetect your internet ip, or manualy specify
// Examples:
// public static string Address = "12.34.56.78";
// public static string Address = "shard.host.com";
// ==================================================================================
public const bool InternetIPAutodetect = true;
public const int MinutesBetweenIPAutodetect = 1440;
public static string Address = null; //Home Server's IP
/*//Server A
public static string AddressA = "196.1xx.x.xxx"; //Server A's IP
public const int PortA = 259x; //Server A's Port*/
/*//Server B
public static string AddressB = "###.###.#.###"; //Server B's IP
public const int PortB = ####; //Server B's Port*/
/*//Server C
public static string AddressB = "###.###.#.###"; //Server C's IP
public const int PortB = ####; //Server C's Port*/
|
|
|
|
|
|
#22 (permalink) |
|
Forum Novice
|
yes further on down in the script you have to delete the "/*" and "*/"
Code:
// ----------------------------------------------------
// Send serverlist
// ----------------------------------------------------
if ( Resolve( Address != null && !IsLocalMachine( e.State ) ? Address : Dns.GetHostName(), out ipAddr ) )
{
e.AddServer( ServerName, new IPEndPoint( ipAddr, Listener.Port ) );
e.AddServer( ServerNameA, new IPEndPoint( ipAddr, PortA ) );
/*e.AddServer( ServerNameB, new IPEndPoint( ipAddr, PortB ) );*/
/*e.AddServer( ServerNameC, new IPEndPoint( ipAddr, PortC ) );*/
} else {
e.Rejected = true;
}
}
catch
{
e.Rejected = true;
}
}
|
|
|
|
|
#23 (permalink) |
|
Forum Expert
|
Looks like a cool script but when i tested it i keep loging into the same server lol. From any login, (I have 3 test centers) had them all going all on the serverlist.cs and all add the new serverlist.cs but any one i picked keep logging me into the same server as the Listener.Port. I was always told in order to pull this one off you would have to make a login server with a database to pull this one off. But again i could be doing something wrong.
Ronin
__________________
Let me out i am stuck in your pocket! |
|
|
|
|
#24 (permalink) |
|
Forum Newbie
Join Date: Jul 2004
Age: 18
Posts: 33
|
hey i dont get this im trying to get this im trying to set it up but when i do it it dont show if i do it a different way i get errors plz help me and tell me what lines and stufff i need to changed to make it work using System; using System.Net; using System.Net.Sockets; using Server; using Server.Network; namespace Server.Misc { public class ServerList { // ================================================== ================================ // YOUR SERVERS NAME // ================================================== ================================ public const string ServerName = "Home Server"; //Home Server's Name /*//Server A public const string ServerNameA = "Pre Osi"; //Server A's Name*/ /*//Server B public const string ServerNameB = "Pure Osi"; //Server B's Name*/ /*//Server C public const string ServerNameC = "Gm Land"; //Server C's Name*/ // ================================================== ================================ // YOUR INTERNET IP OR DNS NAME // Here you can select to autodetect your internet ip, or manualy specify // Examples: // public static string Address = "12.34.56.78"; // public static string Address = "shard.host.com"; // ================================================== ================================ public const bool InternetIPAutodetect = true; public const int MinutesBetweenIPAutodetect = 1440; public static string Address = null; //Home Server's IP /*//Server A public static string AddressA = "68.203.171.184"; //Server A's IP public const int PortA = 2593; //Server A's Port*/ /*//Server B public static string AddressB = "68.203.171.184"; //Server B's IP public const int PortB = 2593; //Server B's Port*/ /*//Server C public static string AddressB = "68.203.171.184"; //Server C's IP public const int PortB = 2593; //Server C's Port*/ // ================================================== ================================ // Here are some values stored // ================================================== ================================ private static LocalLanIPRange[] LocalLanIPRanges = new LocalLanIPRange[10]; private static UInt32 LocalLanIPRangesCount; private static AutoIPMirror[] AutoIPMirrors = new AutoIPMirror[10]; private static UInt32 AutoIPMirrorsCount; private static DateTime InternetIPAutodetectLast; // ================================================== ================================ // Initialization // ================================================== ================================ public static void Initialize() { // ---------------------------------------------------- // Select what home port to use // ---------------------------------------------------- Listener.Port = 2593; //Home Server's Port // ---------------------------------------------------- // Load the local LAN ip ranges // ---------------------------------------------------- AddLocalLANIPRange("10.0.0.0", "10.255.255.255"); AddLocalLANIPRange("192.168.0.0", "192.168.255.255"); AddLocalLANIPRange("172.16.0.0", "172.32.255.255"); AddLocalLANIPRange("169.254.0.0", "169.254.255.255"); // ---------------------------------------------------- // Load the Auto IP mirros // ---------------------------------------------------- AddAutoIPMirror("http://www.findmyip.com/", "Your IP address is:<br>", "</FONT>"); AddAutoIPMirror("http://www.ipaddy.com/", "Your IP address is: ", "<br>"); AddAutoIPMirror("http://checkip.dyndns.org/", "Current IP Address: ", "</body>"); AddAutoIPMirror("http://ipid.shat.net/iponly/", "<title>", "</title>"); AddAutoIPMirror("http://www.edpsciences.com/htbin/ipaddress", "Your IP address is <B> ", " </B>"); AddAutoIPMirror("http://www2.simflex.com/ip.shtml", "Your IP address is <BR>", "<BR>"); // ---------------------------------------------------- // Create the event // ---------------------------------------------------- EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList ); // ---------------------------------------------------- // Show info in console // ---------------------------------------------------- Console.WriteLine("ServerList 2.2"); Console.WriteLine("Welcome to SERVERS NAME"); // ---------------------------------------------------- // Lets find internet ip // ---------------------------------------------------- DetectInternetIP(); } // ================================================== ================================ // Add a range of local lan ips // ================================================== ================================ private static void AddLocalLANIPRange(string RangeFrom, string RangeTo) { LocalLanIPRanges[LocalLanIPRangesCount] = new LocalLanIPRange(); LocalLanIPRanges[LocalLanIPRangesCount].RangeFrom = StringIPToUInt32IP(RangeFrom); LocalLanIPRanges[LocalLanIPRangesCount].RangeTo = StringIPToUInt32IP(RangeTo); LocalLanIPRangesCount = LocalLanIPRangesCount + 1; } // ================================================== ================================ // Convert a ip string to a binary unsigned int // ================================================== ================================ private static UInt32 StringIPToUInt32IP(string addr) { byte[] byteArray1 = IPAddress.Parse(addr).GetAddressBytes(); byte[] byteArray2 = IPAddress.Parse(addr).GetAddressBytes(); byteArray1[0] = byteArray2[3]; byteArray1[1] = byteArray2[2]; byteArray1[2] = byteArray2[1]; byteArray1[3] = byteArray2[0]; return BitConverter.ToUInt32( byteArray1, 0); } // ================================================== ================================ // Used to store the local lan ip ranges // ================================================== ================================ private class LocalLanIPRange { public UInt32 RangeFrom; public UInt32 RangeTo; } // ================================================== ================================ // Add a AutoIP mirror // ================================================== ================================ private static void AddAutoIPMirror(string sURL, string sStart, string sEnd) { AutoIPMirrors[AutoIPMirrorsCount] = new AutoIPMirror(); AutoIPMirrors[AutoIPMirrorsCount].sURL = sURL; AutoIPMirrors[AutoIPMirrorsCount].sStart = sStart; AutoIPMirrors[AutoIPMirrorsCount].sEnd = sEnd; AutoIPMirrorsCount = AutoIPMirrorsCount + 1; } // ================================================== ================================ // Used to store the Auto IP mirrors // ================================================== ================================ private class AutoIPMirror { public string sURL; public string sStart; public string sEnd; public UInt32 iFailures; } // ================================================== ================================ // Detect ip // ================================================== ================================ public static void DetectInternetIP() { // ---------------------------------------------------- // Autodetect the Internet IP // ---------------------------------------------------- if (InternetIPAutodetect) { DateTime UpdateTime = InternetIPAutodetectLast; UpdateTime = UpdateTime.AddMinutes(MinutesBetweenIPAutodetect); if (UpdateTime<DateTime.Now) { string NewAddress = null; NewAddress = FindInternetIP(); InternetIPAutodetectLast = DateTime.Now; if (NewAddress!=null) { Address = NewAddress; } } } } // ================================================== ================================ // The serverlist event // ================================================== ================================ public static void EventSink_ServerList( ServerListEventArgs e ) { try { // ---------------------------------------------------- // Lets find internet ip // ---------------------------------------------------- DetectInternetIP(); // ---------------------------------------------------- // Find the server ip to use for this user // ---------------------------------------------------- IPAddress ipAddr = FindMachineIP(e); // ---------------------------------------------------- // Send serverlist // ---------------------------------------------------- if ( Resolve( Address != null && !IsLocalMachine( e.State ) ? Address : Dns.GetHostName(), out ipAddr ) ) { e.AddServer( ServerName, new IPEndPoint( ipAddr, Listener.Port ) ); *e.AddServer( ServerNameA, new IPEndPoint( ipAddr, PortA ) ); *e.AddServer( ServerNameB, new IPEndPoint( ipAddr, PortB ) ); *e.AddServer( ServerNameC, new IPEndPoint( ipAddr, PortC ) ); } else { e.Rejected = true; } } catch { e.Rejected = true; } } // ================================================== ================================ // Connects to a webserver that gives you your internet ip // ================================================== ================================ public static string FindInternetIP( ) { // ---------------------------------------------------- // Pick a random mirror // ---------------------------------------------------- Random rnd = new Random(); int UseMirror = (int)( rnd.NextDouble() * AutoIPMirrorsCount); string MyIP = ""; // ---------------------------------------------------- // Catch if the mirror is down // ---------------------------------------------------- try { // ---------------------------------------------------- // Get the webpage // ---------------------------------------------------- WebClient client = new WebClient(); byte[] pageData = client.DownloadData(AutoIPMirrors[UseMirror].sURL); MyIP = System.Text.Encoding.ASCII.GetString(pageData); // ---------------------------------------------------- // Find the string // ---------------------------------------------------- int iStart = MyIP.LastIndexOf(AutoIPMirrors[UseMirror].sStart); int iEnd = MyIP.IndexOf(AutoIPMirrors[UseMirror].sEnd, iStart+AutoIPMirrors[UseMirror].sStart.Length); MyIP = MyIP.Substring(iStart+AutoIPMirrors[UseMirror].sStart.Length, iEnd-iStart-AutoIPMirrors[UseMirror].sStart.Length ); MyIP = MyIP.Trim(); // ---------------------------------------------------- // Return value // ---------------------------------------------------- Console.WriteLine("Internet IP: {0} ({1})", MyIP, AutoIPMirrors[UseMirror].sURL); return MyIP; } catch { Console.WriteLine("Unable to autoupdate the Internet IP from {0}!", AutoIPMirrors[UseMirror].sURL); Console.WriteLine("----------------------------------------------------------------------"); Console.WriteLine(MyIP); Console.WriteLine("----------------------------------------------------------------------"); return null; } } // ================================================== ================================ // Calculates what server IP to use // ================================================== ================================ public static IPAddress FindMachineIP( ServerListEventArgs e ) { // ---------------------------------------------------- // Find the IP of the connecting user // ------------------------------ |