diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-05-20 16:41:03 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-05-20 16:41:03 -0300 |
| commit | 42be37f4ad99fc8580415fed89939e305d56193e (patch) | |
| tree | 41303aace3c214f925a43fec6a857f313196e38d /reference/game.c | |
| parent | 7fe30185df21617cf44100f89db462cd4501050e (diff) | |
| download | game-42be37f4ad99fc8580415fed89939e305d56193e.tar.gz game-42be37f4ad99fc8580415fed89939e305d56193e.zip | |
implement `main.cc`, `shm.cc`, and `time.cc` + overall tweeks
Diffstat (limited to 'reference/game.c')
| -rw-r--r-- | reference/game.c | 1747 |
1 files changed, 0 insertions, 1747 deletions
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)
{
|
