aboutsummaryrefslogtreecommitdiff
path: root/reference/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'reference/game.c')
-rw-r--r--reference/game.c1316
1 files changed, 0 insertions, 1316 deletions
diff --git a/reference/game.c b/reference/game.c
index 2b04018..a3130b1 100644
--- a/reference/game.c
+++ b/reference/game.c
@@ -18382,1322 +18382,6 @@ void __static_initialization_and_destruction_0(int __initialize_p,int __priority
return;
}
-// DWARF original prototype: void TPlayer(TPlayer * this, TConnection * Connection, ulong
-// CharacterID)
-
-void __thiscall TPlayer::TPlayer(TPlayer *this,TConnection *Connection,ulong CharacterID)
-
-{
- char *__dest;
- TSkill **ppTVar1;
- TSkill *pTVar2;
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar3;
- bool bVar4;
- byte bVar5;
- ushort HouseID;
- int i;
- Object *pOVar6;
- uint uVar7;
- TPlayerData *pTVar8;
- char *__src;
- time_t tVar9;
- TPlayer **ppTVar10;
- int iVar11;
- TCreature *pTVar12;
- tm *__tp;
- int iVar13;
- ulong id;
- int i_1;
- uchar *puVar14;
- int *piVar15;
- char local_ac [4];
- char TimeString [100];
- Object local_3c [4];
- ulong local_2c;
-
- TCreature::TCreature(&this->super_TCreature);
- pOVar6 = this->OpenContainer;
- (this->Depot).ObjectID = 0;
- (this->TradeObject).ObjectID = 0;
- iVar13 = 0xf;
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TPlayer_08127c68;
- do {
- pOVar6->ObjectID = 0;
- iVar13 = iVar13 + -1;
- pOVar6 = pOVar6 + 1;
- } while (iVar13 != -1);
- // try { // try from 080a9026 to 080a902a has its CatchHandler @ 080a9a43
- vector<>::vector(&this->AttackedPlayers,0,10,10);
- // try { // try from 080a9052 to 080a9056 has its CatchHandler @ 080a9a3f
- vector<>::vector(&this->FormerAttackedPlayers,0,10,10);
- (this->super_TCreature).Profession = '\0';
- this->ConstructError = NOERROR;
- (this->super_TCreature).Type = PLAYER;
- (this->Depot).ObjectID = ::NONE.ObjectID;
- local_3c[0] = ::NONE;
- local_2c = ::NONE.ObjectID;
- (this->TradeObject).ObjectID = ::NONE.ObjectID;
- this->OldState = 0;
- this->OpenContainer[0].ObjectID = 0;
- this->OpenContainer[2].ObjectID = 0;
- this->OpenContainer[4].ObjectID = 0;
- this->OpenContainer[1].ObjectID = 0;
- this->OpenContainer[5].ObjectID = 0;
- this->OpenContainer[7].ObjectID = 0;
- this->OpenContainer[6].ObjectID = 0;
- this->OpenContainer[8].ObjectID = 0;
- this->OpenContainer[10].ObjectID = 0;
- this->OpenContainer[3].ObjectID = 0;
- this->OpenContainer[9].ObjectID = 0;
- this->OpenContainer[0xb].ObjectID = 0;
- this->OpenContainer[0xe].ObjectID = 0;
- this->OpenContainer[0xc].ObjectID = 0;
- this->OpenContainer[0xd].ObjectID = 0;
- this->OpenContainer[0xf].ObjectID = 0;
- puVar14 = this->SpellList;
- for (iVar13 = 0x40; iVar13 != 0; iVar13 = iVar13 + -1) {
- puVar14[0] = '\0';
- puVar14[1] = '\0';
- puVar14[2] = '\0';
- puVar14[3] = '\0';
- puVar14 = puVar14 + 4;
- }
- uVar7 = 2000;
- piVar15 = this->QuestValues;
- if (((uint)piVar15 & 4) != 0) {
- uVar7 = 0x7cc;
- this->QuestValues[0] = 0;
- piVar15 = this->QuestValues + 1;
- }
- for (uVar7 = uVar7 >> 2; uVar7 != 0; uVar7 = uVar7 - 1) {
- *piVar15 = 0;
- piVar15 = piVar15 + 1;
- }
- this->Request = 0;
- this->RequestTimestamp = 0;
- this->RequestProcessingGamemaster = 0;
- this->TutorActivities = 0;
- this->NumberOfAttackedPlayers = 0;
- this->NumberOfFormerAttackedPlayers = 0;
- this->PartyLeader = 0;
- (this->super_TCreature).LoseInventory = 1;
- iVar13 = 0;
- this->Guild[0] = '\0';
- this->Rank[0] = '\0';
- this->Title[0] = '\0';
- this->Aggressor = false;
- this->FormerAggressor = false;
- this->TalkBufferFullTime = 0;
- this->MutingEndRound = 0;
- this->NumberOfMutings = 0;
- do {
- this->Addressees[iVar13] = 0;
- iVar13 = iVar13 + 1;
- } while (iVar13 < 0x14);
- // try { // try from 080a91fa to 080a9232 has its CatchHandler @ 080a9a3b
- pTVar8 = AttachPlayerPoolSlot(CharacterID,false);
- this->PlayerData = pTVar8;
- if (pTVar8 == (TPlayerData *)0x0) {
- error("TPlayer::TPlayer: PlayerData-Slot nicht gefunden.\n");
- this->ConstructError = ERROR;
- }
- else {
- SendMails(pTVar8);
- pTVar8 = this->PlayerData;
- __dest = (this->super_TCreature).Name;
- (this->super_TCreature).Connection = Connection;
- strcpy(__dest,pTVar8->Name);
- // try { // try from 080a9266 to 080a99d8 has its CatchHandler @ 080a99f0
- TCreature::SetID(&this->super_TCreature,CharacterID);
- InsertPlayerIndex(&PlayerIndexHead,0,__dest,CharacterID);
- LoadData(this);
- this->AccountID = this->PlayerData->AccountID;
- __src = TConnection::GetIPAddress(Connection);
- strcpy(this->IPAddress,__src);
- pTVar8 = this->PlayerData;
- *(undefined4 *)this->Rights = *(undefined4 *)pTVar8->Rights;
- *(undefined4 *)(this->Rights + 4) = *(undefined4 *)(pTVar8->Rights + 4);
- *(undefined4 *)(this->Rights + 8) = *(undefined4 *)(pTVar8->Rights + 8);
- bVar4 = CheckRight((this->super_TCreature).ID,PREMIUM_ACCOUNT);
- if (bVar4) {
- Log("game","Spieler besitzt Premium Account.\n");
- }
- pTVar8 = this->PlayerData;
- (this->super_TCreature).Sex = pTVar8->Sex;
- strcpy(this->Guild,pTVar8->Guild);
- strcpy(this->Rank,this->PlayerData->Rank);
- strcpy(this->Title,this->PlayerData->Title);
- pTVar8 = this->PlayerData;
- this->Request = 0;
- this->RequestTimestamp = 0;
- this->RequestProcessingGamemaster = 0;
- tVar9 = time((time_t *)0x0);
- if (pTVar8->PlayerkillerEnd < tVar9) {
- this->PlayerData->PlayerkillerEnd = 0;
- }
- CheckOutfit(this);
- TCreature::SetInCrList(&this->super_TCreature);
- Semaphore::down(&PlayerMutex);
- ppTVar10 = vector<TPlayer*>::operator()(&PlayerList,FirstFreePlayer);
- FirstFreePlayer = FirstFreePlayer + 1;
- *ppTVar10 = this;
- Semaphore::up(&PlayerMutex);
- iVar13 = 1;
- NotifyBuddies((this->super_TCreature).ID,__dest,true);
- IncrementPlayersOnline();
- if ((this->super_TCreature).Profession == '\0') {
- IncrementNewbiesOnline();
- }
- pTVar2 = (this->super_TCreature).super_TSkillBase.Skills[0x16];
- bVar4 = CheckRight((this->super_TCreature).ID,PREMIUM_ACCOUNT);
- if (bVar4) {
- bVar4 = 9 < (this->super_TCreature).Profession;
- }
- else {
- bVar4 = false;
- }
- iVar11 = 200;
- if (!bVar4) {
- iVar11 = 100;
- }
- pTVar2->Max = iVar11;
- TSkill::Check((this->super_TCreature).super_TSkillBase.Skills[0x16]);
- pTVar2 = (this->super_TCreature).super_TSkillBase.Skills[0x16];
- iVar11 = (*pTVar2->_vptr_TSkill[0xd])(pTVar2);
- if (0xe < iVar11) {
- bVar4 = CheckRight((this->super_TCreature).ID,PREMIUM_ACCOUNT);
- if (bVar4) {
- bVar4 = 9 < (this->super_TCreature).Profession;
- }
- else {
- bVar4 = false;
- }
- iVar13 = 0xf;
- if (!bVar4) {
- iVar13 = 0x78;
- }
- CharacterID = (iVar11 + -1) % iVar13 + 1;
- iVar13 = (iVar11 + -1) / iVar13 + 1;
- TSkillBase::SetTimer(&(this->super_TCreature).super_TSkillBase);
- }
- pTVar2 = (this->super_TCreature).super_TSkillBase.Skills[2];
- iVar11 = TSkill::Get(pTVar2);
- if (iVar11 < 1) {
- (*pTVar2->_vptr_TSkill[2])(pTVar2,pTVar2->Max,iVar13,CharacterID);
- iVar13 = 0;
- (this->super_TCreature).posx = (this->super_TCreature).startx;
- (this->super_TCreature).posy = (this->super_TCreature).starty;
- (this->super_TCreature).posz = (this->super_TCreature).startz;
- do {
- TSkillBase::DelTimer(&(this->super_TCreature).super_TSkillBase,(ushort)iVar13);
- TSkill::SetMDAct((this->super_TCreature).super_TSkillBase.Skills[iVar13],0);
- ppTVar1 = (this->super_TCreature).super_TSkillBase.Skills + iVar13;
- iVar13 = iVar13 + 1;
- (*ppTVar1)->DAct = 0;
- } while (iVar13 < 0x19);
- aVar3 = (this->super_TCreature).OrgOutfit.field_1;
- (this->super_TCreature).Outfit.OutfitID = (this->super_TCreature).OrgOutfit.OutfitID;
- pTVar2 = (this->super_TCreature).super_TSkillBase.Skills[3];
- (this->super_TCreature).Outfit.field_1 = aVar3;
- (*pTVar2->_vptr_TSkill[2])
- ((this->super_TCreature).super_TSkillBase.Skills[3],pTVar2->Max);
- }
- if (this->PlayerData->LastLoginTime == 0) {
- bVar4 = CheckRight((this->super_TCreature).ID,GAMEMASTER_OUTFIT);
- if (bVar4) {
- Log("game","Gamemaster-Charakter %s loggt zum ersten Mal ein -> Level 2 setzen.\n",
- __dest);
- (this->super_TCreature).super_TSkillBase.Skills[0]->Act = 2;
- (this->super_TCreature).super_TSkillBase.Skills[0]->Exp = 100;
- (this->super_TCreature).super_TSkillBase.Skills[0]->LastLevel = 100;
- (this->super_TCreature).super_TSkillBase.Skills[0]->NextLevel = 200;
- }
- }
- bVar4 = CoordinateFlag();
- if (bVar4) {
- Regenerate(this);
- }
- HouseID = GetHouseID((this->super_TCreature).posx,(this->super_TCreature).posy,
- (this->super_TCreature).posz);
- if (HouseID != 0) {
- bVar4 = IsInvited(HouseID,this,this->PlayerData->LastLogoutTime);
- if (!bVar4) {
- bVar4 = CheckRight((this->super_TCreature).ID,ENTER_HOUSES);
- if (!bVar4) {
- GetExitPosition(HouseID,&(this->super_TCreature).posx,
- &(this->super_TCreature).posy,&(this->super_TCreature).posz);
- }
- }
- }
- bVar4 = CheckRight((this->super_TCreature).ID,PREMIUM_ACCOUNT);
- if (!bVar4) {
- bVar4 = IsPremiumArea((this->super_TCreature).startx,(this->super_TCreature).starty,
- (this->super_TCreature).startz);
- if (bVar4) {
- Log("game",&DAT_08103880,__dest);
- bVar5 = (this->super_TCreature).Profession;
- if (9 < bVar5) {
- bVar5 = bVar5 - 10;
- }
- GetStartPosition(&(this->super_TCreature).startx,&(this->super_TCreature).starty,
- &(this->super_TCreature).startz,bVar5 == 0);
- }
- bVar4 = IsPremiumArea((this->super_TCreature).posx,(this->super_TCreature).posy,
- (this->super_TCreature).posz);
- if (bVar4) {
- Log("game",
- "Spieler %s wird aus PayArea geworfen und in seine Heimatstadt gesetzt.\n",
- __dest);
- (this->super_TCreature).posx = (this->super_TCreature).startx;
- (this->super_TCreature).posy = (this->super_TCreature).starty;
- (this->super_TCreature).posz = (this->super_TCreature).startz;
- }
- }
- TCreature::SetOnMap(&this->super_TCreature);
- TConnection::EnterGame(Connection);
- SendInitGame((TConnection *)(this->super_TCreature).ID,id);
- SendRights((this->super_TCreature).Connection);
- SendFullScreen((this->super_TCreature).Connection);
- local_3c[0].ObjectID = (this->super_TCreature).CrObject.ObjectID;
- GraphicalEffect(local_3c,0xb);
- LoadInventory(this,this->PlayerData->LastLoginTime == 0);
- TCreature::NotifyChangeInventory(&this->super_TCreature);
- SendAmbiente((this->super_TCreature).Connection);
- pTVar12 = GetCreature((this->super_TCreature).ID);
- if (pTVar12 == (TCreature *)0x0) {
- error("TPlayer::TPlayer: Kreatur nicht korrekt angelegt.\n");
- }
- else {
- AnnounceChangedCreature((this->super_TCreature).ID,2);
- }
- SendPlayerSkills((this->super_TCreature).Connection);
- this->OldState = 0;
- CheckState(this);
- if (this->PlayerData->LastLoginTime == 0) {
- bVar4 = CheckRight((this->super_TCreature).ID,GAMEMASTER_OUTFIT);
- if (!bVar4) {
- Log("game","Spieler %s loggt zum ersten Mal ein -> Outfitwahl.\n",__dest);
- SendMessage((this->super_TCreature).Connection,0x14,
- "Welcome to Tibia! Please choose your outfit.");
- SendOutfit((this->super_TCreature).Connection);
- }
- }
- SendBuddies(this);
- pTVar8 = this->PlayerData;
- if (pTVar8->LastLoginTime != 0) {
- __tp = localtime(&pTVar8->LastLoginTime);
- strftime(local_ac,100,"%d. %b %Y %X %Z",__tp);
- SendMessage((this->super_TCreature).Connection,0x14,"Your last visit in Tibia: %s.",
- local_ac);
- pTVar8 = this->PlayerData;
- }
- tVar9 = time((time_t *)0x0);
- pTVar8->LastLoginTime = tVar9;
- }
- return;
-}
-
-
-
-// DWARF original prototype: void TPlayer(TPlayer * this, TConnection * Connection, ulong
-// CharacterID)
-
-void __thiscall TPlayer::TPlayer(TPlayer *this,TConnection *Connection,ulong CharacterID)
-
-{
- char *__dest;
- TSkill **ppTVar1;
- TSkill *pTVar2;
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar3;
- bool bVar4;
- byte bVar5;
- ushort HouseID;
- int i;
- Object *pOVar6;
- uint uVar7;
- TPlayerData *pTVar8;
- char *__src;
- time_t tVar9;
- TPlayer **ppTVar10;
- int iVar11;
- TCreature *pTVar12;
- tm *__tp;
- int iVar13;
- ulong id;
- int i_1;
- uchar *puVar14;
- int *piVar15;
- char local_ac [4];
- char TimeString [100];
- Object local_3c [4];
- ulong local_2c;
-
- TCreature::TCreature(&this->super_TCreature);
- pOVar6 = this->OpenContainer;
- (this->Depot).ObjectID = 0;
- (this->TradeObject).ObjectID = 0;
- iVar13 = 0xf;
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TPlayer_08127c68;
- do {
- pOVar6->ObjectID = 0;
- iVar13 = iVar13 + -1;
- pOVar6 = pOVar6 + 1;
- } while (iVar13 != -1);
- // try { // try from 080a9ad6 to 080a9ada has its CatchHandler @ 080aa4f3
- vector<>::vector(&this->AttackedPlayers,0,10,10);
- // try { // try from 080a9b02 to 080a9b06 has its CatchHandler @ 080aa4ef
- vector<>::vector(&this->FormerAttackedPlayers,0,10,10);
- (this->super_TCreature).Profession = '\0';
- this->ConstructError = NOERROR;
- (this->super_TCreature).Type = PLAYER;
- (this->Depot).ObjectID = ::NONE.ObjectID;
- local_3c[0] = ::NONE;
- local_2c = ::NONE.ObjectID;
- (this->TradeObject).ObjectID = ::NONE.ObjectID;
- this->OpenContainer[0].ObjectID = 0;
- this->OldState = 0;
- this->OpenContainer[3].ObjectID = 0;
- this->OpenContainer[4].ObjectID = 0;
- this->OpenContainer[2].ObjectID = 0;
- this->OpenContainer[6].ObjectID = 0;
- this->OpenContainer[7].ObjectID = 0;
- this->OpenContainer[5].ObjectID = 0;
- this->OpenContainer[9].ObjectID = 0;
- this->OpenContainer[0xb].ObjectID = 0;
- this->OpenContainer[1].ObjectID = 0;
- this->OpenContainer[8].ObjectID = 0;
- this->OpenContainer[0xc].ObjectID = 0;
- this->OpenContainer[0xe].ObjectID = 0;
- this->OpenContainer[10].ObjectID = 0;
- this->OpenContainer[0xd].ObjectID = 0;
- this->OpenContainer[0xf].ObjectID = 0;
- puVar14 = this->SpellList;
- for (iVar13 = 0x40; iVar13 != 0; iVar13 = iVar13 + -1) {
- puVar14[0] = '\0';
- puVar14[1] = '\0';
- puVar14[2] = '\0';
- puVar14[3] = '\0';
- puVar14 = puVar14 + 4;
- }
- uVar7 = 2000;
- piVar15 = this->QuestValues;
- if (((uint)piVar15 & 4) != 0) {
- piVar15 = this->QuestValues + 1;
- uVar7 = 0x7cc;
- this->QuestValues[0] = 0;
- }
- for (uVar7 = uVar7 >> 2; uVar7 != 0; uVar7 = uVar7 - 1) {
- *piVar15 = 0;
- piVar15 = piVar15 + 1;
- }
- this->Request = 0;
- this->RequestTimestamp = 0;
- this->RequestProcessingGamemaster = 0;
- this->TutorActivities = 0;
- (this->super_TCreature).LoseInventory = 1;
- this->NumberOfAttackedPlayers = 0;
- this->NumberOfFormerAttackedPlayers = 0;
- this->NumberOfMutings = 0;
- iVar13 = 0;
- this->Guild[0] = '\0';
- this->Rank[0] = '\0';
- this->Title[0] = '\0';
- this->Aggressor = false;
- this->FormerAggressor = false;
- this->PartyLeader = 0;
- this->TalkBufferFullTime = 0;
- this->MutingEndRound = 0;
- do {
- this->Addressees[iVar13] = 0;
- iVar13 = iVar13 + 1;
- } while (iVar13 < 0x14);
- // try { // try from 080a9caa to 080a9ce2 has its CatchHandler @ 080aa4eb
- pTVar8 = AttachPlayerPoolSlot(CharacterID,false);
- this->PlayerData = pTVar8;
- if (pTVar8 == (TPlayerData *)0x0) {
- error("TPlayer::TPlayer: PlayerData-Slot nicht gefunden.\n");
- this->ConstructError = ERROR;
- }
- else {
- SendMails(pTVar8);
- pTVar8 = this->PlayerData;
- (this->super_TCreature).Connection = Connection;
- __dest = (this->super_TCreature).Name;
- strcpy(__dest,pTVar8->Name);
- // try { // try from 080a9d16 to 080aa488 has its CatchHandler @ 080aa4a0
- TCreature::SetID(&this->super_TCreature,CharacterID);
- InsertPlayerIndex(&PlayerIndexHead,0,__dest,CharacterID);
- LoadData(this);
- this->AccountID = this->PlayerData->AccountID;
- __src = TConnection::GetIPAddress(Connection);
- strcpy(this->IPAddress,__src);
- pTVar8 = this->PlayerData;
- *(undefined4 *)this->Rights = *(undefined4 *)pTVar8->Rights;
- *(undefined4 *)(this->Rights + 4) = *(undefined4 *)(pTVar8->Rights + 4);
- *(undefined4 *)(this->Rights + 8) = *(undefined4 *)(pTVar8->Rights + 8);
- bVar4 = CheckRight((this->super_TCreature).ID,PREMIUM_ACCOUNT);
- if (bVar4) {
- Log("game","Spieler besitzt Premium Account.\n");
- }
- pTVar8 = this->PlayerData;
- (this->super_TCreature).Sex = pTVar8->Sex;
- strcpy(this->Guild,pTVar8->Guild);
- strcpy(this->Rank,this->PlayerData->Rank);
- strcpy(this->Title,this->PlayerData->Title);
- pTVar8 = this->PlayerData;
- this->Request = 0;
- this->RequestTimestamp = 0;
- this->RequestProcessingGamemaster = 0;
- tVar9 = time((time_t *)0x0);
- if (pTVar8->PlayerkillerEnd < tVar9) {
- this->PlayerData->PlayerkillerEnd = 0;
- }
- CheckOutfit(this);
- TCreature::SetInCrList(&this->super_TCreature);
- Semaphore::down(&PlayerMutex);
- ppTVar10 = vector<TPlayer*>::operator()(&PlayerList,FirstFreePlayer);
- FirstFreePlayer = FirstFreePlayer + 1;
- *ppTVar10 = this;
- Semaphore::up(&PlayerMutex);
- iVar13 = 1;
- NotifyBuddies((this->super_TCreature).ID,__dest,true);
- IncrementPlayersOnline();
- if ((this->super_TCreature).Profession == '\0') {
- IncrementNewbiesOnline();
- }
- pTVar2 = (this->super_TCreature).super_TSkillBase.Skills[0x16];
- bVar4 = CheckRight((this->super_TCreature).ID,PREMIUM_ACCOUNT);
- if (bVar4) {
- bVar4 = 9 < (this->super_TCreature).Profession;
- }
- else {
- bVar4 = false;
- }
- iVar11 = 200;
- if (!bVar4) {
- iVar11 = 100;
- }
- pTVar2->Max = iVar11;
- TSkill::Check((this->super_TCreature).super_TSkillBase.Skills[0x16]);
- pTVar2 = (this->super_TCreature).super_TSkillBase.Skills[0x16];
- iVar11 = (*pTVar2->_vptr_TSkill[0xd])(pTVar2);
- if (0xe < iVar11) {
- bVar4 = CheckRight((this->super_TCreature).ID,PREMIUM_ACCOUNT);
- if (bVar4) {
- bVar4 = 9 < (this->super_TCreature).Profession;
- }
- else {
- bVar4 = false;
- }
- iVar13 = 0xf;
- if (!bVar4) {
- iVar13 = 0x78;
- }
- CharacterID = (iVar11 + -1) % iVar13 + 1;
- iVar13 = (iVar11 + -1) / iVar13 + 1;
- TSkillBase::SetTimer(&(this->super_TCreature).super_TSkillBase);
- }
- pTVar2 = (this->super_TCreature).super_TSkillBase.Skills[2];
- iVar11 = TSkill::Get(pTVar2);
- if (iVar11 < 1) {
- (*pTVar2->_vptr_TSkill[2])(pTVar2,pTVar2->Max,iVar13,CharacterID);
- iVar13 = 0;
- (this->super_TCreature).posx = (this->super_TCreature).startx;
- (this->super_TCreature).posy = (this->super_TCreature).starty;
- (this->super_TCreature).posz = (this->super_TCreature).startz;
- do {
- TSkillBase::DelTimer(&(this->super_TCreature).super_TSkillBase,(ushort)iVar13);
- TSkill::SetMDAct((this->super_TCreature).super_TSkillBase.Skills[iVar13],0);
- ppTVar1 = (this->super_TCreature).super_TSkillBase.Skills + iVar13;
- iVar13 = iVar13 + 1;
- (*ppTVar1)->DAct = 0;
- } while (iVar13 < 0x19);
- aVar3 = (this->super_TCreature).OrgOutfit.field_1;
- (this->super_TCreature).Outfit.OutfitID = (this->super_TCreature).OrgOutfit.OutfitID;
- pTVar2 = (this->super_TCreature).super_TSkillBase.Skills[3];
- (this->super_TCreature).Outfit.field_1 = aVar3;
- (*pTVar2->_vptr_TSkill[2])
- ((this->super_TCreature).super_TSkillBase.Skills[3],pTVar2->Max);
- }
- if (this->PlayerData->LastLoginTime == 0) {
- bVar4 = CheckRight((this->super_TCreature).ID,GAMEMASTER_OUTFIT);
- if (bVar4) {
- Log("game","Gamemaster-Charakter %s loggt zum ersten Mal ein -> Level 2 setzen.\n",
- __dest);
- (this->super_TCreature).super_TSkillBase.Skills[0]->Act = 2;
- (this->super_TCreature).super_TSkillBase.Skills[0]->Exp = 100;
- (this->super_TCreature).super_TSkillBase.Skills[0]->LastLevel = 100;
- (this->super_TCreature).super_TSkillBase.Skills[0]->NextLevel = 200;
- }
- }
- bVar4 = CoordinateFlag();
- if (bVar4) {
- Regenerate(this);
- }
- HouseID = GetHouseID((this->super_TCreature).posx,(this->super_TCreature).posy,
- (this->super_TCreature).posz);
- if (HouseID != 0) {
- bVar4 = IsInvited(HouseID,this,this->PlayerData->LastLogoutTime);
- if (!bVar4) {
- bVar4 = CheckRight((this->super_TCreature).ID,ENTER_HOUSES);
- if (!bVar4) {
- GetExitPosition(HouseID,&(this->super_TCreature).posx,
- &(this->super_TCreature).posy,&(this->super_TCreature).posz);
- }
- }
- }
- bVar4 = CheckRight((this->super_TCreature).ID,PREMIUM_ACCOUNT);
- if (!bVar4) {
- bVar4 = IsPremiumArea((this->super_TCreature).startx,(this->super_TCreature).starty,
- (this->super_TCreature).startz);
- if (bVar4) {
- Log("game",&DAT_08103880,__dest);
- bVar5 = (this->super_TCreature).Profession;
- if (9 < bVar5) {
- bVar5 = bVar5 - 10;
- }
- GetStartPosition(&(this->super_TCreature).startx,&(this->super_TCreature).starty,
- &(this->super_TCreature).startz,bVar5 == 0);
- }
- bVar4 = IsPremiumArea((this->super_TCreature).posx,(this->super_TCreature).posy,
- (this->super_TCreature).posz);
- if (bVar4) {
- Log("game",
- "Spieler %s wird aus PayArea geworfen und in seine Heimatstadt gesetzt.\n",
- __dest);
- (this->super_TCreature).posx = (this->super_TCreature).startx;
- (this->super_TCreature).posy = (this->super_TCreature).starty;
- (this->super_TCreature).posz = (this->super_TCreature).startz;
- }
- }
- TCreature::SetOnMap(&this->super_TCreature);
- TConnection::EnterGame(Connection);
- SendInitGame((TConnection *)(this->super_TCreature).ID,id);
- SendRights((this->super_TCreature).Connection);
- SendFullScreen((this->super_TCreature).Connection);
- local_3c[0].ObjectID = (this->super_TCreature).CrObject.ObjectID;
- GraphicalEffect(local_3c,0xb);
- LoadInventory(this,this->PlayerData->LastLoginTime == 0);
- TCreature::NotifyChangeInventory(&this->super_TCreature);
- SendAmbiente((this->super_TCreature).Connection);
- pTVar12 = GetCreature((this->super_TCreature).ID);
- if (pTVar12 == (TCreature *)0x0) {
- error("TPlayer::TPlayer: Kreatur nicht korrekt angelegt.\n");
- }
- else {
- AnnounceChangedCreature((this->super_TCreature).ID,2);
- }
- SendPlayerSkills((this->super_TCreature).Connection);
- this->OldState = 0;
- CheckState(this);
- if (this->PlayerData->LastLoginTime == 0) {
- bVar4 = CheckRight((this->super_TCreature).ID,GAMEMASTER_OUTFIT);
- if (!bVar4) {
- Log("game","Spieler %s loggt zum ersten Mal ein -> Outfitwahl.\n",__dest);
- SendMessage((this->super_TCreature).Connection,0x14,
- "Welcome to Tibia! Please choose your outfit.");
- SendOutfit((this->super_TCreature).Connection);
- }
- }
- SendBuddies(this);
- pTVar8 = this->PlayerData;
- if (pTVar8->LastLoginTime != 0) {
- __tp = localtime(&pTVar8->LastLoginTime);
- strftime(local_ac,100,"%d. %b %Y %X %Z",__tp);
- SendMessage((this->super_TCreature).Connection,0x14,"Your last visit in Tibia: %s.",
- local_ac);
- pTVar8 = this->PlayerData;
- }
- tVar9 = time((time_t *)0x0);
- pTVar8->LastLoginTime = tVar9;
- }
- return;
-}
-
-
-
-// DWARF original prototype: void ~TPlayer(TPlayer * this, int __in_chrg)
-
-void __thiscall TPlayer::~TPlayer(TPlayer *this,int __in_chrg)
-
-{
- ulong *puVar1;
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar2;
- bool bVar3;
- TCreature *cr;
- time_t tVar4;
- TCreature *pTVar5;
- __pid_t _Var6;
- ulong uVar7;
- TSkill *pTVar8;
- int iVar9;
- TPlayerData *pTVar10;
- int i;
- TCreature *pTVar11;
- uint uVar12;
- uchar *puVar13;
- int *piVar14;
- char *pcVar15;
- char *in_stack_ffffffd8;
- char *pcVar16;
- char *local_14;
-
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TPlayer_08127c68;
- LogoutOrder(this);
- if (this->ConstructError != NOERROR) {
- DelInList(this);
- goto LAB_080aa53c;
- }
- pTVar10 = this->PlayerData;
- tVar4 = time((time_t *)0x0);
- pTVar10->LastLogoutTime = tVar4;
- SaveData(this);
- if ((this->super_TCreature).IsDead == false) {
- Log("game","Spieler %s loggt aus.\n",(this->super_TCreature).Name);
- pcVar16 = (char *)(this->super_TCreature).posz;
- GraphicalEffect();
- SaveInventory(this);
- }
- else {
- pcVar16 = (this->super_TCreature).Name;
- pcVar15 = pcVar16;
- Log("game","Spieler %s ist gestorben.\n",pcVar16);
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- error("TPlayer::~TPlayer: PlayerData ist NULL.\n");
- pTVar10 = this->PlayerData;
- if (pTVar10 != (TPlayerData *)0x0) goto LAB_080aa5d9;
- }
- else {
-LAB_080aa5d9:
- if (pTVar10->Inventory != (uchar *)0x0) {
- operator_delete__(pTVar10->Inventory);
- this->PlayerData->Inventory = (uchar *)0x0;
- }
- }
- if (((this->super_TCreature).Profession == '\0') ||
- (iVar9 = TSkill::Get((this->super_TCreature).super_TSkillBase.Skills[0]), 5 < iVar9)) {
- pTVar8 = (this->super_TCreature).super_TSkillBase.Skills[2];
- if (pTVar8->Max < 1) goto LAB_080aa7f3;
- pTVar10 = this->PlayerData;
- pcVar16 = pcVar15;
- }
- else {
- pTVar8 = (this->super_TCreature).super_TSkillBase.Skills[2];
-LAB_080aa7f3:
- if (pTVar8->Max < 1) {
- Log("game",&DAT_08103aa0,pcVar16);
- }
- Log("game",&DAT_08103a60,pcVar16);
- pTVar10 = this->PlayerData;
- if (pTVar10 != (TPlayerData *)0x0) {
- uVar12 = 2000;
- aVar2 = (pTVar10->OriginalOutfit).field_1;
- (pTVar10->CurrentOutfit).OutfitID = (pTVar10->OriginalOutfit).OutfitID;
- (pTVar10->CurrentOutfit).field_1 = aVar2;
- this->PlayerData->startx = 0;
- this->PlayerData->starty = 0;
- this->PlayerData->startz = 0;
- this->PlayerData->posx = 0;
- this->PlayerData->posy = 0;
- this->PlayerData->posz = 0;
- this->PlayerData->Profession = 0;
- puVar13 = this->PlayerData->SpellList;
- for (iVar9 = 0x40; iVar9 != 0; iVar9 = iVar9 + -1) {
- puVar13[0] = '\0';
- puVar13[1] = '\0';
- puVar13[2] = '\0';
- puVar13[3] = '\0';
- puVar13 = puVar13 + 4;
- }
- pTVar10 = this->PlayerData;
- piVar14 = pTVar10->QuestValues;
- if (((uint)piVar14 & 4) != 0) {
- piVar14 = pTVar10->QuestValues + 1;
- pTVar10->QuestValues[0] = 0;
- uVar12 = 0x7cc;
- }
- iVar9 = 0;
- for (uVar12 = uVar12 >> 2; uVar12 != 0; uVar12 = uVar12 - 1) {
- *piVar14 = 0;
- piVar14 = piVar14 + 1;
- }
- do {
- this->PlayerData->Minimum[iVar9] = -0x80000000;
- iVar9 = iVar9 + 1;
- } while (iVar9 < 0x19);
- pTVar10 = this->PlayerData;
- }
- (this->super_TCreature).LoseInventory = 2;
- }
- if (pTVar10->PlayerkillerEnd != 0) {
- (this->super_TCreature).LoseInventory = 2;
- }
- bVar3 = CheckRight((this->super_TCreature).ID,KEEP_INVENTORY);
- if (bVar3) {
- (this->super_TCreature).LoseInventory = 0;
- }
- }
- local_14 = (this->super_TCreature).Name;
- in_stack_ffffffd8 = (char *)0xe;
- bVar3 = CheckRight((this->super_TCreature).ID,READ_GAMEMASTER_CHANNEL);
- if (bVar3) {
- CloseProcessedRequests((this->super_TCreature).ID);
- }
- if (this->Request != 0) {
- if (this->RequestProcessingGamemaster == 0) {
- DeleteGamemasterRequest(local_14);
- }
- else {
- pTVar5 = GetCreature(this->RequestProcessingGamemaster);
- pTVar11 = (TCreature *)0x0;
- if ((pTVar5 != (TCreature *)0x0) && (pTVar11 = pTVar5, pTVar5->Type != PLAYER)) {
- error("GetPlayer: Kreatur ist kein Spieler.\n");
- pTVar11 = (TCreature *)0x0;
- }
- if (pTVar11 != (TCreature *)0x0) {
- SendFinishRequest(pTVar11->Connection,local_14);
- in_stack_ffffffd8 = local_14;
- }
- }
- this->Request = 0;
- }
- LeaveAllChannels((this->super_TCreature).ID);
- if (this->PartyLeavingRound == 0) {
- uVar7 = this->PartyLeader;
- }
- else {
- uVar7 = 0;
- }
- if (uVar7 != 0) {
- in_stack_ffffffd8 = (char *)0x1;
- ::LeaveParty((this->super_TCreature).ID,true);
- }
- ClearPlayerkillingMarks(this);
- DelInList(this);
- this->PlayerData->Dirty = true;
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- error("DecreasePlayerPoolSlotSticky: Slot ist NULL.\n");
- }
- else {
- Semaphore::down(&PlayerDataPoolMutex);
- piVar14 = &pTVar10->Sticky;
- *piVar14 = *piVar14 + -1;
- Semaphore::up(&PlayerDataPoolMutex);
- }
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist NULL.\n";
- }
- else {
- pcVar16 = (char *)pTVar10->CharacterID;
- in_stack_ffffffd8 = "Gebe Slot von Spieler %ld frei.\n";
- print();
- if (pTVar10->Locked == 0) {
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist nicht gesperrt.\n";
- }
- else {
- _Var6 = getpid();
- if (pTVar10->Locked == _Var6) {
- pTVar10->Locked = 0;
- goto LAB_080aa53c;
- }
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist von einem anderen Thread gesperrt.\n";
- }
- }
- error(pcVar15,in_stack_ffffffd8,pcVar16);
-LAB_080aa53c:
- puVar1 = (this->FormerAttackedPlayers).entry;
- if (puVar1 != (ulong *)0x0) {
- operator_delete__(puVar1);
- }
- puVar1 = (this->AttackedPlayers).entry;
- if (puVar1 != (ulong *)0x0) {
- operator_delete__(puVar1);
- }
- TCreature::~TCreature(&this->super_TCreature,(int)in_stack_ffffffd8);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TPlayer(TPlayer * this, int __in_chrg)
-
-void __thiscall TPlayer::~TPlayer(TPlayer *this,int __in_chrg)
-
-{
- ulong *puVar1;
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar2;
- bool bVar3;
- TCreature *cr;
- time_t tVar4;
- TCreature *pTVar5;
- __pid_t _Var6;
- ulong uVar7;
- TSkill *pTVar8;
- int iVar9;
- TPlayerData *pTVar10;
- int i;
- TCreature *pTVar11;
- uint uVar12;
- uchar *puVar13;
- int *piVar14;
- char *pcVar15;
- char *in_stack_ffffffd8;
- char *pcVar16;
- char *local_14;
-
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TPlayer_08127c68;
- LogoutOrder(this);
- if (this->ConstructError != NOERROR) {
- DelInList(this);
- goto LAB_080aaa0c;
- }
- pTVar10 = this->PlayerData;
- tVar4 = time((time_t *)0x0);
- pTVar10->LastLogoutTime = tVar4;
- SaveData(this);
- if ((this->super_TCreature).IsDead == false) {
- Log("game","Spieler %s loggt aus.\n",(this->super_TCreature).Name);
- pcVar16 = (char *)(this->super_TCreature).posz;
- GraphicalEffect();
- SaveInventory(this);
- }
- else {
- pcVar16 = (this->super_TCreature).Name;
- pcVar15 = pcVar16;
- Log("game","Spieler %s ist gestorben.\n",pcVar16);
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- error("TPlayer::~TPlayer: PlayerData ist NULL.\n");
- pTVar10 = this->PlayerData;
- if (pTVar10 != (TPlayerData *)0x0) goto LAB_080aaaa9;
- }
- else {
-LAB_080aaaa9:
- if (pTVar10->Inventory != (uchar *)0x0) {
- operator_delete__(pTVar10->Inventory);
- this->PlayerData->Inventory = (uchar *)0x0;
- }
- }
- if (((this->super_TCreature).Profession == '\0') ||
- (iVar9 = TSkill::Get((this->super_TCreature).super_TSkillBase.Skills[0]), 5 < iVar9)) {
- pTVar8 = (this->super_TCreature).super_TSkillBase.Skills[2];
- if (pTVar8->Max < 1) goto LAB_080aacc3;
- pTVar10 = this->PlayerData;
- pcVar16 = pcVar15;
- }
- else {
- pTVar8 = (this->super_TCreature).super_TSkillBase.Skills[2];
-LAB_080aacc3:
- if (pTVar8->Max < 1) {
- Log("game",&DAT_08103aa0,pcVar16);
- }
- Log("game",&DAT_08103a60,pcVar16);
- pTVar10 = this->PlayerData;
- if (pTVar10 != (TPlayerData *)0x0) {
- uVar12 = 2000;
- aVar2 = (pTVar10->OriginalOutfit).field_1;
- (pTVar10->CurrentOutfit).OutfitID = (pTVar10->OriginalOutfit).OutfitID;
- (pTVar10->CurrentOutfit).field_1 = aVar2;
- this->PlayerData->startx = 0;
- this->PlayerData->starty = 0;
- this->PlayerData->startz = 0;
- this->PlayerData->posx = 0;
- this->PlayerData->posy = 0;
- this->PlayerData->posz = 0;
- this->PlayerData->Profession = 0;
- puVar13 = this->PlayerData->SpellList;
- for (iVar9 = 0x40; iVar9 != 0; iVar9 = iVar9 + -1) {
- puVar13[0] = '\0';
- puVar13[1] = '\0';
- puVar13[2] = '\0';
- puVar13[3] = '\0';
- puVar13 = puVar13 + 4;
- }
- pTVar10 = this->PlayerData;
- piVar14 = pTVar10->QuestValues;
- if (((uint)piVar14 & 4) != 0) {
- piVar14 = pTVar10->QuestValues + 1;
- pTVar10->QuestValues[0] = 0;
- uVar12 = 0x7cc;
- }
- iVar9 = 0;
- for (uVar12 = uVar12 >> 2; uVar12 != 0; uVar12 = uVar12 - 1) {
- *piVar14 = 0;
- piVar14 = piVar14 + 1;
- }
- do {
- this->PlayerData->Minimum[iVar9] = -0x80000000;
- iVar9 = iVar9 + 1;
- } while (iVar9 < 0x19);
- pTVar10 = this->PlayerData;
- }
- (this->super_TCreature).LoseInventory = 2;
- }
- if (pTVar10->PlayerkillerEnd != 0) {
- (this->super_TCreature).LoseInventory = 2;
- }
- bVar3 = CheckRight((this->super_TCreature).ID,KEEP_INVENTORY);
- if (bVar3) {
- (this->super_TCreature).LoseInventory = 0;
- }
- }
- local_14 = (this->super_TCreature).Name;
- in_stack_ffffffd8 = (char *)0xe;
- bVar3 = CheckRight((this->super_TCreature).ID,READ_GAMEMASTER_CHANNEL);
- if (bVar3) {
- CloseProcessedRequests((this->super_TCreature).ID);
- }
- if (this->Request != 0) {
- if (this->RequestProcessingGamemaster == 0) {
- DeleteGamemasterRequest(local_14);
- }
- else {
- pTVar5 = GetCreature(this->RequestProcessingGamemaster);
- pTVar11 = (TCreature *)0x0;
- if ((pTVar5 != (TCreature *)0x0) && (pTVar11 = pTVar5, pTVar5->Type != PLAYER)) {
- error("GetPlayer: Kreatur ist kein Spieler.\n");
- pTVar11 = (TCreature *)0x0;
- }
- if (pTVar11 != (TCreature *)0x0) {
- SendFinishRequest(pTVar11->Connection,local_14);
- in_stack_ffffffd8 = local_14;
- }
- }
- this->Request = 0;
- }
- LeaveAllChannels((this->super_TCreature).ID);
- if (this->PartyLeavingRound == 0) {
- uVar7 = this->PartyLeader;
- }
- else {
- uVar7 = 0;
- }
- if (uVar7 != 0) {
- in_stack_ffffffd8 = (char *)0x1;
- ::LeaveParty((this->super_TCreature).ID,true);
- }
- ClearPlayerkillingMarks(this);
- DelInList(this);
- this->PlayerData->Dirty = true;
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- error("DecreasePlayerPoolSlotSticky: Slot ist NULL.\n");
- }
- else {
- Semaphore::down(&PlayerDataPoolMutex);
- piVar14 = &pTVar10->Sticky;
- *piVar14 = *piVar14 + -1;
- Semaphore::up(&PlayerDataPoolMutex);
- }
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist NULL.\n";
- }
- else {
- pcVar16 = (char *)pTVar10->CharacterID;
- in_stack_ffffffd8 = "Gebe Slot von Spieler %ld frei.\n";
- print();
- if (pTVar10->Locked == 0) {
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist nicht gesperrt.\n";
- }
- else {
- _Var6 = getpid();
- if (pTVar10->Locked == _Var6) {
- pTVar10->Locked = 0;
- goto LAB_080aaa0c;
- }
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist von einem anderen Thread gesperrt.\n";
- }
- }
- error(pcVar15,in_stack_ffffffd8,pcVar16);
-LAB_080aaa0c:
- puVar1 = (this->FormerAttackedPlayers).entry;
- if (puVar1 != (ulong *)0x0) {
- operator_delete__(puVar1);
- }
- puVar1 = (this->AttackedPlayers).entry;
- if (puVar1 != (ulong *)0x0) {
- operator_delete__(puVar1);
- }
- TCreature::~TCreature(&this->super_TCreature,(int)in_stack_ffffffd8);
- return;
-}
-
-
-
-// DWARF original prototype: void ~TPlayer(TPlayer * this, int __in_chrg)
-
-void __thiscall TPlayer::~TPlayer(TPlayer *this,int __in_chrg)
-
-{
- ulong *puVar1;
- anon_union_4_2_730cd3ca_for_TOutfit_2 aVar2;
- bool bVar3;
- TCreature *cr;
- time_t tVar4;
- TCreature *pTVar5;
- __pid_t _Var6;
- ulong uVar7;
- TSkill *pTVar8;
- int iVar9;
- TPlayerData *pTVar10;
- int i;
- TCreature *pTVar11;
- uint uVar12;
- uchar *puVar13;
- int *piVar14;
- char *pcVar15;
- char *in_stack_ffffffd8;
- char *pcVar16;
- char *local_14;
-
- (this->super_TCreature)._vptr_TCreature = (_func_int_varargs **)&PTR__TPlayer_08127c68;
- LogoutOrder(this);
- if (this->ConstructError != NOERROR) {
- DelInList(this);
- goto LAB_080aaedc;
- }
- pTVar10 = this->PlayerData;
- tVar4 = time((time_t *)0x0);
- pTVar10->LastLogoutTime = tVar4;
- SaveData(this);
- if ((this->super_TCreature).IsDead == false) {
- Log("game","Spieler %s loggt aus.\n",(this->super_TCreature).Name);
- pcVar16 = (char *)(this->super_TCreature).posz;
- GraphicalEffect();
- SaveInventory(this);
- }
- else {
- pcVar16 = (this->super_TCreature).Name;
- pcVar15 = pcVar16;
- Log("game","Spieler %s ist gestorben.\n",pcVar16);
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- error("TPlayer::~TPlayer: PlayerData ist NULL.\n");
- pTVar10 = this->PlayerData;
- if (pTVar10 != (TPlayerData *)0x0) goto LAB_080aaf79;
- }
- else {
-LAB_080aaf79:
- if (pTVar10->Inventory != (uchar *)0x0) {
- operator_delete__(pTVar10->Inventory);
- this->PlayerData->Inventory = (uchar *)0x0;
- }
- }
- if (((this->super_TCreature).Profession == '\0') ||
- (iVar9 = TSkill::Get((this->super_TCreature).super_TSkillBase.Skills[0]), 5 < iVar9)) {
- pTVar8 = (this->super_TCreature).super_TSkillBase.Skills[2];
- if (pTVar8->Max < 1) goto LAB_080ab193;
- pTVar10 = this->PlayerData;
- pcVar16 = pcVar15;
- }
- else {
- pTVar8 = (this->super_TCreature).super_TSkillBase.Skills[2];
-LAB_080ab193:
- if (pTVar8->Max < 1) {
- Log("game",&DAT_08103aa0,pcVar16);
- }
- Log("game",&DAT_08103a60,pcVar16);
- pTVar10 = this->PlayerData;
- if (pTVar10 != (TPlayerData *)0x0) {
- uVar12 = 2000;
- aVar2 = (pTVar10->OriginalOutfit).field_1;
- (pTVar10->CurrentOutfit).OutfitID = (pTVar10->OriginalOutfit).OutfitID;
- (pTVar10->CurrentOutfit).field_1 = aVar2;
- this->PlayerData->startx = 0;
- this->PlayerData->starty = 0;
- this->PlayerData->startz = 0;
- this->PlayerData->posx = 0;
- this->PlayerData->posy = 0;
- this->PlayerData->posz = 0;
- this->PlayerData->Profession = 0;
- puVar13 = this->PlayerData->SpellList;
- for (iVar9 = 0x40; iVar9 != 0; iVar9 = iVar9 + -1) {
- puVar13[0] = '\0';
- puVar13[1] = '\0';
- puVar13[2] = '\0';
- puVar13[3] = '\0';
- puVar13 = puVar13 + 4;
- }
- pTVar10 = this->PlayerData;
- piVar14 = pTVar10->QuestValues;
- if (((uint)piVar14 & 4) != 0) {
- piVar14 = pTVar10->QuestValues + 1;
- pTVar10->QuestValues[0] = 0;
- uVar12 = 0x7cc;
- }
- iVar9 = 0;
- for (uVar12 = uVar12 >> 2; uVar12 != 0; uVar12 = uVar12 - 1) {
- *piVar14 = 0;
- piVar14 = piVar14 + 1;
- }
- do {
- this->PlayerData->Minimum[iVar9] = -0x80000000;
- iVar9 = iVar9 + 1;
- } while (iVar9 < 0x19);
- pTVar10 = this->PlayerData;
- }
- (this->super_TCreature).LoseInventory = 2;
- }
- if (pTVar10->PlayerkillerEnd != 0) {
- (this->super_TCreature).LoseInventory = 2;
- }
- bVar3 = CheckRight((this->super_TCreature).ID,KEEP_INVENTORY);
- if (bVar3) {
- (this->super_TCreature).LoseInventory = 0;
- }
- }
- local_14 = (this->super_TCreature).Name;
- in_stack_ffffffd8 = (char *)0xe;
- bVar3 = CheckRight((this->super_TCreature).ID,READ_GAMEMASTER_CHANNEL);
- if (bVar3) {
- CloseProcessedRequests((this->super_TCreature).ID);
- }
- if (this->Request != 0) {
- if (this->RequestProcessingGamemaster == 0) {
- DeleteGamemasterRequest(local_14);
- }
- else {
- pTVar5 = GetCreature(this->RequestProcessingGamemaster);
- pTVar11 = (TCreature *)0x0;
- if ((pTVar5 != (TCreature *)0x0) && (pTVar11 = pTVar5, pTVar5->Type != PLAYER)) {
- error("GetPlayer: Kreatur ist kein Spieler.\n");
- pTVar11 = (TCreature *)0x0;
- }
- if (pTVar11 != (TCreature *)0x0) {
- SendFinishRequest(pTVar11->Connection,local_14);
- in_stack_ffffffd8 = local_14;
- }
- }
- this->Request = 0;
- }
- LeaveAllChannels((this->super_TCreature).ID);
- if (this->PartyLeavingRound == 0) {
- uVar7 = this->PartyLeader;
- }
- else {
- uVar7 = 0;
- }
- if (uVar7 != 0) {
- in_stack_ffffffd8 = (char *)0x1;
- ::LeaveParty((this->super_TCreature).ID,true);
- }
- ClearPlayerkillingMarks(this);
- DelInList(this);
- this->PlayerData->Dirty = true;
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- error("DecreasePlayerPoolSlotSticky: Slot ist NULL.\n");
- }
- else {
- Semaphore::down(&PlayerDataPoolMutex);
- piVar14 = &pTVar10->Sticky;
- *piVar14 = *piVar14 + -1;
- Semaphore::up(&PlayerDataPoolMutex);
- }
- pTVar10 = this->PlayerData;
- if (pTVar10 == (TPlayerData *)0x0) {
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist NULL.\n";
- }
- else {
- pcVar16 = (char *)pTVar10->CharacterID;
- in_stack_ffffffd8 = "Gebe Slot von Spieler %ld frei.\n";
- print();
- if (pTVar10->Locked == 0) {
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist nicht gesperrt.\n";
- }
- else {
- _Var6 = getpid();
- if (pTVar10->Locked == _Var6) {
- pTVar10->Locked = 0;
- goto LAB_080aaedc;
- }
- pcVar15 = "ReleasePlayerPoolSlot: Slot ist von einem anderen Thread gesperrt.\n";
- }
- }
- error(pcVar15,in_stack_ffffffd8,pcVar16);
-LAB_080aaedc:
- puVar1 = (this->FormerAttackedPlayers).entry;
- if (puVar1 != (ulong *)0x0) {
- operator_delete__(puVar1);
- }
- puVar1 = (this->AttackedPlayers).entry;
- if (puVar1 != (ulong *)0x0) {
- operator_delete__(puVar1);
- }
- TCreature::~TCreature(&this->super_TCreature,(int)in_stack_ffffffd8);
- operator_delete(this);
- return;
-}
-
-
-
-// DWARF original prototype: void SetInList(TPlayer * this)
-
-void __thiscall TPlayer::SetInList(TPlayer *this)
-
-{
- TPlayer **ppTVar1;
-
- TCreature::SetInCrList(&this->super_TCreature);
- Semaphore::down(&PlayerMutex);
- ppTVar1 = vector<TPlayer*>::operator()(&PlayerList,FirstFreePlayer);
- FirstFreePlayer = FirstFreePlayer + 1;
- *ppTVar1 = this;
- Semaphore::up(&PlayerMutex);
- NotifyBuddies((this->super_TCreature).ID,(this->super_TCreature).Name,true);
- IncrementPlayersOnline();
- if ((this->super_TCreature).Profession != '\0') {
- return;
- }
- IncrementNewbiesOnline();
- return;
-}
-
-
-
-// DWARF original prototype: void DelInList(TPlayer * this)
-
-void __thiscall TPlayer::DelInList(TPlayer *this)
-
-{
- TPlayer **ppTVar1;
- TPlayer **ppTVar2;
- int i;
- int i_00;
-
- i_00 = 0;
- NotifyBuddies((this->super_TCreature).ID,(this->super_TCreature).Name,false);
- if (0 < FirstFreePlayer) {
- do {
- ppTVar1 = vector<TPlayer*>::operator()(&PlayerList,i_00);
- if (*ppTVar1 == this) {
- Semaphore::down(&PlayerMutex);
- ppTVar1 = vector<TPlayer*>::operator()(&PlayerList,i_00);
- ppTVar2 = vector<TPlayer*>::operator()(&PlayerList,FirstFreePlayer + -1);
- *ppTVar1 = *ppTVar2;
- ppTVar1 = vector<TPlayer*>::operator()(&PlayerList,FirstFreePlayer + -1);
- *ppTVar1 = (TPlayer *)0x0;
- FirstFreePlayer = FirstFreePlayer + -1;
- Semaphore::up(&PlayerMutex);
- DecrementPlayersOnline();
- if ((this->super_TCreature).Profession != '\0') {
- return;
- }
- DecrementNewbiesOnline();
- return;
- }
- i_00 = i_00 + 1;
- } while (i_00 < FirstFreePlayer);
- }
- return;
-}
-
-
-
// DWARF original prototype: void ClearConnection(TPlayer * this)
void __thiscall TPlayer::ClearConnection(TPlayer *this)