[wpdev-commits] wolfpack/network uosocket.cpp,1.387,1.388
Brought to you by:
rip,
thiagocorrea
From: Correa <thi...@us...> - 2004-08-07 15:33:09
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6014/network Modified Files: uosocket.cpp Log Message: fix bug 208 ( new char doesn't get the events from players.xml ) Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.387 retrieving revision 1.388 diff -C2 -d -r1.387 -r1.388 *** uosocket.cpp 6 Aug 2004 22:27:03 -0000 1.387 --- uosocket.cpp 7 Aug 2004 15:32:59 -0000 1.388 *************** *** 841,845 **** if ( statSum > 80 || ( packet->strength() > 60 ) || ( packet->dexterity() > 60 ) || ( packet->intelligence() > 60 ) ) { ! log( QString( "Submitted invalid stats during char creation (%1,%2,%3).\n" ).arg( packet->strength() ).arg( packet->dexterity() ).arg( packet->intelligence() ) ); cancelCreate( tr( "Invalid Character stats" ) ) } --- 841,845 ---- if ( statSum > 80 || ( packet->strength() > 60 ) || ( packet->dexterity() > 60 ) || ( packet->intelligence() > 60 ) ) { ! log( tr( "Submitted invalid stats during char creation (%1,%2,%3).\n" ).arg( packet->strength() ).arg( packet->dexterity() ).arg( packet->intelligence() ) ); cancelCreate( tr( "Invalid Character stats" ) ) } *************** *** 848,852 **** if ( ( packet->skillId1() >= ALLSKILLS ) || ( packet->skillValue1() > 50 ) || ( packet->skillId2() >= ALLSKILLS ) || ( packet->skillValue2() > 50 ) || ( packet->skillId3() >= ALLSKILLS ) || ( packet->skillValue3() > 50 ) || ( packet->skillValue1() + packet->skillValue2() + packet->skillValue3() > 100 ) ) { ! log( QString( "Submitted invalid skills during char creation (%1=%2,%3=%4,%5=%6).\n" ).arg( packet->skillId1() ).arg( packet->skillValue1() ).arg( packet->skillId2() ).arg( packet->skillValue2() ).arg( packet->skillId3() ).arg( packet->skillValue3() ) ); cancelCreate( tr( "Invalid Character skills" ) ) } --- 848,852 ---- if ( ( packet->skillId1() >= ALLSKILLS ) || ( packet->skillValue1() > 50 ) || ( packet->skillId2() >= ALLSKILLS ) || ( packet->skillValue2() > 50 ) || ( packet->skillId3() >= ALLSKILLS ) || ( packet->skillValue3() > 50 ) || ( packet->skillValue1() + packet->skillValue2() + packet->skillValue3() > 100 ) ) { ! log( tr( "Submitted invalid skills during char creation (%1=%2,%3=%4,%5=%6).\n" ).arg( packet->skillId1() ).arg( packet->skillValue1() ).arg( packet->skillId2() ).arg( packet->skillValue2() ).arg( packet->skillId3() ).arg( packet->skillValue3() ) ); cancelCreate( tr( "Invalid Character skills" ) ) } *************** *** 855,859 **** if ( packet->hairStyle() && ( !isHair( packet->hairStyle() ) || !isHairColor( packet->hairColor() ) ) ) { ! log( QString( "Submitted wrong hair style (%1) or wrong hair color (%2) during char creation.\n" ).arg( packet->hairStyle() ).arg( packet->hairColor() ) ); cancelCreate( tr( "Invalid hair" ) ) } --- 855,859 ---- if ( packet->hairStyle() && ( !isHair( packet->hairStyle() ) || !isHairColor( packet->hairColor() ) ) ) { ! log( tr( "Submitted wrong hair style (%1) or wrong hair color (%2) during char creation.\n" ).arg( packet->hairStyle() ).arg( packet->hairColor() ) ); cancelCreate( tr( "Invalid hair" ) ) } *************** *** 862,866 **** if ( packet->beardStyle() && ( !isBeard( packet->beardStyle() ) || !isHairColor( packet->beardColor() ) ) ) { ! log( QString( "Submitted wrong beard style (%1) or wrong beard color (%2) during char creation.\n" ).arg( packet->beardStyle() ).arg( packet->beardColor() ) ); cancelCreate( tr( "Invalid beard" ) ) } --- 862,866 ---- if ( packet->beardStyle() && ( !isBeard( packet->beardStyle() ) || !isHairColor( packet->beardColor() ) ) ) { ! log( tr( "Submitted wrong beard style (%1) or wrong beard color (%2) during char creation.\n" ).arg( packet->beardStyle() ).arg( packet->beardColor() ) ); cancelCreate( tr( "Invalid beard" ) ) } *************** *** 869,873 **** if ( !isNormalColor( packet->shirtColor() ) || !isNormalColor( packet->pantsColor() ) ) { ! log( QString( "Submitted wrong shirt (%1) or pant (%2) color during char creation.\n" ).arg( packet->shirtColor() ).arg( packet->pantsColor() ) ); cancelCreate( tr( "Invalid shirt or pant color" ) ) } --- 869,873 ---- if ( !isNormalColor( packet->shirtColor() ) || !isNormalColor( packet->pantsColor() ) ) { ! log( tr( "Submitted wrong shirt (%1) or pant (%2) color during char creation.\n" ).arg( packet->shirtColor() ).arg( packet->pantsColor() ) ); cancelCreate( tr( "Invalid shirt or pant color" ) ) } *************** *** 878,882 **** if ( packet->startTown() >= startLocations.size() ) { ! log( QString( "Submitted wrong starting location (%1) during char creation.\n" ).arg( packet->startTown() ) ); cancelCreate( tr( "Invalid start location" ) ) } --- 878,882 ---- if ( packet->startTown() >= startLocations.size() ) { ! log( tr( "Submitted wrong starting location (%1) during char creation.\n" ).arg( packet->startTown() ) ); cancelCreate( tr( "Invalid start location" ) ) } *************** *** 885,889 **** if ( !isSkinColor( packet->skinColor() ) ) { ! log( QString( "Submitted a wrong skin color (%1) during char creation.\n" ).arg( packet->skinColor() ) ); cancelCreate( tr( "Invalid skin color" ) ) } --- 885,889 ---- if ( !isSkinColor( packet->skinColor() ) ) { ! log( tr( "Submitted a wrong skin color (%1) during char creation.\n" ).arg( packet->skinColor() ) ); cancelCreate( tr( "Invalid skin color" ) ) } *************** *** 892,914 **** P_PLAYER pChar = new cPlayer; pChar->Init(); - pChar->setGender( packet->gender() ); ! pChar->setName( packet->name() ); ! ! pChar->setSkin( packet->skinColor() ); ! pChar->setOrgSkin( packet->skinColor() ); ! ! pChar->setBody( ( packet->gender() == 1 ) ? 0x191 : 0x190 ); ! if ( packet->gender() == 1 ) { pChar->setBaseid( "player_female" ); } else { pChar->setBaseid( "player_male" ); } pChar->setOrgBody( pChar->body() ); --- 892,919 ---- P_PLAYER pChar = new cPlayer; pChar->Init(); pChar->setGender( packet->gender() ); ! const cElement* playerDefinition = 0; if ( packet->gender() == 1 ) { pChar->setBaseid( "player_female" ); + playerDefinition = Definitions::instance()->getDefinition( WPDT_NPC, "player_female" ); } else { pChar->setBaseid( "player_male" ); + playerDefinition = Definitions::instance()->getDefinition( WPDT_NPC, "player_male" ); } + if ( playerDefinition ) + pChar->applyDefinition( playerDefinition ); + + pChar->setName( packet->name() ); + + pChar->setSkin( packet->skinColor() ); + pChar->setOrgSkin( packet->skinColor() ); + + pChar->setBody( ( packet->gender() == 1 ) ? 0x191 : 0x190 ); + pChar->setOrgBody( pChar->body() ); |