- Joined
- Apr 12, 2009
- Messages
- 1,259
- Reaction score
- 240
You can still use it, if(strstr(szName, ";")) return false;
szName.
Anyway, you'll learn more of your mistakes if you actually find the solution yourself.
It won't enter the message if it gots ;
You can still use it, if(strstr(szName, ";")) return false;
szName.
Anyway, you'll learn more of your mistakes if you actually find the solution yourself.
It won't enter the message if it gots ;
You can still use it, if(strstr(szName, ";")) return false;
szName.
I knew you gonna answer that
, all what I want is to develop gunz and making it active again, but you're making it harder for me and for others, Why you don't just release fixes and help each others ?
Don't need the ";", I could still use the ' and launch a DoS attack by generating SQL errors.
It won't enter the message if it gots ;
I'm probably gonna write an advanced spam filter for the chat since the current one is fucked up as it is.
Been there with Goat ages ago, simply add a variable to MMatchObject holding the last time a chat was submitted (using timeGetTime() or similar), then check if the delay is at least 500 (1000 is default client). You should simply drop the message though, nothing more, considering people may spike and spam 3 messages at once due to 3 seconds of net inactivity.
dwCurrentTime = timeGetTime();
if (dwStartTime + 250 < dwCurrentTime)
{
dwStartTime = dwCurrentTime;
SpamLobby(GetCharUID(&MyUID), GetChannelUID(&ChannelUID), "Message");
}
Code:dwCurrentTime = timeGetTime(); if (dwStartTime + 250 < dwCurrentTime) { dwStartTime = dwCurrentTime; SpamLobby(GetCharUID(&MyUID), GetChannelUID(&ChannelUID), "Message"); }
Great, you can apply the maths. Who can't, lmao. You've already shown you hardly can do anything on your own. Every release you've made or contributed to has to be flawed.
Was talking about something similar with SuperWaffle just before you posted that. I was gonna increment variable x which I'm going to declare and whenever x is divisible by 3, store timeGetTime() and whenever another's message is sent, if the difference between the time stored and the current time is less than 3000, throw a message.
bool MMatchServer::OnChannelChat(struct MUID &uidChar, struct MUID &uidChannel, char *szMessage) {
GoatObject *pGoatObj = GoatServer::getInstance()->getGoat(&uidChar);
MMatchServer *pMMatchServer = MMatchServer::GetInstance();
MMatchObject *pObject = pMMatchServer->GetObjectA(&uidChar);
MMatchChannel *pChannel = pMMatchServer->FindChannel(uidChannel);
if (pObject == NULL || pGoatObj == NULL || pChannel == NULL) {
return false;
}
//GoatServer::checkTimeout(pGoatObj, pObject, NULL);
if (pObject->m_AccountInfo.m_nPGrade == GOAT_PENALTY_CHAT || pObject->m_AccountInfo.m_nPGrade == GOAT_PENALTY_CHAT_AND_TAUNT) {
Logging::writeObjectLog(pObject, "Has attempted to chat in channel [%u-%u] but his goat penalty is set to %i.", uidChannel.LowID, uidChannel.HighID, pObject->m_AccountInfo.m_nPGrade);
GoatProtection::banHacker(pObject, "Penalty hacking.");
return false;
}
if (pObject->m_nPlace != MMatchObject::CHANNEL) {
Logging::writeObjectLog(pObject, "Has attempted to chat in channel [%u-%u] but MMatchPlace is set to %i.", uidChannel.LowID, uidChannel.HighID, pObject->m_nPlace);
GoatProtection::banHacker(pObject, "Channel spamming.");
return false;
}
if (pObject->m_ChannelInfo.m_uidChannel.HighID != uidChannel.HighID) {
Logging::writeObjectLog(pObject, "Has attempted to channel chat in channel [%u-%u] while he is at channel [%u-%u].", uidChannel.LowID, uidChannel.HighID, pObject->m_ChannelInfo.m_uidChannel.LowID, pObject->m_ChannelInfo.m_uidChannel.HighID);
GoatProtection::banHacker(pObject, "Channel spamming.");
return false;
}
DWORD dwTime = GetTickCount();
if (pGoatObj->m_dwLastChat > (dwTime - 500)) {
Logging::writeObjectLog(pObject, "Has posted a channel message %u milliseconds after his previous!", (dwTime - pGoatObj->m_dwLastChat));
pMMatchServer->DisconnectObject(uidChar); //Lucky guy, I'd be better off banning him.
return false;
}
if (pGoatObj->m_dwLastChat != NULL && strncmp(pGoatObj->m_szLastChat, szMessage, strlen(pGoatObj->m_szLastChat)) == 0 && ++pGoatObj->m_nSpamCount >= 3) {
Logging::writeObjectLog(pObject, "Has posted the same channel chat message three times in a row. Message: %s", szMessage);
GoatServer::popupPlayer(pObject, "That looks like spam. Your connection to the gameserver will be terminated within 3 seconds.");
pObject->disconnect(3);
return false;
}
//Logging::writeChannelLog(pObject, pChannel, szMessage);
strncpy_s(pGoatObj->m_szLastChat, szMessage, 128);
pGoatObj->m_dwLastChat = dwTime;
return true;
}
that is why gunz is die
Wish Q, you do know Wiz has been deving for probably longer than you have been alive. Stop with the spam ****, it's annoying me.
As for this script, qet coded it, ofc theres gonna be errors <3 Joe
Talking about errors? Gunz is the biggest error.
I can't find any errors in my source, when I code something I code it without thinking about hackers becaue i don't understand a **** about sql and ****. Anyway it was my first coded **** connected with website and i excpect bugs, but you guys making it harder for me lol.
This being the first thing you coded connected with website is irrelevant to the fact that you left SQLi open.
Talking about errors? Gunz is the biggest error.