diff --git a/raknet/RPCMap.cpp b/raknet/RPCMap.cpp index 97f8f6f..88be0a0 100644 --- a/raknet/RPCMap.cpp +++ b/raknet/RPCMap.cpp @@ -104,50 +104,4 @@ void RPCMap::AddIdentifierWithFunction(char *uniqueIdentifier, void *functionPoi rpcSet.Insert(node); // No empty spots available so just add to the end of the list } -void RPCMap::AddIdentifierAtIndex(char *uniqueIdentifier, RPCIndex insertionIndex) -{ -#ifdef _DEBUG - assert(uniqueIdentifier && uniqueIdentifier[0]); -#endif - - unsigned existingNodeIndex; - RPCNode *node, *oldNode; - - existingNodeIndex=GetIndexFromFunctionName(uniqueIdentifier); - - if (existingNodeIndex==insertionIndex) - return; // Already there - - if ((RPCIndex)existingNodeIndex!=UNDEFINED_RPC_INDEX) - { - // Delete the existing one - oldNode=rpcSet[existingNodeIndex]; - rpcSet[existingNodeIndex]=0; - delete [] oldNode->uniqueIdentifier; - delete oldNode; - } - - node = new RPCNode; - node->uniqueIdentifier = new char [strlen(uniqueIdentifier)+1]; - strcpy(node->uniqueIdentifier, uniqueIdentifier); - node->functionPointer=0; - - // Insert at a user specified spot - if (insertionIndex < rpcSet.Size()) - { - // Overwrite what is there already - oldNode=rpcSet[insertionIndex]; - if (oldNode) - { - delete [] oldNode->uniqueIdentifier; - delete oldNode; - } - rpcSet[insertionIndex]=node; - } - else - { - // Insert after the end of the list and use 0 as a filler for the empty spots - rpcSet.Replace(node, 0, insertionIndex); - } -} diff --git a/raknet/RPCMap.h b/raknet/RPCMap.h index c3d1470..9074aa0 100644 --- a/raknet/RPCMap.h +++ b/raknet/RPCMap.h @@ -38,8 +38,6 @@ public: RPCNode *GetNodeFromFunctionName(char *uniqueIdentifier); RPCIndex GetIndexFromFunctionName(char *uniqueIdentifier); void AddIdentifierWithFunction(char *uniqueIdentifier, void *functionPointer, bool isPointerToMember); - void AddIdentifierAtIndex(char *uniqueIdentifier, RPCIndex insertionIndex); - protected: DataStructures::List rpcSet; };