Show
Ignore:
Timestamp:
11/19/08 13:37:14 (17 years ago)
Author:
yumileroy
Message:

[svn] * Merge CLI Commands with regular commands and give them level4 access. sec_console. Source mangos - thanks to ogeraisi for the amalgamated patch.
* Redid/Fixed/Added some lang strings.
* As usual remember this is a trunk rev so stability only guaranteed on northern countries of Mars and western parts of Pluto. No warranties outside the solar system, sorry :( . Check with your local government or dictator on regulations regarding export.

Original author: KingPin?
Date: 2008-10-26 13:32:42-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/trinitycore/RASocket.cpp

    r102 r112  
    4545typedef int(* pPrintf)(const char*,...); 
    4646 
    47 void ParseCommand(pPrintf zprintf, char*command); 
     47void ParseCommand(CliCommandHolder::Print*, char*command); 
    4848 
    4949/// RASocket constructor 
     
    223223                { 
    224224                    sLog.outRALog("Got '%s' cmd.\n",buff); 
    225                     ParseCommand(&RASocket::zprintf , buff); 
     225                    sWorld.QueueCliCommand(&RASocket::zprint , buff); 
    226226                } 
    227227                else 
     
    235235 
    236236/// Output function 
    237 int RASocket::zprintf( const char * szText, ... ) 
    238 { 
    239     if( !szText ) return 0; 
    240     va_list ap; 
    241     va_start(ap, szText); 
    242     /// \todo Remove buffer length here. Can be >1024 (e.g. list of users) 
    243     char *megabuffer=new char[1024]; 
    244     unsigned int sz=vsnprintf(megabuffer,1024,szText,ap); 
     237void RASocket::zprint( const char * szText ) 
     238{ 
     239    if( !szText ) 
     240        return; 
     241 
    245242    #ifdef RA_CRYPT 
     243 
     244        char *megabuffer=strdup(szText); 
     245    unsigned int sz=strlen(megabuffer); 
    246246    Encrypt(megabuffer,sz); 
     247        send(r,megabuffer,sz,0); 
     248    delete [] megabuffer; 
     249     
     250        #else 
     251 
     252    unsigned int sz=strlen(szText); 
     253    send(r,szText,sz,0); 
     254 
    247255    #endif 
    248  
    249     send(r,megabuffer,sz,0); 
    250     delete [] megabuffer; 
    251     va_end(ap); 
    252     return 0; 
    253 } 
     256}