• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

pomocna dłoń jest mi potrzebna ! :D Old tajbia 7.92 !

Nuvemem

;]
Joined
Apr 4, 2009
Messages
220
Reaction score
0
Location
Somewhere...
siemano!

mam taki problem, po dodaniu do Source paru linijek kodu, a dokładniej, że jeśli gracz chcę zmienić outfit to musi mieć otwarte okienko z outfitami, aby uniknąć bugu, że gracze robią full addony za pomocą bota ng ( w starszych silnikach 7.92 ), server sie crashuje i nie wiem co zrobiłem nie tak, ponieważ użyłem skryptu z tfs'a, a dokładniej tego :

protocol79.cpp : ( chodzi o opcje hasRequestedOutfit, ją właśnie dodałem ) [ zaznaczyłem to co dodałem ]

Code:
void Protocol79::parseRequestOutfit(NetworkMessage& msg)
{
	OTSYS_THREAD_LOCK_CLASS lockClass(g_game.gameLock, "Protocol79::parseRequestOutfit()");
	msg.Reset();
	
	msg.AddByte(0xC8);
	AddCreatureOutfit(msg, player, player->getDefaultOutfit());
	
	unsigned long counter = 0;
	const OutfitListType& player_outfits = player->getPlayerOutfits();
	
	std::list<int> outfitList;
	for(OutfitListType::const_iterator it = player_outfits.begin(); it != player_outfits.end() && (counter < 15); ++it, ++counter){
		if((*it)->premium == 0 || player->isPremium()){
			outfitList.push_back((*it)->looktype);
		}
	}

	//client outfits limit is 15
	long count_outfits = outfitList.size();
	if(count_outfits > 15){
		msg.AddByte(15);
	}
	//there is not any available outfit
	else if(count_outfits == 0){
		return;
	}
	else{
		msg.AddByte(count_outfits);
	}

	for(std::list<int>::iterator i = outfitList.begin(); i != outfitList.end(); ++i){
		msg.AddU16(*i);
		msg.AddString(Outfits::getInstance()->getOutfitName(*i));
		msg.AddByte(player->getOutfitAddon(*i));
	}
		[COLOR="#f4a460"]hasRequestedOutfit = true;[/COLOR]	
	WriteBuffer(msg);
}

void Protocol79::parseSetOutfit(NetworkMessage& msg)
     
{
	int looktype = msg.GetU16();
	int lookhead = msg.GetByte();
	int lookbody = msg.GetByte();
	int looklegs = msg.GetByte();
	int lookfeet = msg.GetByte();
	int lookaddons = msg.GetByte();
	
	if(player->canWear(looktype))
	{
                                 		[COLOR="#f4a460"]if(hasRequestedOutfit)[/COLOR]
                                 		{
		Outfit_t newOutfit;
		newOutfit.lookType = looktype;
		newOutfit.lookHead = lookhead;
		newOutfit.lookBody = lookbody;
		newOutfit.lookLegs = looklegs;
		newOutfit.lookFeet = lookfeet;
		newOutfit.lookAddons = lookaddons;

		g_game.playerChangeOutfit(player, newOutfit);
		[COLOR="#f4a460"]hasRequestedOutfit = false;[/COLOR]
	}
}
}

protocol79.h :

Code:
	bool pendingLogout;
	Player* player;
	SOCKET s;
		[COLOR="#f4a460"]bool hasRequestedOutfit;[/COLOR]


problem jest taki, że na początku wszystko pięknie git malina śmiga, a później się coś złego dzieje i się silnik crashuje, i to na pewno spowodowane jest tymi linijkami, może jakis kox mógłby mi pomóc, byłbym bardzo wdzięczny i napewno za każdą pomoc dam rep+ !


Pjona !
 
Last edited:
dla mnie to i tak to jest czarna magia, ledwo udaje mi się coś samemu dodać lub przerobić w kodzie, lecz dzięki za pomoc ;] rep ;p
 
Back
Top