Skip to content

Commit

Permalink
begin adding my coding notes
Browse files Browse the repository at this point in the history
Signed-off-by: Allan <[email protected]>
  • Loading branch information
zhyrohaad committed Apr 2, 2021
1 parent 9432530 commit 478774c
Show file tree
Hide file tree
Showing 20 changed files with 7,361 additions and 0 deletions.
871 changes: 871 additions & 0 deletions doc/code_and_design_notes/Alasiya_TODO

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions doc/code_and_design_notes/Process-call_layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
Alasiya EvEmu Process Call PseudoCode
updated 12Aug20 (incomplete)


Main Server Loop {
[if exit]
shutdown;

[if new connection]
[create and assign new client object]
[add new client to map and perform initial proc]

EntityList::Process();

[if proc time < loop time]
thread::sleep();
}

EntityList::Process() {
client->ProcessNet(); -- do network connection things (connect, ping, d/c)

[onSubTic] -- this is currently 250ms
TargetManager->Process();
ProbeSE->Process();

[onTic] -- this is 1hz tic
Client->ProcessClient();
[forEach system]
SystemManager->ProcessTic(); -- if this returns false (empty system), system is unloaded and removed

sCivMgr.Process();
sBubbleMgr.Process();

[onMinTic] -- this is 60s tic
sMissionDataMgr.Process();

[on5MinTic]
sWHMgr.Process();
[forEach system]
cur.second->UpdateData(); -- update active system timers and dynamic data every 5m

[on15MinTic]
sMktBotMgr.Process(); -- update orders in current system based on settings, travel to next system
sConsole.UpdateStatus();

[onHourTic]
MapDB::ManipulateTimeData();
sMktMgr.Process(); -- compile recent market data and update history in db
}


TargetManager->Process()
[if isTargeted or hasTarget]
[check distances, attack, add/remove target, etc as needed]

ProbeSE->Process()
[check for movement and action timers and update client as needed]


sWHMgr.Process()
-- loop current wormholes for status, kill off expired wh, spawn new wh as needed

sBubbleMgr.Process()
[if bubble empty]
delete(); -- this removes bubble from system, and releases its resources (bubble unloading)
[forEach bubble] -- this loop contains data for all loaded bubbles
SystemBubble->Process(); -- bubbles are proc in order created, independent of system


SystemBubble->Process()
[if players in bubble]
[spawn npcs]

Client->ProcessClient(); -- check timers, do actions as required


SystemManager->ProcessTic() {
[if system empty]
return false;

m_anomMgr->Process();
m_beltMgr->Process();
m_spawnMgr->Process();

[forEach entity]
SE->Process();
}

m_anomMgr->Process()
[check timer and current counts and spawn anomaly as needed]

m_beltMgr->Process()
[check for and set active belts]

m_spawnMgr->Process()
[check for popped npcs and respawn accordingly]


