|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Join Date: Apr 2004
Age: 28
Posts: 10
|
i have this error
Scripts: Compiling C# scripts...failed (3 errors, 0 warnings) - Error: Scripts\Misc\ServerList.cs: CS1518: (line 89, column 17) Expected clas s, delegate, enum, interface, or struct - Error: Scripts\Misc\ServerList.cs: CS1003: (line 104, column 59) Syntax error , ']' expected - Error: Scripts\Misc\ServerList.cs: CS1022: (line 106, column 6) Type or names pace definition, or end-of-file expected Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. and here is my server list: using System; using System.Net; using System.Net.Sockets; using Server; using Server.Network; namespace Server.Misc { public class ServerList { public static void Initialize() { Listener.Port = 2593; EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList ); } private static bool OnServerLocalNetwork( Socket s ) { // Check for Loopback also IPEndPoint LEndPoint = (IPEndPoint)s.LocalEndPoint; IPEndPoint REndPoint = (IPEndPoint)s.RemoteEndPoint; string LocalIP = LEndPoint.Address.ToString(); string RemoteIP = REndPoint.Address.ToString(); int lastdot = RemoteIP.LastIndexOf('.'); if ( !(LocalIP.Substring(0,lastdot) == RemoteIP.Substring(0,lastdot)) ) return false; else return true; // ((IPEndPoint)e.State.Socket.RemoteEndPoint).Addres s.ToString() } public static void EventSink_ServerList( ServerListEventArgs e ) { bool Router = true; string ServerName = "disorder"; string Domain = "disorder.3utilities.com"; if (!Router) { IPHostEntry thisHost = Dns.Resolve( Dns.GetHostName() ); IPAddress[] addressList = thisHost.AddressList; if ( addressList.Length > 0 ) { e.AddServer( ServerName, new IPEndPoint( addressList[addressList.Length - 1], Listener.Port ) ); } else { e.Rejected = true; } } else if (OnServerLocalNetwork(e.State.Socket)) { // Check for Loopback client - no, check for local network. IPHostEntry thisHost = Dns.Resolve( Dns.GetHostName() ); IPAddress[] addressList = thisHost.AddressList; if (addressList.Length > 0) { e.AddServer( ServerName, new IPEndPoint( addressList[addressList.Length - 1], Listener.Port ) ); } else { e.Rejected = true; } } else { // If behind a router, and not on local network: IPHostEntry thisHost = Dns.Resolve(Domain); IPAddress[] addressList = thisHost.AddressList; if (addressList.Length > 0) { e.AddServer( ServerName, new IPEndPoint( addressList[addressList.Length - 1], Listener.Port ) ); } else { 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; } } } PLZ HELP ME!!!! lol thanks |
|
|
|
|
|
#3 (permalink) | |
|
Account Terminated
|
Quote:
We will tell you what to fix, but your going to do it. I will look at it in about an hour, I don't feel like helping you after reading your reply. |
|
|
|
|
|
|
#6 (permalink) |
|
Join Date: Feb 2004
Location: Canada eh
Posts: 413
|
Too many '}' in EventSink_ServerList
The error message is correct and distinct, the compiler did not know what to do at (line 89, column 17). Start looking there and work your way back from there. ----------------------------------------------------------------------------------------------------------------------------------- awdball · NON-beligerent Forum Member · · · · ;^) · · · · RUNUO-FAQ · · [CODE] Post CODE inside tags [/CODE] The team for moderation on RUNUO Forums · · · · HelpSomeone (old school c coder learning and luvin c#) · · · · · · · Great C# Tutorial
__________________
awdball |
|
|
|
|
|
#9 (permalink) | |
|
Join Date: Feb 2004
Location: Canada eh
Posts: 413
|
Quote:
Do a C# tutorial or two also. This ia a programming language and not very forgiving. ----------------------------------------------------------------------------------------------------------------------------------- awdball · NON-beligerent Forum Member · · · · ;^) · · · · RUNUO-FAQ · · [CODE] Post CODE inside tags [/CODE] The team for moderation on RUNUO Forums · · · · HelpSomeone (old school c coder learning and luvin c#) · · · · · · · Great C# Tutorial
__________________
awdball |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|