public void Execute(NetworkBase network)
        {
            switch (internCode)
            {
            case InternalCode.HostListResponse: network._MasterRPCHostListResponse(stream.ReadHostDatas()); break;

            case InternalCode.RegisterResponse: network._MasterRPCRegisterResponse(stream.ReadEndPoint()); break;

            case InternalCode.ProxyResponse: network._MasterRPCProxyResponse(stream.ReadUInt16(), stream.ReadPassword()); break;

            case InternalCode.ProxyClient: network._MasterRPCProxyClient(stream.ReadEndPoint(), stream.ReadPassword(), stream.ReadUInt16(), stream.ReadPassword()); break;

            case InternalCode.ProxyFailed: network._MasterRPCProxyFailed(stream.ReadInt32()); break;

            case InternalCode.RegisterFailed: network._MasterRPCRegisterFailed(stream.ReadInt32()); break;

            default:
                Log.Error(NetworkLogFlags.RPC, "Unknown internal Master RPC: ", internCode);
                break;
            }
        }
Exemplo n.º 2
0
        public void Execute(NetworkBase network)
        {
            switch (internCode)
            {
            case InternalCode.DiscoverHostRequest: network._UnconnectedRPCDiscoverHostRequest(stream.ReadHostDataFilter(), stream.ReadDouble(), endpoint); break;

            case InternalCode.DiscoverHostResponse: network._UnconnectedRPCDiscoverHostResponse(stream.ReadLocalHostData(), stream.ReadDouble(), endpoint); break;

            case InternalCode.KnownHostRequest: network._UnconnectedRPCKnownHostRequest(stream.ReadDouble(), stream.ReadBoolean(), endpoint); break;

            case InternalCode.KnownHostResponse: network._UnconnectedRPCKnownHostResponse(stream.ReadLocalHostData(), stream.ReadDouble(), endpoint); break;

            case InternalCode.PreConnectRequest: network._UnconnectedRPCPreConnectRequest(endpoint); break;

            case InternalCode.PreConnectResponse: network._UnconnectedRPCPreConnectResponse(endpoint); break;

            case InternalCode.LicenseRequest: network._UnconnectedRPCLicenseRequest(stream.ReadLocalHostData(), stream.ReadBoolean(), stream.ReadBytes(), endpoint); break;

            default:
                Log.Debug(NetworkLogFlags.RPC, "Unknown internal Unconnected RPC: ", internCode, " from ", endpoint);
                break;
            }
        }
        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;
            }
        }
Exemplo n.º 4
0
 internal NetworkViewBase(NetworkBase network)
 {
     _network = network;
 }