Пример #1
0
/*
========================
idLobby::UpdateSessionUserOnPeers
========================
*/
void idLobby::UpdateSessionUserOnPeers( idBitMsg & msg ) {
	for ( int p = 0; p < peers.Num(); p++ ) {
		QueueReliableMessage( p, RELIABLE_UPDATE_SESSION_USER, msg.GetReadData() + msg.GetReadCount(), msg.GetSize() - msg.GetReadCount() );
	}

	HandleUpdateSessionUser( msg );
}
Пример #2
0
/*
============
sdGUIDFile::ListBans
============
*/
void sdGUIDFile::ListBans( const idBitMsg& msg ) {
	while ( msg.GetSize() != msg.GetReadCount() ) {
		int index = msg.ReadLong();
		char buffer[ 128 ];
		msg.ReadString( buffer, sizeof( buffer ) );
		gameLocal.Printf( "%d: %s\n", index, buffer );
	}
}
/*
===============
idCommonLocal::NetReceiveReliable
===============
*/
void idCommonLocal::NetReceiveReliable( int peer, int type, idBitMsg & msg ) {
    int clientNum = Game()->MapPeerToClient( peer );
    // Only servers care about the client num. Band-aid for problems related to the host's peerIndex being -1 on clients.
    if ( common->IsServer() && clientNum == -1 ) {
        idLib::Warning( "NetReceiveReliable: Could not find client for peer %d", peer );
        return;
    }

    const byte * msgData = msg.GetReadData() + msg.GetReadCount();
    int msgSize = msg.GetRemainingData();
    reliableMsg_t & reliable = reliableQueue.Alloc();
    reliable.client = clientNum;
    reliable.type = type;
    reliable.dataSize = msgSize;
    reliable.data = (byte *)Mem_Alloc( msgSize, TAG_NETWORKING );
    memcpy( reliable.data, msgData, msgSize );
}