|
||
|
|||||||
| Network Modifications This forum is for modifications to the networking code of RunUO |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
|
Greetings,
With the recent SVN 264 change, Listener.Port was changed to IPEndPoint[] m_EndPoints, so it could read other ports than just 2593. I am trying to fix a script that used Listern.Port and would like to know how to change it to do the range, instead of erroring out. Code:
if (((IPEndPoint)from.Socket.LocalEndPoint).Port != Listener.Port)
{
//Do Stuff Here
}
Code:
IPEndPoint[] ipep = Listener.EndPoints;
m_Listeners = new Listener[ipep.Length];
bool success = false;
do
{
for (int i = 0; i < ipep.Length; i++)
{
if (((IPEndPoint)from.Socket.LocalEndPoint).Port != ipep.Length)
{
//Do Stuff Here
return;
}
}
if (!success)
{
Console.WriteLine("Retrying...");
Thread.Sleep(10000);
}
} while (!success);
-Ravon
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|