
Forward declaration. More...
Forward declarations.
The namespace RakNet is not consistently used. It's only purpose is to avoid compiler errors for classes whose names are very common. For the most part I've tried to avoid this simply by using names very likely to be unique for my classes.
| anonymous enum |
| SEND_SERIALIZATION_GENERIC_TO_SYSTEM |
Serialization command initiated by the user. |
| BROADCAST_SERIALIZATION_GENERIC_TO_SYSTEM |
Serialization command initiated by the user. |
| SEND_SERIALIZATION_CONSTRUCTION_TO_SYSTEM |
Serialization command automatically called after sending construction of the object. |
| BROADCAST_SERIALIZATION_CONSTRUCTION_TO_SYSTEM |
Serialization command automatically called after sending construction of the object. |
| SEND_AUTO_SERIALIZE_TO_SYSTEM |
Automatic serialization of data, based on Replica2::AddAutoSerializeTimer. |
| BROADCAST_AUTO_SERIALIZE_TO_SYSTEM |
Automatic serialization of data, based on Replica2::AddAutoSerializeTimer. |
| RELAY_SERIALIZATION_TO_SYSTEMS |
Received a serialization command, relaying to systems other than the sender. |
| SEND_CONSTRUCTION_SERIALIZATION_AUTO_INITIAL_DOWNLOAD_TO_SYSTEM |
If SetAutoAddNewConnections is true, this is the command sent when sending all game objects to new connections automatically. |
| SEND_VISIBILITY_AUTO_INITIAL_DOWNLOAD_TO_SYSTEM | |
| SEND_DATA_SERIALIZATION_AUTO_INITIAL_DOWNLOAD_TO_SYSTEM |
The data portion of the game download, preceeded by SEND_CONSTRUCTION_SERIALIZATION_AUTO_INITIAL_DOWNLOAD_TO_SYSTEM. |
| SEND_DESTRUCTION_GENERIC_TO_SYSTEM |
Default reason to send a destruction command. |
| SEND_DESTRUCTION_VISIBILITY_RECALCULATION_TO_SYSTEM |
Triggered by ReplicaManager2::RecalculateVisibility - A replica is now never constructed, so needs to be destroyed. |
| BROADCAST_DESTRUCTION_GENERIC_TO_SYSTEM |
Triggered by Replica2::BroadcastDestruction. |
| RELAY_DESTRUCTION_TO_SYSTEMS |
Received destruction message, relaying to other systems. |
| SEND_CONSTRUCTION_GENERIC_TO_SYSTEM |
Default reason to send a construction command. |
| SEND_CONSTRUCTION_VISIBILITY_RECALCULATION_TO_SYSTEM |
Triggered by ReplicaManager2::RecalculateVisibility - A replica is now always constructed, so needs to be created. |
| BROADCAST_CONSTRUCTION_GENERIC_TO_SYSTEM |
Triggered by Replica2::BroadcastConstruction(). |
| SEND_CONSTRUCTION_REQUEST_TO_SERVER |
Replica2::QueryIsConstructionAuthority()==false yet we called ReplicaManager2::SendConstruction(). |
| BROADCAST_CONSTRUCTION_REQUEST_ACCEPTED_TO_SYSTEM |
A non-authority object was created by a client, accepted, and is now relayed to all other connected systems. |
| SEND_CONSTRUCTION_REPLY_ACCEPTED_TO_CLIENT |
A non-authority object was created by a client, accepted. |
| SEND_CONSTRUCTION_REPLY_DENIED_TO_CLIENT |
A non-authority object was created by a client, denied. |
| SEND_VISIBILITY_TRUE_TO_SYSTEM |
An object is visible. |
| BROADCAST_VISIBILITY_TRUE_TO_SYSTEM |
An object is visible. |
| SEND_VISIBILITY_FALSE_TO_SYSTEM |
An object is not visible. |
| BROADCAST_VISIBILITY_FALSE_TO_SYSTEM |
An object is not visible. |
| RELAY_VISIBILITY_TRUE_TO_SYSTEMS |
An object is visible, and we are telling other systems about this. |
| RELAY_VISIBILITY_FALSE_TO_SYSTEMS |
An object is visible, and we are telling other systems about this. |
| AUTOSERIALIZE_RESYNCH_ONLY |
Calling Replica2::Serialize() for the purpose of reading memory to compare against later. This read will not be transmitted. |
| AUTOSERIALIZE_DEFAULT |
Calling Replica2::Serialize() to compare against a prior call. The serialization may be transmitted. |
| UNDEFINED_REASON |
Start your own reasons one unit past this enum. |
Definition at line 37 of file ReplicaManager2.h.
{
SEND_SERIALIZATION_GENERIC_TO_SYSTEM,
BROADCAST_SERIALIZATION_GENERIC_TO_SYSTEM,
SEND_SERIALIZATION_CONSTRUCTION_TO_SYSTEM,
BROADCAST_SERIALIZATION_CONSTRUCTION_TO_SYSTEM,
SEND_AUTO_SERIALIZE_TO_SYSTEM,
BROADCAST_AUTO_SERIALIZE_TO_SYSTEM,
RELAY_SERIALIZATION_TO_SYSTEMS,
SEND_CONSTRUCTION_SERIALIZATION_AUTO_INITIAL_DOWNLOAD_TO_SYSTEM,
// Automatically sent message indicating if the replica is visible or not to a new connection
SEND_VISIBILITY_AUTO_INITIAL_DOWNLOAD_TO_SYSTEM,
SEND_DATA_SERIALIZATION_AUTO_INITIAL_DOWNLOAD_TO_SYSTEM,
SEND_DESTRUCTION_GENERIC_TO_SYSTEM,
SEND_DESTRUCTION_VISIBILITY_RECALCULATION_TO_SYSTEM,
BROADCAST_DESTRUCTION_GENERIC_TO_SYSTEM,
RELAY_DESTRUCTION_TO_SYSTEMS,
SEND_CONSTRUCTION_GENERIC_TO_SYSTEM,
SEND_CONSTRUCTION_VISIBILITY_RECALCULATION_TO_SYSTEM,
BROADCAST_CONSTRUCTION_GENERIC_TO_SYSTEM,
SEND_CONSTRUCTION_REQUEST_TO_SERVER,
BROADCAST_CONSTRUCTION_REQUEST_ACCEPTED_TO_SYSTEM,
SEND_CONSTRUCTION_REPLY_ACCEPTED_TO_CLIENT,
SEND_CONSTRUCTION_REPLY_DENIED_TO_CLIENT,
SEND_VISIBILITY_TRUE_TO_SYSTEM,
BROADCAST_VISIBILITY_TRUE_TO_SYSTEM,
SEND_VISIBILITY_FALSE_TO_SYSTEM,
BROADCAST_VISIBILITY_FALSE_TO_SYSTEM,
RELAY_VISIBILITY_TRUE_TO_SYSTEMS,
RELAY_VISIBILITY_FALSE_TO_SYSTEMS,
AUTOSERIALIZE_RESYNCH_ONLY,
AUTOSERIALIZE_DEFAULT,
UNDEFINED_REASON,
};
Definition at line 15 of file NatTypeDetectionCommon.h.
{
NAT_TYPE_NONE,
NAT_TYPE_FULL_CONE,
NAT_TYPE_ADDRESS_RESTRICTED,
NAT_TYPE_PORT_RESTRICTED,
NAT_TYPE_SYMMETRIC,
NAT_TYPE_UKNOWN,
NAT_TYPE_DETECTION_IN_PROGRESS,
NAT_TYPE_SUPPORTS_UPNP,
NAT_TYPE_COUNT
};
Error codes returned by a remote system as to why an RPC function call cannot execute Follows packet ID ID_RPC_REMOTE_ERROR Name of the function will be appended, if available. Read as follows: char outputBuff[256]; stringCompressor->DecodeString(outputBuff,256,&RakNet::BitStream(p->data+sizeof(MessageID)+1,p->length-sizeof(MessageID)-1,false),0); printf("Function: %s\n", outputBuff);
| RPC_ERROR_NETWORK_ID_MANAGER_UNAVAILABLE |
AutoRPC::SetNetworkIDManager() was not called, and it must be called to call a C++ object member. |
| RPC_ERROR_OBJECT_DOES_NOT_EXIST |
Cannot execute C++ object member call because the object specified by SetRecipientObject() does not exist on this system. |
| RPC_ERROR_FUNCTION_INDEX_OUT_OF_RANGE |
Internal error, index optimization for function lookup does not exist. |
| RPC_ERROR_FUNCTION_NOT_REGISTERED |
Named function was not registered with RegisterFunction(). Check your spelling. |
| RPC_ERROR_FUNCTION_NO_LONGER_REGISTERED |
Named function was registered, but later unregistered with UnregisterFunction() and can no longer be called. |
| RPC_ERROR_CALLING_CPP_AS_C |
SetRecipientObject() was not called before Call(), but RegisterFunction() was called with isObjectMember=true If you intended to call a CPP function, call SetRecipientObject() with a valid object first. |
| RPC_ERROR_CALLING_C_AS_CPP |
SetRecipientObject() was called before Call(), but RegisterFunction() was called with isObjectMember=false If you intended to call a C function, call SetRecipientObject(UNASSIGNED_NETWORK_ID) first. |
| RPC_ERROR_STACK_TOO_SMALL |
Internal error, passed stack is bigger than current stack. Check that the version is the same on both systems. |
| RPC_ERROR_STACK_DESERIALIZATION_FAILED |
Internal error, formatting error with how the stack was serialized. |
| RPC_ERROR_INCORRECT_NUMBER_OF_PARAMETERS |
The parameterCount parameter passed to RegisterFunction() on this system does not match the parameterCount parameter passed to SendCall() on the remote system. |
| RPC_ERROR_FUNCTION_NOT_REGISTERED |
Named function was not registered with RegisterFunction(). Check your spelling. |
Definition at line 123 of file AutoRPC.h.
{
RPC_ERROR_NETWORK_ID_MANAGER_UNAVAILABLE,
RPC_ERROR_OBJECT_DOES_NOT_EXIST,
RPC_ERROR_FUNCTION_INDEX_OUT_OF_RANGE,
RPC_ERROR_FUNCTION_NOT_REGISTERED,
RPC_ERROR_FUNCTION_NO_LONGER_REGISTERED,
RPC_ERROR_CALLING_CPP_AS_C,
RPC_ERROR_CALLING_C_AS_CPP,
RPC_ERROR_STACK_TOO_SMALL,
RPC_ERROR_STACK_DESERIALIZATION_FAILED,
RPC_ERROR_INCORRECT_NUMBER_OF_PARAMETERS,
};
| UDPFORWARDER_FORWARDING_ALREADY_EXISTS | |
| UDPFORWARDER_NO_SOCKETS | |
| UDPFORWARDER_INVALID_PARAMETERS | |
| UDPFORWARDER_SUCCESS |
Definition at line 27 of file UDPForwarder.h.
{
UDPFORWARDER_FORWARDING_ALREADY_EXISTS,
UDPFORWARDER_NO_SOCKETS,
UDPFORWARDER_INVALID_PARAMETERS,
UDPFORWARDER_SUCCESS,
};
| void * RakNet::_DLMallocDirectMMap | ( | size_t | size | ) |
Definition at line 257 of file RakMemoryOverride.cpp.
{(void) size; return 0;}
| void * RakNet::_DLMallocMMap | ( | size_t | size | ) |
Definition at line 256 of file RakMemoryOverride.cpp.
{(void) size; return 0;}
| int RakNet::_DLMallocMUnmap | ( | void * | p, | |
| size_t | size | |||
| ) |
Definition at line 258 of file RakMemoryOverride.cpp.
{(void) size; (void) p; return 0;}
| void RakNet::_RakFree | ( | void * | p | ) |
Definition at line 139 of file RakMemoryOverride.cpp.
{
free(p);
}
| void RakNet::_RakFree_Ex | ( | void * | p, | |
| const char * | file, | |||
| unsigned int | line | |||
| ) |
Definition at line 160 of file RakMemoryOverride.cpp.
{
(void) file;
(void) line;
free(p);
}
| void * RakNet::_RakMalloc | ( | size_t | size | ) |
Definition at line 129 of file RakMemoryOverride.cpp.
{
return malloc(size);
}
| void * RakNet::_RakMalloc_Ex | ( | size_t | size, | |
| const char * | file, | |||
| unsigned int | line | |||
| ) |
Definition at line 144 of file RakMemoryOverride.cpp.
{
(void) file;
(void) line;
return malloc(size);
}
| void * RakNet::_RakRealloc | ( | void * | p, | |
| size_t | size | |||
| ) |
Definition at line 134 of file RakMemoryOverride.cpp.
{
return realloc(p,size);
}
| void * RakNet::_RakRealloc_Ex | ( | void * | p, | |
| size_t | size, | |||
| const char * | file, | |||
| unsigned int | line | |||
| ) |
Definition at line 152 of file RakMemoryOverride.cpp.
{
(void) file;
(void) line;
return realloc(p,size);
}
| bool RakNet::CanConnect | ( | NATTypeDetectionResult | type1, | |
| NATTypeDetectionResult | type2 | |||
| ) |
If one system is NAT_TYPE_SYMMETRIC, the other must be NAT_TYPE_ADDRESS_RESTRICTED or less If one system is NAT_TYPE_PORT_RESTRICTED, the other must be NAT_TYPE_PORT_RESTRICTED or less
Definition at line 7 of file NatTypeDetectionCommon.cpp.
{
bool connectionGraph[5][5] =
{
// None, Full Cone, Address Restricted, Port Restricted, Symmetric
true, true, true, true, true, // None
true, true, true, true, true, // Full Cone
true, true, true, true, true, // Address restricted
true, true, true, true, false, // Port restricted
true, true, true, false, false, // Symmetric
};
return connectionGraph[(int) type1][(int) type2];
}
| SOCKET RakNet::CreateNonblockingBoundSocket | ( | const char * | bindAddr | ) |
Definition at line 64 of file NatTypeDetectionCommon.cpp.
References SocketLayer::CreateBoundSocket(), and SocketLayer::Instance().
Referenced by RakNet::NatTypeDetectionClient::DetectNATType(), and RakNet::NatTypeDetectionServer::Startup().
{
SOCKET s = SocketLayer::Instance()->CreateBoundSocket( 0, false, bindAddr, true );
#ifdef _WIN32
unsigned long nonblocking = 1;
ioctlsocket( s, FIONBIO, &nonblocking );
#elif defined(_PS3) || defined(__PS3__) || defined(SN_TARGET_PS3)
#else
fcntl( s, F_SETFL, O_NONBLOCK );
#endif
return s;
}
| RakNetTime RakNet::GetTime | ( | void | ) |
Definition at line 36 of file GetTime.cpp.
References GetTimeNS().
Referenced by RakNet::UDPForwarder::AddForwardingEntry(), LightweightDatabaseServer::AddRow(), RakPeer::AddToBanList(), RakPeer::AssignSystemAddressToRemoteSystemList(), RakNet::Connection_RM3::AutoConstructByQuery(), ReplicaManager::Destruct(), RakNet::UDPForwarder::ForwardEntry::ForwardEntry(), RakPeer::GenerateSYNCookieRandomNumber(), EmailSender::GetResponse(), RakPeer::GetSocket(), RakPeer::GetSockets(), GetTimeMS(), RakPeer::IsBanned(), RakNet::ReplicaManager2::OnAttach(), PacketLogger::OnDirectSocketReceive(), PacketLogger::OnDirectSocketSend(), RakNet::UDPProxyCoordinator::OnForwardingReplyFromServerToCoordinator(), RakNet::UDPProxyCoordinator::OnForwardingRequestFromClientToCoordinator(), NatPunchthroughServer::OnGetMostRecentPort(), RakNet::ReplicaManager3::OnLocalConstructionAccepted(), RakNet::UDPProxyClient::OnPingServers(), LightweightDatabaseServer::OnPong(), PacketLogger::OnPushBackPacket(), RakNet::UDPProxyClient::OnReceive(), PacketLogger::OnReliabilityLayerPacketError(), RakPeer::Ping(), RakPeer::PingInternal(), ReplicaManager::ProcessReceivedCommand(), LightweightDatabaseServer::RemoveRowsFromIP(), RakPeer::RPC(), RakPeer::RunUpdateCycle(), RakPeer::SecuredConnectionResponse(), EmailSender::Send(), RakPeer::SendConnectionRequest(), RakNet::Connection_RM3::SendConstruction(), MessageFilter::SetSystemFilterSet(), RakPeer::Shutdown(), PacketFileLogger::StartLog(), NatPunchthroughServer::StartPunchthroughForUser(), RakNet::UDPProxyCoordinator::Update(), RakNet::UDPProxyClient::Update(), RakNet::ReplicaManager3::Update(), RakNet::ReplicaManager2::Update(), ReplicaManager::Update(), RakNet::NatTypeDetectionServer::Update(), NatPunchthroughServer::Update(), MessageFilter::Update(), LightweightDatabaseServer::Update(), RakNet::UDPForwarder::UpdateThreaded(), and PacketLogger::WriteMiscellaneous().
{
return (RakNetTime)(GetTimeNS()/1000);
}
| RakNetTime RakNet::GetTimeMS | ( | void | ) | [inline] |
Definition at line 28 of file GetTime.h.
References GetTime().
Referenced by RakNet::Router2::ConnectInternal(), ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer(), ReliabilityLayer::InitializeVariables(), RakNet::Router2::OnRequestForwarding(), ReliabilityLayer::SendBitStream(), RakPeer::Shutdown(), RakNet::Router2::Update(), and NatPunchthroughClient::Update().
{return GetTime();}
| RakNetTimeUS RakNet::GetTimeNS | ( | void | ) |
Definition at line 40 of file GetTime.cpp.
References initialTime, and tp.
Referenced by GetTime(), GetTimeUS(), ReliabilityLayer::InitializeVariables(), RakPeer::NotifyAndFlagForShutdown(), RakPeer::ParseConnectionRequestPacket(), RakPeer::PingInternal(), RakPeer::RunUpdateCycle(), RakPeer::SecuredConnectionConfirmation(), RakPeer::SecuredConnectionResponse(), and RakPeer::SendConnectionRequestAccepted().
{
#if defined(_PS3) || defined(__PS3__) || defined(SN_TARGET_PS3)
#elif defined(_WIN32)
// Win32
if ( initialized == false)
{
initialized = true;
#if !defined(_WIN32_WCE) && !defined(_XBOX) && !defined(X360)
// Save the current process
HANDLE mProc = GetCurrentProcess();
// Get the current Affinity
#if _MSC_VER >= 1400 && defined (_M_X64)
GetProcessAffinityMask(mProc, (PDWORD_PTR)&mProcMask, (PDWORD_PTR)&mSysMask);
#else
GetProcessAffinityMask(mProc, &mProcMask, &mSysMask);
#endif
mThread = GetCurrentThread();
#endif // !defined(_WIN32_WCE)
QueryPerformanceFrequency( &yo );
}
// 01/12/08 - According to the docs "The frequency cannot change while the system is running." so this shouldn't be necessary
/*
if (++queryCount==200)
{
// Set affinity to the first core
SetThreadAffinityMask(mThread, 1);
QueryPerformanceFrequency( &yo );
// Reset affinity
SetThreadAffinityMask(mThread, mProcMask);
queryCount=0;
}
*/
#elif (defined(__GNUC__) || defined(__GCCXML__))
if ( initialized == false)
{
gettimeofday( &tp, 0 );
initialized=true;
// I do this because otherwise RakNetTime in milliseconds won't work as it will underflow when dividing by 1000 to do the conversion
initialTime = ( tp.tv_sec ) * (RakNetTimeUS) 1000000 + ( tp.tv_usec );
}
#endif
#if defined(_PS3) || defined(__PS3__) || defined(SN_TARGET_PS3)
#elif defined(_WIN32)
RakNetTimeUS curTime;
static RakNetTimeUS lastQueryVal=(RakNetTimeUS)0;
// static unsigned long lastTickCountVal = GetTickCount();
LARGE_INTEGER PerfVal;
#if !defined(_WIN32_WCE) && !defined(_XBOX) && !defined(X360)
// Set affinity to the first core
// 8/9/09 This freaking destroys performance, 90% of the time in this function is due to SetThreadAffinityMask().
//SetThreadAffinityMask(mThread, 1);
#endif // !defined(_WIN32_WCE)
// Docs: On a multiprocessor computer, it should not matter which processor is called.
// However, you can get different results on different processors due to bugs in the basic input/output system (BIOS) or the hardware abstraction layer (HAL). To specify processor affinity for a thread, use the SetThreadAffinityMask function.
// Query the timer
QueryPerformanceCounter( &PerfVal );
#if !defined(_WIN32_WCE) && !defined(_XBOX) && !defined(X360)
// Reset affinity
// 8/9/09 This freaking destroys performance, 90% of the time in this function is due to SetThreadAffinityMask().
// SetThreadAffinityMask(mThread, mProcMask);
#endif // !defined(_WIN32_WCE)
__int64 quotient, remainder;
quotient=((PerfVal.QuadPart) / yo.QuadPart);
remainder=((PerfVal.QuadPart) % yo.QuadPart);
curTime = (RakNetTimeUS) quotient*(RakNetTimeUS)1000000 + (remainder*(RakNetTimeUS)1000000 / yo.QuadPart);
// 08/26/08 - With the below workaround, the time seems to jump forward regardless.
// Just make sure the time doesn't go backwards
if (curTime < lastQueryVal)
return lastQueryVal;
#if !defined(_XBOX) && !defined(X360)
// To call timeGetTime
// on Code::Blocks, at the top of the file you need to import libwinmm.a instead of Winmm.lib
DWORD tgt = timeGetTime();
RakNetTimeMS timeInMS = curTime/1000;
if (timeInMS>tgt+1000)
{
// To workaround http://support.microsoft.com/kb/274323 where the timer can sometimes jump forward by hours or days
curTime=(RakNetTimeUS) tgt * (RakNetTimeUS) 1000;
}
#endif
lastQueryVal=curTime;
return curTime;
#elif (defined(__GNUC__) || defined(__GCCXML__))
// GCC
RakNetTimeUS curTime;
gettimeofday( &tp, 0 );
curTime = ( tp.tv_sec ) * (RakNetTimeUS) 1000000 + ( tp.tv_usec );
// Subtract from initialTime so the millisecond conversion does not underflow
return curTime - initialTime;
#endif
}
| RakNetTimeUS RakNet::GetTimeUS | ( | void | ) | [inline] |
Definition at line 29 of file GetTime.h.
References GetTimeNS().
Referenced by FullyConnectedMesh2::AssignOurFCMGuid(), RakPeer::GenerateGUID(), FullyConnectedMesh2::GetElapsedRuntime(), ReliabilityLayer::GetStatistics(), ReliabilityLayer::InitializeVariables(), FullyConnectedMesh2::OnAttach(), FullyConnectedMesh2::OnRakPeerStartup(), SocketLayer::RawRecvFromNonBlocking(), SocketLayer::RecvFrom(), SocketLayer::RecvFromBlocking(), ReliabilityLayer::Reset(), FullyConnectedMesh2::ResetHostCalculation(), RakPeer::RunUpdateCycle(), StatisticsToString(), and ReliabilityLayer::Update().
{return GetTimeNS();}
| const char * RakNet::NATTypeDetectionResultToString | ( | NATTypeDetectionResult | type | ) |
Definition at line 24 of file NatTypeDetectionCommon.cpp.
References NAT_TYPE_ADDRESS_RESTRICTED, NAT_TYPE_FULL_CONE, NAT_TYPE_NONE, NAT_TYPE_PORT_RESTRICTED, and NAT_TYPE_SYMMETRIC.
{
switch (type)
{
case NAT_TYPE_NONE:
return "None";
case NAT_TYPE_FULL_CONE:
return "Full cone";
case NAT_TYPE_ADDRESS_RESTRICTED:
return "Address restricted";
case NAT_TYPE_PORT_RESTRICTED:
return "Port restricted";
case NAT_TYPE_SYMMETRIC:
return "Symmetric";
}
return "Error, unknown enum in NATTypeDetectionResult";
}
| const char * RakNet::NATTypeDetectionResultToStringFriendly | ( | NATTypeDetectionResult | type | ) |
Return a friendly string representing the enumeration None and relaxed can connect to anything Moderate can connect to moderate or less Strict can connect to relaxed or less
Definition at line 45 of file NatTypeDetectionCommon.cpp.
References NAT_TYPE_ADDRESS_RESTRICTED, NAT_TYPE_FULL_CONE, NAT_TYPE_NONE, NAT_TYPE_PORT_RESTRICTED, and NAT_TYPE_SYMMETRIC.
{
switch (type)
{
case NAT_TYPE_NONE:
return "Open";
case NAT_TYPE_FULL_CONE:
return "Relaxed";
case NAT_TYPE_ADDRESS_RESTRICTED:
return "Relaxed";
case NAT_TYPE_PORT_RESTRICTED:
return "Moderate";
case NAT_TYPE_SYMMETRIC:
return "Strict";
}
return "Error, unknown enum in NATTypeDetectionResult";
}
| int RakNet::NatTypeRecvFrom | ( | char * | data, | |
| SOCKET | socket, | |||
| SystemAddress & | sender | |||
| ) |
Definition at line 78 of file NatTypeDetectionCommon.cpp.
References SystemAddress::binaryAddress, MAXIMUM_MTU_SIZE, and SystemAddress::port.
Referenced by RakNet::NatTypeDetectionServer::Update(), and RakNet::NatTypeDetectionClient::Update().
{
sockaddr_in sa;
socklen_t len2;
const int flag=0;
len2 = sizeof( sa );
sa.sin_family = AF_INET;
sa.sin_port=0;
int len = recvfrom( socket, data, MAXIMUM_MTU_SIZE, flag, ( sockaddr* ) & sa, ( socklen_t* ) & len2 );
if (len>0)
{
sender.binaryAddress = sa.sin_addr.s_addr;
sender.port = ntohs( sa.sin_port );
}
return len;
}
| void RakNet::OP_DELETE | ( | Type * | buff, | |
| const char * | file, | |||
| unsigned int | line | |||
| ) |
Definition at line 167 of file RakMemoryOverride.h.
References GetFree_Ex.
Referenced by RakNet::UDPForwarder::AddForwardingEntry(), RPCMap::AddIdentifierAtIndex(), DataStructures::Table::AddRow(), RakNet::StringTable::AddString(), RakNet::FunctionThreadDependentClass::AssignFunctionThread(), ReliabilityLayer::BuildPacketFromSplitPacketList(), RakNet::Replica2::CancelAutoSerializeTimer(), RakPeer::CancelConnectionAttempt(), FileListTransfer::CancelReceive(), DataStructures::SingleProducerConsumer< SingleProducerConsumerType >::Clear(), RPCMap::Clear(), ReplicaManager::Clear(), ReadyEvent::Clear(), LightweightDatabaseServer::Clear(), FileListTransfer::Clear(), DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::Clear(), DataStructures::OrderedChannelHeap< channel_key_type, heap_data_type, channel_key_comparison_func >::Clear(), DataStructures::CircularLinkedList< CircularLinkedListType >::Clear(), DataStructures::BinarySearchTree< BinarySearchTreeType >::Clear(), RakNet::AutoRPC::Clear(), PacketizedTCP::ClearAllConnections(), RakNet::Replica2::ClearAutoSerializeTimers(), RakPeer::ClearBanList(), RakNet::Router2::ClearConnectionRequests(), DataStructures::StringKeyedHash< data_type, HASH_SIZE >::ClearIndex(), DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ClearPointer(), DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ClearPointers(), RakPeer::ClearRequestedConnectionList(), TCPInterface::Connect(), ConnectionAttemptLoop(), MessageFilter::DeallocateFilterSet(), TCPInterface::DeallocatePacket(), RakNetTransport2::DeallocatePacket(), TableSerializer::DeallocateQueryList(), FileListTransfer::DecodeFile(), FileListTransfer::DecodeSetHeader(), DataStructures::CircularLinkedList< CircularLinkedListType >::Del(), DataStructures::BinarySearchTree< BinarySearchTreeType >::Del(), RakPeer::DeleteCompressionLayer(), NatPunchthroughServer::User::DeleteConnectionAttempt(), DataStructures::Tree< TreeType >::DeleteDecendants(), ReadyEvent::DeleteEvent(), DataStructures::DeletePtr_RakNet(), DataStructures::Table::DeleteRow(), RefCountedObj::Deref(), RakNetworkFactory::DestroyConnectionGraph(), RakNetworkFactory::DestroyConsoleServer(), RakNetworkFactory::DestroyLogCommandParser(), RakNetworkFactory::DestroyPacketConsoleLogger(), RakNetworkFactory::DestroyPacketFileLogger(), RakNetworkFactory::DestroyPacketLogger(), RakNetworkFactory::DestroyRakNetCommandParser(), RakNetworkFactory::DestroyRakNetTransport(), RakNetworkFactory::DestroyRakPeerInterface(), RakNetworkFactory::DestroyReplicaManager(), RakNetworkFactory::DestroyRouter(), RakNetworkFactory::DestroyTelnetTransport(), HuffmanEncodingTree::FreeMemory(), RakNet::RakString::FreeMemoryNoMutex(), FreeRow(), ReliabilityLayer::FreeThreadSafeMemory(), StringCompressor::GenerateTreeFromStrings(), TelnetTransport::HasLostConnection(), RakPeer::IsBanned(), RakNet::UDPProxyCoordinator::OnClosedConnection(), NatPunchthroughServer::OnClosedConnection(), ConnectionGraph2::OnClosedConnection(), RakNet::AutoRPC::OnClosedConnection(), RakNet::Connection_RM3::OnDereference(), RakNet::UDPProxyCoordinator::OnForwardingReplyFromServerToCoordinator(), RakNet::UDPProxyCoordinator::OnForwardingRequestFromClientToCoordinator(), NatPunchthroughServer::OnNATPunchthroughRequest(), RakNet::Connection_RM3::OnNeverConstruct(), RakNet::UDPProxyClient::OnReceive(), FileListTransfer::OnReferencePush(), RakNetSmartPtr< RakNetSocket >::operator=(), DataStructures::StringKeyedHash< data_type, HASH_SIZE >::Pop(), ProcessOfflineNetworkPacket(), PacketizedTCP::Receive(), DataStructures::StringKeyedHash< data_type, HASH_SIZE >::RemoveAtIndex(), DataStructures::OrderedChannelHeap< channel_key_type, heap_data_type, channel_key_comparison_func >::RemoveChannel(), DataStructures::Table::RemoveColumn(), RakNet::Router2::RemoveConnectionRequest(), RakPeer::RemoveFromBanList(), PacketizedTCP::RemoveFromConnectionList(), RPCMap::RemoveNode(), DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::RemoveNode(), ReplicaManager::RemoveParticipant(), FileListTransfer::RemoveReceiver(), RakNet::StringTable::RemoveReference(), StringCompressor::RemoveReference(), LightweightDatabaseServer::RemoveTable(), RakPeer::RunUpdateCycle(), RakPeer::SendConnectionRequest(), FileListTransfer::SendIRIToAddress(), RakNet::Router2::SetMaximumForwardingRequests(), RakNetSmartPtr< RakNetSocket >::SetNull(), FileListTransfer::SetupReceive(), TelnetTransport::Stop(), RakNetTransport2::Stop(), RakNet::UDPForwarder::StopForwardingThreaded(), RakNet::UDPProxyCoordinator::TryNextServer(), RakNet::UDPProxyCoordinator::Update(), RakNet::UDPProxyClient::Update(), ReplicaManager::Update(), ReliabilityLayer::Update(), FileListTransfer::Update(), RakNet::UDPForwarder::UpdateThreaded(), DirectoryDeltaTransfer::~DirectoryDeltaTransfer(), RakNet::FunctionThreadDependentClass::~FunctionThreadDependentClass(), RakNet::LastSerializationResult::~LastSerializationResult(), NatPunchthroughServer::~NatPunchthroughServer(), ReplicaManager::ParticipantStruct::~ParticipantStruct(), RakNetSmartPtr< RakNetSocket >::~RakNetSmartPtr(), RakNet::Router2::~Router2(), DataStructures::SingleProducerConsumer< SingleProducerConsumerType >::~SingleProducerConsumer(), and StringCompressor::~StringCompressor().
{
#if _USE_RAK_MEMORY_OVERRIDE==1
if (buff==0) return;
buff->~Type();
(GetFree_Ex())((char*)buff, file, line );
#else
(void) file;
(void) line;
delete buff;
#endif
}
| void RakNet::OP_DELETE_ARRAY | ( | Type * | buff, | |
| const char * | file, | |||
| unsigned int | line | |||
| ) |
Definition at line 182 of file RakMemoryOverride.h.
References GetFree_Ex.
Referenced by RPCMap::AddIdentifierAtIndex(), RSACrypt::cleanup(), DataStructures::StringKeyedHash< data_type, HASH_SIZE >::Clear(), DataStructures::Queue< queue_type >::Clear(), DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Clear(), DataStructures::List< list_type >::Clear(), DataStructures::Queue< queue_type >::ClearAndForceAllocation(), DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::ClearDijkstra(), RakPeer::ClearRemoteSystemLookup(), DataStructures::Queue< queue_type >::Compress(), DataStructures::List< list_type >::Compress(), TableSerializer::DeallocateQueryList(), VariadicSQLParser::FreeArguments(), GridSectorizer::Init(), DataStructures::List< list_type >::Insert(), DataStructures::List< list_type >::Preallocate(), DataStructures::Queue< queue_type >::Push(), DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ReallocToSize(), DataStructures::List< list_type >::Replace(), NetworkIDObject::SetParent(), ConnectionGraph::SetPassword(), RakPeer::Shutdown(), TCPInterface::Stop(), ConnectionGraph::~ConnectionGraph(), GridSectorizer::~GridSectorizer(), DataStructures::List< list_type >::~List(), DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::~Multilist(), DataStructures::Queue< queue_type >::~Queue(), and TCPInterface::~TCPInterface().
{
#if _USE_RAK_MEMORY_OVERRIDE==1
if (buff==0)
return;
int count = ((int*)((char*)buff-sizeof(int)))[0];
Type *t;
for (int i=0; i<count; i++)
{
t = buff+i;
t->~Type();
}
(GetFree_Ex())((char*)buff-sizeof(int), file, line );
#else
(void) file;
(void) line;
delete [] buff;
#endif
}
| Type* RakNet::OP_NEW | ( | const char * | file, | |
| unsigned int | line | |||
| ) |
Definition at line 72 of file RakMemoryOverride.h.
References GetMalloc_Ex.
Referenced by DataStructures::WeightedGraph< node_type, weight_type, allow_unlinkedNodes >::AddNode(), and ReliabilityLayer::AddToOrderingList().
{
#if _USE_RAK_MEMORY_OVERRIDE==1
char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
Type *t = new (buffer) Type;
return t;
#else
(void) file;
(void) line;
return new Type;
#endif
}
| Type* RakNet::OP_NEW_1 | ( | const char * | file, | |
| unsigned int | line, | |||
| const P1 & | p1 | |||
| ) |
Definition at line 86 of file RakMemoryOverride.h.
References GetMalloc_Ex.
{
#if _USE_RAK_MEMORY_OVERRIDE==1
char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
Type *t = new (buffer) Type(p1);
return t;
#else
(void) file;
(void) line;
return new Type(p1);
#endif
}
| Type* RakNet::OP_NEW_2 | ( | const char * | file, | |
| unsigned int | line, | |||
| const P1 & | p1, | |||
| const P2 & | p2 | |||
| ) |
Definition at line 100 of file RakMemoryOverride.h.
References GetMalloc_Ex.
{
#if _USE_RAK_MEMORY_OVERRIDE==1
char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
Type *t = new (buffer) Type(p1, p2);
return t;
#else
(void) file;
(void) line;
return new Type(p1, p2);
#endif
}
| Type* RakNet::OP_NEW_3 | ( | const char * | file, | |
| unsigned int | line, | |||
| const P1 & | p1, | |||
| const P2 & | p2, | |||
| const P3 & | p3 | |||
| ) |
Definition at line 114 of file RakMemoryOverride.h.
References GetMalloc_Ex.
{
#if _USE_RAK_MEMORY_OVERRIDE==1
char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
Type *t = new (buffer) Type(p1, p2, p3);
return t;
#else
(void) file;
(void) line;
return new Type(p1, p2, p3);
#endif
}
| Type* RakNet::OP_NEW_4 | ( | const char * | file, | |
| unsigned int | line, | |||
| const P1 & | p1, | |||
| const P2 & | p2, | |||
| const P3 & | p3, | |||
| const P4 & | p4 | |||
| ) |
Definition at line 128 of file RakMemoryOverride.h.
References GetMalloc_Ex.
{
#if _USE_RAK_MEMORY_OVERRIDE==1
char *buffer = (char *) (GetMalloc_Ex())(sizeof(Type), file, line);
Type *t = new (buffer) Type(p1, p2, p3, p4);
return t;
#else
(void) file;
(void) line;
return new Type(p1, p2, p3, p4);
#endif
}
| Type* RakNet::OP_NEW_ARRAY | ( | const int | count, | |
| const char * | file, | |||
| unsigned int | line | |||
| ) |
Definition at line 143 of file RakMemoryOverride.h.
References GetMalloc_Ex.
{
if (count==0)
return 0;
#if _USE_RAK_MEMORY_OVERRIDE==1
// Type *t;
char *buffer = (char *) (GetMalloc_Ex())(sizeof(int)+sizeof(Type)*count, file, line);
((int*)buffer)[0]=count;
for (int i=0; i<count; i++)
{
//t =
new(buffer+sizeof(int)+i*sizeof(Type)) Type;
}
return (Type *) (buffer+sizeof(int));
#else
(void) file;
(void) line;
return new Type[count];
#endif
}
| BitStream& RakNet::operator<< | ( | BitStream & | out, | |
| templateType & | c | |||
| ) |
Definition at line 1906 of file BitStream.h.
References RakNet::BitStream::WriteRef().
{
out.WriteRef(c);
return out;
}
| BitStream& RakNet::operator>> | ( | BitStream & | in, | |
| templateType & | c | |||
| ) |
Definition at line 1912 of file BitStream.h.
References RakAssert, and RakNet::BitStream::Read().
{
bool success = in.Read(c);
RakAssert(success);
return in;
}
const int RakNet::RM3_NUM_OUTPUT_BITSTREAM_CHANNELS = 8 [static] |
Definition at line 269 of file ReplicaManager3.h.
Referenced by RakNet::Connection_RM3::AutoConstructByQuery(), RakNet::ReplicaManager3::OnLocalConstructionAccepted(), RakNet::ReplicaManager3::OnSerialize(), RakNet::Connection_RM3::SendConstruction(), RakNet::Connection_RM3::SendSerializeIfChanged(), and RakNet::ReplicaManager3::Update().
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.