SE->Process()
SystemEntity::Process();
-- do whatever else is needed for this entity (in it's specific class code)


SystemEntity::Process() -- generic base class call for each SE to process movement
DestinyManager->Process();


DestinyManager->Process()
-- this processes ALL movement in space (except scan probes, which are governed by separate code)
-- make calls, checks, and updates as needed to move object


115 changes: 115 additions & 0 deletions doc/code_and_design_notes/classes_by_itemID
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

*******************************
********* ITEM CLASSES BASED ON UniqueIdetifier (UID)
<0 private chat channels
1 static chat channels
1k temp Planet Structures (PinIDs - sent from client)
100k bookmark folders ** not implemented yet
350k market groups
500k Factions
1m NPC Corp
2m1 trial-friendly chat channels
3m Agents/NPCs
4m Trader NPCs (TraderJoe = 4m)
9m Universes
10m K-Space Region (known space)
11m W-Space Region (Wormhole space)
12m A-Space Region (Abyssal space - not in crucible)
20m K-Space Constellation
20m W-Space Constellation
20m A-Space Constellation
30m K-Space Solar System
31m W-Space Solar System
32m A-Space Solar System
40m Celestial (star:multiple_types,groupID=6, planet:multiple_types,groupID=7, moon:typeID=14,groupID=8; belt:typeID=15,groupID=9)
50m Stargate (groupid 10)
60m Stations (groupid 15, catid 3)
61m Outposts ** need to put Outpost creation here @ 61m, and save in mapDenormalize table.
64m Trading ** containers for trade. this is the inventory item all traded items are contained in, but separate, ofc.
66m OfficeFolder
68m FactoryFolder
70m UniverseAsteroid ** this is NON-targetable, NON-selectable roids. deco only
80m Control Bunker (to 80m1) ** not sure what this is yet
81m Promenades (WIS shit)
82m Planatary Districts
90m PlayerCharacters (-1 = max NPC Item)
98m PlayerCorps
99m Alliance
100m Station Office ** corp officeID. used for locationID of items in corp hangar, based on flag.
110m temp SEs
130m Planet Structures (PinIDs)
135m Customs Offices (67253 planets) ** 1004746013567 on live
140m saved DSEs, player items
140m saved dynamic system entities, player items
450m asteroid SEs
500m player drones
600m bookmarks - player created ** 1130462570 on live
635m bookmarks - mission created ** not implemented yet
650m blueprints ** not implemented yet ** 1007111250519 on live
*** begin temp, non-saved UIDs
750m npcs and jetcans used as tracking markers
950m fleetIDs
960m wingIDs
970m squadIDs
1b temp DSEs (missiles only at this time) ** 9000000000001190696 on live
1b2 dungeon SEs
2b1 max int32
9e0 fake items


9223372036854775807 max int64
18446744073709551615 max uint64 (unsigned types removed from Alasiya-EvEmu -allan 10Dec17)

maxInt = 2147483647
maxBigint = 9223372036854775807L


20:07:36 G Alasiya's EvEMu: Common Account Roles:
20:07:36 W ROLE_DEV: 7131450020691447808(0x62f8000280c41000)
20:07:36 W ROLE_STD: 6917529029788565504(0x6000000080000000)
20:07:36 W ROLE_VIP: 7061644217868615680(0x6200000080400000)
20:07:36 W ROLE_VIP+: 7061644217877004288(0x6200000080c00000)
20:07:36 W ROLE_VIEW: 139611588448485376(0x1f0000000000000)
20:07:36 W ROLE_BOSS: 7203507614729375744(0x63f8000280c41000)
20:07:36 W ROLE_SLASH: 7079658624976683008(0x6240000280c40000)
20:07:36 W ROLE_CREATOR: 7124694621250392064(0x62e0000280c41000)
20:07:36 W
20:07:36 G Alasiya's EvEMu: Common Corp Roles:
20:07:36 W Role_All: 1134904941433847168(0xfbffe07fffffd80)
20:07:36 W Role_Cont: 558551906910208(0x1fc0000000000)
20:07:36 W Role_Admin: 1152919339943329665(0xffffe07ffffff81)
20:07:36 W Role_Hangar: 134209536(0x7ffe000)
20:07:36 W Role_Account: 4503616673022208(0x100003f8000100)
20:07:36 W Role_Starbase: 441354962505564160(0x620020000000000)


EvE ids (from client data)
0 10k System items (including junkyards and other special purpose items
.5m 1m Factions
1m 2m NPC corporations
3m 4m NPC characters (agents and NPC corporation CEO's)
9m 10m Universes
10m 11m NEW-EDEN Regions
11m 12m Wormhole Regions
12m 13m Abyssal regions
20m 21m NEW-EDEN Constellations
21m 22m Wormhole Constellations
22m 23m Abyssal constellations
30m 31m NEW-EDEN Solar systems
31m 32m Wormhole Solar systems
32m 33m Abyssal systems
40m 50m Celestials (suns, planets, moons, asteroid belts)
50m 60m Stargates
60m 61m Stations created by CCP
61m 64m Stations created from outposts
68m 69m Station folders for stations created by CCP
69m 70m Station folders for stations created from outposts
70m 80m Asteroids
80m 80m1 Control Bunkers
81m 82m WiS Promenades
82m 85m Planetary Districts
90m 98m EVE characters created after 2010-11-03
98m 99m Corporations created after 2010-11-03
99m 100m EVE alliances created after 2010-11-03
100m 2b1 EVE characters, corporations and/or alliances created before 2010-11-03
2b1 DUST characters, EVE characters created after 2016-05-30
83 changes: 83 additions & 0 deletions doc/code_and_design_notes/coding_rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

http://www.modernescpp.com/index.php/c-core-guidelines-constructors-assignments-and-desctructors


C++ provides six default operations, sometimes also called special functions, for managing the lifecycle of an object.
The default operations are related. This means if you implement or =delete one of them, you have to think about the five others.
These operations are:
a default constructor: X()
a copy constructor: X(const X&)
a copy assignment: operator=(const X&)
a move constructor: X(X&&)
a move assignment: operator=(X&&)
a destructor: ~X()

C++ provides value semantic and not reference semantic for its types.
Value semantic: Value (or “copy”) semantics mean assignment copies the value, not just the pointer.
Reference semantic: With reference semantics, assignment is a pointer-copy (i.e., a reference).



The 9 default operations rules in C++:
C.80: Use =default if you have to be explicit about using the default semantics
C.81: Use =delete when you want to disable default behavior (without wanting an alternative)
C.82: Don’t call virtual functions in constructors and destructors
C.83: For value-like types, consider providing a noexcept swap function
C.84: A swap may not fail
C.85: Make swap noexcept
C.86: Make == symmetric with respect of operand types and noexcept
C.87: Beware of == on base classes
C.89: Make a hash noexcept



Does my class need a destructor?
Most of the times the answer is no and you are fine with the rule of zero.
Sometimes the answer is yes and we are back to the rule of five.
The guidelines provide eight rules for destructors:
C.30: Define a destructor if a class needs an explicit action at object destruction
C.31: All resources acquired by a class must be released by the class’s destructor
C.32: If a class has a raw pointer (T*) or reference (T&), consider whether it might be owning
C.33: If a class has an owning pointer member, define a destructor
C.34: If a class has an owning reference member, define a destructor
C.35: A base class destructor should be either public and virtual, or protected and nonvirtual
C.36: A destructor may not fail
C.37: Make destructors noexcept



The 15 C++11 features you must really use in your C++ projects.
https://cppdepend.com/blog/?p=319
1- auto
2- nullptr
3- shared_ptr
4- Strongly-typed enums
5- static assert
6- Variadic template
7- Range-based for loops
8- Initializer lists
9- noexcept
10- move
11- lambda
12- Explicitly defaulted and deleted special member functions
13- override identifier
14- std::thread
15- Unordered containers


static variable (class)
lifetime = program runtime (1)
visibility = determined by access modifiers (private/protected/public)

static variable (global scope)
lifetime = program runtime (1)
visibility = the compilation unit it is instantiated in (2)

heap variable
lifetime = defined by you (new to delete)
visibility = defined by you (whatever you assign the pointer to)

stack variable
visibility = from declaration until scope is exited
lifetime = from declaration until declaring scope is exited

Loading

0 comments on commit 478774c

Please sign in to comment.