private static void OnCommandMessage(NetworkMessage netMsg)
{
int cmdHash = (int) netMsg.reader.ReadPackedUInt32();
NetworkInstanceId netId = netMsg.reader.ReadNetworkId();
GameObject obj2 = FindLocalObject(netId);
if (obj2 == null)
{
if (LogFilter.logWarn)
{
Debug.LogWarning("Instance not found when handling Command message [netId=" + netId + "]");
}
}
else
{
NetworkIdentity component = obj2.GetComponent<NetworkIdentity>();
if (component == null)
{
if (LogFilter.logWarn)
{
Debug.LogWarning("NetworkIdentity deleted when handling Command message [netId=" + netId + "]");
}
}
else
{
bool flag = false;
for (int i = 0; i < netMsg.conn.playerControllers.Count; i++)
{
PlayerController controller = netMsg.conn.playerControllers[i];
if ((controller.gameObject != null) && (controller.gameObject.GetComponent<NetworkIdentity>().netId == component.netId))
{
flag = true;
break;
}
}
if (!flag && (component.clientAuthorityOwner != netMsg.conn))
{
if (LogFilter.logWarn)
{
Debug.LogWarning("Command for object without authority [netId=" + netId + "]");
}
}
else
{
if (LogFilter.logDev)
{
Debug.Log(string.Concat(new object[] { "OnCommandMessage for netId=", netId, " conn=", netMsg.conn }));
}
component.HandleCommand(cmdHash, netMsg.reader);
}
}
}
}