Strange problem, I tried to follow guide on how to initialize insimdotnet by DarkTimes somehow whenever debugging on the insim, I need to disconnect and reconnect at the host again just to see the NCN Messages.
I attached my code here, I couldn't somehow solve it
I attached my code here, I couldn't somehow solve it
<?php
public static InSim insim = new InSim();
public void InSimConnect()
{
try
{
insim = newInSimObject();
// Initialize InSim
insim.Initialize(new InSimSettings
{
Host = "127.0.0.1",
Port = 29999,
Admin = "sadmin",
Prefix = '!',
Interval = 500,
Flags = InSimFlags.ISF_AXM_EDIT | InSimFlags.ISF_AXM_LOAD | InSimFlags.ISF_CON | InSimFlags.ISF_MCI | InSimFlags.ISF_MSO_COLS | InSimFlags.ISF_OBH,
UdpPort = 0,
IName = "^2DRAG"
});
}
catch (InSimException ex) { MessageBox.Show(ex.Message); }
finally
{
insim.Bind<IS_NCN>(NCN_ClientJoinsHost);
// Request players.
insim.Send(new IS_TINY { SubT = TinyType.TINY_SST, ReqI = 255 });
insim.Send(new IS_TINY { SubT = TinyType.TINY_ISM, ReqI = 255 });
insim.Send(new IS_TINY { SubT = TinyType.TINY_VER, ReqI = 255 });
insim.Send(new IS_TINY { SubT = TinyType.TINY_NPL, ReqI = 255 });
if (insim.IsConnected == true)
{
insim.Send("/wind=0");
insim.Send("/wind=1");
insim.Send("/pit_all");
}
System.Threading.Thread.Sleep(1000);
}
}
private void NCN_ClientJoinsHost(InSim ins, IS_NCN NCN)
{
insim.Send(new IS_MTC { Msg = "Test Hello!, " + NCN.PName, UCID = NCN.UCID });
}
?>