It occurs when sending a string.
I will check the exception in 15 mins. On the phone now.
System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at InSimDotNet.EncodingHelper.GetBytes(String value, Byte[] buffer, Int32 index, Int32 length) in G:\Users\Povilas\Desktop\InSimDotNet\EncodingHelper.cs:line 94
at InSimDotNet.PacketWriter.Write(String value, Int32 length) in G:\Users\Povilas\Desktop\InSimDotNet\PacketWriter.cs:line 108
at InSimDotNet.Packets.IS_BTN.GetBuffer() in G:\Users\Povilas\Desktop\InSimDotNet\Packets\IS_BTN.cs:line 121
at InSimDotNet.InSim.Send(ISendable packet) in G:\Users\Povilas\Desktop\InSimDotNet\InSim.cs:line 231
at LsCruise.Processor.QueueButton(String Text, ButtonStyles ButtonStyles, Byte ClickID, Byte H, Byte W, Byte T, Byte L, Byte ReqI, Byte UCID) in G:\Users\Povilas\Desktop\Visual Studio 2010\RC_new\ConsoleApplication1\Processor.cs:line 26
at LsCruise.Program.bttHandler(InSim InSim, IS_BTT BTT) in G:\Users\Povilas\Desktop\Visual Studio 2010\RC_new\ConsoleApplication1\eventHandlers\bttHandler.cs:line 48
System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at InSimDotNet.EncodingHelper.GetBytes(String value, Byte[] buffer, Int32 index, Int32 length) in G:\Users\Povilas\Desktop\InSimDotNet\EncodingHelper.cs:line 94
at InSimDotNet.PacketWriter.Write(String value, Int32 length) in G:\Users\Povilas\Desktop\InSimDotNet\PacketWriter.cs:line 108
at InSimDotNet.Packets.IS_BTN.GetBuffer() in G:\Users\Povilas\Desktop\InSimDotNet\Packets\IS_BTN.cs:line 121
at InSimDotNet.InSim.Send(ISendable packet) in G:\Users\Povilas\Desktop\InSimDotNet\InSim.cs:line 231
at LsCruise.Processor.QueueButton(String Text, ButtonStyles ButtonStyles, Byte ClickID, Byte H, Byte W, Byte T, Byte L, Byte ReqI, Byte UCID) in G:\Users\Povilas\Desktop\Visual Studio 2010\RC_new\ConsoleApplication1\Processor.cs:line 26
at LsCruise.Program.bttHandler(InSim InSim, IS_BTT BTT) in G:\Users\Povilas\Desktop\Visual Studio 2010\RC_new\ConsoleApplication1\eventHandlers\bttHandler.cs:line 48
Message: Index was outside the bounds of the array.
StackTrace: at InSimDotNet.EncodingHelper.GetBytes(String value, Byte[] buffer, Int32 index, Int32 length) in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\EncodingHelper.cs:line 92
at InSimDotNet.PacketWriter.Write(String value, Int32 length) in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\PacketWriter.cs:line 121
at InSimDotNet.Packets.IS_MST.GetBuffer() in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\Packets\IS_MST.cs:line 50
at InSimDotNet.InSim.Send(ISendable packet) in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\InSim.cs:line 231
at InSimDotNet.InSim.Send(String message, Object[] args) in C:\Users\Loran\Desktop\Random\InSimDotNet\insimdotnet_6b678d6ab605\InSimDotNet\InSim.cs:line 265
at Dizplay_Cruise.Dizplay.iSendMsg(String Message) in D:\Loran\Programming\C#\Live for Speed\Dizplay\Cruise A.0.1\Dizplay Cruise\Dizplay Cruise\Dizplay.cs:line 240
at Dizplay_Cruise.Dizplay.Received_CON(InSim InSim, IS_CON CON) in D:\Loran\Programming\C#\Live for Speed\Dizplay\Cruise A.0.1\Dizplay Cruise\Dizplay Cruise\Dizplay.cs:line 553
Target: Int32 GetBytes(System.String, Byte[], Int32, Int32)
<?php
iSendMsg("^7Crash: " + A.NCN.PName + " ^7>< " + B.NCN.PName + " ^7(" + Speed + " km/h)");
?>
<?php
public static void iSendMsg(string Message)
{
InSim.Send(Globals.MS + Message); // This is line 240
}
?>
private static void Collision(InSim insim, IS_CON con) {
IS_NPL a = _players[con.A.PLID];
IS_NPL b = _players[con.B.PLID];
double speed = MathHelper.MpsToKph((con.SpClose & 0x00ff) * 0.1);
insim.Send("^7Crash: " + a.PName + " ^7>< " + b.PName + " ^7(" + speed + " km/h)");
}
<?php
public static readonly string MS = "^3» ";
?>
^7☆THC﹥^3Broken^7☆
Base64 encoded: XjfimIZUSEPvuaVeM0Jyb2tlbl434piG
^3» ^7Crash: ^7☆THC﹥^3Broken^7☆ ^7>< ^tGaz^t ^7(0.00 km/h)
insim.Initialize(new InSimSettings { Prefix = '!' });
void MessageOut(InSim insim, IS_MSO mso) {
if (mso.UserType == UserType.MSO_PREFIX) {
string command = mso.Msg.Substring(mso.TextStart);
if (command == "!top") {
// Do something...
}
}
}
static void MessageOut(InSim insim, IS_MSO mso)
{
try
{
if (mso.UCID != 0)
{
var npl = players[mso.PLID];
var nco = players_info[mso.UCID];
if (mso.UserType == UserType.MSO_PREFIX)
{
insim.Send("/msg MSG=" + mso.Msg);