/// <summary>
/// Check the argument update with the stream and start index
/// </summary>
/// <param name="stream">Stream to be updated</param>
/// <param name="start">Start index</param>
public ulong SetupInstantiateId(NetworkingStream stream, int start)
{
ulong id = 0;
if (MethodName == INSTANTIATE_METHOD_NAME)
{
string objName = stream.Bytes.GetString(start + 16);
if (!NetworkingManager.TryPullIdFromObject(objName, ref id))
{
throw new NetworkException("Invalid object being instantiated");
}
if (id == 0)
{
throw new NetworkException("Invalid object being instantiated");
}
idReplacer = BitConverter.GetBytes(id);
for (int i = 0; i < idReplacer.Length; i++)
{
stream.Bytes.byteArr[start + sizeof(ulong) + i] = idReplacer[i];
}
}
return(id);
}