Llorenç Marti
unread,Oct 19, 2010, 4:41:23 AM10/19/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lidgren-network
Hi Michael
I want to inform that for new security reasons, i think Lidgren
library is not working with new Unity 3 (remember that i am not 100%
sure that i am correct).
(Lidgren gen 2 used)
I found that:
- When i execute the game in windows/PC mode, all OK.
- When i execute the game via WebPlayer, then, a problem arise at
connection
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: options
at System.Text.RegularExpressions.Regex.validate_options
(RegexOptions options) [0x00000] in <filename unknown>:0
at System.Text.RegularExpressions.Regex..ctor (System.String
pattern, RegexOptions options) [0x00000] in <filename unknown>:0
at Lidgren.Network.NetUtility.Resolve (System.String ipOrHost)
[0x00000] in <filename unknown>:0
at Lidgren.Network.NetClient.Connect (System.String host, Int32
port, System.Byte[] hailData) [0x00000] in <filename unknown>:0
at NetHandler.Start () [0x00000] in <filename unknown>:0
I pass "192.168.1.10" and 38381 to tha 'Connect' function, so, when
the Lidgren Lib tries to resolve the IP (string ----> byte[ ]) then
it crashes.
//
-------------------------------------------------------------------------------
public static IPAddress Resolve(string ipOrHost)
{
if (string.IsNullOrEmpty(ipOrHost))
throw new ArgumentException("Supplied string must not be empty",
"ipOrHost");
ipOrHost = ipOrHost.Trim();
if (s_regIP == null)
{
string expression = "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\
\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b";
RegexOptions options = RegexOptions.Compiled;
s_regIP = new Regex(expression, options);
<-------------------------------------------- ( I think its here
the problem )
}
....
//
-------------------------------------------------------------------------------
I can bypass this error using the other Connect function that takes a
byte array and doesnt need any Resolve instruction.
Thanks for your time and work :)
LLORENS