aboutsummaryrefslogtreecommitdiff
path: root/reference/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'reference/game.c')
-rw-r--r--reference/game.c6564
1 files changed, 0 insertions, 6564 deletions
diff --git a/reference/game.c b/reference/game.c
index 7958431..723efb5 100644
--- a/reference/game.c
+++ b/reference/game.c
@@ -26728,6570 +26728,6 @@ void __static_initialization_and_destruction_0(int __initialize_p,int __priority
return;
}
-
-
-bool BeginSendData(TConnection *Connection)
-
-{
- bool bVar1;
-
- bVar1 = false;
- if (Connection != (TConnection *)0x0) {
- bVar1 = false;
- if ((Connection->State - CONNECTION_LOGIN < 4) &&
- (bVar1 = false, Connection->State != CONNECTION_LOGIN)) {
- if (Connection->NextToCommit == Connection->NextToSend + 0x4000) {
- bVar1 = false;
- TConnection::GetSocket(Connection);
- print();
- }
- else {
- Connection->NextToWrite = Connection->NextToCommit;
- bVar1 = true;
- Connection->Overflow = false;
- }
- }
- }
- return bVar1;
-}
-
-
-
-void FinishSendData(TConnection *Connection)
-
-{
- if (Connection == (TConnection *)0x0) {
- Connection = (TConnection *)s_FinishSendData__Verbindung_ist_N_08108b60;
- }
- else {
- if (Connection->State - CONNECTION_LOGIN < 4) {
- if (Connection->Overflow == false) {
- Connection->NextToCommit = Connection->NextToWrite;
- if (Connection->WillingToSend == false) {
- Connection->NextSendingConnection = FirstSendingConnection;
- FirstSendingConnection = Connection;
- Connection->WillingToSend = true;
- }
- }
- else {
- print();
- }
- return;
- }
- Connection = (TConnection *)s_FinishSendData__Verbindung_ist_n_08108b20;
- }
- error((char *)Connection);
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void SendAll(void)
-
-{
- TConnection **ppTVar1;
- pid_t __pid;
- TConnection *Connection;
- TConnection *this;
-
- this = FirstSendingConnection;
- if (FirstSendingConnection != (TConnection *)0x0) {
- do {
- if (this->WillingToSend == false) {
- error("SendAll: Verbindung ist nicht sendewillig.\n");
- }
- else {
- this->WillingToSend = false;
- if ((this->State - CONNECTION_LOGIN < 4) && (this->NextToSend != this->NextToCommit)
- ) {
- __pid = TConnection::GetPID(this);
- kill(__pid,0xc);
- }
- }
- ppTVar1 = &this->NextSendingConnection;
- this = *ppTVar1;
- } while (*ppTVar1 != (TConnection *)0x0);
- }
- FirstSendingConnection = (TConnection *)0x0;
- return;
-}
-
-
-
-void SkipFlush(TConnection *Connection)
-
-{
- int iVar1;
- int iVar2;
-
- if (Skip != -1) {
- do {
- if (Skip < 0x100) {
- iVar1 = Connection->NextToSend;
- iVar2 = Connection->NextToWrite;
- if (iVar2 < iVar1 + 0x4000) {
- Connection->OutData[iVar2 % 0x4000] = (uchar)Skip;
- iVar2 = iVar2 + 1;
- Connection->NextToWrite = iVar2;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar2 < iVar1 + 0x4000) {
- Connection->OutData[iVar2 % 0x4000] = 0xff;
- Connection->NextToWrite = iVar2 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- Skip = -1;
- }
- else {
- iVar2 = Connection->NextToWrite;
- if (iVar2 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar2 % 0x4000] = 0xff;
- Connection->NextToWrite = iVar2 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- iVar2 = Connection->NextToWrite;
- if (iVar2 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar2 % 0x4000] = 0xff;
- Connection->NextToWrite = iVar2 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- Skip = Skip + -0x100;
- }
- } while (-1 < Skip);
- }
- return;
-}
-
-
-
-void SendMapObject(TConnection *Connection,Object *Obj)
-
-{
- undefined2 uVar1;
- ushort uVar2;
- bool bVar3;
- uchar uVar4;
- TPlayer *this;
- KNOWNCREATURESTATE KVar5;
- int iVar6;
- uint uVar7;
- TPlayer *pTVar8;
- ulong uVar9;
- size_t Length;
- char *pcVar10;
- int iVar11;
- uint uVar12;
- int iVar13;
- char *s;
- uint uVar14;
- char *__s;
- char *pcVar15;
- uchar local_74;
- uchar local_4c;
- uchar local_44 [4];
- int HelpBrightness;
- int HelpColor;
- Object local_2c [7];
-
- bVar3 = Object::exists(Obj);
- if (!bVar3) {
- pcVar15 = &DAT_08108be0;
-LAB_080cc3ff:
- error(pcVar15);
- return;
- }
- Object::getObjectType(local_2c);
- if (local_2c[0].ObjectID != 99) {
- local_2c[0] = (Object)Obj->ObjectID;
- Object::getObjectType((Object *)&HelpColor);
- bVar3 = ObjectType::getFlag((ObjectType *)&HelpColor,DISGUISE);
- if (bVar3) {
- Object::getObjectType((Object *)&HelpColor);
- uVar9 = ObjectType::getAttribute((ObjectType *)&HelpColor,DISGUISETARGET);
- HelpColor._0_2_ = (undefined2)uVar9;
- }
- else {
- Object::getObjectType((Object *)&HelpColor);
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)(undefined2)HelpColor;
- uVar12 = iVar6 + 1;
- uVar7 = iVar6 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)((ushort)(undefined2)HelpColor >> 8);
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- Object::getObjectType((Object *)&HelpColor);
- bVar3 = ObjectType::getFlag((ObjectType *)&HelpColor,LIQUIDCONTAINER);
- if (bVar3) {
- uVar9 = Object::getAttribute(Obj,CONTAINERLIQUIDTYPE);
- uVar4 = GetLiquidColor(uVar9);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar4;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType((Object *)&HelpColor);
- bVar3 = ObjectType::getFlag((ObjectType *)&HelpColor,LIQUIDPOOL);
- if (bVar3) {
- uVar9 = Object::getAttribute(Obj,POOLLIQUIDTYPE);
- uVar4 = GetLiquidColor(uVar9);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar4;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType((Object *)&HelpColor);
- bVar3 = ObjectType::getFlag((ObjectType *)&HelpColor,CUMULATIVE);
- if (!bVar3) {
- return;
- }
- uVar9 = Object::getAttribute(Obj,AMOUNT);
- iVar6 = Connection->NextToWrite;
- if (Connection->NextToSend + 0x4000 <= iVar6) {
- Connection->Overflow = true;
- return;
- }
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar9;
-LAB_080cce56:
- Connection->NextToWrite = iVar6 + 1;
- return;
- }
- local_2c[0] = (Object)Obj->ObjectID;
- this = (TPlayer *)GetCreature(local_2c);
- if (this == (TPlayer *)0x0) {
- pcVar15 = "SendMapObject: Kreatur hat kein Kreatur-Objekt\n";
- goto LAB_080cc3ff;
- }
- KVar5 = TConnection::KnownCreature(Connection,(this->super_TCreature).ID,true);
- if (KVar5 == KNOWNCREATURE_UPTODATE) {
- iVar11 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar11 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = 'c';
- iVar6 = iVar6 + 1;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar6 < iVar11 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = '\0';
- iVar6 = iVar6 + 1;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- uVar9 = (this->super_TCreature).ID;
- if (iVar6 < iVar11 + 0x3ffd) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar9;
- uVar12 = iVar6 + 1;
- uVar7 = iVar6 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)(uVar9 >> 8);
- uVar12 = iVar6 + 2;
- uVar7 = iVar6 + 0x4001;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)(uVar9 >> 0x10);
- uVar12 = iVar6 + 3;
- uVar7 = iVar6 + 0x4002;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)(uVar9 >> 0x18);
- iVar6 = iVar6 + 4;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar11 + 0x4000 <= iVar6) {
- Connection->Overflow = true;
- return;
- }
- Connection->OutData[iVar6 % 0x4000] = (uchar)(this->super_TCreature).Direction;
- goto LAB_080cce56;
- }
- if (1 < (int)KVar5) {
- if (KVar5 != KNOWNCREATURE_OUTDATED) {
- return;
- }
- iVar11 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar11 + 0x4000) {
- iVar13 = iVar6 % 0x4000;
- iVar6 = iVar6 + 1;
- Connection->OutData[iVar13] = 'b';
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar6 < iVar11 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = '\0';
- iVar6 = iVar6 + 1;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- uVar9 = (this->super_TCreature).ID;
- if (iVar6 < iVar11 + 0x3ffd) {
- uVar12 = iVar6 + 1;
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar9;
- uVar7 = iVar6 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)(uVar9 >> 8);
- uVar12 = iVar6 + 2;
- uVar7 = iVar6 + 0x4001;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)(uVar9 >> 0x10);
- uVar12 = iVar6 + 3;
- uVar7 = iVar6 + 0x4002;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)(uVar9 >> 0x18);
- Connection->NextToWrite = iVar6 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- iVar6 = TCreature::GetHealth((TCreature *)this);
- uVar4 = (uchar)iVar6;
- iVar6 = Connection->NextToSend;
- goto LAB_080cc4e9;
- }
- if (KVar5 != KNOWNCREATURE_FREE) {
- return;
- }
- iVar11 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar11 + 0x4000) {
- iVar13 = iVar6 % 0x4000;
- iVar6 = iVar6 + 1;
- Connection->OutData[iVar13] = 'a';
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar6 < iVar11 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = '\0';
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- uVar9 = TConnection::NewKnownCreature(Connection,(this->super_TCreature).ID);
- iVar11 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar11 + 0x3ffd) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar9;
- uVar12 = iVar6 + 1;
- uVar7 = iVar6 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) = (char)(uVar9 >> 8);
- uVar12 = iVar6 + 2;
- uVar7 = iVar6 + 0x4001;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) = (char)(uVar9 >> 0x10)
- ;
- uVar12 = iVar6 + 3;
- uVar7 = iVar6 + 0x4002;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- iVar6 = iVar6 + 4;
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) = (char)(uVar9 >> 0x18)
- ;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- uVar9 = (this->super_TCreature).ID;
- if (iVar6 < iVar11 + 0x3ffd) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar9;
- uVar12 = iVar6 + 1;
- uVar7 = iVar6 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) = (char)(uVar9 >> 8);
- uVar12 = iVar6 + 2;
- uVar7 = iVar6 + 0x4001;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) = (char)(uVar9 >> 0x10)
- ;
- uVar12 = iVar6 + 3;
- uVar7 = iVar6 + 0x4002;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) = (char)(uVar9 >> 0x18)
- ;
- Connection->NextToWrite = iVar6 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- if ((this->super_TCreature).Type == MONSTER) {
- pcVar15 = (this->super_TCreature).Name;
- pcVar10 = strchr(pcVar15,0x20);
- __s = pcVar10 + 1;
- if (pcVar10 == (char *)0x0) {
- __s = pcVar15;
- }
- if (__s == (char *)0x0) goto LAB_080ccb5e;
- Length = strlen(__s);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3fff) {
- local_4c = (uchar)(Length & 0xffff);
- Connection->OutData[iVar6 % 0x4000] = local_4c;
- uVar12 = iVar6 + 1;
- uVar7 = iVar6 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- local_4c = (uchar)((Length & 0xffff) >> 8);
- *(uchar *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) = local_4c;
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
-joined_r0x080ccbc6:
- if (0 < (int)Length) {
- SendText(Connection,__s,Length);
- }
- }
- else {
- __s = (this->super_TCreature).Name;
- if (__s != (char *)0x0) {
- Length = strlen(__s);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar11 + 0x3fff) {
- local_74 = (uchar)(Length & 0xffff);
- Connection->OutData[iVar6 % 0x4000] = local_74;
- uVar12 = iVar6 + 1;
- uVar7 = iVar6 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- local_74 = (uchar)((Length & 0xffff) >> 8);
- *(uchar *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) = local_74;
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- goto joined_r0x080ccbc6;
- }
-LAB_080ccb5e:
- error("SendString: String ist NULL.\n");
- }
- iVar6 = TCreature::GetHealth((TCreature *)this);
- uVar4 = (uchar)iVar6;
- iVar6 = Connection->NextToSend;
-LAB_080cc4e9:
- iVar11 = Connection->NextToWrite;
- if (iVar11 < iVar6 + 0x4000) {
- Connection->OutData[iVar11 % 0x4000] = uVar4;
- iVar11 = iVar11 + 1;
- Connection->NextToWrite = iVar11;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar11 < iVar6 + 0x4000) {
- Connection->OutData[iVar11 % 0x4000] = (uchar)(this->super_TCreature).Direction;
- iVar11 = iVar11 + 1;
- Connection->NextToWrite = iVar11;
- }
- else {
- Connection->Overflow = true;
- }
- uVar1 = (undefined2)(this->super_TCreature).Outfit.OutfitID;
- if (iVar11 < iVar6 + 0x3fff) {
- Connection->OutData[iVar11 % 0x4000] = (uchar)uVar1;
- uVar12 = iVar11 + 1;
- uVar7 = iVar11 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar1 >> 8);
- Connection->NextToWrite = iVar11 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if ((this->super_TCreature).Outfit.OutfitID == 0) {
- uVar2 = (this->super_TCreature).Outfit.field_1.ObjectType;
- iVar11 = Connection->NextToWrite;
- if (iVar11 < iVar6 + 0x3fff) {
- uVar12 = iVar11 + 1;
- Connection->OutData[iVar11 % 0x4000] = (uchar)uVar2;
- uVar7 = iVar11 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- *(char *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806) =
- (char)(uVar2 >> 8);
- Connection->NextToWrite = iVar11 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- }
- else {
- SendText(Connection,(char *)(this->super_TCreature).Outfit.field_1.Colors,4);
- }
- GetCreatureLight((this->super_TCreature).ID,(int *)local_44,&HelpBrightness);
- iVar11 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar11 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = local_44[0];
- iVar6 = iVar6 + 1;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar6 < iVar11 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)HelpBrightness;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- uVar7 = TCreature::GetSpeed((TCreature *)this);
- iVar6 = Connection->NextToWrite;
- iVar11 = Connection->NextToSend;
- if (iVar6 < iVar11 + 0x3fff) {
- local_74 = (uchar)(uVar7 & 0xffff);
- Connection->OutData[iVar6 % 0x4000] = local_74;
- uVar14 = iVar6 + 1;
- uVar12 = iVar6 + 0x4000;
- if (-1 < (int)uVar14) {
- uVar12 = uVar14;
- }
- local_74 = (uchar)((uVar7 & 0xffff) >> 8);
- *(uchar *)((int)Connection + (uVar14 - (uVar12 & 0xffffc000)) + 0x806) = local_74;
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if ((this->super_TCreature).Type == PLAYER) {
- pTVar8 = TConnection::GetPlayer(Connection);
- iVar6 = TPlayer::GetPlayerkillingMark(this,pTVar8);
- uVar4 = (uchar)iVar6;
- iVar11 = Connection->NextToSend;
- }
- else {
- uVar4 = '\0';
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar11 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar4;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- if ((this->super_TCreature).Type == PLAYER) {
- pTVar8 = TConnection::GetPlayer(Connection);
- iVar6 = TPlayer::GetPartyMark(this,pTVar8);
- uVar4 = (uchar)iVar6;
- iVar11 = Connection->NextToSend;
- }
- else {
- uVar4 = '\0';
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar11 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar4;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void SendMapPoint(void)
-
-{
- int Count;
- int iVar1;
- TConnection *in_stack_00000004;
- Object local_4c [4];
- Object local_3c [4];
- ulong local_2c;
- Object Obj;
-
- GetFirstObject();
- local_3c[0].ObjectID = NONE.ObjectID;
- if (local_2c != NONE.ObjectID) {
- iVar1 = 0;
- SkipFlush(in_stack_00000004);
- if (local_2c != NONE.ObjectID) {
- do {
- iVar1 = iVar1 + 1;
- local_4c[0].ObjectID = local_2c;
- local_3c[0].ObjectID = NONE.ObjectID;
- SendMapObject(in_stack_00000004,local_4c);
- Object::getNextObject(local_3c);
- local_2c = local_3c[0].ObjectID;
- if (iVar1 == 10) break;
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- }
- Skip = Skip + 1;
- return;
-}
-
-
-
-void SendResult(TConnection *Connection,RESULT r)
-
-{
- int iVar1;
- bool bVar2;
- TPlayer *pTVar3;
- char *pcVar4;
-
- if (Connection == (TConnection *)0x0) {
- return;
- }
- switch(r) {
- case NOERROR:
- Connection = (TConnection *)s_SendResult__NOERROR_08109aa1;
- goto LAB_080cd2ea;
- case NOTACCESSIBLE:
- pcVar4 = "Sorry, not possible.";
- break;
- case NOTMOVABLE:
- pcVar4 = "You cannot move this object.";
- break;
- case NOTTAKABLE:
- pcVar4 = "You cannot take this object.";
- break;
- case NOROOM:
- pcVar4 = "There is not enough room.";
- break;
- case OUTOFRANGE:
- pcVar4 = "Destination is out of range.";
- break;
- case OUTOFHOME:
- Connection = (TConnection *)s_SendResult__OUTOFHOME_08109b3c;
- goto LAB_080cd2ea;
- case CANNOTTHROW:
- pcVar4 = "You cannot throw there.";
- break;
- case TOOHEAVY:
- pcVar4 = "This object is too heavy.";
- break;
- case CROSSREFERENCE:
- pcVar4 = "This is impossible.";
- break;
- case CONTAINERFULL:
- pcVar4 = "You cannot put more objects in this container.";
- break;
- case WRONGPOSITION:
- pcVar4 = "Put this object in your hand.";
- break;
- case WRONGPOSITION2:
- pcVar4 = "Put this object in both hands.";
- break;
- case WRONGCLOTHES:
- pcVar4 = "You cannot dress this object there.";
- break;
- case HANDSNOTFREE:
- pcVar4 = "Both hands have to be free.";
- break;
- case HANDBLOCKED:
- pcVar4 = "Drop the double-handed object first.";
- break;
- case ONEWEAPONONLY:
- pcVar4 = "You may only use one weapon.";
- break;
- case NOMATCH:
- Connection = (TConnection *)s_SendResult__NOMATCH_08109bf0;
- goto LAB_080cd2ea;
- case NOTCUMULABLE:
- Connection = (TConnection *)s_SendResult__NOTCUMULABLE_08109c05;
- goto LAB_080cd2ea;
- case TOOMANYPARTS:
- Connection = (TConnection *)s_SendResult__TOOMANYPARTS_08109c1f;
- goto LAB_080cd2ea;
- case EMPTYCONTAINER:
- Connection = (TConnection *)s_SendResult__EMPTYCONTAINER_08109c39;
- goto LAB_080cd2ea;
- case SPLITOBJECT:
- Connection = (TConnection *)s_SendResult__SPLITOBJECT_08109c55;
- goto LAB_080cd2ea;
- case NOKEYMATCH:
- pcVar4 = "The key does not match.";
- break;
- case UPSTAIRS:
- pcVar4 = "First go upstairs.";
- break;
- case DOWNSTAIRS:
- pcVar4 = "First go downstairs.";
- break;
- case CREATURENOTEXISTING:
- pcVar4 = "A creature with this name does not exist.";
- break;
- case PLAYERNOTEXISTING:
- pcVar4 = "A player with this name does not exist.";
- break;
- case PLAYERNOTONLINE:
- pcVar4 = "A player with this name is not online.";
- break;
- case NAMEAMBIGUOUS:
- pcVar4 = "Playername is ambiguous.";
- break;
- case NOTUSABLE:
- pcVar4 = "You cannot use this object.";
- break;
- case FEDUP:
- pcVar4 = "You are full.";
- break;
- case SPELLUNKNOWN:
- pcVar4 = "You must learn this spell first.";
- break;
- case LOWMAGICLEVEL:
- pcVar4 = "Your magic level is too low.";
- break;
- case MAGICITEM:
- pcVar4 = "A magic item is necessary to cast this spell.";
- break;
- case NOTENOUGHMANA:
- pcVar4 = "You do not have enough mana.";
- break;
- case NOSKILL:
- Connection = (TConnection *)s_SendResult__NOSKILL_08109d2b;
- goto LAB_080cd2ea;
- case TARGETLOST:
- pcVar4 = "Target lost.";
- break;
- case NOCREATURE:
- pcVar4 = "You can only use this rune on creatures.";
- break;
- case TOOLONG:
- Connection = (TConnection *)s_SendResult__TOOLONG_08109d4d;
-LAB_080cd2ea:
- error((char *)Connection);
- return;
- case ATTACKNOTALLOWED:
- pcVar4 = "You may not attack this person.";
- break;
- case NOWAY:
- pcVar4 = "There is no way.";
- break;
- case LOGINERROR:
- pcVar4 = "An error occured while logging in.";
- break;
- case PROTECTIONZONE:
- pcVar4 = "This action is not permitted in a protection zone.";
- break;
- case ENTERPROTECTIONZONE:
- pcVar4 = "Characters who attacked other players may not enter a protection zone.";
- goto LAB_080cd511;
- case EXHAUSTED:
- pcVar4 = "You are exhausted.";
- break;
- case NOTINVITED:
- pcVar4 = "You are not invited.";
- goto LAB_080cd511;
- case NOPREMIUMACCOUNT:
- pcVar4 = "You need a premium account.";
- break;
- case MOVENOTPOSSIBLE:
- pcVar4 = "Sorry, not possible.";
-LAB_080cd511:
- SendMessage(Connection,0x17,pcVar4);
- bVar2 = BeginSendData(Connection);
- if (!bVar2) {
- return;
- }
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = 0xb5;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar3 = TConnection::GetPlayer(Connection);
- if (pTVar3 == (TPlayer *)0x0) {
- return;
- }
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = (uchar)(pTVar3->super_TCreature).Direction;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- case ALREADYTRADING:
- pcVar4 = "You are already trading. Finish this trade first.";
- break;
- case PARTNERTRADING:
- pcVar4 = "This person is already trading.";
- break;
- case TOOMANYOBJECTS:
- pcVar4 = "You can only trade up to 100 objects at one time.";
- break;
- case TOOMANYSLAVES:
- pcVar4 = "You cannot control more creatures.";
- break;
- case NOTTURNABLE:
- pcVar4 = "You cannot turn this object.";
- break;
- case SECUREMODE:
- pcVar4 = "Turn secure mode off if you really want to attack unmarked players.";
- break;
- case NOTENOUGHSOULPOINTS:
- pcVar4 = "You do not have enough soulpoints.";
- break;
- case LOWLEVEL:
- pcVar4 = "Your level is too low.";
- break;
- default:
- goto switchD_080cd2dc_caseD_ffffffff;
- }
- SendMessage(Connection,0x17,pcVar4);
-switchD_080cd2dc_caseD_ffffffff:
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Color
-
-void SendRefresh(TConnection *Connection)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
- uchar local_18 [4];
- int Brightness;
- int Color;
-
- SendFullScreen(Connection);
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0x82;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- GetAmbiente((int *)local_18,&Brightness);
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = local_18[0];
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)Brightness;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- }
- SendPlayerData(Connection);
- SendPlayerSkills(Connection);
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: id_local
-
-void __regparm2 SendInitGame(TConnection *Connection,ulong id)
-
-{
- int iVar1;
- undefined2 uVar2;
- bool bVar3;
- int iVar4;
- uint uVar5;
- uint uVar6;
- TConnection *in_stack_00000004;
- ulong in_stack_00000008;
- uchar local_14;
- ulong id_local;
-
- bVar3 = BeginSendData(in_stack_00000004);
- if (bVar3) {
- iVar1 = in_stack_00000004->NextToSend;
- iVar4 = in_stack_00000004->NextToWrite;
- if (iVar4 < iVar1 + 0x4000) {
- in_stack_00000004->OutData[iVar4 % 0x4000] = '\n';
- iVar4 = iVar4 + 1;
- in_stack_00000004->NextToWrite = iVar4;
- }
- else {
- in_stack_00000004->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x3ffd) {
- uVar6 = iVar4 + 1;
- local_14 = (uchar)in_stack_00000008;
- in_stack_00000004->OutData[iVar4 % 0x4000] = local_14;
- uVar5 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar5 = uVar6;
- }
- *(char *)((int)in_stack_00000004 + (uVar6 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)(in_stack_00000008 >> 8);
- uVar6 = iVar4 + 2;
- uVar5 = iVar4 + 0x4001;
- if (-1 < (int)uVar6) {
- uVar5 = uVar6;
- }
- *(char *)((int)in_stack_00000004 + (uVar6 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)(in_stack_00000008 >> 0x10);
- uVar6 = iVar4 + 3;
- uVar5 = iVar4 + 0x4002;
- if (-1 < (int)uVar6) {
- uVar5 = uVar6;
- }
- *(char *)((int)in_stack_00000004 + (uVar6 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)(in_stack_00000008 >> 0x18);
- iVar4 = iVar4 + 4;
- in_stack_00000004->NextToWrite = iVar4;
- }
- else {
- in_stack_00000004->Overflow = true;
- }
- uVar2 = (undefined2)Beat;
- if (iVar4 < iVar1 + 0x3fff) {
- uVar6 = iVar4 + 1;
- in_stack_00000004->OutData[iVar4 % 0x4000] = (uchar)(undefined2)Beat;
- uVar5 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar5 = uVar6;
- }
- *(char *)((int)in_stack_00000004 + (uVar6 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar2 >> 8);
- in_stack_00000004->NextToWrite = iVar4 + 2;
- }
- else {
- in_stack_00000004->Overflow = true;
- }
- bVar3 = CheckRight(in_stack_00000008,SEND_BUGREPORTS);
- iVar4 = in_stack_00000004->NextToWrite;
- if (iVar4 < in_stack_00000004->NextToSend + 0x4000) {
- in_stack_00000004->OutData[iVar4 % 0x4000] = bVar3;
- in_stack_00000004->NextToWrite = iVar4 + 1;
- }
- else {
- in_stack_00000004->Overflow = true;
- }
- FinishSendData(in_stack_00000004);
- return;
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Connection_local
-
-void __regparm2 SendRights(TConnection *Connection)
-
-{
- bool bVar1;
- bool bVar2;
- TPlayer *pTVar3;
- int Action;
- int iVar4;
- int Reason;
- int Actions;
- uint uVar5;
- TConnection *in_stack_00000004;
- RIGHT local_20;
- int Right;
- bool SendIt;
- TPlayer *pl;
- TConnection *Connection_local;
-
- bVar1 = BeginSendData(in_stack_00000004);
- if (bVar1) {
- iVar4 = in_stack_00000004->NextToWrite;
- if (iVar4 < in_stack_00000004->NextToSend + 0x4000) {
- in_stack_00000004->OutData[iVar4 % 0x4000] = '\v';
- in_stack_00000004->NextToWrite = iVar4 + 1;
- }
- else {
- in_stack_00000004->Overflow = true;
- }
- pTVar3 = TConnection::GetPlayer(in_stack_00000004);
- bVar1 = false;
- local_20 = NAME_INSULTING;
- do {
- bVar2 = CheckRight((pTVar3->super_TCreature).ID,local_20);
- uVar5 = 0;
- if (bVar2) {
- iVar4 = 0;
- uVar5 = 0;
- do {
- bVar2 = CheckBanishmentRight
- ((pTVar3->super_TCreature).ID,local_20 - NAME_INSULTING,iVar4)
- ;
- if (bVar2) {
- uVar5 = uVar5 | 1 << ((byte)iVar4 & 0x1f);
- }
- iVar4 = iVar4 + 1;
- } while (iVar4 < 7);
- if (uVar5 != 0) {
- bVar2 = CheckRight((pTVar3->super_TCreature).ID,IP_BANISHMENT);
- if (bVar2) {
- uVar5 = uVar5 | 0x80;
- }
- }
- }
- iVar4 = in_stack_00000004->NextToWrite;
- if (iVar4 < in_stack_00000004->NextToSend + 0x4000) {
- in_stack_00000004->OutData[iVar4 % 0x4000] = (uchar)uVar5;
- in_stack_00000004->NextToWrite = iVar4 + 1;
- }
- else {
- in_stack_00000004->Overflow = true;
- }
- if (uVar5 != 0) {
- bVar1 = true;
- }
- local_20 = local_20 + NOTATION;
- } while ((int)local_20 < 0x32);
- if (bVar1) {
- FinishSendData(in_stack_00000004);
- return;
- }
- }
- return;
-}
-
-
-
-void SendPing(TConnection *Connection)
-
-{
- int iVar1;
- bool bVar2;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = '\x1e';
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: posz
-
-void SendFullScreen(TConnection *Connection)
-
-{
- bool bVar1;
- int iVar2;
- uint uVar3;
- uint uVar4;
- int y;
- int iVar5;
- int iVar6;
- int z_1;
- int z;
- int iVar7;
- int local_30;
- int local_2c;
- int x_1;
- int x;
- int sy;
- int sx;
- int posx;
- int posy;
- int posz;
-
- bVar1 = BeginSendData(Connection);
- if (bVar1) {
- iVar7 = Connection->NextToWrite;
- if (iVar7 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar7 % 0x4000] = 'd';
- Connection->NextToWrite = iVar7 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- TConnection::GetPosition(Connection,&sx,&posx,&posy);
- iVar2 = Connection->NextToSend;
- iVar7 = Connection->NextToWrite;
- if (iVar7 < iVar2 + 0x3fff) {
- Connection->OutData[iVar7 % 0x4000] = (uchar)(undefined2)sx;
- uVar4 = iVar7 + 1;
- uVar3 = iVar7 + 0x4000;
- if (-1 < (int)uVar4) {
- uVar3 = uVar4;
- }
- *(char *)((int)Connection + (uVar4 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((ushort)(undefined2)sx >> 8);
- iVar7 = iVar7 + 2;
- Connection->NextToWrite = iVar7;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar7 < iVar2 + 0x3fff) {
- uVar4 = iVar7 + 1;
- Connection->OutData[iVar7 % 0x4000] = (uchar)(undefined2)posx;
- uVar3 = iVar7 + 0x4000;
- if (-1 < (int)uVar4) {
- uVar3 = uVar4;
- }
- *(char *)((int)Connection + (uVar4 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((ushort)(undefined2)posx >> 8);
- iVar7 = iVar7 + 2;
- Connection->NextToWrite = iVar7;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar7 < iVar2 + 0x4000) {
- Connection->OutData[iVar7 % 0x4000] = (uchar)posy;
- Connection->NextToWrite = iVar7 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- Skip = -1;
- if (posy < 8) {
- iVar7 = 7;
- local_30 = Connection->TerminalWidth;
- do {
- x_1 = 0;
- if (0 < local_30) {
- iVar2 = Connection->TerminalHeight;
- do {
- iVar5 = 0;
- if (0 < iVar2) {
- do {
- iVar5 = iVar5 + 1;
- SendMapPoint();
- iVar2 = Connection->TerminalHeight;
- } while (iVar5 < iVar2);
- local_30 = Connection->TerminalWidth;
- }
- x_1 = x_1 + 1;
- } while (x_1 < local_30);
- }
- iVar7 = iVar7 + -1;
- } while (-1 < iVar7);
- }
- else {
- iVar7 = posy + -2;
- if ((iVar7 <= posy + 2) && (iVar7 < 0x10)) {
- local_30 = Connection->TerminalWidth;
- iVar2 = posy;
- do {
- local_2c = 0;
- if (0 < local_30) {
- iVar5 = Connection->TerminalHeight;
- do {
- iVar6 = 0;
- if (0 < iVar5) {
- do {
- iVar6 = iVar6 + 1;
- SendMapPoint();
- iVar5 = Connection->TerminalHeight;
- } while (iVar6 < iVar5);
- local_30 = Connection->TerminalWidth;
- iVar2 = posy;
- }
- local_2c = local_2c + 1;
- } while (local_2c < local_30);
- }
- iVar7 = iVar7 + 1;
- } while ((iVar7 <= iVar2 + 2) && (iVar7 < 0x10));
- }
- }
- SkipFlush(Connection);
- FinishSendData(Connection);
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: posz
-
-void SendRow(TConnection *Connection,int Direction)
-
-{
- bool bVar1;
- int iVar2;
- int iVar3;
- int z;
- int iVar4;
- int local_2c;
- int end;
- int dz;
- int sy;
- int sx;
- int posx;
- int posy;
- int posz;
-
- bVar1 = BeginSendData(Connection);
- if (!bVar1) {
- return;
- }
- if (Direction == 1) {
- iVar4 = Connection->NextToWrite;
- if (Connection->NextToSend + 0x4000 <= iVar4) goto LAB_080cdfdc;
- Connection->OutData[iVar4 % 0x4000] = 'f';
- }
- else if (Direction < 2) {
- if (Direction != 0) {
-LAB_080cdfab:
- error(&DAT_08109140,Direction);
- return;
- }
- iVar4 = Connection->NextToWrite;
- if (Connection->NextToSend + 0x4000 <= iVar4) goto LAB_080cdfdc;
- Connection->OutData[iVar4 % 0x4000] = 'e';
- }
- else if (Direction == 2) {
- iVar4 = Connection->NextToWrite;
- if (Connection->NextToSend + 0x4000 <= iVar4) {
-LAB_080cdfdc:
- Connection->Overflow = true;
- goto LAB_080cdfe3;
- }
- Connection->OutData[iVar4 % 0x4000] = 'g';
- }
- else {
- if (Direction != 3) goto LAB_080cdfab;
- iVar4 = Connection->NextToWrite;
- if (Connection->NextToSend + 0x4000 <= iVar4) goto LAB_080cdfdc;
- Connection->OutData[iVar4 % 0x4000] = 'h';
- }
- Connection->NextToWrite = iVar4 + 1;
-LAB_080cdfe3:
- TConnection::GetPosition(Connection,&sx,&posx,&posy);
- Skip = -1;
- if (posy < 8) {
- end = -1;
- iVar4 = 7;
- local_2c = -1;
- }
- else {
- end = 1;
- iVar4 = posy + -2;
- local_2c = 0x10;
- if (posy + 3 < 0x11) {
- local_2c = posy + 3;
- }
- }
- if (Direction == 1) {
- if (iVar4 != local_2c) {
- iVar2 = Connection->TerminalHeight;
- do {
- iVar3 = 0;
- if (0 < iVar2) {
- do {
- iVar3 = iVar3 + 1;
- SendMapPoint();
- iVar2 = Connection->TerminalHeight;
- } while (iVar3 < iVar2);
- }
- iVar4 = iVar4 + end;
- } while (iVar4 != local_2c);
- }
- }
- else if (Direction < 2) {
- if ((Direction == 0) && (iVar4 != local_2c)) {
- iVar2 = Connection->TerminalWidth;
- do {
- iVar3 = 0;
- if (0 < iVar2) {
- do {
- iVar3 = iVar3 + 1;
- SendMapPoint();
- iVar2 = Connection->TerminalWidth;
- } while (iVar3 < iVar2);
- }
- iVar4 = iVar4 + end;
- } while (iVar4 != local_2c);
- }
- }
- else if (Direction == 2) {
- if (iVar4 != local_2c) {
- iVar2 = Connection->TerminalWidth;
- do {
- iVar3 = 0;
- if (0 < iVar2) {
- do {
- iVar3 = iVar3 + 1;
- SendMapPoint();
- iVar2 = Connection->TerminalWidth;
- } while (iVar3 < iVar2);
- }
- iVar4 = iVar4 + end;
- } while (iVar4 != local_2c);
- }
- }
- else if ((Direction == 3) && (iVar4 != local_2c)) {
- iVar2 = Connection->TerminalHeight;
- do {
- iVar3 = 0;
- if (0 < iVar2) {
- do {
- iVar3 = iVar3 + 1;
- SendMapPoint();
- iVar2 = Connection->TerminalHeight;
- } while (iVar3 < iVar2);
- }
- iVar4 = iVar4 + end;
- } while (iVar4 != local_2c);
- }
- SkipFlush(Connection);
- FinishSendData(Connection);
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: posz
-
-void SendFloors(TConnection *Connection,bool Up)
-
-{
- bool bVar1;
- int iVar2;
- int iVar3;
- int iVar4;
- int z;
- int iVar5;
- int local_30;
- int x;
- int sy;
- int sx;
- int dz;
- int end;
- int posx;
- int posy;
- int posz;
-
- bVar1 = BeginSendData(Connection);
- if (!bVar1) {
- return;
- }
- iVar5 = Connection->NextToWrite;
- if (iVar5 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar5 % 0x4000] = !Up + 0xbe;
- Connection->NextToWrite = iVar5 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- TConnection::GetPosition(Connection,&end,&posx,&posy);
- if (Up) {
- if (7 < posy) {
- sx = -1;
- iVar5 = posy + -2;
- dz = posy + -3;
- goto LAB_080ce3a4;
- }
- if (posy != 7) goto LAB_080ce47c;
- sx = -1;
- iVar5 = 5;
- }
- else {
- if (8 < posy) {
- sx = 1;
- iVar5 = posy + 2;
- dz = posy + 3;
- if (0x10 < iVar5) {
- iVar5 = 0x10;
- }
- if (0x10 < dz) {
- dz = 0x10;
- }
- goto LAB_080ce3a4;
- }
- if (posy == 8) {
- sx = 1;
- iVar5 = 8;
- dz = 0xb;
- goto LAB_080ce3a4;
- }
-LAB_080ce47c:
- sx = 0;
- iVar5 = -1;
- }
- dz = -1;
-LAB_080ce3a4:
- Skip = -1;
- if (iVar5 != dz) {
- iVar3 = Connection->TerminalWidth;
- do {
- local_30 = 0;
- if (0 < iVar3) {
- iVar2 = Connection->TerminalHeight;
- do {
- iVar4 = 0;
- if (0 < iVar2) {
- do {
- iVar4 = iVar4 + 1;
- SendMapPoint();
- iVar2 = Connection->TerminalHeight;
- } while (iVar4 < iVar2);
- iVar3 = Connection->TerminalWidth;
- }
- local_30 = local_30 + 1;
- } while (local_30 < iVar3);
- }
- iVar5 = iVar5 + sx;
- } while (iVar5 != dz);
- }
- SkipFlush(Connection);
- FinishSendData(Connection);
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: x_local
-
-void __regparm2 SendFieldData(TConnection *Connection,int x,int y,int z)
-
-{
- int iVar1;
- bool bVar2;
- uint uVar3;
- int iVar4;
- uint uVar5;
- int iVar6;
- undefined4 in_stack_0000000c;
- undefined1 in_stack_00000010;
- int z_local;
- int y_local;
- int x_local;
-
- bVar2 = BeginSendData((TConnection *)y);
- if (bVar2) {
- iVar1 = *(int *)(y + 0x4808);
- iVar4 = *(int *)(y + 0x4810);
- if (iVar4 < iVar1 + 0x4000) {
- iVar6 = iVar4 % 0x4000;
- iVar4 = iVar4 + 1;
- *(undefined1 *)(y + 0x806 + iVar6) = 0x69;
- *(int *)(y + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- *(char *)(y + 0x806 + iVar4 % 0x4000) = (char)z;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- iVar4 = iVar4 + 2;
- *(char *)(y + 0x806 + (uVar5 - (uVar3 & 0xffffc000))) = (char)((uint)z >> 8);
- *(int *)(y + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- *(char *)(y + 0x806 + iVar4 % 0x4000) = (char)in_stack_0000000c;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- iVar4 = iVar4 + 2;
- *(char *)(y + 0x806 + (uVar5 - (uVar3 & 0xffffc000))) =
- (char)((uint)in_stack_0000000c >> 8);
- *(int *)(y + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x4000) {
- *(undefined1 *)(y + 0x806 + iVar4 % 0x4000) = in_stack_00000010;
- *(int *)(y + 0x4810) = iVar4 + 1;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- Skip = -1;
- SendMapPoint();
- SkipFlush((TConnection *)y);
- FinishSendData((TConnection *)y);
- return;
- }
- return;
-}
-
-
-
-void SendCloseContainer(TConnection *Connection,int ContNr)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 'o';
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)ContNr;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-void SendContainer(TConnection *Connection,int ContNr)
-
-{
- int iVar1;
- bool bVar2;
- uchar uVar3;
- TPlayer *pl;
- TPlayer *Window;
- ulong uVar4;
- char *__s;
- size_t Length;
- uint uVar5;
- int iVar6;
- uint uVar7;
- undefined2 uVar8;
- int *piVar9;
- undefined4 uVar10;
- int local_6c;
- int Count;
- int local_60;
- Object local_5c [4];
- Object local_4c [4];
- Object local_3c [4];
- Object local_2c;
- Object Obj;
-
- bVar2 = BeginSendData(Connection);
- if (!bVar2) {
- return;
- }
- iVar1 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar1 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = 'n';
- iVar6 = iVar6 + 1;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar6 < iVar1 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)ContNr;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- Window = TConnection::GetPlayer(Connection);
- if (Window == (TPlayer *)0x0) {
- error(&DAT_081091c0);
- return;
- }
- iVar6 = ContNr;
- TPlayer::GetOpenContainer((TPlayer *)&local_2c,(int)Window);
- bVar2 = Object::exists(&local_2c);
- if (!bVar2) {
- error("SendContainer: Container %d existiert nicht.\n",ContNr,iVar6);
- return;
- }
- local_3c[0].ObjectID = local_2c.ObjectID;
- Object::getObjectType(local_4c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_4c,DISGUISE);
- if (bVar2) {
- Object::getObjectType(local_4c);
- uVar4 = ObjectType::getAttribute((ObjectType *)local_4c,DISGUISETARGET);
- uVar8 = (undefined2)uVar4;
- }
- else {
- Object::getObjectType(local_4c);
- uVar8 = (undefined2)local_4c[0].ObjectID;
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar8;
- uVar7 = iVar6 + 1;
- uVar5 = iVar6 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar8 >> 8);
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- Object::getObjectType(local_4c);
- uVar10 = 0xffffffff;
- __s = ObjectType::getName((ObjectType *)local_4c);
- if (__s == (char *)0x0) {
- error("SendString: String ist NULL.\n",uVar10);
- }
- else {
- Length = strlen(__s);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3fff) {
- Count._0_1_ = (uchar)(Length & 0xffff);
- Connection->OutData[iVar6 % 0x4000] = (uchar)Count;
- uVar7 = iVar6 + 1;
- uVar5 = iVar6 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- Count._0_1_ = (uchar)((Length & 0xffff) >> 8);
- *(uchar *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) = (uchar)Count;
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,__s,Length);
- }
- }
- Object::getObjectType(local_4c);
- uVar4 = ObjectType::getAttribute((ObjectType *)local_4c,CAPACITY);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar4;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- Object::getContainer(local_4c);
- Object::getObjectType(local_3c);
- if ((_func_int_varargs **)local_3c[0].ObjectID != (_func_int_varargs **)0x0) {
- Object::getContainer(local_3c);
- Object::getObjectType(local_5c);
- bVar2 = false;
- if ((0 < (int)local_5c[0].ObjectID) && ((int)local_5c[0].ObjectID < 0xb)) {
- bVar2 = true;
- }
- uVar3 = '\x01';
- if (!bVar2) goto LAB_080ce9df;
- }
- uVar3 = '\0';
-LAB_080ce9df:
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- local_5c[0].ObjectID = local_2c.ObjectID;
- local_60 = CountObjectsInContainer(local_5c);
- iVar6 = Connection->NextToWrite;
- piVar9 = &OBJECTS_PER_CONTAINER;
- if (local_60 < 0x25) {
- piVar9 = &local_60;
- }
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)*piVar9;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- local_6c = 0;
- local_3c[0].ObjectID = local_2c.ObjectID;
- GetFirstContainerObject(local_4c);
- local_2c.ObjectID = local_4c[0].ObjectID;
- while( true ) {
- bVar2 = false;
- local_5c[0].ObjectID = NONE.ObjectID;
- local_4c[0].ObjectID = NONE.ObjectID;
- if ((local_2c.ObjectID != NONE.ObjectID) && (local_6c < 0x24)) {
- bVar2 = true;
- }
- if (!bVar2) break;
- local_5c[0].ObjectID = local_2c.ObjectID;
- Object::getObjectType(local_4c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_4c,DISGUISE);
- if (bVar2) {
- Object::getObjectType(local_4c);
- uVar4 = ObjectType::getAttribute((ObjectType *)local_4c,DISGUISETARGET);
- uVar8 = (undefined2)uVar4;
- }
- else {
- Object::getObjectType(local_4c);
- uVar8 = (undefined2)local_4c[0].ObjectID;
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar8;
- uVar7 = iVar6 + 1;
- uVar5 = iVar6 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar8 >> 8);
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- Object::getObjectType(local_5c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_5c,LIQUIDCONTAINER);
- if (bVar2) {
- uVar4 = Object::getAttribute(&local_2c,CONTAINERLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar4);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_5c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_5c,LIQUIDPOOL);
- if (bVar2) {
- uVar4 = Object::getAttribute(&local_2c,POOLLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar4);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_5c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_5c,CUMULATIVE);
- if (bVar2) {
- uVar4 = Object::getAttribute(&local_2c,AMOUNT);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar4;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getNextObject(local_4c);
- local_2c.ObjectID = local_4c[0].ObjectID;
- local_6c = local_6c + 1;
- }
- FinishSendData(Connection);
- return;
-}
-
-
-
-void SendCreateInContainer(TConnection *Connection,int ContNr,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- uchar uVar3;
- ulong uVar4;
- uint uVar5;
- int iVar6;
- uint uVar7;
- Object local_3c [4];
- ulong local_2c;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar1 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = 'p';
- iVar6 = iVar6 + 1;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar6 < iVar1 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)ContNr;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- local_2c = Obj->ObjectID;
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,DISGUISE);
- if (bVar2) {
- Object::getObjectType(local_3c);
- uVar4 = ObjectType::getAttribute((ObjectType *)local_3c,DISGUISETARGET);
- local_3c[0].ObjectID._0_2_ = (undefined2)uVar4;
- }
- else {
- Object::getObjectType(local_3c);
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)(undefined2)local_3c[0].ObjectID;
- uVar7 = iVar6 + 1;
- uVar5 = iVar6 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)(undefined2)local_3c[0].ObjectID >> 8);
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,LIQUIDCONTAINER);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,CONTAINERLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar4);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,LIQUIDPOOL);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,POOLLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar4);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,CUMULATIVE);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,AMOUNT);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar4;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- FinishSendData(Connection);
- }
- else {
- error(&DAT_08109200);
- }
- }
- return;
-}
-
-
-
-void SendChangeInContainer(TConnection *Connection,int ContNr,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- uchar uVar3;
- int iVar4;
- ulong uVar5;
- uint uVar6;
- int iVar7;
- uint uVar8;
- uchar local_40;
- int RNum;
- Object local_2c [7];
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- local_2c[0] = (Object)Obj->ObjectID;
- iVar4 = GetObjectRNum(local_2c);
- if (iVar4 < 0x24) {
- iVar1 = Connection->NextToSend;
- iVar7 = Connection->NextToWrite;
- if (iVar7 < iVar1 + 0x4000) {
- Connection->OutData[iVar7 % 0x4000] = 'q';
- iVar7 = iVar7 + 1;
- Connection->NextToWrite = iVar7;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar7 < iVar1 + 0x4000) {
- Connection->OutData[iVar7 % 0x4000] = (uchar)ContNr;
- iVar7 = iVar7 + 1;
- Connection->NextToWrite = iVar7;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar7 < iVar1 + 0x4000) {
- local_40 = (uchar)iVar4;
- Connection->NextToWrite = iVar7 + 1;
- Connection->OutData[iVar7 % 0x4000] = local_40;
- }
- else {
- Connection->Overflow = true;
- }
- local_2c[0] = (Object)Obj->ObjectID;
- Object::getObjectType((Object *)&RNum);
- bVar2 = ObjectType::getFlag((ObjectType *)&RNum,DISGUISE);
- if (bVar2) {
- Object::getObjectType((Object *)&RNum);
- uVar5 = ObjectType::getAttribute((ObjectType *)&RNum,DISGUISETARGET);
- RNum._0_2_ = (undefined2)uVar5;
- }
- else {
- Object::getObjectType((Object *)&RNum);
- }
- iVar4 = Connection->NextToWrite;
- if (iVar4 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)(undefined2)RNum;
- uVar8 = iVar4 + 1;
- uVar6 = iVar4 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar6 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar6 & 0xffffc000)) + 0x806) =
- (char)((ushort)(undefined2)RNum >> 8);
- Connection->NextToWrite = iVar4 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- Object::getObjectType((Object *)&RNum);
- bVar2 = ObjectType::getFlag((ObjectType *)&RNum,LIQUIDCONTAINER);
- if (bVar2) {
- uVar5 = Object::getAttribute(Obj,CONTAINERLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar5);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType((Object *)&RNum);
- bVar2 = ObjectType::getFlag((ObjectType *)&RNum,LIQUIDPOOL);
- if (bVar2) {
- uVar5 = Object::getAttribute(Obj,POOLLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar5);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType((Object *)&RNum);
- bVar2 = ObjectType::getFlag((ObjectType *)&RNum,CUMULATIVE);
- if (bVar2) {
- uVar5 = Object::getAttribute(Obj,AMOUNT);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)uVar5;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- FinishSendData(Connection);
- }
- }
- else {
- error(&DAT_08109240);
- }
- }
- return;
-}
-
-
-
-void SendDeleteInContainer(TConnection *Connection,int ContNr,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
- int iVar4;
- int RNum;
- Object local_2c [7];
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- local_2c[0] = (Object)Obj->ObjectID;
- iVar3 = GetObjectRNum(local_2c);
- if (iVar3 < 0x24) {
- iVar1 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = 'r';
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)ContNr;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)iVar3;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- }
- }
- else {
- error(&DAT_08109280);
- }
- }
- return;
-}
-
-
-
-void SendBodyInventory(TConnection *Connection,ulong CreatureID)
-
-{
- int Position;
- int Position_00;
- Object local_4c [4];
- ulong local_3c;
- ulong local_2c;
- Object Obj;
-
- Position_00 = 1;
- do {
- GetBodyObject((ulong)&local_2c,CreatureID);
- local_3c = NONE.ObjectID;
- local_4c[0].ObjectID = NONE.ObjectID;
- if (local_2c != NONE.ObjectID) {
- local_4c[0].ObjectID = local_2c;
- SendSetInventory(Connection,Position_00,local_4c);
- }
- Position_00 = Position_00 + 1;
- } while (Position_00 < 0xb);
- return;
-}
-
-
-
-void SendSetInventory(TConnection *Connection,int Position,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- uchar uVar3;
- ulong uVar4;
- uint uVar5;
- int iVar6;
- uint uVar7;
- Object local_3c [4];
- ulong local_2c;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar1 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = 'x';
- iVar6 = iVar6 + 1;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar6 < iVar1 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)Position;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- local_2c = Obj->ObjectID;
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,DISGUISE);
- if (bVar2) {
- Object::getObjectType(local_3c);
- uVar4 = ObjectType::getAttribute((ObjectType *)local_3c,DISGUISETARGET);
- local_3c[0].ObjectID._0_2_ = (undefined2)uVar4;
- }
- else {
- Object::getObjectType(local_3c);
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)(undefined2)local_3c[0].ObjectID;
- uVar7 = iVar6 + 1;
- uVar5 = iVar6 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)(undefined2)local_3c[0].ObjectID >> 8);
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,LIQUIDCONTAINER);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,CONTAINERLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar4);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,LIQUIDPOOL);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,POOLLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar4);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,CUMULATIVE);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,AMOUNT);
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar4;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- FinishSendData(Connection);
- }
- else {
- error("SendSetInventory: Objekt existiert nicht.\n");
- }
- }
- return;
-}
-
-
-
-void SendDeleteInventory(TConnection *Connection,int Position)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 'y';
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)Position;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-void SendTradeObjects(TConnection *Connection,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- uchar uVar3;
- ulong uVar4;
- uint uVar5;
- uint uVar6;
- Object local_4c [4];
- Object local_3c [4];
- Object local_2c [7];
-
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- local_2c[0] = (Object)Obj->ObjectID;
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,DISGUISE);
- if (bVar2) {
- Object::getObjectType(local_3c);
- uVar4 = ObjectType::getAttribute((ObjectType *)local_3c,DISGUISETARGET);
- local_3c[0].ObjectID._0_2_ = (undefined2)uVar4;
- }
- else {
- Object::getObjectType(local_3c);
- }
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar1 % 0x4000] = (uchar)(undefined2)local_3c[0].ObjectID;
- uVar6 = iVar1 + 1;
- uVar5 = iVar1 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar5 = uVar6;
- }
- *(char *)((int)Connection + (uVar6 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)(undefined2)local_3c[0].ObjectID >> 8);
- Connection->NextToWrite = iVar1 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,LIQUIDCONTAINER);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,CONTAINERLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar4);
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,LIQUIDPOOL);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,POOLLIQUIDTYPE);
- uVar3 = GetLiquidColor(uVar4);
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = uVar3;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,CUMULATIVE);
- if (bVar2) {
- uVar4 = Object::getAttribute(Obj,AMOUNT);
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = (uchar)uVar4;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- }
- Object::getObjectType(local_3c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_3c,CONTAINER);
- if (bVar2) {
- local_4c[0] = (Object)Obj->ObjectID;
- GetFirstContainerObject(local_2c);
- Obj->ObjectID = (ulong)local_2c[0];
- if (local_2c[0].ObjectID != NONE.ObjectID) {
- do {
- local_4c[0] = (Object)Obj->ObjectID;
- local_3c[0].ObjectID = NONE.ObjectID;
- SendTradeObjects(Connection,local_4c);
- Object::getNextObject(local_3c);
- Obj->ObjectID = (ulong)local_3c[0];
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- }
- }
- return;
-}
-
-
-
-void SendTradeOffer(TConnection *Connection,char *Name,bool OwnOffer,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- size_t Length;
- int iVar3;
- uint uVar4;
- uint uVar5;
- char *Text;
- Object local_2c [7];
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = !OwnOffer + '}';
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- if (Name == (char *)0x0) {
- Text = "SendTradeOffer: Name ist NULL.\n";
- }
- else {
- Length = strlen(Name);
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)(Length & 0xffff);
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,Name,Length);
- }
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- local_2c[0] = (Object)Obj->ObjectID;
- iVar3 = CountObjects(local_2c);
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = (uchar)iVar3;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- local_2c[0] = (Object)Obj->ObjectID;
- SendTradeObjects(Connection,local_2c);
- FinishSendData(Connection);
- return;
- }
- Text = "SendTradeOffer: Objekt existiert nicht.\n";
- }
- error(Text);
- }
- return;
-}
-
-
-
-void SendCloseTrade(TConnection *Connection)
-
-{
- int iVar1;
- bool bVar2;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = '\x7f';
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-void SendAddField(TConnection *Connection,int x,int y,int z,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- uint uVar3;
- int iVar4;
- uint uVar5;
- Object local_2c [7];
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = 'j';
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)x;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- iVar4 = iVar4 + 2;
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((uint)x >> 8);
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)y;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- iVar4 = iVar4 + 2;
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((uint)y >> 8);
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)z;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- local_2c[0] = (Object)Obj->ObjectID;
- SendMapObject(Connection,local_2c);
- FinishSendData(Connection);
- }
- else {
- error(&DAT_08109360);
- }
- }
- return;
-}
-
-
-
-void SendDeleteField(TConnection *Connection,int x,int y,int z,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
- uint uVar4;
- int RNum;
- uint uVar5;
- Object local_2c [7];
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 'l';
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)x;
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((uint)x >> 8);
- iVar3 = iVar3 + 2;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)y;
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((uint)y >> 8);
- iVar3 = iVar3 + 2;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)z;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- local_2c[0] = (Object)Obj->ObjectID;
- iVar3 = GetObjectRNum(local_2c);
- if (iVar3 < 10) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = (uchar)iVar3;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- }
- }
- else {
- error(&DAT_08109360);
- }
- }
- return;
-}
-
-
-
-void SendChangeField(TConnection *Connection,int x,int y,int z,Object *Obj)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
- uint uVar4;
- int RNum;
- uint uVar5;
- Object local_2c [7];
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 'k';
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)x;
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((uint)x >> 8);
- iVar3 = iVar3 + 2;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)y;
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((uint)y >> 8);
- iVar3 = iVar3 + 2;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)z;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- bVar2 = Object::exists(Obj);
- if (bVar2) {
- local_2c[0] = (Object)Obj->ObjectID;
- iVar3 = GetObjectRNum(local_2c);
- if (iVar3 < 10) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = (uchar)iVar3;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- local_2c[0] = (Object)Obj->ObjectID;
- SendMapObject(Connection,local_2c);
- FinishSendData(Connection);
- }
- }
- else {
- error(&DAT_081093a0);
- }
- }
- return;
-}
-
-
-
-void SendMoveCreature(TConnection *Connection,ulong CreatureID,int x,int y,int z)
-
-{
- undefined2 uVar1;
- int iVar2;
- bool bVar3;
- bool bVar4;
- bool bVar5;
- TCreature *pTVar6;
- int iVar7;
- uint uVar8;
- int iVar9;
- uint uVar10;
- TCreature *cr;
- uchar uStack_30;
- bool DestVisible;
- bool StartVisible;
- int RNum;
-
- if (Connection != (TConnection *)0x0) {
- pTVar6 = GetCreature(CreatureID);
- if (pTVar6 == (TCreature *)0x0) {
- error("SendMoveCreature: Kreatur existiert nicht.\n");
- }
- else {
- RNum = (pTVar6->CrObject).ObjectID;
- iVar7 = GetObjectRNum((Object *)&RNum);
- bVar3 = false;
- bVar4 = TConnection::IsVisible(Connection,pTVar6->posx,pTVar6->posy,pTVar6->posz);
- if ((bVar4) && (iVar7 < 10)) {
- bVar3 = true;
- }
- bVar4 = TConnection::IsVisible(Connection,x,y,z);
- if (bVar3) {
- if (bVar4) {
- bVar5 = BeginSendData(Connection);
- if (!bVar5) {
- return;
- }
- iVar2 = Connection->NextToSend;
- iVar9 = Connection->NextToWrite;
- if (iVar9 < iVar2 + 0x4000) {
- Connection->OutData[iVar9 % 0x4000] = 'm';
- iVar9 = iVar9 + 1;
- Connection->NextToWrite = iVar9;
- }
- else {
- Connection->Overflow = true;
- }
- uVar1 = (undefined2)pTVar6->posx;
- if (iVar9 < iVar2 + 0x3fff) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)uVar1;
- uVar10 = iVar9 + 1;
- uVar8 = iVar9 + 0x4000;
- if (-1 < (int)uVar10) {
- uVar8 = uVar10;
- }
- *(char *)((int)Connection + (uVar10 - (uVar8 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar1 >> 8);
- iVar9 = iVar9 + 2;
- Connection->NextToWrite = iVar9;
- }
- else {
- Connection->Overflow = true;
- }
- uVar1 = (undefined2)pTVar6->posy;
- if (iVar9 < iVar2 + 0x3fff) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)uVar1;
- uVar10 = iVar9 + 1;
- uVar8 = iVar9 + 0x4000;
- if (-1 < (int)uVar10) {
- uVar8 = uVar10;
- }
- iVar9 = iVar9 + 2;
- *(char *)((int)Connection + (uVar10 - (uVar8 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar1 >> 8);
- Connection->NextToWrite = iVar9;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar9 < iVar2 + 0x4000) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)pTVar6->posz;
- iVar9 = iVar9 + 1;
- Connection->NextToWrite = iVar9;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar9 < iVar2 + 0x4000) {
- uStack_30 = (uchar)iVar7;
- iVar7 = iVar9 % 0x4000;
- iVar9 = iVar9 + 1;
- Connection->OutData[iVar7] = uStack_30;
- Connection->NextToWrite = iVar9;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar9 < iVar2 + 0x3fff) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)x;
- uVar10 = iVar9 + 1;
- uVar8 = iVar9 + 0x4000;
- if (-1 < (int)uVar10) {
- uVar8 = uVar10;
- }
- *(char *)((int)Connection + (uVar10 - (uVar8 & 0xffffc000)) + 0x806) =
- (char)((uint)x >> 8);
- iVar9 = iVar9 + 2;
- Connection->NextToWrite = iVar9;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar9 < iVar2 + 0x3fff) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)y;
- uVar10 = iVar9 + 1;
- uVar8 = iVar9 + 0x4000;
- if (-1 < (int)uVar10) {
- uVar8 = uVar10;
- }
- iVar9 = iVar9 + 2;
- *(char *)((int)Connection + (uVar10 - (uVar8 & 0xffffc000)) + 0x806) =
- (char)((uint)y >> 8);
- Connection->NextToWrite = iVar9;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar9 < iVar2 + 0x4000) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)z;
- Connection->NextToWrite = iVar9 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- }
- if (bVar3) {
- if (bVar4) {
- return;
- }
- RNum = (pTVar6->CrObject).ObjectID;
- SendDeleteField(Connection,pTVar6->posx,pTVar6->posy,pTVar6->posz,
- (Object *)&RNum);
- return;
- }
- }
- else if (!bVar4) {
- return;
- }
- if (bVar4) {
- RNum = (pTVar6->CrObject).ObjectID;
- SendAddField(Connection,x,y,z,(Object *)&RNum);
- }
- }
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: y_local
-
-void __regparm2 SendGraphicalEffect(TConnection *Connection,int x,int y,int z,int Type)
-
-{
- int iVar1;
- bool bVar2;
- uint uVar3;
- int iVar4;
- int iVar5;
- uint uVar6;
- undefined1 in_stack_00000010;
- undefined1 in_stack_00000014;
- int Type_local;
- int z_local;
- int y_local;
-
- bVar2 = BeginSendData((TConnection *)y);
- if (bVar2) {
- iVar1 = *(int *)(y + 0x4808);
- iVar4 = *(int *)(y + 0x4810);
- if (iVar4 < iVar1 + 0x4000) {
- *(undefined1 *)(y + 0x806 + iVar4 % 0x4000) = 0x83;
- iVar4 = iVar4 + 1;
- *(int *)(y + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- *(char *)(y + 0x806 + iVar4 % 0x4000) = (char)(z & 0xffffU);
- uVar6 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- iVar4 = iVar4 + 2;
- *(char *)(y + 0x806 + (uVar6 - (uVar3 & 0xffffc000))) = (char)((z & 0xffffU) >> 8);
- *(int *)(y + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- *(char *)(y + 0x806 + iVar4 % 0x4000) = (char)Type;
- uVar6 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- iVar4 = iVar4 + 2;
- *(char *)(y + 0x806 + (uVar6 - (uVar3 & 0xffffc000))) = (char)((uint)Type >> 8);
- *(int *)(y + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x4000) {
- iVar5 = iVar4 % 0x4000;
- iVar4 = iVar4 + 1;
- *(undefined1 *)(y + 0x806 + iVar5) = in_stack_00000010;
- *(int *)(y + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x4000) {
- *(undefined1 *)(y + 0x806 + iVar4 % 0x4000) = in_stack_00000014;
- *(int *)(y + 0x4810) = iVar4 + 1;
- }
- else {
- *(undefined1 *)(y + 0x4814) = 1;
- }
- FinishSendData((TConnection *)y);
- return;
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: z_local
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void SendTextualEffect(TConnection *Connection,int x,int y,int z,int Color,char *Text)
-
-{
- int iVar1;
- bool bVar2;
- size_t Length;
- uint uVar3;
- int iVar4;
- uint uVar5;
- char *Text_local;
- int Color_local;
- int z_local;
-
- if (Text == (char *)0x0) {
- Connection = (TConnection *)s_SendTextualEffect__Text_ist_NULL_08109460;
- }
- else {
- if (*Text != '\0') {
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = 0x84;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)(x & 0xffffU);
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- iVar4 = iVar4 + 2;
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((x & 0xffffU) >> 8);
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- uVar5 = iVar4 + 1;
- Connection->OutData[iVar4 % 0x4000] = (uchar)(y & 0xffffU);
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((y & 0xffffU) >> 8);
- iVar4 = iVar4 + 2;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x4000) {
- Color_local._0_1_ = (uchar)z;
- Connection->OutData[iVar4 % 0x4000] = (uchar)Color_local;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x4000) {
- Text_local._0_1_ = (uchar)Color;
- Connection->OutData[iVar4 % 0x4000] = (uchar)Text_local;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- if (Text == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- }
- else {
- Length = strlen(Text);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)(Length & 0xffff);
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- Connection->NextToWrite = iVar4 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,Text,Length);
- }
- }
- FinishSendData(Connection);
- return;
- }
- return;
- }
- Connection = (TConnection *)s_SendTextualEffect__Text_ist_leer_08109420;
- }
- error((char *)Connection);
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: sy_local
-
-void __regparm2
-SendMissileEffect(TConnection *Connection,int sx,int sy,int sz,int zx,int zy,int zz,int Type)
-
-{
- int iVar1;
- bool bVar2;
- uint uVar3;
- int iVar4;
- int iVar5;
- uint uVar6;
- undefined1 in_stack_0000001c;
- undefined1 in_stack_00000020;
- int Type_local;
- int zz_local;
- int zy_local;
- int zx_local;
- int sz_local;
- int sy_local;
-
- bVar2 = BeginSendData((TConnection *)sy);
- if (bVar2) {
- iVar1 = *(int *)(sy + 0x4808);
- iVar4 = *(int *)(sy + 0x4810);
- if (iVar4 < iVar1 + 0x4000) {
- *(undefined1 *)(sy + 0x806 + iVar4 % 0x4000) = 0x85;
- iVar4 = iVar4 + 1;
- *(int *)(sy + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(sy + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- *(char *)(sy + 0x806 + iVar4 % 0x4000) = (char)(sz & 0xffffU);
- uVar6 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- iVar4 = iVar4 + 2;
- *(char *)(sy + 0x806 + (uVar6 - (uVar3 & 0xffffc000))) = (char)((sz & 0xffffU) >> 8);
- *(int *)(sy + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(sy + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- *(char *)(sy + 0x806 + iVar4 % 0x4000) = (char)zx;
- uVar6 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- iVar4 = iVar4 + 2;
- *(char *)(sy + 0x806 + (uVar6 - (uVar3 & 0xffffc000))) = (char)((uint)zx >> 8);
- *(int *)(sy + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(sy + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x4000) {
- zx_local._0_1_ = (undefined1)zy;
- iVar5 = iVar4 % 0x4000;
- iVar4 = iVar4 + 1;
- *(undefined1 *)(sy + 0x806 + iVar5) = (undefined1)zx_local;
- *(int *)(sy + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(sy + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- *(char *)(sy + 0x806 + iVar4 % 0x4000) = (char)zz;
- uVar6 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- iVar4 = iVar4 + 2;
- *(char *)(sy + 0x806 + (uVar6 - (uVar3 & 0xffffc000))) = (char)((uint)zz >> 8);
- *(int *)(sy + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(sy + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3fff) {
- *(char *)(sy + 0x806 + iVar4 % 0x4000) = (char)Type;
- uVar6 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- iVar4 = iVar4 + 2;
- *(char *)(sy + 0x806 + (uVar6 - (uVar3 & 0xffffc000))) = (char)((uint)Type >> 8);
- *(int *)(sy + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(sy + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x4000) {
- iVar5 = iVar4 % 0x4000;
- iVar4 = iVar4 + 1;
- *(undefined1 *)(sy + 0x806 + iVar5) = in_stack_0000001c;
- *(int *)(sy + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(sy + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x4000) {
- *(undefined1 *)(sy + 0x806 + iVar4 % 0x4000) = in_stack_00000020;
- *(int *)(sy + 0x4810) = iVar4 + 1;
- }
- else {
- *(undefined1 *)(sy + 0x4814) = 1;
- }
- FinishSendData((TConnection *)sy);
- return;
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Color_local
-
-void __regparm2 SendMarkCreature(TConnection *Connection,ulong CreatureID,int Color)
-
-{
- int iVar1;
- bool bVar2;
- uint uVar3;
- int iVar4;
- uint uVar5;
- undefined4 in_stack_00000008;
- undefined1 in_stack_0000000c;
- int Color_local;
-
- bVar2 = BeginSendData((TConnection *)Color);
- if (bVar2) {
- iVar1 = *(int *)(Color + 0x4808);
- iVar4 = *(int *)(Color + 0x4810);
- if (iVar4 < iVar1 + 0x4000) {
- *(undefined1 *)(Color + 0x806 + iVar4 % 0x4000) = 0x86;
- iVar4 = iVar4 + 1;
- *(int *)(Color + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(Color + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x3ffd) {
- *(char *)(Color + 0x806 + iVar4 % 0x4000) = (char)in_stack_00000008;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)(Color + 0x806 + (uVar5 - (uVar3 & 0xffffc000))) =
- (char)((uint)in_stack_00000008 >> 8);
- uVar5 = iVar4 + 2;
- uVar3 = iVar4 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)(Color + 0x806 + (uVar5 - (uVar3 & 0xffffc000))) =
- (char)((uint)in_stack_00000008 >> 0x10);
- uVar5 = iVar4 + 3;
- uVar3 = iVar4 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- iVar4 = iVar4 + 4;
- *(char *)(Color + 0x806 + (uVar5 - (uVar3 & 0xffffc000))) =
- (char)((uint)in_stack_00000008 >> 0x18);
- *(int *)(Color + 0x4810) = iVar4;
- }
- else {
- *(undefined1 *)(Color + 0x4814) = 1;
- }
- if (iVar4 < iVar1 + 0x4000) {
- *(undefined1 *)(Color + 0x806 + iVar4 % 0x4000) = in_stack_0000000c;
- *(int *)(Color + 0x4810) = iVar4 + 1;
- }
- else {
- *(undefined1 *)(Color + 0x4814) = 1;
- }
- FinishSendData((TConnection *)Color);
- return;
- }
- return;
-}
-
-
-
-void SendEditText(TConnection *Connection,Object *Obj)
-
-{
- Object *this;
- bool bVar1;
- TPlayer *pl;
- ulong uVar2;
- size_t sVar3;
- uint uVar4;
- TPlayer *pTVar5;
- int iVar6;
- int iVar7;
- uint uVar8;
- ushort *puVar9;
- char *Text_00;
- uchar local_1060;
- char *local_1048;
- char *Editor;
- char *Text;
- ushort MaxLen;
- char Buffer [4096];
-
- bVar1 = BeginSendData(Connection);
- if (!bVar1) {
- return;
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = 0x96;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- bVar1 = Object::exists(Obj);
- if (!bVar1) {
- Text_00 = &DAT_081094e0;
-LAB_080d1c40:
- error(Text_00);
- return;
- }
- uVar2 = Obj->ObjectID;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3ffd) {
- uVar8 = iVar6 + 1;
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar2;
- uVar4 = iVar6 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) = (char)(uVar2 >> 8);
- uVar8 = iVar6 + 2;
- uVar4 = iVar6 + 0x4001;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) = (char)(uVar2 >> 0x10);
- uVar8 = iVar6 + 3;
- uVar4 = iVar6 + 0x4002;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) = (char)(uVar2 >> 0x18);
- Connection->NextToWrite = iVar6 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- this = (Object *)(Buffer + 0xffc);
- Object::getObjectType(this);
- bVar1 = ObjectType::getFlag((ObjectType *)this,DISGUISE);
- if (bVar1) {
- Object::getObjectType(this);
- uVar2 = ObjectType::getAttribute((ObjectType *)this,DISGUISETARGET);
- Buffer._4092_2_ = (undefined2)uVar2;
- }
- else {
- Object::getObjectType(this);
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x3fff) {
- uVar8 = iVar6 + 1;
- Connection->OutData[iVar6 % 0x4000] = (uchar)Buffer._4092_2_;
- uVar4 = iVar6 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) =
- SUB21(Buffer._4092_2_,1);
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- Editor = (char *)&MaxLen;
- puVar9 = &MaxLen;
- for (iVar6 = 0x400; iVar6 != 0; iVar6 = iVar6 + -1) {
- puVar9[0] = 0;
- puVar9[1] = 0;
- puVar9 = puVar9 + 2;
- }
- Object::getObjectType(this);
- bVar1 = ObjectType::getFlag((ObjectType *)this,WRITE);
- if (bVar1) {
-LAB_080d171d:
- Object::getObjectType(this);
- bVar1 = ObjectType::getFlag((ObjectType *)this,WRITE);
- Object::getObjectType(this);
- uVar2 = ObjectType::getAttribute((ObjectType *)this,!bVar1 + MAXLENGTH);
- Text._0_2_ = (short)uVar2 + -1;
- uVar2 = Object::getAttribute(Obj,TEXTSTRING);
- Editor = GetDynamicString(uVar2);
- uVar2 = Object::getAttribute(Obj,EDITOR);
- local_1048 = GetDynamicString(uVar2);
- }
- else {
- Object::getObjectType(this);
- bVar1 = ObjectType::getFlag((ObjectType *)this,WRITEONCE);
- if (bVar1) goto LAB_080d171d;
- Object::getObjectType(this);
- bVar1 = ObjectType::getFlag((ObjectType *)this,INFORMATION);
- if (bVar1) {
- Object::getObjectType(this);
- uVar2 = ObjectType::getAttribute((ObjectType *)this,INFORMATIONTYPE);
- if (uVar2 != 4) goto LAB_080d1b88;
- pTVar5 = TConnection::GetPlayer(Connection);
- if (pTVar5 == (TPlayer *)0x0) {
- Text_00 = &DAT_081094a0;
- goto LAB_080d1c40;
- }
- GetSpellbook((pTVar5->super_TCreature).ID,Editor);
- local_1048 = (char *)0x0;
- sVar3 = strlen(Editor);
- Text._0_2_ = (short)sVar3;
- }
- else {
-LAB_080d1b88:
- uVar2 = Object::getAttribute(Obj,TEXTSTRING);
- Editor = GetDynamicString(uVar2);
- uVar2 = Object::getAttribute(Obj,EDITOR);
- local_1048 = GetDynamicString(uVar2);
- Text._0_2_ = 0;
- if (Editor != (char *)0x0) {
- sVar3 = strlen(Editor);
- Text._0_2_ = (short)sVar3;
- }
- }
- }
- iVar6 = Connection->NextToSend;
- iVar7 = Connection->NextToWrite;
- if (iVar7 < iVar6 + 0x3fff) {
- Connection->OutData[iVar7 % 0x4000] = (uchar)Text;
- uVar8 = iVar7 + 1;
- uVar4 = iVar7 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((ushort)(short)Text >> 8);
- Connection->NextToWrite = iVar7 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (Editor != (char *)0x0) {
- if ((short)Text != 0) {
- sVar3 = strlen(Editor);
- iVar7 = Connection->NextToWrite;
- if (iVar7 < iVar6 + 0x3fff) {
- local_1060 = (uchar)(sVar3 & 0xffff);
- Connection->OutData[iVar7 % 0x4000] = local_1060;
- uVar8 = iVar7 + 1;
- uVar4 = iVar7 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- local_1060 = (uchar)((sVar3 & 0xffff) >> 8);
- *(uchar *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) = local_1060;
- Connection->NextToWrite = iVar7 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)sVar3) {
- SendText(Connection,Editor,sVar3);
- iVar6 = Connection->NextToSend;
- }
- if (local_1048 == (char *)0x0) {
- iVar7 = Connection->NextToWrite;
- if (iVar7 < iVar6 + 0x3fff) {
- uVar8 = iVar7 + 1;
- uVar4 = iVar7 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- Connection->OutData[iVar7 % 0x4000] = '\0';
- *(undefined1 *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) = 0;
- Connection->NextToWrite = iVar7 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- }
- else {
- sVar3 = strlen(local_1048);
- iVar7 = Connection->NextToWrite;
- if (iVar7 < iVar6 + 0x3fff) {
- Connection->OutData[iVar7 % 0x4000] = (uchar)(sVar3 & 0xffff);
- uVar8 = iVar7 + 1;
- uVar4 = iVar7 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((sVar3 & 0xffff) >> 8);
- Connection->NextToWrite = iVar7 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)sVar3) {
- SendText(Connection,local_1048,sVar3);
- }
- }
- }
- if (Editor == (char *)0x0) {
- iVar6 = Connection->NextToSend;
- }
- else {
- if ((short)Text != 0) goto LAB_080d1904;
- iVar6 = Connection->NextToSend;
- }
- }
- iVar7 = Connection->NextToWrite;
- if (iVar7 < iVar6 + 0x3fff) {
- Connection->OutData[iVar7 % 0x4000] = '\0';
- uVar8 = iVar7 + 1;
- uVar4 = iVar7 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) = 0;
- iVar7 = iVar7 + 2;
- Connection->NextToWrite = iVar7;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar7 < iVar6 + 0x3fff) {
- Connection->OutData[iVar7 % 0x4000] = '\0';
- uVar8 = iVar7 + 1;
- uVar4 = iVar7 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar4 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar4 & 0xffffc000)) + 0x806) = 0;
- Connection->NextToWrite = iVar7 + 2;
- }
- else {
- Connection->Overflow = true;
- }
-LAB_080d1904:
- FinishSendData(Connection);
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Type_local
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void SendEditList(TConnection *Connection,uchar Type,ulong ID,char *Text)
-
-{
- int iVar1;
- bool bVar2;
- size_t Length;
- uint uVar3;
- int iVar4;
- uint uVar5;
- char *Text_local;
- uchar Type_local;
-
- bVar2 = BeginSendData(Connection);
- if (!bVar2) {
- return;
- }
- iVar1 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = 0x97;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = Type;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x3ffd) {
- uVar5 = iVar4 + 1;
- Connection->OutData[iVar4 % 0x4000] = (uchar)ID;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) = (char)(ID >> 8);
- uVar5 = iVar4 + 2;
- uVar3 = iVar4 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) = (char)(ID >> 0x10);
- uVar5 = iVar4 + 3;
- uVar3 = iVar4 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) = (char)(ID >> 0x18);
- Connection->NextToWrite = iVar4 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- Length = strlen(Text);
- if (Length < 0xfa1) {
- if (Text == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- }
- else {
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)(Length & 0xffff);
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- Connection->NextToWrite = iVar4 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,Text,Length);
- }
- }
- FinishSendData(Connection);
- return;
- }
- error("SendEditList: Text ist zu lang.\n");
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Color
-
-void SendAmbiente(TConnection *Connection)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
- uchar local_18 [4];
- int Brightness;
- int Color;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0x82;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- GetAmbiente((int *)local_18,&Brightness);
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = local_18[0];
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)Brightness;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- }
- return;
-}
-
-
-
-void SendCreatureHealth(TConnection *Connection,ulong CreatureID)
-
-{
- bool bVar1;
- TCreature *cr;
- TCreature *this;
- int iVar2;
- int iVar3;
- uint uVar4;
- uint uVar5;
-
- bVar1 = BeginSendData(Connection);
- if (!bVar1) {
- return;
- }
- iVar2 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar2 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0x8c;
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar2 + 0x3ffd) {
- uVar5 = iVar3 + 1;
- Connection->OutData[iVar3 % 0x4000] = (uchar)CreatureID;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 8);
- uVar5 = iVar3 + 2;
- uVar4 = iVar3 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x10);
- uVar5 = iVar3 + 3;
- uVar4 = iVar3 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x18);
- Connection->NextToWrite = iVar3 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- this = GetCreature(CreatureID);
- if (this != (TCreature *)0x0) {
- iVar2 = TCreature::GetHealth(this);
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)iVar2;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- error("SendCreatureHealth: Kreatur %ld existiert nicht.\n");
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: HelpColor
-
-void SendCreatureLight(TConnection *Connection,ulong CreatureID)
-
-{
- int iVar1;
- bool bVar2;
- TCreature *pTVar3;
- int iVar4;
- TCreature *cr;
- uint uVar5;
- int iVar6;
- uint uVar7;
- uchar local_18 [4];
- int HelpBrightness;
- int HelpColor;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = 0x8d;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x3ffd) {
- uVar7 = iVar4 + 1;
- Connection->OutData[iVar4 % 0x4000] = (uchar)CreatureID;
- uVar5 = iVar4 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 8);
- uVar7 = iVar4 + 2;
- uVar5 = iVar4 + 0x4001;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x10);
- uVar7 = iVar4 + 3;
- uVar5 = iVar4 + 0x4002;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x18);
- Connection->NextToWrite = iVar4 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar3 = GetCreature(CreatureID);
- if (pTVar3 == (TCreature *)0x0) {
- error("SendCreatureLight: Kreatur %ld existiert nicht.\n",CreatureID);
- }
- else {
- GetCreatureLight(pTVar3->ID,(int *)local_18,&HelpBrightness);
- iVar1 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x4000) {
- iVar6 = iVar4 % 0x4000;
- iVar4 = iVar4 + 1;
- Connection->OutData[iVar6] = local_18[0];
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)HelpBrightness;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- }
- }
- return;
-}
-
-
-
-void SendCreatureOutfit(TConnection *Connection,ulong CreatureID)
-
-{
- undefined2 uVar1;
- ushort uVar2;
- int iVar3;
- bool bVar4;
- TCreature *pTVar5;
- uint uVar6;
- int iVar7;
- TCreature *cr;
- uint uVar8;
-
- bVar4 = BeginSendData(Connection);
- if (!bVar4) {
- return;
- }
- iVar3 = Connection->NextToSend;
- iVar7 = Connection->NextToWrite;
- if (iVar7 < iVar3 + 0x4000) {
- Connection->OutData[iVar7 % 0x4000] = 0x8e;
- iVar7 = iVar7 + 1;
- Connection->NextToWrite = iVar7;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar7 < iVar3 + 0x3ffd) {
- uVar8 = iVar7 + 1;
- Connection->OutData[iVar7 % 0x4000] = (uchar)CreatureID;
- uVar6 = iVar7 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar6 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar6 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 8);
- uVar8 = iVar7 + 2;
- uVar6 = iVar7 + 0x4001;
- if (-1 < (int)uVar8) {
- uVar6 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar6 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x10);
- uVar8 = iVar7 + 3;
- uVar6 = iVar7 + 0x4002;
- if (-1 < (int)uVar8) {
- uVar6 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar6 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x18);
- Connection->NextToWrite = iVar7 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar5 = GetCreature(CreatureID);
- if (pTVar5 != (TCreature *)0x0) {
- uVar1 = (undefined2)(pTVar5->Outfit).OutfitID;
- iVar7 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar7 + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)uVar1;
- uVar8 = iVar3 + 1;
- uVar6 = iVar3 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar6 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar6 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar1 >> 8);
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if ((pTVar5->Outfit).OutfitID == 0) {
- uVar2 = (pTVar5->Outfit).field_1.ObjectType;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar7 + 0x3fff) {
- uVar8 = iVar3 + 1;
- Connection->OutData[iVar3 % 0x4000] = (uchar)uVar2;
- uVar6 = iVar3 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar6 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar6 & 0xffffc000)) + 0x806) =
- (char)(uVar2 >> 8);
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- }
- else {
- SendText(Connection,(char *)(pTVar5->Outfit).field_1.Colors,4);
- }
- FinishSendData(Connection);
- return;
- }
- error("SendCreatureOutfit: Kreatur %ld existiert nicht.\n");
- return;
-}
-
-
-
-void SendCreatureSpeed(TConnection *Connection,ulong CreatureID)
-
-{
- int iVar1;
- bool bVar2;
- TCreature *cr;
- TCreature *this;
- uint uVar3;
- int iVar4;
- uint uVar5;
- uint uVar6;
-
- bVar2 = BeginSendData(Connection);
- if (!bVar2) {
- return;
- }
- iVar1 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < iVar1 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = 0x8f;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < iVar1 + 0x3ffd) {
- uVar6 = iVar4 + 1;
- Connection->OutData[iVar4 % 0x4000] = (uchar)CreatureID;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- *(char *)((int)Connection + (uVar6 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 8);
- uVar6 = iVar4 + 2;
- uVar3 = iVar4 + 0x4001;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- *(char *)((int)Connection + (uVar6 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x10);
- uVar6 = iVar4 + 3;
- uVar3 = iVar4 + 0x4002;
- if (-1 < (int)uVar6) {
- uVar3 = uVar6;
- }
- *(char *)((int)Connection + (uVar6 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x18);
- Connection->NextToWrite = iVar4 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- this = GetCreature(CreatureID);
- if (this != (TCreature *)0x0) {
- uVar3 = TCreature::GetSpeed(this);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)(uVar3 & 0xffff);
- uVar5 = iVar4 + 1;
- uVar6 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar6 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar6 & 0xffffc000)) + 0x806) =
- (char)((uVar3 & 0xffff) >> 8);
- Connection->NextToWrite = iVar4 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- error("SendCreatureSpeed: Kreatur %ld existiert nicht.\n");
- return;
-}
-
-
-
-void SendCreatureSkull(TConnection *Connection,ulong CreatureID)
-
-{
- bool bVar1;
- TPlayer *this;
- TPlayer *Observer;
- int iVar2;
- int iVar3;
- uint uVar4;
- TPlayer *pl;
- uint uVar5;
-
- bVar1 = BeginSendData(Connection);
- if (!bVar1) {
- return;
- }
- iVar2 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar2 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0x90;
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar2 + 0x3ffd) {
- uVar5 = iVar3 + 1;
- Connection->OutData[iVar3 % 0x4000] = (uchar)CreatureID;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 8);
- uVar5 = iVar3 + 2;
- uVar4 = iVar3 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x10);
- uVar5 = iVar3 + 3;
- uVar4 = iVar3 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x18);
- Connection->NextToWrite = iVar3 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- this = GetPlayer(CreatureID);
- if (this != (TPlayer *)0x0) {
- Observer = TConnection::GetPlayer(Connection);
- iVar2 = TPlayer::GetPlayerkillingMark(this,Observer);
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)iVar2;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- error("SendCreatureSkull: Kreatur %ld existiert nicht.\n");
- return;
-}
-
-
-
-void SendCreatureParty(TConnection *Connection,ulong CreatureID)
-
-{
- bool bVar1;
- TPlayer *this;
- TPlayer *Observer;
- int iVar2;
- int iVar3;
- uint uVar4;
- TPlayer *pl;
- uint uVar5;
-
- bVar1 = BeginSendData(Connection);
- if (!bVar1) {
- return;
- }
- iVar2 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar2 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0x91;
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar2 + 0x3ffd) {
- uVar5 = iVar3 + 1;
- Connection->OutData[iVar3 % 0x4000] = (uchar)CreatureID;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 8);
- uVar5 = iVar3 + 2;
- uVar4 = iVar3 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x10);
- uVar5 = iVar3 + 3;
- uVar4 = iVar3 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)(CreatureID >> 0x18);
- Connection->NextToWrite = iVar3 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- this = GetPlayer(CreatureID);
- if (this != (TPlayer *)0x0) {
- Observer = TConnection::GetPlayer(Connection);
- iVar2 = TPlayer::GetPartyMark(this,Observer);
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)iVar2;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- error("SendCreatureParty: Kreatur %ld existiert nicht.\n");
- return;
-}
-
-
-
-void SendClearTarget(TConnection *Connection)
-
-{
- int iVar1;
- bool bVar2;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = 0xa3;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: pl
-
-void SendPlayerData(TConnection *Connection)
-
-{
- undefined2 uVar1;
- TSkill *pTVar2;
- bool bVar3;
- TPlayer *pTVar4;
- uint uVar5;
- int iVar6;
- uint uVar7;
- TSkill *sk;
- int Capacity;
- uint uVar8;
- int iVar9;
- int local_1c;
- TPlayer *pl;
-
- bVar3 = BeginSendData(Connection);
- if (!bVar3) {
- return;
- }
- iVar9 = Connection->NextToWrite;
- if (iVar9 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar9 % 0x4000] = 0xa0;
- Connection->NextToWrite = iVar9 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar4 = TConnection::GetPlayer(Connection);
- if (pTVar4 == (TPlayer *)0x0) {
- error(&DAT_081096e0);
- return;
- }
- pTVar2 = (pTVar4->super_TCreature).super_TSkillBase.Skills[2];
- if (pTVar2 == (TSkill *)0x0) {
- local_1c = Connection->NextToSend;
- iVar9 = Connection->NextToWrite;
- if (local_1c + 0x3fff <= iVar9) goto LAB_080d3570;
- Connection->OutData[iVar9 % 0x4000] = '\0';
- uVar8 = iVar9 + 1;
- uVar5 = iVar9 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) = 0;
-LAB_080d2d93:
- iVar9 = iVar9 + 2;
- Connection->NextToWrite = iVar9;
- }
- else {
- uVar5 = TSkill::Get(pTVar2);
- local_1c = Connection->NextToSend;
- iVar9 = Connection->NextToWrite;
- if (iVar9 < local_1c + 0x3fff) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)(uVar5 & 0xffff);
- uVar7 = iVar9 + 1;
- uVar8 = iVar9 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar8 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar8 & 0xffffc000)) + 0x806) =
- (char)((uVar5 & 0xffff) >> 8);
- goto LAB_080d2d93;
- }
-LAB_080d3570:
- Connection->Overflow = true;
- }
- if (pTVar2 == (TSkill *)0x0) {
- if (local_1c + 0x3fff <= iVar9) goto LAB_080d3510;
- Connection->OutData[iVar9 % 0x4000] = '\0';
- uVar8 = iVar9 + 1;
- uVar5 = iVar9 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) = 0;
-LAB_080d2df5:
- Connection->NextToWrite = iVar9 + 2;
- }
- else {
- uVar1 = (undefined2)pTVar2->Max;
- if (iVar9 < local_1c + 0x3fff) {
- uVar8 = iVar9 + 1;
- Connection->OutData[iVar9 % 0x4000] = (uchar)uVar1;
- uVar5 = iVar9 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar1 >> 8);
- goto LAB_080d2df5;
- }
-LAB_080d3510:
- Connection->Overflow = true;
- }
- iVar9 = 0;
- pTVar2 = (pTVar4->super_TCreature).super_TSkillBase.Skills[5];
- if (pTVar2 != (TSkill *)0x0) {
- iVar6 = TSkill::Get(pTVar2);
- iVar9 = GetInventoryWeight((pTVar4->super_TCreature).ID);
- iVar9 = iVar6 * 100 - iVar9;
- }
- if (iVar9 < 0) {
- iVar9 = 0;
- }
- bVar3 = CheckRight((pTVar4->super_TCreature).ID,ZERO_CAPACITY);
- if (bVar3) {
- iVar9 = 0;
- }
- local_1c = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- uVar5 = iVar9 / 100 & 0xffff;
- if (iVar6 < local_1c + 0x3fff) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)uVar5;
- uVar7 = iVar6 + 1;
- uVar8 = iVar6 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar8 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar8 & 0xffffc000)) + 0x806) = (char)(uVar5 >> 8);
- iVar6 = iVar6 + 2;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar2 = (pTVar4->super_TCreature).super_TSkillBase.Skills[0];
- if (pTVar2 == (TSkill *)0x0) {
- if (local_1c + 0x3ffd <= iVar6) goto LAB_080d3425;
- uVar8 = iVar6 + 1;
- Connection->OutData[iVar6 % 0x4000] = '\0';
- uVar5 = iVar6 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) = 0;
- uVar8 = iVar6 + 2;
- uVar5 = iVar6 + 0x4001;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) = 0;
- uVar8 = iVar6 + 3;
- uVar5 = iVar6 + 0x4002;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) = 0;
-LAB_080d2f38:
- Connection->NextToWrite = iVar6 + 4;
- }
- else {
- iVar9 = pTVar2->Exp;
- if (iVar6 < local_1c + 0x3ffd) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)iVar9;
- uVar8 = iVar6 + 1;
- uVar5 = iVar6 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((uint)iVar9 >> 8);
- uVar8 = iVar6 + 2;
- uVar5 = iVar6 + 0x4001;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((uint)iVar9 >> 0x10);
- uVar8 = iVar6 + 3;
- uVar5 = iVar6 + 0x4002;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((uint)iVar9 >> 0x18);
- goto LAB_080d2f38;
- }
-LAB_080d3425:
- Connection->Overflow = true;
- }
- if (pTVar2 == (TSkill *)0x0) {
- iVar9 = Connection->NextToWrite;
- if (local_1c + 0x3fff <= iVar9) goto LAB_080d33c6;
- uVar8 = iVar9 + 1;
- Connection->OutData[iVar9 % 0x4000] = '\0';
- uVar5 = iVar9 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) = 0;
-LAB_080d2fb2:
- Connection->NextToWrite = iVar9 + 2;
- }
- else {
- uVar5 = TSkill::Get(pTVar2);
- local_1c = Connection->NextToSend;
- iVar9 = Connection->NextToWrite;
- if (iVar9 < local_1c + 0x3fff) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)(uVar5 & 0xffff);
- uVar7 = iVar9 + 1;
- uVar8 = iVar9 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar8 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar8 & 0xffffc000)) + 0x806) =
- (char)((uVar5 & 0xffff) >> 8);
- goto LAB_080d2fb2;
- }
-LAB_080d33c6:
- Connection->Overflow = true;
- }
- if (pTVar2 == (TSkill *)0x0) {
- iVar9 = Connection->NextToWrite;
- if (local_1c + 0x4000 <= iVar9) goto LAB_080d3383;
- Connection->OutData[iVar9 % 0x4000] = '\0';
-LAB_080d3009:
- Connection->NextToWrite = iVar9 + 1;
- }
- else {
- iVar6 = TSkill::GetProgress(pTVar2);
- local_1c = Connection->NextToSend;
- iVar9 = Connection->NextToWrite;
- if (iVar9 < local_1c + 0x4000) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)iVar6;
- goto LAB_080d3009;
- }
-LAB_080d3383:
- Connection->Overflow = true;
- }
- pTVar2 = (pTVar4->super_TCreature).super_TSkillBase.Skills[3];
- if (pTVar2 == (TSkill *)0x0) {
- iVar9 = Connection->NextToWrite;
- if (local_1c + 0x3fff <= iVar9) goto LAB_080d3321;
- uVar8 = iVar9 + 1;
- Connection->OutData[iVar9 % 0x4000] = '\0';
- uVar5 = iVar9 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) = 0;
-LAB_080d3086:
- iVar9 = iVar9 + 2;
- Connection->NextToWrite = iVar9;
- }
- else {
- uVar5 = TSkill::Get(pTVar2);
- local_1c = Connection->NextToSend;
- iVar9 = Connection->NextToWrite;
- if (iVar9 < local_1c + 0x3fff) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)(uVar5 & 0xffff);
- uVar7 = iVar9 + 1;
- uVar8 = iVar9 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar8 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar8 & 0xffffc000)) + 0x806) =
- (char)((uVar5 & 0xffff) >> 8);
- goto LAB_080d3086;
- }
-LAB_080d3321:
- Connection->Overflow = true;
- }
- if (pTVar2 == (TSkill *)0x0) {
- if (local_1c + 0x3fff <= iVar9) goto LAB_080d32c8;
- uVar8 = iVar9 + 1;
- Connection->OutData[iVar9 % 0x4000] = '\0';
- uVar5 = iVar9 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(undefined1 *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) = 0;
-LAB_080d30e8:
- Connection->NextToWrite = iVar9 + 2;
- }
- else {
- uVar1 = (undefined2)pTVar2->Max;
- if (iVar9 < local_1c + 0x3fff) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)uVar1;
- uVar8 = iVar9 + 1;
- uVar5 = iVar9 + 0x4000;
- if (-1 < (int)uVar8) {
- uVar5 = uVar8;
- }
- *(char *)((int)Connection + (uVar8 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar1 >> 8);
- goto LAB_080d30e8;
- }
-LAB_080d32c8:
- Connection->Overflow = true;
- }
- pTVar2 = (pTVar4->super_TCreature).super_TSkillBase.Skills[1];
- if (pTVar2 == (TSkill *)0x0) {
- iVar9 = Connection->NextToWrite;
- if (local_1c + 0x4000 <= iVar9) goto LAB_080d3286;
- Connection->OutData[iVar9 % 0x4000] = '\0';
-LAB_080d3143:
- Connection->NextToWrite = iVar9 + 1;
- }
- else {
- iVar6 = TSkill::Get(pTVar2);
- local_1c = Connection->NextToSend;
- iVar9 = Connection->NextToWrite;
- if (iVar9 < local_1c + 0x4000) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)iVar6;
- goto LAB_080d3143;
- }
-LAB_080d3286:
- Connection->Overflow = true;
- }
- if (pTVar2 == (TSkill *)0x0) {
- iVar9 = Connection->NextToWrite;
- if (local_1c + 0x4000 <= iVar9) goto LAB_080d3243;
- Connection->OutData[iVar9 % 0x4000] = '\0';
-LAB_080d319a:
- Connection->NextToWrite = iVar9 + 1;
- }
- else {
- iVar6 = TSkill::GetProgress(pTVar2);
- local_1c = Connection->NextToSend;
- iVar9 = Connection->NextToWrite;
- if (iVar9 < local_1c + 0x4000) {
- Connection->OutData[iVar9 % 0x4000] = (uchar)iVar6;
- goto LAB_080d319a;
- }
-LAB_080d3243:
- Connection->Overflow = true;
- }
- pTVar2 = (pTVar4->super_TCreature).super_TSkillBase.Skills[0x16];
- if (pTVar2 == (TSkill *)0x0) {
- iVar9 = Connection->NextToWrite;
- if (local_1c + 0x4000 <= iVar9) goto LAB_080d3201;
- Connection->OutData[iVar9 % 0x4000] = '\0';
- }
- else {
- iVar6 = TSkill::Get(pTVar2);
- iVar9 = Connection->NextToWrite;
- if (Connection->NextToSend + 0x4000 <= iVar9) {
-LAB_080d3201:
- Connection->Overflow = true;
- goto LAB_080d31f2;
- }
- Connection->OutData[iVar9 % 0x4000] = (uchar)iVar6;
- }
- Connection->NextToWrite = iVar9 + 1;
-LAB_080d31f2:
- FinishSendData(Connection);
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: pl
-
-void SendPlayerSkills(TConnection *Connection)
-
-{
- TSkill *pTVar1;
- bool bVar2;
- TPlayer *pTVar3;
- int iVar4;
- int iVar5;
- int iVar6;
- TSkill *sk;
- uchar local_18;
- TPlayer *pl;
-
- bVar2 = BeginSendData(Connection);
- if (!bVar2) {
- return;
- }
- iVar6 = Connection->NextToWrite;
- if (iVar6 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = 0xa1;
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar3 = TConnection::GetPlayer(Connection);
- if (pTVar3 == (TPlayer *)0x0) {
- error(&DAT_08109720);
- return;
- }
- pTVar1 = (pTVar3->super_TCreature).super_TSkillBase.Skills[0xb];
- if (pTVar1 == (TSkill *)0x0) {
- iVar5 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3e93;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d36d2:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::Get(pTVar1);
- iVar5 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar5 + 0x4000) {
- local_18 = (uchar)iVar4;
- Connection->OutData[iVar6 % 0x4000] = local_18;
- goto LAB_080d36d2;
- }
-LAB_080d3e93:
- Connection->Overflow = true;
- }
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3e52;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d3725:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::GetProgress(pTVar1);
- iVar6 = Connection->NextToWrite;
- iVar5 = Connection->NextToSend;
- if (iVar6 < iVar5 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)iVar4;
- goto LAB_080d3725;
- }
-LAB_080d3e52:
- Connection->Overflow = true;
- }
- pTVar1 = (pTVar3->super_TCreature).super_TSkillBase.Skills[9];
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3e13;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d3781:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::Get(pTVar1);
- iVar5 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar5 + 0x4000) {
- local_18 = (uchar)iVar4;
- Connection->OutData[iVar6 % 0x4000] = local_18;
- goto LAB_080d3781;
- }
-LAB_080d3e13:
- Connection->Overflow = true;
- }
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3dd2;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d37d4:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::GetProgress(pTVar1);
- iVar6 = Connection->NextToWrite;
- iVar5 = Connection->NextToSend;
- if (iVar6 < iVar5 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)iVar4;
- goto LAB_080d37d4;
- }
-LAB_080d3dd2:
- Connection->Overflow = true;
- }
- pTVar1 = (pTVar3->super_TCreature).super_TSkillBase.Skills[8];
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3d93;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d3830:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::Get(pTVar1);
- iVar5 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar5 + 0x4000) {
- local_18 = (uchar)iVar4;
- Connection->OutData[iVar6 % 0x4000] = local_18;
- goto LAB_080d3830;
- }
-LAB_080d3d93:
- Connection->Overflow = true;
- }
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3d52;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d3883:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::GetProgress(pTVar1);
- iVar6 = Connection->NextToWrite;
- iVar5 = Connection->NextToSend;
- if (iVar6 < iVar5 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)iVar4;
- goto LAB_080d3883;
- }
-LAB_080d3d52:
- Connection->Overflow = true;
- }
- pTVar1 = (pTVar3->super_TCreature).super_TSkillBase.Skills[10];
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3d13;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d38df:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::Get(pTVar1);
- iVar5 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar5 + 0x4000) {
- local_18 = (uchar)iVar4;
- Connection->OutData[iVar6 % 0x4000] = local_18;
- goto LAB_080d38df;
- }
-LAB_080d3d13:
- Connection->Overflow = true;
- }
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3cd2;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d3932:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::GetProgress(pTVar1);
- iVar6 = Connection->NextToWrite;
- iVar5 = Connection->NextToSend;
- if (iVar6 < iVar5 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)iVar4;
- goto LAB_080d3932;
- }
-LAB_080d3cd2:
- Connection->Overflow = true;
- }
- pTVar1 = (pTVar3->super_TCreature).super_TSkillBase.Skills[7];
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3c93;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d398e:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::Get(pTVar1);
- iVar5 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar5 + 0x4000) {
- local_18 = (uchar)iVar4;
- Connection->OutData[iVar6 % 0x4000] = local_18;
- goto LAB_080d398e;
- }
-LAB_080d3c93:
- Connection->Overflow = true;
- }
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3c52;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d39e1:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::GetProgress(pTVar1);
- iVar6 = Connection->NextToWrite;
- iVar5 = Connection->NextToSend;
- if (iVar6 < iVar5 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)iVar4;
- goto LAB_080d39e1;
- }
-LAB_080d3c52:
- Connection->Overflow = true;
- }
- pTVar1 = (pTVar3->super_TCreature).super_TSkillBase.Skills[6];
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3c13;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d3a3d:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::Get(pTVar1);
- iVar5 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar5 + 0x4000) {
- local_18 = (uchar)iVar4;
- Connection->OutData[iVar6 % 0x4000] = local_18;
- goto LAB_080d3a3d;
- }
-LAB_080d3c13:
- Connection->Overflow = true;
- }
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3bd2;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d3a90:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::GetProgress(pTVar1);
- iVar6 = Connection->NextToWrite;
- iVar5 = Connection->NextToSend;
- if (iVar6 < iVar5 + 0x4000) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)iVar4;
- goto LAB_080d3a90;
- }
-LAB_080d3bd2:
- Connection->Overflow = true;
- }
- pTVar1 = (pTVar3->super_TCreature).super_TSkillBase.Skills[0xd];
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3b91;
- Connection->OutData[iVar6 % 0x4000] = '\0';
-LAB_080d3aec:
- Connection->NextToWrite = iVar6 + 1;
- }
- else {
- iVar4 = TSkill::Get(pTVar1);
- iVar5 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar5 + 0x4000) {
- local_18 = (uchar)iVar4;
- Connection->OutData[iVar6 % 0x4000] = local_18;
- goto LAB_080d3aec;
- }
-LAB_080d3b91:
- Connection->Overflow = true;
- }
- if (pTVar1 == (TSkill *)0x0) {
- iVar6 = Connection->NextToWrite;
- if (iVar5 + 0x4000 <= iVar6) goto LAB_080d3b50;
- Connection->OutData[iVar6 % 0x4000] = '\0';
- }
- else {
- iVar5 = TSkill::GetProgress(pTVar1);
- iVar6 = Connection->NextToWrite;
- if (Connection->NextToSend + 0x4000 <= iVar6) {
-LAB_080d3b50:
- Connection->Overflow = true;
- goto LAB_080d3b3e;
- }
- Connection->OutData[iVar6 % 0x4000] = (uchar)iVar5;
- }
- Connection->NextToWrite = iVar6 + 1;
-LAB_080d3b3e:
- FinishSendData(Connection);
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: State_local
-
-void SendPlayerState(TConnection *Connection,uchar State)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
- uchar State_local;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0xa2;
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = State;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-void SendMessage(TConnection *Connection,int Mode,char *Text,...)
-
-{
- int iVar1;
- bool bVar2;
- size_t Length;
- uint uVar3;
- uint uVar4;
- int iVar5;
- int iVar6;
- char local_101c [4];
- char Buffer [4096];
-
- if (Mode - 0x12U < 6) {
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- vsnprintf(local_101c,0x1000,Text,&stack0x00000010);
- iVar1 = Connection->NextToSend;
- iVar6 = Connection->NextToWrite;
- if (iVar6 < iVar1 + 0x4000) {
- iVar5 = iVar6 % 0x4000;
- iVar6 = iVar6 + 1;
- Connection->OutData[iVar5] = 0xb4;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar6 < iVar1 + 0x4000) {
- iVar5 = iVar6 % 0x4000;
- iVar6 = iVar6 + 1;
- Connection->OutData[iVar5] = (uchar)Mode;
- Connection->NextToWrite = iVar6;
- }
- else {
- Connection->Overflow = true;
- }
- Length = strlen(local_101c);
- if (iVar6 < iVar1 + 0x3fff) {
- Connection->OutData[iVar6 % 0x4000] = (uchar)(Length & 0xffff);
- uVar4 = iVar6 + 1;
- uVar3 = iVar6 + 0x4000;
- if (-1 < (int)uVar4) {
- uVar3 = uVar4;
- }
- *(char *)((int)Connection + (uVar4 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- Connection->NextToWrite = iVar6 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,local_101c,Length);
- }
- FinishSendData(Connection);
- }
- }
- else {
- error(&DAT_08109760,Mode);
- }
- return;
-}
-
-
-
-void SendSnapback(TConnection *Connection)
-
-{
- int iVar1;
- bool bVar2;
- TPlayer *pl;
- TPlayer *pTVar3;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = 0xb5;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar3 = TConnection::GetPlayer(Connection);
- if (pTVar3 != (TPlayer *)0x0) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = (uchar)(pTVar3->super_TCreature).Direction;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Sender_local
-
-void SendTalk(TConnection *Connection,ulong StatementID,char *Sender,int Mode,char *Text,int Data)
-
-{
- bool bVar1;
- size_t sVar2;
- uint uVar3;
- int iVar4;
- uint uVar5;
- int local_28;
- uchar local_24;
- uchar local_1c;
- int Data_local;
- char *Text_local;
- char *Sender_local;
-
- if ((((Mode != 4) && (Mode != 7)) && (Mode != 8)) &&
- (((Mode != 6 && (Mode != 0xb)) && (Mode != 9)))) {
- error(&DAT_081097c0);
- return;
- }
- if (Sender == (char *)0x0) {
- Connection = (TConnection *)s_SendTalk______Sender_ist_NULL__081097a0;
- }
- else {
- if (Text != (char *)0x0) {
- bVar1 = BeginSendData(Connection);
- if (bVar1) {
- local_28 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_28 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = 0xaa;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < local_28 + 0x3ffd) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)StatementID;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(StatementID >> 8);
- uVar5 = iVar4 + 2;
- uVar3 = iVar4 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(StatementID >> 0x10);
- uVar5 = iVar4 + 3;
- uVar3 = iVar4 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(StatementID >> 0x18);
- Connection->NextToWrite = iVar4 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- if (Sender == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- local_28 = Connection->NextToSend;
- }
- else {
- sVar2 = strlen(Sender);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_28 + 0x3fff) {
- local_24 = (uchar)(sVar2 & 0xffff);
- Connection->OutData[iVar4 % 0x4000] = local_24;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- local_24 = (uchar)((sVar2 & 0xffff) >> 8);
- *(uchar *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- local_24;
- Connection->NextToWrite = iVar4 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)sVar2) {
- SendText(Connection,Sender,sVar2);
- local_28 = Connection->NextToSend;
- }
- }
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_28 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)Mode;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- if (Mode == 6) {
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_28 + 0x3ffd) {
- local_1c = (uchar)Data;
- uVar5 = iVar4 + 1;
- Connection->OutData[iVar4 % 0x4000] = local_1c;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- local_1c = (uchar)((uint)Data >> 8);
- *(uchar *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- local_1c;
- uVar5 = iVar4 + 2;
- uVar3 = iVar4 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- local_1c = (uchar)((uint)Data >> 0x10);
- *(uchar *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- local_1c;
- uVar5 = iVar4 + 3;
- uVar3 = iVar4 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- local_1c = (uchar)((uint)Data >> 0x18);
- Connection->NextToWrite = iVar4 + 4;
- *(uchar *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- local_1c;
- }
- else {
- Connection->Overflow = true;
- }
- }
- if (Text == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- }
- else {
- sVar2 = strlen(Text);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_28 + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)(sVar2 & 0xffff);
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((sVar2 & 0xffff) >> 8);
- Connection->NextToWrite = iVar4 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)sVar2) {
- SendText(Connection,Text,sVar2);
- }
- }
- FinishSendData(Connection);
- return;
- }
- return;
- }
- Connection = (TConnection *)s_SendTalk______Text_ist_NULL__08109deb;
- }
- error((char *)Connection);
- return;
-}
-
-
-
-// WARNING: Removing unreachable block (ram,0x080d4a56)
-// WARNING: Variable defined which should be unmapped: Sender_local
-
-void __regparm2
-SendTalk(TConnection *Connection,ulong StatementID,char *Sender,int Mode,int Channel,char *Text)
-
-{
- bool bVar1;
- size_t sVar2;
- uint uVar3;
- int iVar4;
- uint uVar5;
- int iVar6;
- undefined2 in_stack_00000014;
- char *in_stack_00000018;
- int local_2c;
- char local_28;
- char local_24;
- char *Text_local;
- int Channel_local;
- char *Sender_local;
-
- if ((((Text != (char *)0x5) && (Text != (char *)0xa)) && (Text != (char *)0xc)) &&
- (Text != (char *)0xe)) {
- error(&DAT_08109820);
- return;
- }
- if (Channel == 0) {
- Sender = "SendTalk (C): Sender ist NULL.\n";
- }
- else {
- if (in_stack_00000018 != (char *)0x0) {
- bVar1 = BeginSendData((TConnection *)Sender);
- if (!bVar1) {
- return;
- }
- local_2c = *(int *)(Sender + 0x4808);
- iVar4 = *(int *)(Sender + 0x4810);
- if (iVar4 < local_2c + 0x4000) {
- Sender[iVar4 % 0x4000 + 0x806] = -0x56;
- iVar4 = iVar4 + 1;
- *(int *)(Sender + 0x4810) = iVar4;
- }
- else {
- Sender[0x4814] = '\x01';
- }
- if (iVar4 < local_2c + 0x3ffd) {
- Sender[iVar4 % 0x4000 + 0x806] = (char)Mode;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- Sender[(uVar5 - (uVar3 & 0xffffc000)) + 0x806] = (char)((uint)Mode >> 8);
- uVar5 = iVar4 + 2;
- uVar3 = iVar4 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- Sender[(uVar5 - (uVar3 & 0xffffc000)) + 0x806] = (char)((uint)Mode >> 0x10);
- uVar5 = iVar4 + 3;
- uVar3 = iVar4 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- Sender[(uVar5 - (uVar3 & 0xffffc000)) + 0x806] = (char)((uint)Mode >> 0x18);
- *(int *)(Sender + 0x4810) = iVar4 + 4;
- }
- else {
- Sender[0x4814] = '\x01';
- }
- if (Text == (char *)0xe) {
- sVar2 = strlen("");
- iVar4 = *(int *)(Sender + 0x4810);
- if (iVar4 < local_2c + 0x3fff) {
- local_24 = (char)(sVar2 & 0xffff);
- Sender[iVar4 % 0x4000 + 0x806] = local_24;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- local_24 = (char)((sVar2 & 0xffff) >> 8);
- Sender[(uVar5 - (uVar3 & 0xffffc000)) + 0x806] = local_24;
- *(int *)(Sender + 0x4810) = iVar4 + 2;
- }
- else {
- Sender[0x4814] = '\x01';
- }
- if (0 < (int)sVar2) {
- SendText((TConnection *)Sender,"",sVar2);
- local_2c = *(int *)(Sender + 0x4808);
- }
- }
- else {
- if (Channel == 0) {
- error("SendString: String ist NULL.\n");
- }
- else {
- sVar2 = strlen((char *)Channel);
- iVar4 = *(int *)(Sender + 0x4810);
- if (iVar4 < local_2c + 0x3fff) {
- local_28 = (char)(sVar2 & 0xffff);
- Sender[iVar4 % 0x4000 + 0x806] = local_28;
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- local_28 = (char)((sVar2 & 0xffff) >> 8);
- Sender[(uVar5 - (uVar3 & 0xffffc000)) + 0x806] = local_28;
- *(int *)(Sender + 0x4810) = iVar4 + 2;
- }
- else {
- Sender[0x4814] = '\x01';
- }
- if ((int)sVar2 < 1) goto LAB_080d47d5;
- SendText((TConnection *)Sender,(char *)Channel,sVar2);
- }
- local_2c = *(int *)(Sender + 0x4808);
- }
-LAB_080d47d5:
- iVar4 = *(int *)(Sender + 0x4810);
- if (iVar4 < local_2c + 0x4000) {
- iVar6 = iVar4 % 0x4000;
- iVar4 = iVar4 + 1;
- Sender[iVar6 + 0x806] = (char)Text;
- *(int *)(Sender + 0x4810) = iVar4;
- }
- else {
- Sender[0x4814] = '\x01';
- }
- if (iVar4 < local_2c + 0x3fff) {
- uVar5 = iVar4 + 1;
- Sender[iVar4 % 0x4000 + 0x806] = (char)in_stack_00000014;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- Sender[(uVar5 - (uVar3 & 0xffffc000)) + 0x806] =
- (char)((ushort)in_stack_00000014 >> 8);
- *(int *)(Sender + 0x4810) = iVar4 + 2;
- }
- else {
- Sender[0x4814] = '\x01';
- }
- if (in_stack_00000018 == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- }
- else {
- sVar2 = strlen(in_stack_00000018);
- iVar4 = *(int *)(Sender + 0x4810);
- if (iVar4 < local_2c + 0x3fff) {
- Sender[iVar4 % 0x4000 + 0x806] = (char)(sVar2 & 0xffff);
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- Sender[(uVar5 - (uVar3 & 0xffffc000)) + 0x806] = (char)((sVar2 & 0xffff) >> 8);
- *(int *)(Sender + 0x4810) = iVar4 + 2;
- }
- else {
- Sender[0x4814] = '\x01';
- }
- if (0 < (int)sVar2) {
- SendText((TConnection *)Sender,in_stack_00000018,sVar2);
- }
- }
- FinishSendData((TConnection *)Sender);
- return;
- }
- Sender = "SendTalk (C): Text ist NULL.\n";
- }
- error(Sender);
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Sender_local
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void SendTalk(TConnection *Connection,ulong StatementID,char *Sender,int Mode,int x,int y,int z,
- char *Text)
-
-{
- bool bVar1;
- size_t sVar2;
- uint uVar3;
- int iVar4;
- uint uVar5;
- int local_30;
- char *Text_local;
- int z_local;
- int y_local;
- int x_local;
- int Mode_local;
- char *Sender_local;
-
- if (((2 < Mode - 1U) && (Mode != 0x10)) && (Mode != 0x11)) {
- error(&DAT_08109880);
- return;
- }
- if (Sender == (char *)0x0) {
- Connection = (TConnection *)s_SendTalk__K___Sender_ist_NULL__08109860;
- }
- else {
- if (Text != (char *)0x0) {
- bVar1 = BeginSendData(Connection);
- if (bVar1) {
- local_30 = Connection->NextToSend;
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_30 + 0x4000) {
- Connection->OutData[iVar4 % 0x4000] = 0xaa;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < local_30 + 0x3ffd) {
- uVar5 = iVar4 + 1;
- Connection->OutData[iVar4 % 0x4000] = (uchar)StatementID;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(StatementID >> 8);
- uVar5 = iVar4 + 2;
- uVar3 = iVar4 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(StatementID >> 0x10);
- uVar5 = iVar4 + 3;
- uVar3 = iVar4 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(StatementID >> 0x18);
- Connection->NextToWrite = iVar4 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- if (Sender == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- local_30 = Connection->NextToSend;
- }
- else {
- sVar2 = strlen(Sender);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_30 + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)(sVar2 & 0xffff);
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((sVar2 & 0xffff) >> 8);
- Connection->NextToWrite = iVar4 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)sVar2) {
- SendText(Connection,Sender,sVar2);
- local_30 = Connection->NextToSend;
- }
- }
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_30 + 0x4000) {
- x_local._0_1_ = (uchar)Mode;
- Connection->OutData[iVar4 % 0x4000] = (uchar)x_local;
- iVar4 = iVar4 + 1;
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < local_30 + 0x3fff) {
- uVar5 = iVar4 + 1;
- Connection->OutData[iVar4 % 0x4000] = (uchar)x;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- iVar4 = iVar4 + 2;
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((uint)x >> 8);
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < local_30 + 0x3fff) {
- uVar5 = iVar4 + 1;
- Connection->OutData[iVar4 % 0x4000] = (uchar)y;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- iVar4 = iVar4 + 2;
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((uint)y >> 8);
- Connection->NextToWrite = iVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar4 < local_30 + 0x4000) {
- Text_local._0_1_ = (uchar)z;
- Connection->OutData[iVar4 % 0x4000] = (uchar)Text_local;
- Connection->NextToWrite = iVar4 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- if (Text == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- }
- else {
- sVar2 = strlen(Text);
- iVar4 = Connection->NextToWrite;
- if (iVar4 < local_30 + 0x3fff) {
- Connection->OutData[iVar4 % 0x4000] = (uchar)(sVar2 & 0xffff);
- uVar5 = iVar4 + 1;
- uVar3 = iVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)((sVar2 & 0xffff) >> 8);
- Connection->NextToWrite = iVar4 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)sVar2) {
- SendText(Connection,Text,sVar2);
- }
- }
- FinishSendData(Connection);
- return;
- }
- return;
- }
- Connection = (TConnection *)s_SendTalk__K___Text_ist_NULL__08109e27;
- }
- error((char *)Connection);
- return;
-}
-
-
-
-// WARNING: Removing unreachable block (ram,0x080d5313)
-// WARNING: Variable defined which should be unmapped: pl
-
-void SendChannels(TConnection *Connection)
-
-{
- int iVar1;
- int iVar2;
- ulong uVar3;
- uint uVar4;
- bool bVar5;
- size_t sVar6;
- uint uVar7;
- int i;
- int iVar8;
- uchar uVar9;
- uchar uVar10;
- int Count;
- uint uVar11;
- uint uVar12;
- int i_1;
- uint uVar13;
- ulong uStack_50;
- size_t sStack_44;
- undefined1 auStack_40 [12];
- uint local_34;
- char *local_28;
- undefined1 *local_24;
- bool_0_ *Available;
- int local_1c;
- int Channels;
- TPlayer *pTStack_14;
- bool OwnChannel;
- TPlayer *pl;
-
- Available = &stack0xffffffb4;
- uStack_50 = 0x80d5017;
- bVar5 = BeginSendData(Connection);
- if (bVar5) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = 0xab;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- uStack_50 = 0x80d504d;
- pTStack_14 = TConnection::GetPlayer(Connection);
- if (pTStack_14 != (TPlayer *)0x0) {
- uVar9 = '\0';
- iVar8 = 0;
- uStack_50 = 0x80d506a;
- Channels._3_1_ = MayOpenChannel((pTStack_14->super_TCreature).ID);
- uStack_50 = 0x80d5072;
- local_1c = GetNumberOfChannels();
- iVar1 = -(local_1c + 0xfU & 0xfffffff0);
- local_24 = auStack_40 + iVar1;
- uVar10 = '\0';
- if (0 < local_1c) {
- do {
- uVar3 = (pTStack_14->super_TCreature).ID;
- *(int *)(&stack0xffffffb4 + iVar1) = iVar8;
- *(ulong *)(&stack0xffffffb8 + iVar1) = uVar3;
- *(undefined4 *)((int)&uStack_50 + iVar1) = 0x80d53bb;
- bVar5 = ChannelAvailable(*(int *)(&stack0xffffffb4 + iVar1),
- *(ulong *)(&stack0xffffffb8 + iVar1));
- uVar9 = uVar10;
- if (bVar5) {
- uVar9 = uVar10 + '\x01';
- }
- local_24[iVar8] = bVar5;
- iVar8 = iVar8 + 1;
- uVar10 = uVar9;
- } while (iVar8 < local_1c);
- }
- if (Channels._3_1_ != '\0') {
- uVar9 = uVar9 + '\x01';
- }
- iVar8 = Connection->NextToSend;
- iVar2 = Connection->NextToWrite;
- if (iVar2 < iVar8 + 0x4000) {
- Connection->OutData[iVar2 % 0x4000] = uVar9;
- Connection->NextToWrite = iVar2 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- if (Channels._3_1_ != '\0') {
- iVar2 = Connection->NextToWrite;
- if (iVar2 < iVar8 + 0x3fff) {
- uVar11 = iVar2 + 1;
- uVar13 = iVar2 + 0x4000;
- if (-1 < (int)uVar11) {
- uVar13 = uVar11;
- }
- Connection->OutData[iVar2 % 0x4000] = 0xff;
- *(undefined1 *)((int)Connection + (uVar11 - (uVar13 & 0xffffc000)) + 0x806) =
- 0xff;
- Connection->NextToWrite = iVar2 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- *(char **)(&stack0xffffffb4 + iVar1) = "Private Chat Channel";
- *(undefined4 *)((int)&uStack_50 + iVar1) = 0x80d50f8;
- sVar6 = strlen(*(char **)(&stack0xffffffb4 + iVar1));
- iVar8 = Connection->NextToWrite;
- if (iVar8 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar8 % 0x4000] = (uchar)(sVar6 & 0xffff);
- uVar11 = iVar8 + 1;
- uVar13 = iVar8 + 0x4000;
- if (-1 < (int)uVar11) {
- uVar13 = uVar11;
- }
- *(char *)((int)Connection + (uVar11 - (uVar13 & 0xffffc000)) + 0x806) =
- (char)((sVar6 & 0xffff) >> 8);
- Connection->NextToWrite = iVar8 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)sVar6) {
- *(size_t *)((int)&sStack_44 + iVar1) = sVar6;
- *(char **)(&stack0xffffffb8 + iVar1) = "Private Chat Channel";
- *(TConnection **)(&stack0xffffffb4 + iVar1) = Connection;
- *(undefined4 *)((int)&uStack_50 + iVar1) = 0x80d513b;
- SendText(*(TConnection **)(&stack0xffffffb4 + iVar1),
- *(char **)(&stack0xffffffb8 + iVar1),*(int *)((int)&sStack_44 + iVar1))
- ;
- }
- }
- if (0 < local_1c) {
- uVar13 = 0;
- do {
- if (local_24[uVar13] != '\0') {
- iVar8 = Connection->NextToWrite;
- if (iVar8 < Connection->NextToSend + 0x3fff) {
- uVar7 = iVar8 + 1;
- Connection->OutData[iVar8 % 0x4000] = (uchar)(uVar13 & 0xffff);
- uVar11 = iVar8 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar11 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar11 & 0xffffc000)) + 0x806) =
- (char)((uVar13 & 0xffff) >> 8);
- Connection->NextToWrite = iVar8 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- uVar3 = (pTStack_14->super_TCreature).ID;
- *(uint *)(&stack0xffffffb4 + iVar1) = uVar13;
- *(ulong *)(&stack0xffffffb8 + iVar1) = uVar3;
- *(undefined4 *)((int)&uStack_50 + iVar1) = 0x80d5198;
- local_28 = GetChannelName(*(int *)(&stack0xffffffb4 + iVar1),
- *(ulong *)(&stack0xffffffb8 + iVar1));
- if (local_28 == (char *)0x0) {
- *(char **)(&stack0xffffffb4 + iVar1) = "SendString: String ist NULL.\n";
- *(undefined4 *)((int)&uStack_50 + iVar1) = 0x80d5270;
- error(*(char **)(&stack0xffffffb4 + iVar1));
- }
- else {
- *(char **)(&stack0xffffffb4 + iVar1) = local_28;
- *(undefined4 *)((int)&uStack_50 + iVar1) = 0x80d51ae;
- sVar6 = strlen(*(char **)(&stack0xffffffb4 + iVar1));
- uVar11 = sVar6 & 0xffff;
- local_34 = uVar11;
- iVar8 = Connection->NextToWrite;
- if (iVar8 < Connection->NextToSend + 0x3fff) {
- local_34._0_1_ = (uchar)uVar11;
- Connection->OutData[iVar8 % 0x4000] = (uchar)local_34;
- uVar12 = iVar8 + 1;
- uVar7 = iVar8 + 0x4000;
- if (-1 < (int)uVar12) {
- uVar7 = uVar12;
- }
- local_34 = uVar11 >> 8;
- uVar4 = local_34;
- local_34._0_1_ = (uchar)(uVar11 >> 8);
- *(uchar *)((int)Connection + (uVar12 - (uVar7 & 0xffffc000)) + 0x806
- ) = (uchar)local_34;
- Connection->NextToWrite = iVar8 + 2;
- local_34 = uVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)sVar6) {
- *(size_t *)((int)&sStack_44 + iVar1) = sVar6;
- *(char **)(&stack0xffffffb8 + iVar1) = local_28;
- *(TConnection **)(&stack0xffffffb4 + iVar1) = Connection;
- *(undefined4 *)((int)&uStack_50 + iVar1) = 0x80d51ef;
- SendText(*(TConnection **)(&stack0xffffffb4 + iVar1),
- *(char **)(&stack0xffffffb8 + iVar1),
- *(int *)((int)&sStack_44 + iVar1));
- }
- }
- }
- uVar13 = uVar13 + 1;
- } while ((int)uVar13 < local_1c);
- }
- *(TConnection **)(&stack0xffffffb4 + iVar1) = Connection;
- *(undefined4 *)((int)&uStack_50 + iVar1) = 0x80d5204;
- FinishSendData(*(TConnection **)(&stack0xffffffb4 + iVar1));
- }
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: pl
-
-void SendOpenChannel(TConnection *Connection,int Channel)
-
-{
- bool bVar1;
- TPlayer *pTVar2;
- int iVar3;
- char *__s;
- size_t Length;
- uint uVar4;
- uint uVar5;
- TPlayer *pl;
-
- bVar1 = BeginSendData(Connection);
- if (bVar1) {
- if (Channel == 3) {
- error("SendOpenChannel: Kanal ist GM-Request-Queue.\n");
- return;
- }
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0xac;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar2 = TConnection::GetPlayer(Connection);
- if (pTVar2 != (TPlayer *)0x0) {
- if ((-1 < Channel) && (iVar3 = GetNumberOfChannels(), Channel < iVar3)) {
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)(Channel & 0xffffU);
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Channel & 0xffffU) >> 8);
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- __s = GetChannelName(Channel,(pTVar2->super_TCreature).ID);
- if (__s == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- }
- else {
- Length = strlen(__s);
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)(Length & 0xffff);
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,__s,Length);
- }
- }
- FinishSendData(Connection);
- return;
- }
- error(&DAT_081098a0);
- return;
- }
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Name_local
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void SendPrivateChannel(TConnection *Connection,char *Name)
-
-{
- int iVar1;
- int iVar2;
- bool bVar3;
- size_t Length;
- uint uVar4;
- uint uVar5;
- char *Name_local;
-
- bVar3 = BeginSendData(Connection);
- if (!bVar3) {
- return;
- }
- iVar1 = Connection->NextToSend;
- iVar2 = Connection->NextToWrite;
- if (iVar2 < iVar1 + 0x4000) {
- Connection->OutData[iVar2 % 0x4000] = 0xad;
- Connection->NextToWrite = iVar2 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- if (Name != (char *)0x0) {
- Length = strlen(Name);
- iVar2 = Connection->NextToWrite;
- if (iVar2 < iVar1 + 0x3fff) {
- Connection->OutData[iVar2 % 0x4000] = (uchar)(Length & 0xffff);
- uVar5 = iVar2 + 1;
- uVar4 = iVar2 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- Connection->NextToWrite = iVar2 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,Name,Length);
- }
- FinishSendData(Connection);
- return;
- }
- error("SendPrivateChannel: Name ist NULL.\n");
- return;
-}
-
-
-
-void SendOpenRequestQueue(TConnection *Connection)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
- uint uVar4;
- uint uVar5;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0xae;
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x3fff) {
- uVar5 = iVar3 + 1;
- Connection->OutData[iVar3 % 0x4000] = '\x03';
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(undefined1 *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) = 0;
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Name_local
-
-void __regparm2 SendDeleteRequest(TConnection *Connection,char *Name)
-
-{
- int iVar1;
- int iVar2;
- bool bVar3;
- size_t Length;
- uint uVar4;
- uint uVar5;
- TConnection *in_stack_00000004;
- char *in_stack_00000008;
- char *Name_local;
-
- bVar3 = BeginSendData(in_stack_00000004);
- if (!bVar3) {
- return;
- }
- iVar1 = in_stack_00000004->NextToSend;
- iVar2 = in_stack_00000004->NextToWrite;
- if (iVar2 < iVar1 + 0x4000) {
- in_stack_00000004->OutData[iVar2 % 0x4000] = 0xaf;
- in_stack_00000004->NextToWrite = iVar2 + 1;
- }
- else {
- in_stack_00000004->Overflow = true;
- }
- if (in_stack_00000008 != (char *)0x0) {
- Length = strlen(in_stack_00000008);
- iVar2 = in_stack_00000004->NextToWrite;
- if (iVar2 < iVar1 + 0x3fff) {
- in_stack_00000004->OutData[iVar2 % 0x4000] = (uchar)(Length & 0xffff);
- uVar5 = iVar2 + 1;
- uVar4 = iVar2 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)in_stack_00000004 + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- in_stack_00000004->NextToWrite = iVar2 + 2;
- }
- else {
- in_stack_00000004->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(in_stack_00000004,in_stack_00000008,Length);
- }
- FinishSendData(in_stack_00000004);
- return;
- }
- error("SendDeleteRequest: Name ist NULL.\n");
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Name_local
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void SendFinishRequest(TConnection *Connection,char *Name)
-
-{
- int iVar1;
- int iVar2;
- bool bVar3;
- size_t Length;
- uint uVar4;
- uint uVar5;
- char *Name_local;
-
- bVar3 = BeginSendData(Connection);
- if (!bVar3) {
- return;
- }
- iVar1 = Connection->NextToSend;
- iVar2 = Connection->NextToWrite;
- if (iVar2 < iVar1 + 0x4000) {
- Connection->OutData[iVar2 % 0x4000] = 0xb0;
- Connection->NextToWrite = iVar2 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- if (Name != (char *)0x0) {
- Length = strlen(Name);
- iVar2 = Connection->NextToWrite;
- if (iVar2 < iVar1 + 0x3fff) {
- Connection->OutData[iVar2 % 0x4000] = (uchar)(Length & 0xffff);
- uVar5 = iVar2 + 1;
- uVar4 = iVar2 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- Connection->NextToWrite = iVar2 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,Name,Length);
- }
- FinishSendData(Connection);
- return;
- }
- error("SendFinishRequest: Name ist NULL.\n");
- return;
-}
-
-
-
-void SendCloseRequest(TConnection *Connection)
-
-{
- int iVar1;
- bool bVar2;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToWrite;
- if (iVar1 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar1 % 0x4000] = 0xb1;
- Connection->NextToWrite = iVar1 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: pl
-
-void SendOpenOwnChannel(TConnection *Connection,int Channel)
-
-{
- bool bVar1;
- TPlayer *pTVar2;
- int iVar3;
- char *__s;
- size_t Length;
- uint uVar4;
- uint uVar5;
- TPlayer *pl;
-
- bVar1 = BeginSendData(Connection);
- if (bVar1) {
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0xb2;
- Connection->NextToWrite = iVar3 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar2 = TConnection::GetPlayer(Connection);
- if (pTVar2 != (TPlayer *)0x0) {
- if ((-1 < Channel) && (iVar3 = GetNumberOfChannels(), Channel < iVar3)) {
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)(Channel & 0xffffU);
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Channel & 0xffffU) >> 8);
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- __s = GetChannelName(Channel,(pTVar2->super_TCreature).ID);
- if (__s == (char *)0x0) {
- error("SendString: String ist NULL.\n");
- }
- else {
- Length = strlen(__s);
- iVar3 = Connection->NextToWrite;
- if (iVar3 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar3 % 0x4000] = (uchar)(Length & 0xffff);
- uVar5 = iVar3 + 1;
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Length & 0xffff) >> 8);
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- if (0 < (int)Length) {
- SendText(Connection,__s,Length);
- }
- }
- FinishSendData(Connection);
- return;
- }
- error(&DAT_081099e0);
- return;
- }
- }
- return;
-}
-
-
-
-void SendCloseChannel(TConnection *Connection,int Channel)
-
-{
- int iVar1;
- bool bVar2;
- int iVar3;
- uint uVar4;
- uint uVar5;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- iVar3 = Connection->NextToWrite;
- if (iVar3 < iVar1 + 0x4000) {
- Connection->OutData[iVar3 % 0x4000] = 0xb3;
- iVar3 = iVar3 + 1;
- Connection->NextToWrite = iVar3;
- }
- else {
- Connection->Overflow = true;
- }
- if (iVar3 < iVar1 + 0x3fff) {
- uVar5 = iVar3 + 1;
- Connection->OutData[iVar3 % 0x4000] = (uchar)(Channel & 0xffffU);
- uVar4 = iVar3 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar4 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar4 & 0xffffc000)) + 0x806) =
- (char)((Channel & 0xffffU) >> 8);
- Connection->NextToWrite = iVar3 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-void SendOutfit(TConnection *Connection)
-
-{
- undefined2 uVar1;
- int iVar2;
- bool bVar3;
- TPlayer *pTVar4;
- uint uVar5;
- short sVar6;
- TPlayer *pl;
- uint uVar7;
-
- bVar3 = BeginSendData(Connection);
- if (bVar3) {
- iVar2 = Connection->NextToWrite;
- if (iVar2 < Connection->NextToSend + 0x4000) {
- Connection->OutData[iVar2 % 0x4000] = 200;
- Connection->NextToWrite = iVar2 + 1;
- }
- else {
- Connection->Overflow = true;
- }
- pTVar4 = TConnection::GetPlayer(Connection);
- if (pTVar4 != (TPlayer *)0x0) {
- uVar1 = (undefined2)(pTVar4->super_TCreature).OrgOutfit.OutfitID;
- iVar2 = Connection->NextToWrite;
- if (iVar2 < Connection->NextToSend + 0x3fff) {
- Connection->OutData[iVar2 % 0x4000] = (uchar)uVar1;
- uVar7 = iVar2 + 1;
- uVar5 = iVar2 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)uVar1 >> 8);
- Connection->NextToWrite = iVar2 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- SendText(Connection,(char *)(pTVar4->super_TCreature).OrgOutfit.field_1.Colors,4);
- if ((pTVar4->super_TCreature).Sex == 1) {
- iVar2 = Connection->NextToWrite;
- if (iVar2 < Connection->NextToSend + 0x3fff) {
- uVar7 = iVar2 + 1;
- Connection->OutData[iVar2 % 0x4000] = 0x80;
- uVar5 = iVar2 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(undefined1 *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) = 0;
- Connection->NextToWrite = iVar2 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- bVar3 = CheckRight((pTVar4->super_TCreature).ID,PREMIUM_ACCOUNT);
- sVar6 = (ushort)bVar3 * 3 + 0x83;
- }
- else {
- iVar2 = Connection->NextToWrite;
- if (iVar2 < Connection->NextToSend + 0x3fff) {
- uVar7 = iVar2 + 1;
- Connection->OutData[iVar2 % 0x4000] = 0x88;
- uVar5 = iVar2 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(undefined1 *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) = 0;
- Connection->NextToWrite = iVar2 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- bVar3 = CheckRight((pTVar4->super_TCreature).ID,PREMIUM_ACCOUNT);
- sVar6 = (ushort)bVar3 * 3 + 0x8b;
- }
- iVar2 = Connection->NextToWrite;
- if (iVar2 < Connection->NextToSend + 0x3fff) {
- uVar7 = iVar2 + 1;
- Connection->OutData[iVar2 % 0x4000] = (uchar)sVar6;
- uVar5 = iVar2 + 0x4000;
- if (-1 < (int)uVar7) {
- uVar5 = uVar7;
- }
- *(char *)((int)Connection + (uVar7 - (uVar5 & 0xffffc000)) + 0x806) =
- (char)((ushort)sVar6 >> 8);
- Connection->NextToWrite = iVar2 + 2;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Name_local
-
-void __regparm2 SendBuddyData(TConnection *Connection,ulong CharacterID,char *Name,bool Online)
-
-{
- bool bVar1;
- size_t Length;
- uint uVar2;
- int iVar3;
- uint uVar4;
- undefined3 in_stack_00000009;
- char *in_stack_0000000c;
- char in_stack_00000010;
- int local_20;
- bool Online_local;
- char *Name_local;
-
- bVar1 = BeginSendData((TConnection *)Name);
- if (bVar1) {
- local_20 = *(int *)(Name + 0x4808);
- iVar3 = *(int *)(Name + 0x4810);
- if (iVar3 < local_20 + 0x4000) {
- Name[iVar3 % 0x4000 + 0x806] = -0x2e;
- iVar3 = iVar3 + 1;
- *(int *)(Name + 0x4810) = iVar3;
- }
- else {
- Name[0x4814] = '\x01';
- }
- if (iVar3 < local_20 + 0x3ffd) {
- uVar4 = iVar3 + 1;
- Name[iVar3 % 0x4000 + 0x806] = Online;
- uVar2 = iVar3 + 0x4000;
- if (-1 < (int)uVar4) {
- uVar2 = uVar4;
- }
- Name[(uVar4 - (uVar2 & 0xffffc000)) + 0x806] = (char)in_stack_00000009;
- uVar4 = iVar3 + 2;
- uVar2 = iVar3 + 0x4001;
- if (-1 < (int)uVar4) {
- uVar2 = uVar4;
- }
- Name[(uVar4 - (uVar2 & 0xffffc000)) + 0x806] = (char)((uint3)in_stack_00000009 >> 8);
- uVar4 = iVar3 + 3;
- uVar2 = iVar3 + 0x4002;
- if (-1 < (int)uVar4) {
- uVar2 = uVar4;
- }
- Name[(uVar4 - (uVar2 & 0xffffc000)) + 0x806] = (char)((uint3)in_stack_00000009 >> 0x10);
- *(int *)(Name + 0x4810) = iVar3 + 4;
- }
- else {
- Name[0x4814] = '\x01';
- }
- if (in_stack_0000000c != (char *)0x0) {
- Length = strlen(in_stack_0000000c);
- iVar3 = *(int *)(Name + 0x4810);
- if (iVar3 < local_20 + 0x3fff) {
- Name[iVar3 % 0x4000 + 0x806] = (char)(Length & 0xffff);
- uVar4 = iVar3 + 1;
- uVar2 = iVar3 + 0x4000;
- if (-1 < (int)uVar4) {
- uVar2 = uVar4;
- }
- Name[(uVar4 - (uVar2 & 0xffffc000)) + 0x806] = (char)((Length & 0xffff) >> 8);
- *(int *)(Name + 0x4810) = iVar3 + 2;
- }
- else {
- Name[0x4814] = '\x01';
- }
- if (0 < (int)Length) {
- SendText((TConnection *)Name,in_stack_0000000c,Length);
- local_20 = *(int *)(Name + 0x4808);
- }
- iVar3 = *(int *)(Name + 0x4810);
- if (iVar3 < local_20 + 0x4000) {
- Name[iVar3 % 0x4000 + 0x806] = in_stack_00000010 != '\0';
- *(int *)(Name + 0x4810) = iVar3 + 1;
- }
- else {
- Name[0x4814] = '\x01';
- }
- FinishSendData((TConnection *)Name);
- return;
- }
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Online_local
-
-void SendBuddyStatus(TConnection *Connection,ulong CharacterID,bool Online)
-
-{
- int iVar1;
- bool bVar2;
- uint uVar3;
- uint uVar4;
- uint uVar5;
- bool Online_local;
-
- bVar2 = BeginSendData(Connection);
- if (bVar2) {
- iVar1 = Connection->NextToSend;
- uVar4 = Connection->NextToWrite;
- if ((int)uVar4 < iVar1 + 0x4000) {
- uVar3 = uVar4 + 0x3fff;
- if (-1 < (int)uVar4) {
- uVar3 = uVar4;
- }
- *(char *)((int)Connection + (uVar4 - (uVar3 & 0xffffc000)) + 0x806) = !Online + -0x2d;
- uVar4 = uVar4 + 1;
- Connection->NextToWrite = uVar4;
- }
- else {
- Connection->Overflow = true;
- }
- if ((int)uVar4 < iVar1 + 0x3ffd) {
- uVar5 = uVar4 + 1;
- Connection->OutData[(int)uVar4 % 0x4000] = (uchar)CharacterID;
- uVar3 = uVar4 + 0x4000;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(CharacterID >> 8);
- uVar5 = uVar4 + 2;
- uVar3 = uVar4 + 0x4001;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(CharacterID >> 0x10);
- uVar5 = uVar4 + 3;
- uVar3 = uVar4 + 0x4002;
- if (-1 < (int)uVar5) {
- uVar3 = uVar5;
- }
- *(char *)((int)Connection + (uVar5 - (uVar3 & 0xffffc000)) + 0x806) =
- (char)(CharacterID >> 0x18);
- Connection->NextToWrite = uVar4 + 4;
- }
- else {
- Connection->Overflow = true;
- }
- FinishSendData(Connection);
- return;
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Message
-
-void BroadcastMessage(int Mode,char *Text,...)
-
-{
- TConnection *Connection_00;
- TConnection *Connection;
- char local_40c [4];
- char Message [1024];
-
- vsnprintf(local_40c,0x400,Text,&stack0x0000000c);
- Connection_00 = GetFirstConnection();
- while (Connection_00 != (TConnection *)0x0) {
- if (Connection_00->State - CONNECTION_LOGIN < 4) {
- SendMessage(Connection_00,Mode,local_40c);
- }
- Connection_00 = GetNextConnection();
- }
- return;
-}
-
-
-
-void DeleteGamemasterRequest(char *Name)
-
-{
- bool bVar1;
- TPlayer *pl;
- TConnection *this;
- TPlayer *pTVar2;
- undefined3 extraout_var;
- char *Name_00;
- TConnection *Connection;
-
- if (Name != (char *)0x0) {
- this = GetFirstConnection();
- while (this != (TConnection *)0x0) {
- if ((this->State - CONNECTION_LOGIN < 4) &&
- (pTVar2 = TConnection::GetPlayer(this), pTVar2 != (TPlayer *)0x0)) {
- bVar1 = ChannelSubscribed(3,(pTVar2->super_TCreature).ID);
- if (bVar1) {
- SendDeleteRequest((TConnection *)CONCAT31(extraout_var,bVar1),Name_00);
- }
- }
- this = GetNextConnection();
- }
- return;
- }
- error("DeleteGamemasterRequest: Name ist NULL.\n");
- return;
-}
-
-
-
// WARNING: Unknown calling convention -- yet parameter storage is locked
void _GLOBAL__I__Z13BeginSendDataP11TConnection(void)