View Single Post
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 03-31-2009 , 17:02   Re: Server Crashing [Sourcehook RecallGetIFace]
Reply With Quote #8

Certainly, I appreciate the help.

Code:
char *g_MapEntLists; //Stores list of all Map Entities on LevelInit()

//-----------------------------------------------------------------------------
// Purpose: Get the list of Map Entities before they are all created in the
// server and insert our own entities into the map we need.
//-----------------------------------------------------------------------------
bool TF2RocketArena::Hook_LevelInit(const char *pMapName,
                                char const *pMapEntities,
                                char const *pOldLevel,
                                char const *pLandmarkName,
                                bool loadGame,
                                bool background)
{
    //If the Server is running clan arena mode
    if(g_ClanArenaMode.GetInt() == 1)
    {
        char strArenaLogic[255] = "{ \"CapEnableDelay\" \"600\" \"classname\" \"tf_logic_arena\" }";

        size_t StrEntLen = strlen(pMapEntities) + strlen(strArenaLogic) + 64;
        g_MapEntLists = new char [StrEntLen];

        strcpy(g_MapEntLists, pMapEntities);
        strcat(g_MapEntLists, strArenaLogic);

        RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, true, &IServerGameDLL::LevelInit, (pMapName, g_MapEntLists, pOldLevel, pLandmarkName, loadGame, background));
    }

    RETURN_META_VALUE(MRES_IGNORED, NULL);
}
__________________
CrimsonGT is offline