public void ExecuteInternal(NetworkBase network)
        {
            // TODO: optimize arg reading!

            switch (internCode)
            {
            case InternalCode.BufferedRPCs: network._RPCBufferedRPCs(stream.ReadSerializedBuffers(), this); break;

            case InternalCode.CellConnectResponse: network._RPCCellConnectResponse(stream.ReadNetworkPlayer(), stream.ReadBoolean(), this); break;

            case InternalCode.ClientConnectRequest: network._RPCClientConnectRequest(stream, this); break;

            case InternalCode.ClientConnectResponse: network._RPCClientConnectResponse(stream.ReadNetworkPlayer(), stream, this); break;

            case InternalCode.ConnectDenied: network._RPCConnectDenied(stream.ReadInt32(), this); break;

            case InternalCode.Create: network._RPCCreate(stream.ReadNetworkPlayer(), stream.ReadNetworkGroup(), (NetworkAuthFlags)stream.ReadByte(), stream.ReadVector3(), stream.ReadQuaternion(), stream.ReadString(), stream.ReadString(), stream.ReadString(), stream.ReadString(), stream.ReadString(), stream, this); break;

            case InternalCode.DestroyByPlayerID: network._RPCDestroyByPlayerID(stream.ReadNetworkPlayer(), this); break;

            case InternalCode.DestroyByViewID: network._RPCDestroyByViewID(this); break;

            case InternalCode.HandoverRequest: network._RPCHandoverRequest(stream.ReadNetworkViewID(), this); break;

            case InternalCode.HandoverResponse: network._RPCHandoverResponse(stream.ReadNetworkViewID(), stream.ReadNetworkPlayer(), stream.ReadNetworkGroup(), (NetworkAuthFlags)stream.ReadByte(), stream.ReadVector3(), stream.ReadQuaternion(), stream.ReadString(), stream.ReadString(), stream.ReadString(), stream.ReadString(), stream.ReadString(), stream.ReadBytes(), stream, this); break;

            case InternalCode.Redirect: network._RPCRedirect(stream.ReadEndPoint(), stream.ReadPassword(), this); break;

            case InternalCode.SecurityRequest: network._RPCSecurityRequest(stream.ReadPublicKey(), this); break;

            case InternalCode.SecurityResponse: network._RPCSecurityResponse(stream.ReadSymmetricKey(), this); break;

            case InternalCode.UnsecurityRequest: network._RPCUnsecurityRequest(stream.ReadSymmetricKey(), this); break;

            case InternalCode.UnsecurityResponse: network._RPCUnsecurityResponse(this); break;

            case InternalCode.StateSyncOwner: network._RPCStateSyncOwner(stream, this); break;

            case InternalCode.StateSyncProxy: network._RPCStateSyncProxy(stream, this); break;

            case InternalCode.PlayerIDConnected: network._RPCPlayerIDConnected(stream.ReadNetworkPlayer(), stream.ReadEndPoint(), stream, this); break;

            case InternalCode.PlayerIDDisconnected: network._RPCPlayerIDDisconnected(stream.ReadNetworkPlayer(), stream.ReadInt32(), this); break;

            case InternalCode.MultiStateSyncProxy: network._RPCMultiStateSyncProxy(this); break;

            case InternalCode.MultiStateSyncOwner: network._RPCMultiStateSyncOwner(stream.ReadStateSyncs(), this); break;

            case InternalCode.DestroyAll: network._RPCDestroyAll(!stream.isEOF && stream.ReadBoolean(), this); break;

            case InternalCode.DestroyInGroup: network._RPCDestroyInGroup(stream.ReadNetworkGroup(), this); break;

            case InternalCode.DestroyInGroupByPlayerID: network._RPCDestroyInGroupByPlayerID(stream.ReadNetworkPlayer(), stream.ReadNetworkGroup(), this); break;

            case InternalCode.LicenseCheck: network._RPCLicenseCheck(this); break;

            case InternalCode.ChangeGroup: network._RPCChangeGroup(stream.ReadNetworkViewID(), stream.ReadNetworkGroup(), this); break;

            case InternalCode.StateSyncCellProxy: network._RPCStateSyncCellProxy(stream, this); break;

            case InternalCode.MultiStateSyncCellProxy: network._RPCMultiStateSyncCellProxy(this); break;

            case InternalCode.RepairAuthFromProxyRequest: network._RPCRepairAuthFromProxyRequest(stream.ReadNetworkViewID(), this); break;

            case InternalCode.MastDebugInfo: network._RPCMastDebugInfo(stream.ReadVector3(), this); break;

            case InternalCode.ChangeAuthFlags: network._RPCChangeAuthFlags(stream.ReadNetworkViewID(), (NetworkAuthFlags)stream.ReadByte(), stream.ReadVector3(), this); break;

            case InternalCode.StateSyncOwnerDeltaCompressed: network._RPCStateSyncOwnerDeltaCompressed(stream, this); break;

            case InternalCode.StateSyncProxyDeltaCompressed: network._RPCStateSyncProxyDeltaCompressed(stream, this); break;

            case InternalCode.StateSyncOwnerDeltaCompressedInit: network._RPCStateSyncOwnerDeltaCompressedInit(stream, this); break;

            case InternalCode.StateSyncProxyDeltaCompressedInit: network._RPCStateSyncProxyDeltaCompressedInit(stream, this); break;

            default:
                Log.Debug(NetworkLogFlags.RPC, "Unknown internal RPC: ", internCode, " from ", connection, " channel ", channel);
                break;
            }
        }