|
EvEmu
0.8.4
11 September 2021
|

Go to the source code of this file.
Macros | |
| #define | SIZE 100 |
Functions | |
| uint16 | crc_hqx (const uint8 *data, size_t len, uint16 crc) |
| int64 | filesize (const char *filename) |
| Obtains filesize. More... | |
| int64 | filesize (FILE *fd) |
| Obtains filesize. More... | |
| int64 | npowof2 (int64 num) |
| Calculates next (greater or equal) power-of-two number. More... | |
| int64 | MakeRandomInt (int64 low, int64 high) |
| Generates random integer from interval [low; high]. More... | |
| double | MakeRandomFloat (double low, double high) |
| Generates random real from interval [low; high]. More... | |
| uint32 | CreatePIDFile (const std::string &filename) |
| create PID file More... | |
Variables | |
| static uint16 | crc16_table [256] |
| #define SIZE 100 |
Referenced by EvE::traceStack().
This is functionally equivalent to python's binascii.crc_hqx.
| [in] | data | Binary data to be checksumed. |
| [in] | len | Length of binary data. |
| [in] | crc | CRC value to start with. |
Definition at line 67 of file misc.cpp.
Referenced by PyService::_BuildCachedReturn().

| uint32 CreatePIDFile | ( | const std::string & | filename | ) |
| int64 filesize | ( | const char * | filename | ) |
Obtains filesize.
| [in] | filename | Name of file to examine. |
Definition at line 75 of file misc.cpp.
References filesize().
Referenced by filesize(), and CachedObjectMgr::LoadCachedFile().


| int64 filesize | ( | FILE * | fd | ) |
Obtains filesize.
| [in] | fd | Descriptor of file to examine. |
| double MakeRandomFloat | ( | double | low = 0, |
| double | high = 1 |
||
| ) |
Generates random real from interval [low; high].
| [in] | low | Low boundary of interval. |
| [in] | high | High boundary of interval. |
Definition at line 114 of file misc.cpp.
Referenced by TurretModule::ApplyDamage(), AnomalyMgr::CreateAnomaly(), ShipSE::DamageRandModule(), TurretFormulas::GetDroneToHit(), StaticDataMgr::GetLoot(), TurretFormulas::GetNPCToHit(), DungeonMgr::GetRandLevel(), TurretFormulas::GetSentryToHit(), TurretFormulas::GetToHit(), Sentry::Killed(), NPC::Killed(), ShipSE::Killed(), ActiveModule::LaunchProbe(), PlanetSE::LoadExtras(), DungeonMgr::MakeDungeon(), MakeRandomInt(), GPoint::MakeRandomPointOnSphere(), Vector3D::MakeRandomPointOnSphere(), GPoint::MakeRandomPointOnSphereLayer(), Vector3D::MakeRandomPointOnSphereLayer(), NPCAIMgr::MissileLaunched(), SpawnMgr::PrepSpawn(), ConcordAI::Process(), MiningLaser::ProcessCycle(), DroneAIMgr::SetEngaged(), ConcordAI::SetEngaged(), ConcordAI::SetSignaling(), BeltMgr::SpawnBelt(), NPCAIMgr::Targeted(), and SpawnMgr::WarpOutSpawn().

Generates random integer from interval [low; high].
| [in] | low | Low boundary of interval. |
| [in] | high | High boundary of interval. |
Definition at line 109 of file misc.cpp.
References MakeRandomFloat().
Referenced by APIAccountManager::_GenerateAPIKey(), DungeonMgr::AddDecoToVector(), SystemEntity::ApplyDamage(), Prospector::CheckSuccess(), Command_spawn(), Command_spawnn(), PlanetSE::CreateCustomsOffice(), MissionDataMgr::CreateMissionOffer(), SystemEntity::DropLoot(), Prospector::DropSalvage(), Client::Eject(), GenerateKey(), Agent::GetAcceptRsp(), EntityList::GetAnomalyID(), SystemGPoint::GetAnomalyPoint(), Agent::GetCompleteRsp(), Agent::GetDeclineRsp(), AnomalyMgr::GetDungeonType(), StaticDataMgr::GetLoot(), MapData::GetMissionDestination(), SystemManager::GetRandBeltID(), ModuleManager::GetRandModule(), SystemGPoint::GetRandMoon(), SystemGPoint::GetRandPlanet(), SystemGPoint::GetRandPointOnMoon(), SystemGPoint::GetRandPointOnPlanet(), StaticDataMgr::GetRandRatType(), FleetService::GetRandUnitIDs(), Agent::GetStandingsRsp(), CustomsSE::Killed(), StructureSE::Killed(), ShipSE::Killed(), PlanetSE::LoadExtras(), DungeonMgr::MakeDungeon(), SpawnMgr::MakeSpawn(), SpawnMgr::PrepSpawn(), SpawnMgr::ReSpawn(), SystemBubble::SetSpawnTimer(), NPCAIMgr::SetWander(), and BeltMgr::SpawnBelt().


Calculates next (greater or equal) power-of-two number.
| [in] | num | Base number. |
Definition at line 95 of file misc.cpp.
Referenced by Buffer::_CalcBufferCapacity().
