mod.cloner: Adaugat suport fakedescription - descrieri aleatorii pentru clone (similar cu fakehost/fakeuser). Compatibilitate pastrata cu clonedescription ca fallback.
This commit is contained in:
parent
cc2ab892d3
commit
4394533cb9
|
|
@ -66,9 +66,26 @@ fakeuser=graham
|
||||||
fakeuser=clarke
|
fakeuser=clarke
|
||||||
fakeuser=rice
|
fakeuser=rice
|
||||||
|
|
||||||
# Câmpul de nume real al fiecărei clone
|
# Câmpul de nume real al fiecărei clone (valoare unică, compatibilitate)
|
||||||
|
# Dacă nu sunt definite fakedescription mai jos, se va folosi această valoare.
|
||||||
clonedescription = Aceasta este o clonă, aceasta este doar o clonă...
|
clonedescription = Aceasta este o clonă, aceasta este doar o clonă...
|
||||||
|
|
||||||
|
# fakedescription-urile sunt folosite pentru descrierea (realname) clonelor
|
||||||
|
# Pot fi oricâte dorești. Fiecare clonă va primi una aleatorie din listă.
|
||||||
|
# Dacă sunt definite, au prioritate față de clonedescription de mai sus.
|
||||||
|
fakedescription=Aceasta este o clonă, aceasta este doar o clonă...
|
||||||
|
fakedescription=Nu sunt un bot, sunt o persoană adevărată!
|
||||||
|
fakedescription=Trăiesc pe UnderChat de când mă știu
|
||||||
|
fakedescription=IRC este viața mea
|
||||||
|
fakedescription=Clonele sunt cele mai bune prietene
|
||||||
|
fakedescription=Doar navighez prin canale...
|
||||||
|
fakedescription=Am venit să fac cunoștință
|
||||||
|
fakedescription=UnderChat - cea mai tare rețea IRC!
|
||||||
|
fakedescription=Sunt doar un vizitator curios
|
||||||
|
fakedescription=Nu mă deranja, sunt ocupat
|
||||||
|
fakedescription=Salutare lume!
|
||||||
|
fakedescription=Chat all day, chat all night
|
||||||
|
|
||||||
# Modurile pe care fiecare clonă trebuie să le seteze
|
# Modurile pe care fiecare clonă trebuie să le seteze
|
||||||
clonemode = +d
|
clonemode = +d
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,21 @@ if( userNames.empty() )
|
||||||
::exit( 0 ) ;
|
::exit( 0 ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Citim lista de fakedescription din configurare
|
||||||
|
// Dacă nu există niciuna, folosim clonedescription ca valoare unică
|
||||||
|
ptr = conf.Find( "fakedescription" ) ;
|
||||||
|
while( ptr != conf.end() && ptr->first == "fakedescription" )
|
||||||
|
{
|
||||||
|
descriptions.push_back( ptr->second ) ;
|
||||||
|
++ptr ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( descriptions.empty() )
|
||||||
|
{
|
||||||
|
// Compatibilitate: dacă nu sunt fakedescription, folosim clonedescription
|
||||||
|
descriptions.push_back( cloneDescription ) ;
|
||||||
|
}
|
||||||
|
|
||||||
makeCloneCount = 0 ;
|
makeCloneCount = 0 ;
|
||||||
|
|
||||||
minNickLength = atoi( conf.Require( "minnicklength" )->second.c_str() ) ;
|
minNickLength = atoi( conf.Require( "minnicklength" )->second.c_str() ) ;
|
||||||
|
|
@ -586,7 +601,7 @@ iClient* newClient = new iClient(
|
||||||
cloneMode,
|
cloneMode,
|
||||||
string(),
|
string(),
|
||||||
0,
|
0,
|
||||||
cloneDescription,
|
randomDescription(),
|
||||||
::time( 0 ) ) ;
|
::time( 0 ) ) ;
|
||||||
assert( newClient != 0 );
|
assert( newClient != 0 );
|
||||||
|
|
||||||
|
|
@ -606,6 +621,11 @@ string cloner::randomHost()
|
||||||
return hostNames[ rand() % hostNames.size() ] ;
|
return hostNames[ rand() % hostNames.size() ] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string cloner::randomDescription()
|
||||||
|
{
|
||||||
|
return descriptions[ rand() % descriptions.size() ] ;
|
||||||
|
}
|
||||||
|
|
||||||
string cloner::randomNick( int minLength, int maxLength )
|
string cloner::randomNick( int minLength, int maxLength )
|
||||||
{
|
{
|
||||||
string retMe ;
|
string retMe ;
|
||||||
|
|
|
||||||
|
|
@ -60,12 +60,14 @@ protected:
|
||||||
int maxLength = 9 ) ;
|
int maxLength = 9 ) ;
|
||||||
virtual std::string randomUser() ;
|
virtual std::string randomUser() ;
|
||||||
virtual std::string randomHost() ;
|
virtual std::string randomHost() ;
|
||||||
|
virtual std::string randomDescription() ;
|
||||||
virtual char randomChar() ;
|
virtual char randomChar() ;
|
||||||
|
|
||||||
std::list< std::string > allowAccess ;
|
std::list< std::string > allowAccess ;
|
||||||
std::list< iClient* > clones ;
|
std::list< iClient* > clones ;
|
||||||
std::vector< std::string > userNames ;
|
std::vector< std::string > userNames ;
|
||||||
std::vector< std::string > hostNames ;
|
std::vector< std::string > hostNames ;
|
||||||
|
std::vector< std::string > descriptions ;
|
||||||
iServer* fakeServer ;
|
iServer* fakeServer ;
|
||||||
|
|
||||||
bool allowOpers ;
|
bool allowOpers ;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue