In the $Lock section I've been able to Identify the user and lock string and also If I'm an OP, Can't figure out what code to use to auto-kick the user for clients not allowed that are detectable from lock string
[code]
if (getUser()->isClientOp()) {
string usrname = getUser()->getNick();
string usrhub = getUser()->getLastHubName();
string usrhubip = getUser()->getLastHubIp();
string myname = getUser()->getClientNick();
string::size_type iP = Util::findSubString(param.c_str(), "AuMi4x");
if (iP != string::npos) {
//CODE TO SEND PM TO USER AND KICK HIM
}
string::size_type iP2 = Util::findSubString(param.c_str(), "DCGUI");
if (iP2 != string::npos) {
//CODE TO SEND PM TO USER AND KICK HIM
}
string::size_type iP3 = Util::findSubString(param.c_str(), ";QfQy(F6j//qw5g9Ohv+jriJ^v5x*,Xgdy;wGHG_0Onso0bFiT8;Ec=ZXo2qa*^F5C6[Kq*u3aWSqxdtPBe]>IgqPB[ Pk=r¦ss⾁T/%DCN000%/Ã¥/%DCN096%//%DCN036%/%Ã¥gráÕ?±2A‚4Ãâ€
How to auto-kick in UserConnection.cpp
Moderator: Moderators
-
smitty
- Posts: 53
- Joined: 2003-03-01 19:45
How to auto-kick in UserConnection.cpp
Knowledge is Earned BUT Wisdom is Free
-
sarf
- Posts: 382
- Joined: 2003-01-24 10:43
- Location: Sweden
Well, if you specified what, exactly, you wanted help with it would help us help you, as GargoyleMT put it in another thread.
Do you want to know where you should put your code so that you can access the lock/pk of a user, or what?
Sarf
---
It's not that life is too short, it's that death is too long.
Do you want to know where you should put your code so that you can access the lock/pk of a user, or what?
Sarf
---
It's not that life is too short, it's that death is too long.
-
smitty
- Posts: 53
- Joined: 2003-03-01 19:45
The code above I have put In UserConnection.cpp In the $Lock section. I've been able to Identify the user and lock string and also If I'm an OP, Can't figure out what code to use to auto-kick the user for clients not allowed that are detectable from lock string . I have used the MessageBox command and it will send me a message box when a certain client is detected so I know the detection works BUT don't know what references and commands to use to kick that user automatically when detected.
Knowledge is Earned BUT Wisdom is Free
-
sarf
- Posts: 382
- Joined: 2003-01-24 10:43
- Location: Sweden
Sorry - I forgot to check the topic name. :blush:
some code follows:Hope this works (and helps). The code should be put at the end of the method, but it should work anywhere within the method.
Sarf
---
If your face were a tree, it would be different.
some code follows:
Code: Select all
// check if we're an OP
if(aSource->getUser()->getClient()->getOp())
{
bool kickUser = false;
string kickReason = "Using a modified client which is forbidden";
// do your lock detection stuff here
// set kickUser to true if we should kick
// set kickReason to whatever you want if you want to insult people stupid enough to use client XYZ
// ...
if(kickUser)
{
aSource->getUser()->getClient()->kick(aSource->getUser(), kickReason);
}
}Sarf
---
If your face were a tree, it would be different.
-
ender
- Posts: 224
- Joined: 2003-01-03 22:47
Re: How to auto-kick in UserConnection.cpp
Can you tell me a good reason for this:
smitty wrote: string::size_type iP2 = Util::findSubString(param.c_str(), "DCGUI");
if (iP2 != string::npos) {
//CODE TO SEND PM TO USER AND KICK HIM
}
-
GargoyleMT
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-08 02:46
- Location: .pa.us
Re: How to auto-kick in UserConnection.cpp
ender wrote:Can you tell me a good reason for this:
Presumably to treat DCGUI as a second class citizen for no good reason, just like DC++ used to be treated like a second class citizen?
Who is online
Users browsing this forum: Google [Bot] and 0 guests