aboutsummaryrefslogtreecommitdiff
path: root/reference
diff options
context:
space:
mode:
Diffstat (limited to 'reference')
-rw-r--r--reference/enums.hh378
-rw-r--r--reference/game.c1747
-rw-r--r--reference/types.hh377
3 files changed, 1 insertions, 2501 deletions
diff --git a/reference/enums.hh b/reference/enums.hh
index 9e999c4..254781e 100644
--- a/reference/enums.hh
+++ b/reference/enums.hh
@@ -1,47 +1,4 @@
-enum CreatureType: int {
- PLAYER=0,
- MONSTER=1,
- NPC=2
-};
-
-enum CONNECTIONSTATE: int {
- CONNECTION_FREE=0,
- CONNECTION_ASSIGNED=1,
- CONNECTION_CONNECTED=2,
- CONNECTION_LOGIN=3,
- CONNECTION_GAME=4,
- CONNECTION_DEAD=5,
- CONNECTION_LOGOUT=6,
- CONNECTION_DISCONNECTED=7
-};
-
-enum KNOWNCREATURESTATE: int {
- KNOWNCREATURE_FREE=0,
- KNOWNCREATURE_UPTODATE=1,
- KNOWNCREATURE_OUTDATED=2
-};
-
-enum ToDoType: int {
- TDWait=0,
- TDGo=1,
- TDRotate=2,
- TDMove=3,
- TDTrade=4,
- TDUse=5,
- TDTurn=6,
- TDAttack=7,
- TDTalk=8,
- TDChangeState=9
-};
-
-enum GAMESTATE: int {
- GAME_STARTING=0,
- GAME_RUNNING=1,
- GAME_CLOSING=2,
- GAME_ENDING=3
-};
-
enum STATE: int {
SLEEPING=0,
IDLE=1,
@@ -52,90 +9,6 @@ enum STATE: int {
PANIC=6
};
-enum SpellShapeType: int {
- SHAPE_ACTOR=0,
- SHAPE_VICTIM=1,
- SHAPE_ORIGIN=2,
- SHAPE_DESTINATION=3,
- SHAPE_ANGLE=4
-};
-
-enum SpellImpactType: int {
- IMPACT_DAMAGE=0,
- IMPACT_FIELD=1,
- IMPACT_HEALING=2,
- IMPACT_SPEED=3,
- IMPACT_DRUNKEN=4,
- IMPACT_STRENGTH=5,
- IMPACT_OUTFIT=6,
- IMPACT_SUMMON=7
-};
-
-enum RESULT: int {
- ERROR=-1,
- NOERROR=0,
- NOTACCESSIBLE=1,
- NOTMOVABLE=2,
- NOTTAKABLE=3,
- NOROOM=4,
- OUTOFRANGE=5,
- OUTOFHOME=6,
- CANNOTTHROW=7,
- TOOHEAVY=8,
- CROSSREFERENCE=9,
- CONTAINERFULL=10,
- WRONGPOSITION=11,
- WRONGPOSITION2=12,
- WRONGCLOTHES=13,
- HANDSNOTFREE=14,
- HANDBLOCKED=15,
- ONEWEAPONONLY=16,
- NOMATCH=17,
- NOTCUMULABLE=18,
- TOOMANYPARTS=19,
- EMPTYCONTAINER=20,
- SPLITOBJECT=21,
- NOKEYMATCH=22,
- UPSTAIRS=23,
- DOWNSTAIRS=24,
- CREATURENOTEXISTING=25,
- PLAYERNOTEXISTING=26,
- PLAYERNOTONLINE=27,
- NAMEAMBIGUOUS=28,
- NOTUSABLE=29,
- FEDUP=30,
- DESTROYED=31,
- SPELLUNKNOWN=32,
- LOWMAGICLEVEL=33,
- MAGICITEM=34,
- NOTENOUGHMANA=35,
- NOSKILL=36,
- TARGETLOST=37,
- OUTOFAMMO=38,
- NOCREATURE=39,
- TOOLONG=40,
- TARGETOUTOFRANGE=41,
- TARGETHIDDEN=42,
- ATTACKNOTALLOWED=43,
- NOWAY=44,
- LOGINERROR=45,
- LOGINABORT=46,
- PROTECTIONZONE=47,
- ENTERPROTECTIONZONE=48,
- EXHAUSTED=49,
- NOTINVITED=50,
- NOPREMIUMACCOUNT=51,
- MOVENOTPOSSIBLE=52,
- ALREADYTRADING=53,
- PARTNERTRADING=54,
- TOOMANYOBJECTS=55,
- TOOMANYSLAVES=56,
- NOTTURNABLE=57,
- SECUREMODE=58,
- NOTENOUGHSOULPOINTS=59,
- LOWLEVEL=60
-};
-
enum ActionType: int {
ACTION_CREATEONMAP=0,
ACTION_CREATE=1,
@@ -233,140 +106,6 @@ enum INSTANCEATTRIBUTE: int {
REMAININGUSES=17
};
-enum TYPEATTRIBUTE: int {
- WAYPOINTS=0,
- CAPACITY=1,
- CHANGETARGET=2,
- KEYDOORTARGET=3,
- NAMEDOORTARGET=4,
- LEVELDOORTARGET=5,
- QUESTDOORTARGET=6,
- NUTRITION=7,
- INFORMATIONTYPE=8,
- FONTSIZE=9,
- MAXLENGTH=10,
- MAXLENGTHONCE=11,
- SOURCELIQUIDTYPE=12,
- ABSTELEPORTEFFECT=13,
- RELTELEPORTDISPLACEMENT=14,
- RELTELEPORTEFFECT=15,
- AVOIDDAMAGETYPES=16,
- MINIMUMLEVEL=17,
- PROFESSIONS=18,
- WEIGHT=19,
- ROTATETARGET=20,
- DESTROYTARGET=21,
- BODYPOSITION=22,
- SKILLNUMBER=23,
- SKILLMODIFICATION=24,
- PROTECTIONDAMAGETYPES=25,
- DAMAGEREDUCTION=26,
- BRIGHTNESS=27,
- LIGHTCOLOR=28,
- CORPSETYPE=29,
- TOTALEXPIRETIME=30,
- EXPIRETARGET=31,
- TOTALUSES=32,
- WEAROUTTARGET=33,
- WEAPONTYPE=34,
- WEAPONATTACKVALUE=35,
- WEAPONDEFENDVALUE=36,
- SHIELDDEFENDVALUE=37,
- BOWRANGE=38,
- BOWAMMOTYPE=39,
- THROWRANGE=40,
- THROWATTACKVALUE=41,
- THROWDEFENDVALUE=42,
- THROWMISSILE=43,
- THROWSPECIALEFFECT=44,
- THROWEFFECTSTRENGTH=45,
- THROWFRAGILITY=46,
- WANDRANGE=47,
- WANDMANACONSUMPTION=48,
- WANDATTACKSTRENGTH=49,
- WANDATTACKVARIATION=50,
- WANDDAMAGETYPE=51,
- WANDMISSILE=52,
- AMMOTYPE=53,
- AMMOATTACKVALUE=54,
- AMMOMISSILE=55,
- AMMOSPECIALEFFECT=56,
- AMMOEFFECTSTRENGTH=57,
- ARMORVALUE=58,
- ELEVATION=59,
- DISGUISETARGET=60,
- MEANING=61
-};
-
-enum FLAG: int {
- BANK=0,
- CLIP=1,
- BOTTOM=2,
- TOP=3,
- CONTAINER=4,
- CHEST=5,
- CUMULATIVE=6,
- USEEVENT=7,
- CHANGEUSE=8,
- FORCEUSE=9,
- MULTIUSE=10,
- DISTUSE=11,
- MOVEMENTEVENT=12,
- COLLISIONEVENT=13,
- SEPARATIONEVENT=14,
- KEY=15,
- KEYDOOR=16,
- NAMEDOOR=17,
- LEVELDOOR=18,
- QUESTDOOR=19,
- BED=20,
- FOOD=21,
- RUNE=22,
- INFORMATION=23,
- TEXT=24,
- WRITE=25,
- WRITEONCE=26,
- LIQUIDCONTAINER=27,
- LIQUIDSOURCE=28,
- LIQUIDPOOL=29,
- TELEPORTABSOLUTE=30,
- TELEPORTRELATIVE=31,
- UNPASS=32,
- UNMOVE=33,
- UNTHROW=34,
- UNLAY=35,
- AVOID=36,
- MAGICFIELD=37,
- RESTRICTLEVEL=38,
- RESTRICTPROFESSION=39,
- TAKE=40,
- HANG=41,
- HOOKSOUTH=42,
- HOOKEAST=43,
- ROTATE=44,
- DESTROY=45,
- CLOTHES=46,
- SKILLBOOST=47,
- PROTECTION=48,
- LIGHT=49,
- ROPESPOT=50,
- CORPSE=51,
- EXPIRE=52,
- EXPIRESTOP=53,
- WEAROUT=54,
- WEAPON=55,
- SHIELD=56,
- BOW=57,
- THROW=58,
- WAND=59,
- AMMO=60,
- ARMOR=61,
- HEIGHT=62,
- DISGUISE=63,
- SHOWDETAIL=64,
- SPECIALOBJECT=65
-};
-
enum SPECIALMEANING: int {
MONEY_ONE=1,
MONEY_HUNDRED=2,
@@ -397,91 +136,6 @@ enum SPECIALMEANING: int {
MAGICFIELD_RUSHWOOD=48
};
-enum RIGHT: int {
- PREMIUM_ACCOUNT=0,
- NOTATION=1,
- NAMELOCK=2,
- STATEMENT_REPORT=3,
- BANISHMENT=4,
- FINAL_WARNING=5,
- IP_BANISHMENT=6,
- KICK=7,
- HOME_TELEPORT=8,
- GAMEMASTER_BROADCAST=9,
- ANONYMOUS_BROADCAST=10,
- NO_BANISHMENT=11,
- ALLOW_MULTICLIENT=12,
- LOG_COMMUNICATION=13,
- READ_GAMEMASTER_CHANNEL=14,
- READ_TUTOR_CHANNEL=15,
- HIGHLIGHT_HELP_CHANNEL=16,
- SEND_BUGREPORTS=17,
- NAME_INSULTING=18,
- NAME_SENTENCE=19,
- NAME_NONSENSICAL_LETTERS=20,
- NAME_BADLY_FORMATTED=21,
- NAME_NO_PERSON=22,
- NAME_CELEBRITY=23,
- NAME_COUNTRY=24,
- NAME_FAKE_IDENTITY=25,
- NAME_FAKE_POSITION=26,
- STATEMENT_INSULTING=27,
- STATEMENT_SPAMMING=28,
- STATEMENT_ADVERT_OFFTOPIC=29,
- STATEMENT_ADVERT_MONEY=30,
- STATEMENT_NON_ENGLISH=31,
- STATEMENT_CHANNEL_OFFTOPIC=32,
- STATEMENT_VIOLATION_INCITING=33,
- CHEATING_BUG_ABUSE=34,
- CHEATING_GAME_WEAKNESS=35,
- CHEATING_MACRO_USE=36,
- CHEATING_MODIFIED_CLIENT=37,
- CHEATING_HACKING=38,
- CHEATING_MULTI_CLIENT=39,
- CHEATING_ACCOUNT_TRADING=40,
- CHEATING_ACCOUNT_SHARING=41,
- GAMEMASTER_THREATENING=42,
- GAMEMASTER_PRETENDING=43,
- GAMEMASTER_INFLUENCE=44,
- GAMEMASTER_FALSE_REPORTS=45,
- KILLING_EXCESSIVE_UNJUSTIFIED=46,
- DESTRUCTIVE_BEHAVIOUR=47,
- SPOILING_AUCTION=48,
- INVALID_PAYMENT=49,
- TELEPORT_TO_CHARACTER=50,
- TELEPORT_TO_MARK=51,
- TELEPORT_VERTICAL=52,
- TELEPORT_TO_COORDINATE=53,
- LEVITATE=54,
- SPECIAL_MOVEUSE=55,
- MODIFY_GOSTRENGTH=56,
- SHOW_COORDINATE=57,
- RETRIEVE=58,
- ENTER_HOUSES=59,
- OPEN_NAMEDOORS=60,
- INVULNERABLE=61,
- UNLIMITED_MANA=62,
- KEEP_INVENTORY=63,
- ALL_SPELLS=64,
- UNLIMITED_CAPACITY=65,
- ZERO_CAPACITY=66,
- ATTACK_EVERYWHERE=67,
- NO_ATTACK=68,
- NO_RUNES=69,
- NO_LOGOUT_BLOCK=70,
- GAMEMASTER_OUTFIT=71,
- ILLUMINATE=72,
- CHANGE_PROFESSION=73,
- IGNORED_BY_MONSTERS=74,
- SHOW_KEYHOLE_NUMBERS=75,
- CREATE_OBJECTS=76,
- CREATE_MONEY=77,
- CREATE_MONSTERS=78,
- CHANGE_SKILLS=79,
- CLEANUP_FIELDS=80,
- NO_STATISTICS=81
-};
-
enum TWriterThreadReplyType: int {
REPLY_BROADCAST=0,
REPLY_DIRECT=1,
@@ -501,32 +155,6 @@ enum TWriterThreadOrderType: int {
ORDER_SAVEPLAYERDATA=9
};
-enum TALK_MODE: int {
- TALK_SAY=1,
- TALK_WHISPER=2,
- TALK_YELL=3,
- TALK_PRIVATE_MESSAGE=4,
- TALK_CHANNEL_CALL=5,
- TALK_GAMEMASTER_REQUEST=6,
- TALK_GAMEMASTER_ANSWER=7,
- TALK_PLAYER_ANSWER=8,
- TALK_GAMEMASTER_BROADCAST=9,
- TALK_GAMEMASTER_CHANNELCALL=10,
- TALK_GAMEMASTER_MESSAGE=11,
- TALK_HIGHLIGHT_CHANNELCALL=12,
- TALK_ANONYMOUS_BROADCAST=13,
- TALK_ANONYMOUS_CHANNELCALL=14,
- TALK_ANONYMOUS_MESSAGE=15,
- TALK_ANIMAL_LOW=16,
- TALK_ANIMAL_LOUD=17,
- TALK_ADMIN_MESSAGE=18,
- TALK_EVENT_MESSAGE=19,
- TALK_LOGIN_MESSAGE=20,
- TALK_STATUS_MESSAGE=21,
- TALK_INFO_MESSAGE=22,
- TALK_FAILURE_MESSAGE=23
-};
-
enum CHANNEL: int {
GUILD_CHANNEL=0,
GAMEMASTER_CHANNEL=1,
@@ -597,9 +225,3 @@ enum BloodType: int {
BT_FIRE=3,
BT_ENERGY=4
};
-
-enum TWorldType: int {
- NORMAL=0,
- NON_PVP=1,
- PVP_ENFORCED=2
-};
diff --git a/reference/game.c b/reference/game.c
index a005445..07e6991 100644
--- a/reference/game.c
+++ b/reference/game.c
@@ -1946,833 +1946,6 @@ void __static_initialization_and_destruction_0(int __initialize_p,int __priority
return;
}
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void ProcessCommand(void)
-
-{
- char *CommandBuffer;
- int iVar1;
- char *pcVar2;
- int Command;
-
- iVar1 = GetCommand();
- if (iVar1 != 0) {
- pcVar2 = GetCommandBuffer();
- if (iVar1 == 1) {
- if (pcVar2 == (char *)0x0) {
- error(&DAT_080ee440);
- }
- else {
- BroadcastMessage(0x12,"%s",pcVar2);
- }
- }
- else {
- error("ProcessCommand: Unbekanntes Kommando %d.\n",iVar1);
- }
- SetCommand(0,(char *)0x0);
- }
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: Color
-
-void AdvanceGame(int Delay)
-
-{
- int iVar1;
- TConnection *Connection_00;
- TConnection *Connection;
- int Time;
- char *pcVar2;
- int local_20;
- int Hour;
- int Minute;
- int Brightness;
- int Color;
-
- AdvanceGame::SkillTimeCounter = AdvanceGame::SkillTimeCounter + Delay;
- AdvanceGame::OtherTimeCounter = AdvanceGame::OtherTimeCounter + Delay;
- AdvanceGame::CreaturesTimeCounter = AdvanceGame::CreaturesTimeCounter + Delay;
- AdvanceGame::CronTimeCounter = AdvanceGame::CronTimeCounter + Delay;
- if (0x6d5 < AdvanceGame::CreaturesTimeCounter) {
- AdvanceGame::CreaturesTimeCounter = AdvanceGame::CreaturesTimeCounter + -1000;
- ProcessCreatures();
- }
- if (0x5db < AdvanceGame::CronTimeCounter) {
- AdvanceGame::CronTimeCounter = AdvanceGame::CronTimeCounter + -1000;
- ProcessCronSystem();
- }
- if (0x4e1 < AdvanceGame::SkillTimeCounter) {
- AdvanceGame::SkillTimeCounter = AdvanceGame::SkillTimeCounter + -1000;
- ProcessSkills();
- }
- if (999 < AdvanceGame::OtherTimeCounter) {
- AdvanceGame::OtherTimeCounter = AdvanceGame::OtherTimeCounter + -1000;
- RoundNr = RoundNr + 1;
- SetRoundNr(RoundNr);
- ProcessConnections();
- ProcessMonsterhomes();
- ProcessMonsterRaids();
- ProcessCommunicationControl();
- ProcessReaderThreadReplies(RefreshSector,SendMails);
- ProcessWriterThreadReplies();
- ProcessCommand();
- GetAmbiente(&Minute,&Brightness);
- if (Minute != AdvanceGame::OldAmbiente) {
- AdvanceGame::OldAmbiente = Minute;
- Connection_00 = GetFirstConnection();
- while (Connection_00 != (TConnection *)0x0) {
- if (Connection_00->State - CONNECTION_LOGIN < 4) {
- SendAmbiente(Connection_00);
- }
- Connection_00 = GetNextConnection();
- }
- }
- if (RoundNr == (RoundNr / 10) * 10) {
- NetLoadCheck();
- }
- if (AdvanceGame::NextMinute <= RoundNr) {
- GetRealTime(&local_20,&Hour);
- RefreshCylinders();
- if (Hour == (Hour / 5) * 5) {
- CreatePlayerList(true);
- }
- if (Hour == (Hour / 0xf) * 0xf) {
- SavePlayerDataOrder();
- }
- if (Hour == 0) {
- NetLoadSummary();
- }
- if (Hour == 0x37) {
- WriteKillStatistics();
- }
- iVar1 = Hour + local_20 * 0x3c;
- if ((iVar1 + 5) % 0x5a0 == RebootTime) {
- if (Reboot == false) {
- pcVar2 = "Server is going down in 5 minutes.\nPlease log out.";
- }
- else {
- pcVar2 = "Server is saving game in 5 minutes.\nPlease come back in 10 minutes.";
- }
- BroadcastMessage(0x12,pcVar2);
- CloseGame();
- }
- if ((iVar1 + 3) % 0x5a0 == RebootTime) {
- if (Reboot == false) {
- pcVar2 = "Server is going down in 3 minutes.\nPlease log out.";
- }
- else {
- pcVar2 = "Server is saving game in 3 minutes.\nPlease come back in 10 minutes.";
- }
- BroadcastMessage(0x12,pcVar2);
- }
- if ((iVar1 + 1) % 0x5a0 == RebootTime) {
- if (Reboot == false) {
- pcVar2 = "Server is going down in one minute.\nPlease log out.";
- }
- else {
- pcVar2 = "Server is saving game in one minute.\nPlease log out.";
- }
- BroadcastMessage(0x12,pcVar2);
- }
- if (iVar1 == RebootTime) {
- CloseGame();
- LogoutAllPlayers();
- SendAll();
- if (Reboot != false) {
- RefreshMap();
- }
- SaveMap();
- SaveMapOn = false;
- EndGame();
- }
- AdvanceGame::NextMinute = GetRoundForNextMinute();
- }
- CleanupDynamicStrings();
- }
- if (Beat < Delay) {
- Log("lag",&DAT_080ee9c7,Delay);
- }
- if (Delay < 1000) {
- MoveCreatures(Delay);
- AdvanceGame::Lag = false;
- }
- else {
- if ((AdvanceGame::Lag == false) && (10 < RoundNr)) {
- error(&DAT_080ee480,Delay);
- }
- AdvanceGame::Lag = true;
- }
- SendAll();
- return;
-}
-
-
-
-void HandlerSigAlarm(int param_1)
-
-{
- undefined1 local_2c [4];
- itimerval ov;
- itimerval v;
-
- ov.it_value.tv_usec = 0;
- SigAlarmCounter = SigAlarmCounter + 1;
- setitimer(ITIMER_REAL,(itimerval *)&ov.it_value.tv_usec,(itimerval *)local_2c);
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void TimeReset(void)
-
-{
- SigAlarmCounter = 0;
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void InitTime(void)
-
-{
- undefined1 local_2c [4];
- itimerval ov;
- itimerval v;
-
- SigAlarmCounter = 0;
- handler(0xe,HandlerSigAlarm);
- ov.it_value.tv_usec = 0;
- SigAlarmCounter = SigAlarmCounter + 1;
- setitimer(ITIMER_REAL,(itimerval *)&ov.it_value.tv_usec,(itimerval *)local_2c);
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void ExitTime(void)
-
-{
- undefined1 local_2c [4];
- itimerval ov;
- itimerval v;
-
- ov.it_value.tv_usec = 0;
- setitimer(ITIMER_REAL,(itimerval *)&ov.it_value.tv_usec,(itimerval *)local_2c);
- handler(0xe,(_func_void_int *)0x1);
- return;
-}
-
-
-
-void SigHupHandler(int param_1)
-
-{
- return;
-}
-
-
-
-void SigAbortHandler(int param_1)
-
-{
- print();
- AbortWriter();
- return;
-}
-
-
-
-void HandlerSigUsr1(int param_1)
-
-{
- SigUsr1Counter = SigUsr1Counter + 1;
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: s
-
-void DefaultHandler(int signo)
-
-{
- int local_94;
- int Hour;
- int Minute;
- char s [128];
-
- snprintf((char *)&Minute,0x80,"SigNr. %d: %s",signo,*(undefined4 *)(sys_siglist + signo * 4));
- print();
- handler(2,(_func_void_int *)0x1);
- handler(3,(_func_void_int *)0x1);
- handler(0xf,(_func_void_int *)0x1);
- handler(0x18,(_func_void_int *)0x1);
- handler(0x19,(_func_void_int *)0x1);
- handler(0x1e,(_func_void_int *)0x1);
- SaveMapOn = false;
- if (((signo == 3) || (signo == 0xf)) || (signo == 0x1e)) {
- SaveMapOn = true;
- }
- if (signo == 0xf) {
- GetRealTime(&local_94,&Hour);
- RebootTime = (Hour + 6 + local_94 * 0x3c) % 0x5a0;
- CloseGame();
- }
- else {
- EndGame();
- }
- Reboot = false;
- return;
-}
-
-
-
-void ErrorHandler(int signo)
-
-{
- char local_8c [4];
- char s [128];
-
- snprintf(local_8c,0x80,"SigNr. %d: %s",signo,*(undefined4 *)(sys_siglist + signo * 4));
- error("ErrorHandler: %s\n",local_8c);
- EndGame();
- LogoutAllPlayers();
- // WARNING: Subroutine does not return
- exit(1);
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void InitSignalHandler(void)
-
-{
- int count;
-
- handler(1,SigHupHandler);
- handler(2,DefaultHandler);
- handler(3,DefaultHandler);
- handler(6,SigAbortHandler);
- handler(10,(_func_void_int *)0x1);
- handler(0xc,(_func_void_int *)0x1);
- handler(0xd,(_func_void_int *)0x1);
- handler(0xe,(_func_void_int *)0x1);
- handler(0xf,DefaultHandler);
- handler(0x10,(_func_void_int *)0x1);
- handler(0x11,(_func_void_int *)0x1);
- handler(0x14,(_func_void_int *)0x1);
- handler(0x15,(_func_void_int *)0x1);
- handler(0x16,(_func_void_int *)0x1);
- handler(0x17,(_func_void_int *)0x1);
- handler(0x18,DefaultHandler);
- handler(0x19,DefaultHandler);
- handler(0x1a,(_func_void_int *)0x1);
- handler(0x1c,(_func_void_int *)0x1);
- handler(0x1d,(_func_void_int *)0x1);
- handler(0x1e,DefaultHandler);
- print();
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void ExitSignalHandler(void)
-
-{
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void UnlockGame(void)
-
-{
- int iVar1;
- __pid_t _Var2;
- int local_1140;
- int Pid;
- ifstream IF;
- undefined4 local_1134 [3];
- uint auStack_1128 [23];
- __basic_file<char> local_10cc [25];
- undefined1 local_10b3;
- undefined *local_10ac;
- ios_base local_10a8 [16];
- uint local_1098;
- char local_101c [4];
- char FileName [4096];
-
- std::ios_base::ios_base(local_10a8);
- local_10ac = (undefined *)0x8128950;
- // try { // try from 0804bd94 to 0804bd98 has its CatchHandler @ 0804bf54
- std::istream::istream((istream *)&Pid,(streambuf *)(std::ifstream::VTT + 4));
- Pid = (int)&DAT_08128994;
- local_10ac = &DAT_081289a8;
- // try { // try from 0804bdb8 to 0804bdbc has its CatchHandler @ 0804bf50
- std::filebuf::filebuf((filebuf *)local_1134);
- // try { // try from 0804bdca to 0804bdce has its CatchHandler @ 0804bf14
- std::ios::init((EVP_PKEY_CTX *)&local_10ac);
- strcpy(local_101c,SAVEPATH);
- strcat(local_101c,"/game.pid");
- // try { // try from 0804be04 to 0804be36 has its CatchHandler @ 0804bf58
- iVar1 = std::filebuf::open((char *)local_1134,(int)local_101c,8);
- if (iVar1 == 0) {
- std::ios::clear((istream *)&Pid + *(int *)(Pid + -0xc),
- *(uint *)((int)auStack_1128 + *(int *)(Pid + -0xc)) | 4);
- }
- if ((local_1098 & 5) == 0) {
- std::istream::operator>>((istream *)&Pid,&local_1140);
- iVar1 = std::filebuf::close((int)local_1134);
- if (iVar1 == 0) {
- // try { // try from 0804bee1 to 0804bf0e has its CatchHandler @ 0804bf58
- std::ios::clear((istream *)&Pid + *(int *)(Pid + -0xc),
- *(uint *)((int)auStack_1128 + *(int *)(Pid + -0xc)) | 4);
- }
- _Var2 = getpid();
- if (local_1140 == _Var2) {
- unlink(local_101c);
- }
- }
- Pid = (int)&DAT_08128994;
- local_10ac = &DAT_081289a8;
- local_1134[0] = 0x8128ad0;
- std::filebuf::close((int)local_1134);
- local_10b3 = 0;
- std::__basic_file<char>::~__basic_file(local_10cc);
- std::streambuf::~streambuf((streambuf *)local_1134);
- std::istream::~istream((istream *)&Pid);
- std::ios::~ios((ios *)&local_10ac);
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void LockGame(void)
-
-{
- uint uVar1;
- int iVar2;
- ulong uVar3;
- undefined4 *puVar4;
- int local_1260;
- int Pid;
- char FileName [4096];
- ofstream OF;
- uint auStack_250 [24];
- __basic_file<char> local_1f0 [25];
- undefined1 local_1d7;
- undefined *local_1d0;
- ios_base local_1cc [144];
- undefined *local_13c;
- ifstream IF;
- undefined4 local_134 [3];
- uint auStack_128 [23];
- __basic_file<char> local_cc [25];
- undefined1 local_b3;
- undefined *local_ac;
- ios_base local_a8 [16];
- uint local_98;
-
- // try { // try from 0804bff1 to 0804bff5 has its CatchHandler @ 0804c550
- std::ios_base::ios_base(local_a8);
- local_ac = (undefined *)0x8128950;
- // try { // try from 0804c014 to 0804c018 has its CatchHandler @ 0804c3f0
- std::istream::istream((istream *)&local_13c,(streambuf *)(std::ifstream::VTT + 4));
- local_13c = &DAT_08128994;
- local_ac = &DAT_081289a8;
- // try { // try from 0804c038 to 0804c03c has its CatchHandler @ 0804c3e7
- std::filebuf::filebuf((filebuf *)local_134);
- // try { // try from 0804c050 to 0804c054 has its CatchHandler @ 0804c3a0
- std::ios::init((EVP_PKEY_CTX *)&local_ac);
- // try { // try from 0804c05e to 0804c062 has its CatchHandler @ 0804c546
- std::ios_base::ios_base(local_1cc);
- local_1d0 = (undefined *)0x8128950;
- // try { // try from 0804c087 to 0804c08b has its CatchHandler @ 0804c4be
- std::ostream::ostream((ostream *)(FileName + 0xffc),(streambuf *)(std::ofstream::VTT + 4));
- FileName._4092_4_ = &DAT_08128a64;
- local_1d0 = &DAT_08128a78;
- // try { // try from 0804c0ab to 0804c0af has its CatchHandler @ 0804c4b5
- std::filebuf::filebuf((filebuf *)&OF);
- // try { // try from 0804c0c3 to 0804c0c7 has its CatchHandler @ 0804c3f6
- std::ios::init((EVP_PKEY_CTX *)&local_1d0);
- strcpy((char *)&Pid,SAVEPATH);
- strcat((char *)&Pid,"/game.pid");
- // try { // try from 0804c103 to 0804c194 has its CatchHandler @ 0804c4c7
- iVar2 = std::filebuf::open((char *)local_134,(int)&Pid,8);
- if (iVar2 == 0) {
- std::ios::clear((istream *)&local_13c + *(int *)(local_13c + -0xc),
- *(uint *)((int)auStack_128 + *(int *)(local_13c + -0xc)) | 4);
- }
- if ((local_98 & 5) == 0) {
- std::istream::operator>>((istream *)&local_13c,&local_1260);
- iVar2 = std::filebuf::close((int)local_134);
- if (iVar2 == 0) {
- std::ios::clear((istream *)&local_13c + *(int *)(local_13c + -0xc),
- *(uint *)((int)auStack_128 + *(int *)(local_13c + -0xc)) | 4);
- }
- if (local_1260 != 0) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "Game-Server is already running, PID file exists.";
- // WARNING: Subroutine does not return
- __cxa_throw(puVar4,char_const*::typeinfo,0);
- }
- }
- else {
- iVar2 = std::filebuf::close((int)local_134);
- if (iVar2 == 0) {
- std::ios::clear((istream *)&local_13c + *(int *)(local_13c + -0xc),
- *(uint *)((int)auStack_128 + *(int *)(local_13c + -0xc)) | 4);
- }
- iVar2 = std::filebuf::open((char *)&OF,(int)&Pid,0x30);
- if (iVar2 == 0) {
- std::ios::clear(FileName + *(int *)(FileName._4092_4_ + -0xc) + 0xffc,
- *(uint *)((int)auStack_250 + *(int *)(FileName._4092_4_ + -0xc) + 8) | 4
- );
- }
- uVar3 = getpid();
- uVar1 = *(uint *)((int)auStack_250 + *(int *)(FileName._4092_4_ + -0xc));
- if (((uVar1 & 0x40) == 0) && ((uVar1 & 8) == 0)) {
- // try { // try from 0804c2a1 to 0804c397 has its CatchHandler @ 0804c4c7
- std::ostream::operator<<((ostream *)(FileName + 0xffc),uVar3);
- }
- else {
- std::ostream::operator<<((ostream *)(FileName + 0xffc),uVar3);
- }
- atexit(UnlockGame);
- }
- FileName._4092_4_ = &DAT_08128a64;
- local_1d0 = &DAT_08128a78;
- _OF = 0x8128ad0;
- // try { // try from 0804c1cb to 0804c216 has its CatchHandler @ 0804c546
- std::filebuf::close((int)&OF);
- local_1d7 = 0;
- std::__basic_file<char>::~__basic_file(local_1f0);
- std::streambuf::~streambuf((streambuf *)&OF);
- std::ostream::~ostream((ostream *)(FileName + 0xffc));
- std::ios::~ios((ios *)&local_1d0);
- local_13c = &DAT_08128994;
- local_ac = &DAT_081289a8;
- local_134[0] = 0x8128ad0;
- // try { // try from 0804c241 to 0804c286 has its CatchHandler @ 0804c550
- std::filebuf::close((int)local_134);
- local_b3 = 0;
- std::__basic_file<char>::~__basic_file(local_cc);
- std::streambuf::~streambuf((streambuf *)local_134);
- std::istream::~istream((istream *)&local_13c);
- std::ios::~ios((ios *)&local_ac);
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void LoadWorldConfig(void)
-
-{
- TQueryManagerConnection *this;
- int iVar1;
- undefined4 *puVar2;
- TWorldType *pTVar3;
- int *piVar4;
- int *piVar5;
- int *piVar6;
- int *piVar7;
- int *piVar8;
- int *piVar9;
- int *piVar10;
- TWorldType local_60;
- int HelpWorldType;
- int HelpGameAddress [4];
- TQueryManagerConnection Connection;
-
- this = (TQueryManagerConnection *)(HelpGameAddress + 3);
- // try { // try from 0804c590 to 0804c594 has its CatchHandler @ 0804c6b7
- TQueryManagerConnection::TQueryManagerConnection(this,0x4000);
- if (Connection.WriteBuffer.Position < 0) {
- error("LoadWorldConfig: Kann nicht zum Query-Manager verbinden.\n");
- puVar2 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar2 = "cannot connect to querymanager";
- }
- else {
- piVar10 = &PremiumNewbieBuffer;
- piVar5 = &HelpWorldType;
- pTVar3 = &local_60;
- piVar9 = &MaxNewbies;
- piVar8 = &PremiumPlayerBuffer;
- piVar7 = &MaxPlayers;
- piVar6 = &GamePort;
- piVar4 = &RebootTime;
- // try { // try from 0804c5e6 to 0804c5ea has its CatchHandler @ 0804c6a0
- iVar1 = TQueryManagerConnection::loadWorldConfig(this);
- if (iVar1 == 0) {
- iVar1 = 0x10;
- WorldType = local_60;
- snprintf(GameAddress,0x10,"%d.%d.%d.%d",HelpWorldType,HelpGameAddress[0],
- HelpGameAddress[1],HelpGameAddress[2]);
- // try { // try from 0804c632 to 0804c636 has its CatchHandler @ 0804c6b7
- TQueryManagerConnection::~TQueryManagerConnection(this,iVar1);
- return;
- }
- // try { // try from 0804c64b to 0804c685 has its CatchHandler @ 0804c6a0
- error("LoadWorldConfig: Kann Konfigurationsdaten nicht holen.\n",pTVar3,piVar4,piVar5,piVar6
- ,piVar7,piVar8,piVar9,piVar10);
- puVar2 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar2 = "cannot load world config";
- }
- // WARNING: Subroutine does not return
- __cxa_throw(puVar2,char_const*::typeinfo,0);
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void InitAll(void)
-
-{
- uint __seed;
- undefined1 local_2c [4];
- itimerval ov;
- itimerval v;
-
- // try { // try from 0804c6d9 to 0804c7d4 has its CatchHandler @ 0804c7e0
- ReadConfig();
- SetQueryManagerLoginData(1,WorldName);
- LoadWorldConfig();
- InitSHM((bool)(BeADaemon ^ 1));
- LockGame();
- InitLog("game");
- __seed = time((time_t *)0x0);
- srand(__seed);
- InitSignalHandler();
- InitConnections();
- InitCommunication();
- InitStrings();
- InitWriter();
- InitReader();
- InitObjects();
- InitMap();
- InitInfo();
- InitMoveUse();
- InitMagic();
- InitCr();
- InitHouses();
- SigAlarmCounter = 0;
- handler(0xe,HandlerSigAlarm);
- SigAlarmCounter = SigAlarmCounter + 1;
- ov.it_value.tv_usec = 0;
- setitimer(ITIMER_REAL,(itimerval *)&ov.it_value.tv_usec,(itimerval *)local_2c);
- ApplyPatches();
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void ExitAll(void)
-
-{
- undefined1 local_2c [4];
- itimerval ov;
- itimerval v;
-
- EndGame();
- ov.it_value.tv_usec = 0;
- setitimer(ITIMER_REAL,(itimerval *)&ov.it_value.tv_usec,(itimerval *)local_2c);
- handler(0xe,(_func_void_int *)0x1);
- ExitCr();
- ExitMagic();
- ExitMoveUse();
- ExitInfo();
- ExitHouses();
- ExitMap(SaveMapOn);
- ExitObjects();
- ExitReader();
- ExitWriter();
- ExitStrings();
- ExitCommunication();
- ExitConnections();
- ExitSHM();
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void LaunchGame(void)
-
-{
- int iVar1;
- bool bVar2;
-
- SigUsr1Counter = 0;
- handler(10,HandlerSigUsr1);
- StartGame();
- getpid();
- print();
- SaveMapOn = true;
- SigAlarmCounter = 0;
- while (bVar2 = GameRunning(), bVar2) {
- sigblock(0x200);
- while ((SigUsr1Counter == 0 && (SigAlarmCounter == 0))) {
- __sigpause(0,0);
- }
- if (0 < SigUsr1Counter) {
- SigUsr1Counter = 0;
- ReceiveData();
- }
- iVar1 = SigAlarmCounter;
- if (0 < SigAlarmCounter) {
- SigAlarmCounter = 0;
- AdvanceGame(iVar1 * Beat);
- }
- }
- LogoutAllPlayers();
- return;
-}
-
-
-
-int DaemonInit(bool NoFork)
-
-{
- pid_t Pid;
- __pid_t _Var1;
- long lVar2;
- int i;
- int __fd;
- int iVar3;
- int openmax;
-
- if (!NoFork) {
- _Var1 = fork();
- if (_Var1 < 0) {
- return 1;
- }
- if (_Var1 != 0) {
- // WARNING: Subroutine does not return
- exit(0);
- }
- setsid();
- }
- umask(0);
- umask(0x7f);
- chdir(SAVEPATH);
- lVar2 = sysconf(4);
- if (lVar2 < 0) {
- lVar2 = 0x400;
- }
- __fd = 0;
- if (0 < lVar2) {
- do {
- iVar3 = __fd + 1;
- close(__fd);
- __fd = iVar3;
- } while (iVar3 < lVar2);
- }
- return 0;
-}
-
-
-
-int main(int argc,char **argv)
-
-{
- RESULT r;
- int iVar1;
- char *pcVar2;
- char *pcVar3;
- bool bVar4;
- int local_1024;
- int i;
- char local_101c [3];
- bool NoFork;
- char FileName [4096];
-
- local_1024 = 1;
- bVar4 = argc == 1;
- i._3_1_ = false;
- BeADaemon = false;
- Reboot = true;
- if (1 < argc) {
- do {
- iVar1 = 7;
- pcVar2 = argv[local_1024];
- pcVar3 = "daemon";
- do {
- if (iVar1 == 0) break;
- iVar1 = iVar1 + -1;
- bVar4 = *pcVar2 == *pcVar3;
- pcVar2 = pcVar2 + 1;
- pcVar3 = pcVar3 + 1;
- } while (bVar4);
- if (bVar4) {
- BeADaemon = true;
- }
- iVar1 = 7;
- pcVar2 = argv[local_1024];
- pcVar3 = "nofork";
- do {
- if (iVar1 == 0) break;
- iVar1 = iVar1 + -1;
- bVar4 = *pcVar2 == *pcVar3;
- pcVar2 = pcVar2 + 1;
- pcVar3 = pcVar3 + 1;
- } while (bVar4);
- if (bVar4) {
- i._3_1_ = true;
- }
- local_1024 = local_1024 + 1;
- bVar4 = local_1024 == argc;
- } while (local_1024 < argc);
- }
- if (((BeADaemon != false) ||
- (puts("Tibia Game-Server\n(c) by CIP Productions, 2003.\n"), BeADaemon != false)) &&
- (iVar1 = DaemonInit(i._3_1_), iVar1 != 0)) {
- return 2;
- }
- InitAll();
- atexit(ExitAll);
- // try { // try from 0804cb24 to 0804cb28 has its CatchHandler @ 0804cbb5
- LaunchGame();
- if (Reboot != false) {
- UnlockGame();
- sprintf(local_101c,"%s/reboot-daily",BINPATH);
- bVar4 = FileExists(local_101c);
- if (bVar4) {
- ExitAll();
- print();
- execv(local_101c,argv);
- }
- }
- print();
- return 0;
-}
-
-
-
// WARNING: Unknown calling convention -- yet parameter storage is locked
void _GLOBAL__I_BeADaemon(void)
@@ -2782,34 +1955,6 @@ void _GLOBAL__I_BeADaemon(void)
return;
}
-
-
-_func_void_int * handler(int signr,_func_void_int *sighandler)
-
-{
- int iVar1;
- _union_1051 _Var2;
- _union_1051 local_12c;
- sigaction alt_handler;
- _union_1051 local_9c;
- sigaction neu_handler;
-
- local_9c.sa_handler = (__sighandler_t)sighandler;
- sigemptyset((sigset_t *)&neu_handler);
- neu_handler.sa_mask.__val[0x1f] = 0x20000000;
- if (signr != 0xe) {
- neu_handler.sa_mask.__val[0x1f] = 0x10000000;
- }
- iVar1 = sigaction(signr,(sigaction *)&local_9c,(sigaction *)&local_12c);
- _Var2 = (_union_1051)0xffffffff;
- if (-1 < iVar1) {
- _Var2 = local_12c;
- }
- return (_func_void_int *)_Var2.sa_handler;
-}
-
-
-
bool isSpace(int c)
{
@@ -8631,180 +7776,6 @@ void ReadConfig(void)
} while( true );
}
-
-
-// WARNING: Variable defined which should be unmapped: t
-
-void GetAmbiente(int *Brightness,int *Color)
-
-{
- int iVar1;
- int Time;
- tm *ptVar2;
- time_t local_14;
- time_t t;
-
- local_14 = time((time_t *)0x0);
- ptVar2 = localtime(&local_14);
- iVar1 = ptVar2->tm_sec + ptVar2->tm_min * 0x3c;
- iVar1 = ((iVar1 % 0x96) * 2) / 5 + (iVar1 / 0x96) * 0x3c;
- if (iVar1 < 0x3c) {
-LAB_08053cb0:
- *Brightness = 0x33;
- }
- else {
- if (0x77 < iVar1) {
- if (iVar1 < 0xb4) {
- *Brightness = 0x99;
-LAB_08053c88:
- *Color = 0xad;
- return;
- }
- if (iVar1 < 0xf0) {
- *Brightness = 0xcc;
- goto LAB_08053c88;
- }
- if (0x564 < iVar1) goto LAB_08053cb0;
- if (iVar1 < 0x529) {
- if (0x4ec < iVar1) {
- *Brightness = 0x99;
-LAB_08053ce5:
- *Color = 0xd0;
- return;
- }
- if (0x4b0 < iVar1) {
- *Brightness = 0xcc;
- goto LAB_08053ce5;
- }
- *Brightness = 0xff;
- goto LAB_08053cb6;
- }
- }
- *Brightness = 0x66;
- }
-LAB_08053cb6:
- *Color = 0xd7;
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: t
-
-void GetDate(int *Year,int *Cycle,int *Day)
-
-{
- tm *ptVar1;
- tm *Time;
- int local_10;
- time_t t;
-
- local_10 = time((time_t *)0x0);
- ptVar1 = localtime(&local_10);
- *Year = (local_10 / 0x15180 + 4) / 7;
- *Cycle = ptVar1->tm_wday;
- *Day = ptVar1->tm_hour;
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: t
-
-void GetTime(int *Hour,int *Minute)
-
-{
- tm *ptVar1;
- tm *Time;
- time_t local_14;
- time_t t;
-
- local_14 = time((time_t *)0x0);
- ptVar1 = localtime(&local_14);
- *Hour = (ptVar1->tm_sec + ptVar1->tm_min * 0x3c) / 0x96;
- *Minute = (((ptVar1->tm_sec + ptVar1->tm_min * 0x3c) % 0x96) * 2) / 5;
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: t
-
-void GetRealTime(int *Hour,int *Minute)
-
-{
- tm *ptVar1;
- time_t local_8;
- time_t t;
-
- local_8 = time((time_t *)0x0);
- ptVar1 = localtime(&local_8);
- *Hour = ptVar1->tm_hour;
- *Minute = ptVar1->tm_min;
- return;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: t
-
-ulong GetRoundAtTime(int Hour,int Minute)
-
-{
- int Delta;
- tm *ptVar1;
- uint uVar2;
- tm *Time;
- time_t local_c;
- time_t t;
-
- local_c = time((time_t *)0x0);
- ptVar1 = localtime(&local_c);
- uVar2 = ((Hour - ptVar1->tm_hour) * 0xe10 + (Minute - ptVar1->tm_min) * 0x3c) - ptVar1->tm_sec;
- if (0x7fffffff < uVar2) {
- uVar2 = uVar2 + 0x15180;
- }
- return uVar2 + RoundNr;
-}
-
-
-
-// WARNING: Variable defined which should be unmapped: t
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-ulong GetRoundForNextMinute(void)
-
-{
- int iVar1;
- int iVar2;
- ulong NewRound;
- tm *ptVar3;
- int Delta;
- uint uVar4;
- time_t local_14;
- time_t t_1;
- time_t t;
-
- t_1 = time((time_t *)0x0);
- ptVar3 = localtime(&t_1);
- iVar1 = ptVar3->tm_hour;
- iVar2 = ptVar3->tm_min;
- local_14 = time((time_t *)0x0);
- ptVar3 = localtime(&local_14);
- uVar4 = ((iVar1 - ptVar3->tm_hour) * 0xe10 + ((iVar2 + 1) - ptVar3->tm_min) * 0x3c) -
- ptVar3->tm_sec;
- if (0x7fffffff < uVar4) {
- uVar4 = uVar4 + 0x15180;
- }
- for (uVar4 = uVar4 + 0x1e + RoundNr; uVar4 < RoundNr + 0x1e; uVar4 = uVar4 + 0x3c) {
- }
- for (; RoundNr + 0x5a < uVar4; uVar4 = uVar4 - 0x3c) {
- }
- return uVar4;
-}
-
-
-
void __static_initialization_and_destruction_0(int __initialize_p,int __priority)
{
@@ -10104,724 +9075,6 @@ void __static_initialization_and_destruction_0(int __initialize_p,int __priority
return;
}
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void StartGame(void)
-
-{
- if (SHM == (TSharedMemory *)0x0) {
- error("StartGame: SharedMemory existiert nicht.\n");
- }
- else if (SHM->GameState == GAME_STARTING) {
- SHM->GameState = GAME_RUNNING;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void CloseGame(void)
-
-{
- if (SHM == (TSharedMemory *)0x0) {
- error("CloseGame: SharedMemory existiert nicht.\n");
- }
- else if (SHM->GameState == GAME_RUNNING) {
- SHM->GameState = GAME_CLOSING;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void EndGame(void)
-
-{
- if (SHM == (TSharedMemory *)0x0) {
- error("EndGame: SharedMemory existiert nicht.\n");
- }
- else {
- SHM->GameState = GAME_ENDING;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-bool LoginAllowed(void)
-
-{
- bool bVar1;
-
- if (SHM == (TSharedMemory *)0x0) {
- error("IsLoginAllowed: SharedMemory existiert nicht.\n");
- bVar1 = false;
- }
- else {
- bVar1 = SHM->GameState == GAME_RUNNING;
- }
- return bVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-bool GameRunning(void)
-
-{
- bool bVar1;
-
- if (SHM == (TSharedMemory *)0x0) {
- error("GameRunning: SharedMemory existiert nicht.\n");
- bVar1 = false;
- }
- else {
- bVar1 = SHM->GameState < GAME_ENDING;
- }
- return bVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-bool GameStarting(void)
-
-{
- bool bVar1;
-
- if (SHM == (TSharedMemory *)0x0) {
- error("GameStarting: SharedMemory existiert nicht.\n");
- bVar1 = false;
- }
- else {
- bVar1 = SHM->GameState == GAME_STARTING;
- }
- return bVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-bool GameEnding(void)
-
-{
- bool bVar1;
-
- if (SHM == (TSharedMemory *)0x0) {
- error("GameEnding: SharedMemory existiert nicht.\n");
- bVar1 = false;
- }
- else {
- bVar1 = SHM->GameState - GAME_CLOSING < 2;
- }
- return bVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-pid_t GetGameThreadPID(void)
-
-{
- pid_t pVar1;
-
- pVar1 = 0;
- if (SHM != (TSharedMemory *)0x0) {
- pVar1 = SHM->GameThreadPID;
- }
- return pVar1;
-}
-
-
-
-void ErrorHandler(char *Text)
-
-{
- ulong uVar1;
-
- if (VerboseOutput) {
- printf("%s",Text);
- }
- if (SHM != (TSharedMemory *)0x0) {
- if (SHM->Errors < 0x8000) {
- Log("error",Text);
- }
- uVar1 = SHM->Errors + 1;
- SHM->Errors = uVar1;
- if (uVar1 == 0x8000) {
- Log("error","Zu viele Fehler. Keine weitere Protokollierung.\n");
- }
- }
- return;
-}
-
-
-
-void PrintHandler(int Level,char *Text)
-
-{
- size_t sVar1;
- int iVar2;
- int iVar3;
- TSharedMemory *pTVar4;
-
- if (Level <= DebugLevel) {
- if (VerboseOutput) {
- printf("%s",Text);
- }
- if (SHM != (TSharedMemory *)0x0) {
- Semaphore::down(&LogfileMutex);
- strncpy(SHM->PrintBuffer[SHM->PrintBufferPosition],Text,0x7f);
- SHM->PrintBuffer[SHM->PrintBufferPosition][0x7e] = '\0';
- pTVar4 = SHM;
- iVar3 = SHM->PrintBufferPosition;
- if (SHM->PrintBuffer[iVar3][0] != '\0') {
- sVar1 = strlen(SHM->PrintBuffer[iVar3]);
- if (pTVar4->PrintBuffer[iVar3 + -1][sVar1 + 0x7f] != '\n') {
- strcat(pTVar4->PrintBuffer[pTVar4->PrintBufferPosition],"\n");
- pTVar4 = SHM;
- }
- }
- iVar2 = pTVar4->PrintBufferPosition + 1;
- iVar3 = 0;
- if (iVar2 < 200) {
- iVar3 = iVar2;
- }
- pTVar4->PrintBufferPosition = iVar3;
- Semaphore::up(&LogfileMutex);
- return;
- }
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-int GetPrintlogPosition(void)
-
-{
- int iVar1;
-
- iVar1 = 0;
- if (SHM != (TSharedMemory *)0x0) {
- iVar1 = SHM->PrintBufferPosition;
- }
- return iVar1;
-}
-
-
-
-char * GetPrintlogLine(int Line)
-
-{
- char (*pacVar1) [128];
-
- if ((SHM == (TSharedMemory *)0x0) || (199 < Line)) {
- pacVar1 = (char (*) [128])0x0;
- }
- else {
- pacVar1 = SHM->PrintBuffer + Line;
- }
- return *pacVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void IncrementObjectCounter(void)
-
-{
- if (SHM != (TSharedMemory *)0x0) {
- SHM->ObjectCounter = SHM->ObjectCounter + 1;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void DecrementObjectCounter(void)
-
-{
- if (SHM != (TSharedMemory *)0x0) {
- SHM->ObjectCounter = SHM->ObjectCounter - 1;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-ulong GetObjectCounter(void)
-
-{
- ulong uVar1;
-
- uVar1 = 0;
- if (SHM != (TSharedMemory *)0x0) {
- uVar1 = SHM->ObjectCounter;
- }
- return uVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void IncrementPlayersOnline(void)
-
-{
- if (SHM != (TSharedMemory *)0x0) {
- SHM->PlayersOnline = SHM->PlayersOnline + 1;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void DecrementPlayersOnline(void)
-
-{
- if (SHM != (TSharedMemory *)0x0) {
- SHM->PlayersOnline = SHM->PlayersOnline + -1;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-int GetPlayersOnline(void)
-
-{
- int iVar1;
-
- iVar1 = 0;
- if (SHM != (TSharedMemory *)0x0) {
- iVar1 = SHM->PlayersOnline;
- }
- return iVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void IncrementNewbiesOnline(void)
-
-{
- if (SHM != (TSharedMemory *)0x0) {
- SHM->NewbiesOnline = SHM->NewbiesOnline + 1;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void DecrementNewbiesOnline(void)
-
-{
- if (SHM != (TSharedMemory *)0x0) {
- SHM->NewbiesOnline = SHM->NewbiesOnline + -1;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-int GetNewbiesOnline(void)
-
-{
- int iVar1;
-
- iVar1 = 0;
- if (SHM != (TSharedMemory *)0x0) {
- iVar1 = SHM->NewbiesOnline;
- }
- return iVar1;
-}
-
-
-
-void SetRoundNr(ulong RoundNr)
-
-{
- if (SHM != (TSharedMemory *)0x0) {
- SHM->RoundNr = RoundNr;
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-ulong GetRoundNr(void)
-
-{
- ulong uVar1;
-
- uVar1 = 0;
- if (SHM != (TSharedMemory *)0x0) {
- uVar1 = SHM->RoundNr;
- }
- return uVar1;
-}
-
-
-
-void SetCommand(int Command,char *Text)
-
-{
- TSharedMemory *pTVar1;
-
- pTVar1 = SHM;
- if (SHM != (TSharedMemory *)0x0) {
- SHM->Command = Command;
- if (Text == (char *)0x0) {
- pTVar1->CommandBuffer[0] = '\0';
- }
- else {
- strncpy(pTVar1->CommandBuffer,Text,0x100);
- SHM->CommandBuffer[0xff] = '\0';
- }
- }
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-int GetCommand(void)
-
-{
- int iVar1;
-
- iVar1 = 0;
- if (SHM != (TSharedMemory *)0x0) {
- iVar1 = SHM->Command;
- }
- return iVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-char * GetCommandBuffer(void)
-
-{
- char *pcVar1;
-
- pcVar1 = (char *)0x0;
- if (SHM != (TSharedMemory *)0x0) {
- if (SHM->Command == 0) {
- pcVar1 = (char *)0x0;
- }
- else {
- pcVar1 = SHM->CommandBuffer;
- }
- }
- return pcVar1;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-bool DeleteSHM(void)
-
-{
- int SHMID;
- int iVar1;
- bool bVar2;
-
- iVar1 = shmget(SHMKey,0,0);
- if (iVar1 == -1) {
- if (VerboseOutput != false) {
- puts("DeleteSHM: SharedMemory existiert nicht.");
- }
- bVar2 = true;
- }
- else {
- iVar1 = shmctl(iVar1,0,(shmid_ds *)0x0);
- bVar2 = true;
- if (iVar1 == -1) {
- if (VerboseOutput != false) {
- puts(&DAT_080f1020);
- }
- bVar2 = false;
- }
- }
- return bVar2;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void CreateSHM(void)
-
-{
- bool bVar1;
- int SHMID;
- int iVar2;
- int *piVar3;
- undefined4 *puVar4;
- int iter;
-
- bVar1 = false;
- while( true ) {
- iVar2 = shmget(SHMKey,0x6524,0x7ff);
- if (iVar2 != -1) {
- return;
- }
- piVar3 = __errno_location();
- if ((*piVar3 != 0x11) || (bVar1)) break;
- bVar1 = DeleteSHM();
- if (!bVar1) {
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "Cannot delete SharedMemory";
- goto LAB_08056d20;
- }
- bVar1 = true;
- }
- if (VerboseOutput != false) {
- piVar3 = __errno_location();
- printf("CreateSHM: Kann SharedMemory nicht anlegen (Fehler %d).\n",*piVar3);
- }
- puVar4 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar4 = "Cannot create SharedMemory";
-LAB_08056d20:
- // WARNING: Subroutine does not return
- // try { // try from 08056d33 to 08056d37 has its CatchHandler @ 08056d72
- __cxa_throw(puVar4,char_const*::typeinfo,0);
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void AttachSHM(void)
-
-{
- int SHMID;
- int __shmid;
- undefined4 *puVar1;
-
- __shmid = shmget(SHMKey,0x6524,0);
- if (__shmid == -1) {
- if (VerboseOutput != false) {
- puts("AttachSHM: Kann SharedMemory nicht fassen.");
- }
- SHM = (TSharedMemory *)0x0;
- puVar1 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar1 = "Cannot get SharedMemory";
- }
- else {
- SHM = (TSharedMemory *)shmat(__shmid,(void *)0x0,0);
- if (SHM != (TSharedMemory *)0xffffffff) {
- return;
- }
- if (VerboseOutput != false) {
- puts("AttachSHM: Kann SharedMemory nicht anbinden.");
- }
- SHM = (TSharedMemory *)0x0;
- puVar1 = (undefined4 *)__cxa_allocate_exception(4);
- *puVar1 = "Cannot attach SharedMemory";
- }
- // WARNING: Subroutine does not return
- // try { // try from 08056e1e to 08056e22 has its CatchHandler @ 08056e54
- __cxa_throw(puVar1,char_const*::typeinfo,0);
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void DetachSHM(void)
-
-{
- int result;
- int iVar1;
-
- if (SHM != (TSharedMemory *)0x0) {
- iVar1 = shmdt(SHM);
- if ((iVar1 == -1) && (VerboseOutput != false)) {
- puts(&DAT_080f1160);
- }
- SHM = (TSharedMemory *)0x0;
- }
- return;
-}
-
-
-
-void InitSHM(bool Verbose)
-
-{
- TSharedMemory *pTVar1;
- uint uVar2;
- __pid_t _Var3;
- TSharedMemory *pTVar4;
-
- IsGameServer = true;
- VerboseOutput = Verbose;
- // try { // try from 08056ecb to 08056eec has its CatchHandler @ 08056fe8
- CreateSHM();
- AttachSHM();
- SetErrorFunction(ErrorHandler);
- SetPrintFunction(PrintHandler);
- pTVar4 = SHM;
- uVar2 = 0x6524;
- if (((uint)SHM & 4) != 0) {
- SHM->Command = 0;
- uVar2 = 0x6520;
- pTVar4 = (TSharedMemory *)pTVar4->CommandBuffer;
- }
- for (uVar2 = uVar2 >> 2; uVar2 != 0; uVar2 = uVar2 - 1) {
- pTVar4->Command = 0;
- pTVar4 = (TSharedMemory *)pTVar4->CommandBuffer;
- }
- pTVar4 = SHM;
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0) = 'S';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 1) = 'H';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 2) = 'M';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 3) = ' ';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 4) = 'i';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 5) = 'n';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 6) = 'i';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 7) = 't';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 8) = 'i';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 9) = 'a';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 10) = 'l';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0xb) = 'i';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0xc) = 'z';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0xd) = 'e';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0xe) = 'd';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0xf) = '.';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x10) = ' ';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x11) = 'S';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x12) = 'y';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x13) = 's';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x14) = 't';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x15) = 'e';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x16) = 'm';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x17) = ' ';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x18) = 'p';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x19) = 'r';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x1a) = 'i';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x1b) = 'n';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x1c) = 't';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x1d) = 'i';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x1e) = 'n';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x1f) = 'g';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x20) = ' ';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x21) = 'i';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x22) = 's';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x23) = ' ';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x24) = 'w';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x25) = 'o';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x26) = 'r';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x27) = 'k';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x28) = 'i';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x29) = 'n';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x2a) = 'g';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x2b) = '!';
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x2c) = '\n';
- pTVar1 = SHM;
- *(char *)((int)(pTVar4->PrintBuffer + 0) + 0x2d) = '\0';
- SHM->Errors = 0;
- pTVar1->RoundNr = 0;
- pTVar1->PrintBufferPosition = 1;
- pTVar1->ObjectCounter = 0;
- pTVar1->GameState = GAME_STARTING;
- _Var3 = getpid();
- pTVar1->GameThreadPID = _Var3;
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void ExitSHM(void)
-
-{
- int result;
- int iVar1;
-
- SetErrorFunction((TErrorFunction *)0x0);
- SetPrintFunction((TPrintFunction *)0x0);
- if (SHM != (TSharedMemory *)0x0) {
- iVar1 = shmdt(SHM);
- if ((iVar1 == -1) && (VerboseOutput != false)) {
- puts(&DAT_080f1160);
- }
- SHM = (TSharedMemory *)0x0;
- }
- DeleteSHM();
- return;
-}
-
-
-
-void InitSHMExtern(bool Verbose)
-
-{
- VerboseOutput = Verbose;
- // try { // try from 0805706e to 08057072 has its CatchHandler @ 08057077
- AttachSHM();
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void ExitSHMExtern(void)
-
-{
- int result;
- int iVar1;
-
- if (SHM != (TSharedMemory *)0x0) {
- iVar1 = shmdt(SHM);
- if ((iVar1 == -1) && (VerboseOutput != false)) {
- puts(&DAT_080f1160);
- }
- SHM = (TSharedMemory *)0x0;
- }
- return;
-}
-
-
-
void __tcf_0(void *param_1)
{
diff --git a/reference/types.hh b/reference/types.hh
index d79cf0c..e66ea72 100644
--- a/reference/types.hh
+++ b/reference/types.hh
@@ -1,89 +1,4 @@
-struct Object {
- uint32 ObjectID;
-};
-
-struct TSkill {
- int (**_vptr.TSkill)(...); // VTABLE?
- int DAct;
- int MDAct;
- uint16 SkNr;
- TCreature *Master;
- int Act;
- int Max;
- int Min;
- int FactorPercent;
- int LastLevel;
- int NextLevel;
- int Delta;
- int Exp;
- int Cycle;
- int MaxCycle;
- int Count;
- int MaxCount;
- int AddLevel;
-};
-
-struct TSkillAdd {
- TSkill super_TSkill; // INHERITANCE?
-};
-struct TSkillHitpoints {
- TSkillAdd super_TSkillAdd; // INHERITANCE?
-};
-
-struct TSkillSoulpoints {
- TSkillAdd super_TSkillAdd; // INHERITANCE?
-};
-
-struct TSkillProbe {
- TSkill super_TSkill; // INHERITANCE?
-};
-
-struct TSkillMana {
- TSkillAdd super_TSkillAdd; // INHERITANCE?
-};
-
-struct TSkillGoStrength {
- TSkillAdd super_TSkillAdd; // INHERITANCE?
-};
-
-struct TSkillLight {
- TSkill super_TSkill; // INHERITANCE?
-};
-
-struct TSkillEnergy {
- TSkill super_TSkill; // INHERITANCE?
-};
-
-struct TSkillCarryStrength {
- TSkillAdd super_TSkillAdd; // INHERITANCE?
-};
-
-struct TSkillPoison {
- TSkill super_TSkill; // INHERITANCE?
-};
-
-struct TSkillBurning {
- TSkill super_TSkill; // INHERITANCE?
-};
-
-struct TSkillFed {
- TSkill super_TSkill; // INHERITANCE?
-};
-
-struct TSkillIllusion {
- TSkill super_TSkill; // INHERITANCE?
-};
-
-struct TSkillLevel {
- TSkill super_TSkill; // INHERITANCE?
-};
-
-struct TSkillBase {
- TSkill *Skills[25];
- TSkill *TimerList[25];
- uint16 FirstFreeTimer;
-};
struct TImpact {
int (**_vptr.TImpact)(...); // VTABLE?
@@ -145,142 +60,6 @@ struct TDamageImpact {
bool AllowDefense;
};
-struct TCombatEntry {
- uint32 ID;
- uint32 Damage;
- int TimeStamp;
-};
-
-struct TCombat {
- TCreature *Master;
- uint32 EarliestAttackTime;
- uint32 EarliestDefendTime;
- uint32 LastDefendTime;
- uint32 LatestAttackTime;
- uint32 AttackMode;
- uint32 ChaseMode;
- uint32 SecureMode;
- uint32 AttackDest;
- bool Following;
- Object Shield;
- Object Close;
- Object Missile;
- Object Throw;
- Object Wand;
- Object Ammo;
- bool Fist;
- uint32 CombatDamage;
- int ActCombatEntry;
- TCombatEntry CombatList[20];
- int LearningPoints;
-};
-
-struct TOutfit {
- int OutfitID;
- union{
- uint16 ObjectType;
- uint8 Colors[4];
- };
-};
-
-struct TCreature {
- int (**_vptr.TCreature)(...); // CREATURE VTABLE?
- TSkillBase super_TSkillBase; // INHERITANCE?
- TCombat Combat;
- uint32 ID;
- TCreature *NextHashEntry;
- uint32 NextChainCreature;
- char Name[31];
- char Murderer[31];
- TOutfit OrgOutfit;
- TOutfit Outfit;
- int startx;
- int starty;
- int startz;
- int posx;
- int posy;
- int posz;
- int Sex;
- int Race;
- int Direction;
- int Radius;
- CreatureType Type;
- bool IsDead;
- int LoseInventory;
- bool LoggingOut;
- bool LogoutAllowed;
- uint32 EarliestLogoutRound;
- uint32 EarliestProtectionZoneRound;
- uint32 EarliestYellRound;
- uint32 EarliestTradeChannelRound;
- uint32 EarliestSpellTime;
- uint32 EarliestMultiuseTime;
- uint32 EarliestWalkTime;
- uint32 LifeEndRound;
- TKnownCreature *FirstKnowingConnection;
- int SummonedCreatures;
- uint32 FireDamageOrigin;
- uint32 PoisonDamageOrigin;
- uint32 EnergyDamageOrigin;
- Object CrObject;
- vector<TToDoEntry> ToDoList;
- int ActToDo;
- int NrToDo;
- uint32 NextWakeup;
- bool Stop;
- bool LockToDo;
- uint8 Profession;
- TConnection *Connection;
-};
-
-
-struct TKnownCreature {
- KNOWNCREATURESTATE State;
- uint32 CreatureID;
- TKnownCreature *Next;
- TConnection *Connection;
-};
-
-struct TConnection {
- uint8 InData[2048];
- int InDataSize;
- bool SigIOPending;
- bool WaitingForACK;
- uint8 OutData[16384];
- uint8 field5_0x4806;
- uint8 field6_0x4807;
- int NextToSend;
- int NextToCommit;
- int NextToWrite;
- bool Overflow;
- bool WillingToSend;
- uint8 field12_0x4816;
- uint8 field13_0x4817;
- TConnection *NextSendingConnection;
- uint32 RandomSeed;
- CONNECTIONSTATE State;
- pid_t PID;
- int Socket;
- char IPAddress[16];
- TXTEASymmetricKey SymmetricKey;
- bool ConnectionIsOk;
- bool ClosingIsDelayed;
- uint8 field23_0x4852;
- uint8 field24_0x4853;
- uint32 TimeStamp;
- uint32 TimeStampAction;
- int TerminalType;
- int TerminalVersion;
- int TerminalOffsetX;
- int TerminalOffsetY;
- int TerminalWidth;
- int TerminalHeight;
- uint32 CharacterID;
- char Name[31];
- uint8 field35_0x4897;
- TKnownCreature KnownCreatureTable[150];
-};
-
struct TCircle {
int x[32];
int y[32];
@@ -300,59 +79,6 @@ struct TSpellList {
int Amount;
};
-struct TToDoEntry {
- ToDoType Code;
- union{
- struct{
- uint32 Time;
- } Wait;
-
- struct{
- int x;
- int y;
- int z;
- } Go;
-
- struct{
- int Direction;
- } Rotate;
-
- struct{
- uint32 Obj;
- int x;
- int y;
- int z;
- int Count;
- } Move;
-
- struct{
- uint32 Obj;
- uint32 Partner;
- } Trade;
-
- struct{
- uint32 Obj1;
- uint32 Obj2;
- int Dummy;
- } Use;
-
- struct{
- uint32 Obj;
- } Turn;
-
- struct{
- uint32 Text; // POINTER?
- int Mode;
- uint32 Addressee;
- bool CheckSpamming;
- } Talk;
-
- struct{
- int NewState;
- } ChangeState;
- };
-};
-
struct TXTEASymmetricKey {
int (**_vptr.TXTEASymmetricKey)(...); // VTABLE?
uint8 m_SymmetricKey[16];
@@ -405,20 +131,6 @@ struct TPreparedQuery {
char *Name;
};
-struct TSharedMemory {
- int Command;
- char CommandBuffer[256];
- ulong RoundNr;
- ulong ObjectCounter;
- ulong Errors;
- int PlayersOnline;
- int NewbiesOnline;
- int PrintBufferPosition;
- char PrintBuffer[200][128];
- enum GAMESTATE GameState;
- pid_t GameThreadPID;
-};
-
struct TPlayerIndexNode {
bool InternalNode;
};
@@ -539,16 +251,6 @@ struct listnode<storeunit<TWaitinglistEntry,_100>_> { // Original name: listnode
struct storeunit<TWaitinglistEntry,100> data;
};
-struct ObjectType {
- int TypeID;
-};
-
-struct TItemData {
- struct ObjectType Type;
- int Maximum;
- int Probability;
-};
-
struct TAttackWave {
int x;
int y;
@@ -564,16 +266,6 @@ struct TAttackWave {
struct vector<TItemData> ExtraItem;
};
-struct TSkillData {
- int Nr;
- int Actual;
- int Minimum;
- int Maximum;
- int NextLevel;
- int FactorPercent;
- int AddLevel;
-};
-
struct store<TWaitinglistEntry,100> {
struct list<storeunit<TWaitinglistEntry,_100>_> *Units;
union storeitem<TWaitinglistEntry> *firstFreeItem;
@@ -656,19 +348,7 @@ struct listIterator<storeunit<TWaitinglistEntry,_100>_> { // Original name: list
struct listnode<storeunit<TWaitinglistEntry,_100>_> *actNode;
};
-struct TSpellData {
- enum SpellShapeType Shape;
- int ShapeParam1;
- int ShapeParam2;
- int ShapeParam3;
- int ShapeParam4;
- enum SpellImpactType Impact;
- int ImpactParam1;
- int ImpactParam2;
- int ImpactParam3;
- int ImpactParam4;
- int Delay;
-};
+
struct storeunit<TNode,256> {
union storeitem<TNode> item[256];
@@ -734,14 +414,6 @@ struct list<storeunit<TNode,_256>_> { // Original name: list<storeunit<TNode, 25
struct listnode<storeunit<TNode,_256>_> *lastNode;
};
-struct TObjectType {
- char *Name;
- char *Description;
- uchar Flags[9];
- ulong Attributes[62];
- int AttributeOffsets[18];
-};
-
struct TCondition {
int Type;
ulong Text;
@@ -1207,53 +879,6 @@ struct TBehaviourDatabase {
int Behaviours;
};
-struct TMonster {
- struct TNonplayer super_TNonplayer;
- int Home;
- ulong Master;
- ulong Target;
-};
-
-struct TRaceData {
- char Name[30];
- char Article[3];
- struct TOutfit Outfit;
- struct ObjectType MaleCorpse;
- struct ObjectType FemaleCorpse;
- enum BloodType Blood;
- int ExperiencePoints;
- int FleeThreshold;
- int Attack;
- int Defend;
- int Armor;
- int Poison;
- int SummonCost;
- int LoseTarget;
- int Strategy[4];
- bool KickBoxes;
- bool KickCreatures;
- bool SeeInvisible;
- bool Unpushable;
- bool DistanceFighting;
- bool NoSummon;
- bool NoIllusion;
- bool NoConvince;
- bool NoBurning;
- bool NoPoison;
- bool NoEnergy;
- bool NoHit;
- bool NoLifeDrain;
- bool NoParalyze;
- int Skills;
- struct vector<TSkillData> Skill;
- int Talks;
- struct vector<long_unsigned_int> Talk;
- int Items;
- struct vector<TItemData> Item;
- int Spells;
- struct vector<TSpellData> Spell;
-};
-
struct TQueryManagerConnection {
int BufferSize;
uchar *Buffer;