Hi all. I got this error every time I try to apply this patch. Being
over 188 many times but can't see anything wrong. Tried the latest
nighty - TortoiseSVN 1.4.0, Build 7547 too with same error. Is there
something wrong with it?
Thanks
PS: I found 2 earlier messages - one was telling to find a temp file of
the merge which is not created now, the other - about a tsvnmerge bug.
Index: src/game/ItemHandler.cpp
===================================================================
--- src/game/ItemHandler.cpp (revision 2264)
+++ src/game/ItemHandler.cpp (working copy)
@@ -353,7 +353,7 @@
sLog.outDetail( "WORLD: Received CMSG_BUY_ITEM_IN_SLOT" );
uint64 vendorguid, bagguid;
uint32 item;
- uint8 bag, slot, count, vendorslot;
+ uint8 bag, slot, count, vendorslot=0;
recv_data >> vendorguid >> item >> bagguid >> slot >> count;
recv_data.hexlike();
@@ -364,8 +364,7 @@
Creature *pCreature = ObjectAccessor::Instance().GetCreature(*_player, vendorguid);
if( pCreature )
{
- vendorslot = 0;
- for(int i = 0; i < pCreature->GetItemCount(); i++)
+ for(int i = 0; i < pCreature->GetItemCount(); i++)
{
if ( pCreature->GetItemId(i) == item )
{
@@ -373,10 +372,36 @@
break;
}
}
+ if( sWorld.getConfig(CONFIG_CHEAT_ENABLEPROTECTION) && (count == 0 || !vendorslot) )
+ {
+ sLog.outError("CHEAT: player '%s' tried to buy item '%d'!", _player->GetName(), item);
+ if ( _player->GetSession()->GetSecurity() == 0 )
+ {
+ if( sWorld.getConfig(CONFIG_CHEAT_REMOVEMONEY) )
+ _player->SetMoney(0);
+ if( sWorld.getConfig(CONFIG_CHEAT_JAIL) )
+ {
+ _player->SetBindPointInDB(13,_player->GetZoneId(),0,0,0);
+ _player->TeleportTo(13,0,0,0,0); // put player in "the box" :)
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BROADCAST) )
+ {
+ std::stringstream wmsg;
+ wmsg << "|cffff0000[CHEAT]:|r Player '" << _player->GetName() << "' tried to cheat item #" << item;
+ sWorld.SendWorldText(wmsg.str().c_str(), NULL);
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BAN) )
+ {
+ _player->BanAccount(7);
+ _player->GetSession()->Terminate(true); // this must be the last call (session is invalid after)
+ }
+ }
+ return;
+ }
if( !vendorslot )
{
- _player->SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
- return;
+ _player->SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
+ return;
}
else
vendorslot -= 1;
@@ -440,7 +465,7 @@
sLog.outDetail( "WORLD: Received CMSG_BUY_ITEM" );
uint64 vendorguid;
uint32 item;
- uint8 count, unk1, vendorslot;
+ uint8 count, unk1, vendorslot=0;
recv_data >> vendorguid >> item >> count >> unk1;
recv_data.hexlike();
@@ -451,8 +476,7 @@
Creature *pCreature = ObjectAccessor::Instance().GetCreature(*_player, vendorguid);
if( pCreature )
{
- vendorslot = 0;
- for(int i = 0; i < pCreature->GetItemCount(); i++)
+ for(int i = 0; i < pCreature->GetItemCount(); i++)
{
if ( pCreature->GetItemId(i) == item )
{
@@ -460,6 +484,32 @@
break;
}
}
+ if( sWorld.getConfig(CONFIG_CHEAT_ENABLEPROTECTION) && (count == 0 || !vendorslot) )
+ {
+ sLog.outError("CHEAT: player '%s' tried to buy item '%d!", _player->GetName(), item);
+ if ( _player->GetSession()->GetSecurity() == 0 )
+ {
+ if( sWorld.getConfig(CONFIG_CHEAT_REMOVEMONEY) )
+ _player->SetMoney(0);
+ if( sWorld.getConfig(CONFIG_CHEAT_JAIL) )
+ {
+ _player->SetBindPointInDB(13,_player->GetZoneId(),0,0,0);
+ _player->TeleportTo(13,0,0,0,0); // put player in "the box" :)
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BROADCAST) )
+ {
+ std::stringstream wmsg;
+ wmsg << "|cffff0000[CHEAT]:|r Player '" << _player->GetName() << "' tried to cheat item #" << item;
+ sWorld.SendWorldText(wmsg.str().c_str(), NULL);
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BAN) )
+ {
+ _player->BanAccount(7);
+ _player->GetSession()->Terminate(true); // this must be the last call (session is invalid after)
+ }
+ }
+ return;
+ }
if( !vendorslot )
{
_player->SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
Index: src/game/Player.cpp
===================================================================
--- src/game/Player.cpp (revision 2264)
+++ src/game/Player.cpp (working copy)
@@ -5416,6 +5422,16 @@
GetSession()->SendPacket( &data );
}
+void Player::SetBindPointInDB(uint32 mapId, uint32 zoneId, float x, float y, float z)
+{
+ sDatabase.PExecute("UPDATE `character_homebind` SET `map` = %d,`zone` = %d,`position_x` = %f,`position_y` = %f,`position_z` = %f WHERE `guid` = '%u'", mapId, zoneId, x, y, z, GetGUIDLow());
+}
+
+void Player::BanAccount(uint8 num)
+{
+ loginDatabase.PExecute("UPDATE `account` SET `banned` = %u WHERE `id` = %d", num, GetSession()->GetAccountId() );
+}
+
/*********************************************************/
/*** STORAGE SYSTEM ***/
/*********************************************************/
Index: src/game/Player.h
===================================================================
--- src/game/Player.h (revision 2264)
+++ src/game/Player.h (working copy)
@@ -595,6 +595,8 @@
void SavePet();
void SetBindPoint(uint64 guid);
+ void SetBindPointInDB(uint32 mapId, uint32 zoneId, float x, float y, float z);
+ void BanAccount(uint8 num);
void CalcRage( uint32 damage,bool attacker );
void RegenerateAll();
void Regenerate(Powers power);
Index: src/game/QuestHandler.cpp
===================================================================
--- src/game/QuestHandler.cpp (revision 2264)
+++ src/game/QuestHandler.cpp (working copy)
@@ -87,6 +87,35 @@
sLog.outDebug( "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest );
QuestInfo const* qInfo = objmgr.GetQuestInfo(quest);
+
+ Creature *pCreature = ObjectAccessor::Instance().GetCreature(*_player, guid);
+ if( pCreature && !pCreature->hasQuest(quest) && sWorld.getConfig(CONFIG_CHEAT_ENABLEPROTECTION) )
+ {
+ sLog.outError("CHEAT: player '%s' tried to spoof accept of quest '%d'", _player->GetName(), quest);
+ if ( _player->GetSession()->GetSecurity() == 0)
+ {
+ if( sWorld.getConfig(CONFIG_CHEAT_REMOVEMONEY) )
+ _player->SetMoney(0);
+ if( sWorld.getConfig(CONFIG_CHEAT_JAIL) )
+ {
+ _player->SetBindPointInDB(13,_player->GetZoneId(),0,0,0);
+ _player->TeleportTo(13,0,0,0,0); // put player in "the box" :)
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BROADCAST) )
+ {
+ std::stringstream wmsg;
+ wmsg << "|cffff0000[CHEAT]:|r Player '" << _player->GetName() << "' spoofed reward of quest #" << quest;
+ sWorld.SendWorldText(wmsg.str().c_str(), NULL);
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BAN) )
+ {
+ _player->BanAccount(8);
+ _player->GetSession()->Terminate(true); // this must be the last call (session is invalid after)
+ }
+ }
+ return;
+ }
+
if ( qInfo )
{
if( _player->GetDivider() != 0 )
@@ -107,7 +136,6 @@
if ( _player->CanCompleteQuest( quest ) )
_player->CompleteQuest( quest );
- Creature *pCreature = ObjectAccessor::Instance().GetCreature(*_player, guid);
if( pCreature )
Script->QuestAccept(_player, pCreature, pQuest );
else
@@ -222,11 +250,48 @@
Quest *pQuest = objmgr.NewQuest(quest);
if( pQuest )
{
+
+ Creature *pCreature = ObjectAccessor::Instance().GetCreature(*_player, guid);
+
+ if ( sWorld.getConfig(CONFIG_CHEAT_ENABLEPROTECTION) )
+ {
+ // choose quest reward spoof anticheat:
+ if ( pCreature && (!pCreature->hasInvolvedQuest(quest)) )
+ {
+ sLog.outError("CHEAT: player '%s' tried to spoof reward of quest '%d'", _player->GetName(), quest);
+ _player->PlayerTalkClass->CloseGossip();
+ if ( _player->GetSession()->GetSecurity() == 0)
+ {
+ if( sWorld.getConfig(CONFIG_CHEAT_REMOVEMONEY) )
+ _player->SetMoney(0);
+ if( sWorld.getConfig(CONFIG_CHEAT_JAIL) )
+ {
+ _player->SetBindPointInDB(13,_player->GetZoneId(),0,0,0);
+ _player->TeleportTo(13,0,0,0,0); // put player in "the box" :)
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BROADCAST) )
+ {
+ std::stringstream wmsg;
+ wmsg << "|cffff0000[CHEAT]:|r Player '" << _player->GetName() << "' spoofed reward of quest #" << quest;
+ sWorld.SendWorldText(wmsg.str().c_str(), NULL);
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BAN) )
+ {
+ _player->BanAccount(8);
+ _player->GetSession()->Terminate(true); // this must be the last call (session is invalid after)
+ }
+
+ }
+ delete pQuest;
+ return; // do not complete quest
+ }
+ }
+
if( _player->CanRewardQuest( pQuest, reward, true ) )
{
_player->RewardQuest( pQuest, reward );
- if(Creature *pCreature = ObjectAccessor::Instance().GetCreature(*_player, guid))
+ if(pCreature)
{
_player->CalculateReputation( pQuest, guid );
if( !(Script->ChooseReward( _player, pCreature, pQuest, reward )) )
@@ -348,8 +413,43 @@
sLog.outString( "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest );
Quest *pQuest = objmgr.NewQuest( quest );
+
if( pQuest )
{
+ if ( sWorld.getConfig(CONFIG_CHEAT_ENABLEPROTECTION) )
+ {
+ // basic quest spoof protection:
+ Creature *pCreature = ObjectAccessor::Instance().GetCreature(*_player, guid);
+ if ( !pCreature->hasInvolvedQuest(quest) )
+ {
+ sLog.outError("CHEAT: player '%s' tried to spoof quest '%d'", _player->GetName(), quest);
+ if ( _player->GetSession()->GetSecurity() == 0)
+ {
+ if( sWorld.getConfig(CONFIG_CHEAT_REMOVEMONEY) )
+ _player->SetMoney(0);
+ if( sWorld.getConfig(CONFIG_CHEAT_JAIL) )
+ {
+ _player->SetBindPointInDB(13,_player->GetZoneId(),0,0,0);
+ _player->TeleportTo(13,0,0,0,0); // put player in "the box" :)
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BROADCAST) )
+ {
+ std::stringstream wmsg;
+ wmsg << "|cffff0000[CHEAT]:|r Player '" << _player->GetName() << "' spoofed quest #" << quest;
+ sWorld.SendWorldText(wmsg.str().c_str(), NULL);
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BAN) )
+ {
+ _player->BanAccount(8);
+ _player->GetSession()->Terminate(true); // this must be the last call (session is invalid after)
+ }
+ }
+ delete pQuest;
+ return; // do not complete quest
+ }
+ }
+
+
if( _player->GetQuestStatus( quest ) != QUEST_STATUS_COMPLETE )
_player->PlayerTalkClass->SendRequestedItems(pQuest, guid, false, false);
else
Index: src/game/SpellHandler.cpp
===================================================================
--- src/game/SpellHandler.cpp (revision 2264)
+++ src/game/SpellHandler.cpp (working copy)
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2005,2006 MaNGOS <http://www.mangosproject.org/>
*
* This program is free software; you can redistribute it and/or modify
@@ -92,7 +92,7 @@
SpellEntry *spellInfo = sSpellStore.LookupEntry(spellId);
if(!spellInfo)
{
- sLog.outError("Item (Entry: %u) in have wrong spell id %u, ignoring ", spellId);
+ sLog.outError("Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, spellId);
continue;
}
@@ -258,6 +258,78 @@
return;
}
+
+ // for basic spell anticheat:
+ if ( sWorld.getConfig(CONFIG_CHEAT_ENABLEPROTECTION) )
+ {
+ bool isSpellCheat = false;
+ uint32 req_GM, req_Level, req_Class;
+ std::string desc;
+ // check if the player owns the spell. this blocks cheats like WoWc or Wpe pro spell packet editing
+ if (
+ ((!_player->HasSpell(spellId)) && _player->GetSession()->GetSecurity() == 0) && // only GMs may cast spells they don't own
+ _player->IsInWorld() // the player has to be in the world to be treated as cheater. (on login spell 836 is casted, another one is casted on char enum, forgot the id.)
+ )
+ {
+ isSpellCheat = true;
+ }
+
+ if( (!isSpellCheat) && _player->IsInWorld() && sWorld.getConfig(CONFIG_CHEAT_CHECKSPELLDB) ) // player has spell, now lets check if the player may cast it
+ {
+ QueryResult *result = sDatabase.PQuery("SELECT `Req_GM`,`Req_Level`,`Req_Class`,`Description` FROM `Spell_Anticheat` WHERE `SpellID` = %d", spellId);
+ if (result)
+ {
+ req_GM = (*result)[0].GetUInt32();
+ req_Level = (*result)[1].GetUInt32();
+ req_Class = (*result)[2].GetUInt32();
+ desc = (*result)[3].GetString();
+
+ if ( _player->GetSession()->GetSecurity() < req_GM )
+ {
+ isSpellCheat = true;
+ }
+
+ if ( _player->getLevel() < req_Level && _player->GetSession()->GetSecurity() == 0 )
+ {
+ isSpellCheat = true;
+ }
+
+ if ( req_Class != 0 && req_Class != _player->getClass() && _player->GetSession()->GetSecurity() == 0 )
+ {
+ isSpellCheat = true;
+ }
+ delete result;
+ }
+
+ }
+ if ( isSpellCheat )
+ {
+ sLog.outError("CHEAT: Player '%s' casted Spell '%d'", _player->GetName(),spellId);
+ if ( _player->GetSession()->GetSecurity() == 0 ) // prevent GMs from beeing banned
+ {
+ if( sWorld.getConfig(CONFIG_CHEAT_REMOVEMONEY) )
+ _player->SetMoney(0);
+ if( sWorld.getConfig(CONFIG_CHEAT_JAIL) )
+ {
+ _player->SetBindPointInDB(13,_player->GetZoneId(),0,0,0);
+ _player->TeleportTo(13,0,0,0,0); // put player in "the box" :)
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BROADCAST) )
+ {
+ std::stringstream wmsg;
+ wmsg << "|cffff0000[CHEAT]:|r Player '" << _player->GetName() << "' tried to spoof spell #" << spellId;
+ sWorld.SendWorldText(wmsg.str().c_str(), NULL);
+ }
+ if( sWorld.getConfig(CONFIG_CHEAT_BAN) )
+ {
+ _player->BanAccount(9);
+ _player->GetSession()->Terminate(true); // this must be the last call (session is invalid after)
+ }
+ }
+ return; // spell is not beeing cast
+ }
+ }
+
Spell *spell ;
spell = new Spell(_player, spellInfo, false, 0);
Index: src/game/World.cpp
===================================================================
--- src/game/World.cpp (revision 2264)
+++ src/game/World.cpp (working copy)
@@ -225,9 +225,18 @@
m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 500);
m_configs[CONFIG_GAME_TYPE] = sConfig.GetIntDefault("GameType", 0);
m_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfig.GetIntDefault("AllowTwoSideAccounts", 0);
m_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfig.GetIntDefault("MaxPlayerLevel", 60);
m_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfig.GetIntDefault("MaxPrimaryTradeSkill", 2);
m_configs[CONFIG_WISPERING_TO_GM] = sConfig.GetIntDefault("WhisperingToGM",0);
+ m_configs[CONFIG_CHEAT_BROADCAST] = sConfig.GetBoolDefault("Cheat.Broadcast",1);
+ m_configs[CONFIG_CHEAT_BAN] = sConfig.GetBoolDefault("Cheat.Ban",1);
+ m_configs[CONFIG_CHEAT_JAIL] = sConfig.GetBoolDefault("Cheat.Jail",0);
+ m_configs[CONFIG_CHEAT_REMOVEMONEY] = sConfig.GetBoolDefault("Cheat.RemoveMoney",0);
+ m_configs[CONFIG_CHEAT_ENABLEPROTECTION] = sConfig.GetBoolDefault("Cheat.EnableProtection",1);
+ m_configs[CONFIG_CHEAT_CHECKSPELLDB] = sConfig.GetBoolDefault("Cheat.CheckSpellDB",0);
m_gameTime = (3600*atoi(hour))+(atoi(minute)*60)+(atoi(second));
Index: src/game/World.h
===================================================================
--- src/game/World.h (revision 2264)
+++ src/game/World.h (working copy)
@@ -58,9 +58,18 @@
CONFIG_SIGHT_GUARDER,
CONFIG_GAME_TYPE,
CONFIG_ALLOW_TWO_SIDE_ACCOUNTS,
CONFIG_MAX_PLAYER_LEVEL,
CONFIG_MAX_PRIMARY_TRADE_SKILL,
CONFIG_WISPERING_TO_GM,
+ CONFIG_CHEAT_ENABLEPROTECTION,
+ CONFIG_CHEAT_BAN,
+ CONFIG_CHEAT_BROADCAST,
+ CONFIG_CHEAT_JAIL,
+ CONFIG_CHEAT_REMOVEMONEY,
+ CONFIG_CHEAT_CHECKSPELLDB,
CONFIG_VALUE_COUNT
};
Index: src/game/WorldSession.cpp
===================================================================
--- src/game/WorldSession.cpp (revision 2264)
+++ src/game/WorldSession.cpp (working copy)
@@ -502,3 +502,9 @@
uint32 spellid;
recv_data >> spellid;
}
+
+void WorldSession::Terminate( bool save )
+{
+ LogoutPlayer(save);
+ _socket->Close();
+}
Index: src/game/WorldSession.h
===================================================================
--- src/game/WorldSession.h (revision 2264)
+++ src/game/WorldSession.h (working copy)
@@ -75,6 +75,7 @@
void QueuePacket(WorldPacket& packet);
bool Update(uint32 diff);
+ void Terminate(bool save);
void SendTestCreatureQueryOpcode( uint32 entry, uint64 guid, uint32 testvalue );
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu Sep 21 22:03:54 2006