Fixed the issue where you had to warp to the collapse point every time you logged in in space. #323
Open
jionychiow wants to merge 10 commits intoEvEmu-Project:masterfrom
Open
Fixed the issue where you had to warp to the collapse point every time you logged in in space. #323jionychiow wants to merge 10 commits intoEvEmu-Project:masterfrom
jionychiow wants to merge 10 commits intoEvEmu-Project:masterfrom
Conversation
…e you logged in in space.
Reviewer's GuideAdds proper saving and restoring of precise ship coordinates on logout/login, refactors location persistence into a shared helper, and conditions login warp so players don’t get warped if they are already near their saved position. Sequence diagram for logout/login ship position saving and conditional login warpsequenceDiagram
actor Player
participant Client
participant Ship
participant ShipSE
participant ItemDB
rect rgb(230,230,250)
Player->>Client: Request_logout
Client->>Client: WarpOut()
Client->>Client: SaveLocationData("Logout")
alt ShipSE_available
Client->>ShipSE: GetPosition()
ShipSE-->>Client: GPoint
Client->>Ship: SetPosition(GPoint)
else ShipSE_null
Client->>Ship: Use_current_ship_position
end
Client->>Ship: SaveShip()
Ship->>ItemDB: SaveItem(x,y,z)
ItemDB-->>Ship: Save_success
end
rect rgb(230,255,230)
Player->>Client: Login_and_select_character
Client->>Ship: position()
Ship-->>Client: GPoint
Client->>Client: Set m_loginWarpPoint
Client->>Client: Set m_loginWarpRandomPoint_to_saved_position
Client->>Client: MoveToLocation(locationID, m_loginWarpRandomPoint)
Client->>Client: WarpIn()
Client->>Client: UpdateBubble()
Client->>Client: Compute_distance = |position - m_loginWarpPoint|
alt distance > LOGIN_WARP_DISTANCE_THRESHOLD
Client->>Client: SetStateTimer(0)
Client->>Client: m_clientState = LoginWarp
else distance <= LOGIN_WARP_DISTANCE_THRESHOLD
Client->>Client: m_clientState = Idle
Client->>Client: Clear m_loginWarpPoint and m_loginWarpRandomPoint
Client->>Client: GetShipSE()
Client-->>ShipSE: reference
Client->>ShipSE: DestinyMgr().Stop()
Client->>ShipSE: DestinyMgr().UnCloak()
Client->>ShipSE: SysBubble().GetEntity(shipID)
alt Ship_not_in_bubble
Client->>ShipSE: SysBubble().Add(ShipSE)
end
Client->>ShipSE: SysBubble().SendAddBalls(ShipSE)
Client->>Client: SetStateSent(false)
Client->>ShipSE: DestinyMgr().SendSetState()
end
end
Class diagram for updated Client ship location and warp logicclassDiagram
class Client {
+double LOGIN_WARP_DISTANCE_THRESHOLD
+GPoint m_loginWarpPoint
+GPoint m_loginWarpRandomPoint
+uint32 m_locationID
+SystemData m_systemData
+shared_ptr~Ship~ m_ship
+ShipSE* pShipSE
+void WarpIn()
+void WarpOut()
+void SaveLocationData(const char* customInfoPrefix)
+bool SelectCharacter(int32 charID)
+void MoveToLocation(uint32 location, const GPoint& pt)
+void UpdateBubble()
+void SetStateTimer(uint32 ms)
+void SetStateSent(bool sent)
+ShipSE* GetShipSE()
}
class Ship {
+uint32 itemID
+GPoint position
+void SetPosition(GPoint pos)
+GPoint position()
+void SaveShip()
+void SetCustomInfo(const char* info)
+void SetFlag(uint32 flag)
}
class ShipSE {
+uint32 GetID()
+GPoint GetPosition()
+DestinyMgr* DestinyMgr()
+SysBubble* SysBubble()
}
class DestinyMgr {
+void Stop()
+void UnCloak()
+void SendSetState()
}
class SysBubble {
+Entity* GetEntity(uint32 id)
+void Add(ShipSE* se)
+void SendAddBalls(ShipSE* se)
}
class ItemDB {
+void SaveItem(uint32 itemID, double x, double y, double z)
}
Client --> Ship : owns
Client --> ShipSE : uses
ShipSE --> DestinyMgr : uses
ShipSE --> SysBubble : uses
Ship ..> ItemDB : SaveShip() calls SaveItem()
SysBubble --> ShipSE : manages
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
SaveLocationData,pShipSEis used without being passed in or clearly initialized within the function, which makes the helper brittle and hard to reason about; consider passing the ship entity explicitly or retrieving it inside the function in a well-defined way instead of relying on an external pointer. - The new
SaveLocationDatahelper both updates ship position and sets logout-related flags/custom info; if you intend to reuse this method in non-logout flows, consider separating pure position persistence from logout/offline flag handling to avoid unintended side effects in future callers. - In
WarpIn, when skipping the login warp you call bothSysBubble()->Add(se)andSysBubble()->SendAddBalls(se); ifAddalready triggers the broadcast, this may result in duplicate add-ball notifications, so it might be worth confirming and consolidating to a single code path for adding and broadcasting.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `SaveLocationData`, `pShipSE` is used without being passed in or clearly initialized within the function, which makes the helper brittle and hard to reason about; consider passing the ship entity explicitly or retrieving it inside the function in a well-defined way instead of relying on an external pointer.
- The new `SaveLocationData` helper both updates ship position and sets logout-related flags/custom info; if you intend to reuse this method in non-logout flows, consider separating pure position persistence from logout/offline flag handling to avoid unintended side effects in future callers.
- In `WarpIn`, when skipping the login warp you call both `SysBubble()->Add(se)` and `SysBubble()->SendAddBalls(se)`; if `Add` already triggers the broadcast, this may result in duplicate add-ball notifications, so it might be worth confirming and consolidating to a single code path for adding and broadcasting.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
File: src/eve-server/Client.cpp
- Problem: The server mistakenly set the "structureid" field when the player docked at the traditional space station, causing the client to think the player was inside the structure rather than the traditional space station.
- Fix: Replace pSession->SetInt("structureid", stationID) with pSession->Clear("structureid") (twice)
### 2. Missing Method in StructureDirectoryService
File:
- src/eve-server/structuredirectory/StructureDirectoryService.h
- src/eve-server/structuredirectory/StructureDirectoryService.cpp
- Issue: The client called the GetStructuresInSystem and GetStructureMapData methods, but the server did not implement them.
- Fix: Added the declaration and implementation of the GetStructuresInSystem and GetStructureMapData methods, and returned an empty list.
### 3. Incorrect Return Format of AchievementTrackerMgrService
File: src/eve-server/achievementtracker/AchievementTrackerMgrService.cpp
- Problem: Returning an empty dictionary causes a KeyError on the client side.
- Fix: Modified to return a dictionary structure containing completedDict and eventDict.
- Problem: The GetMySkillHandler returns a tuple (RemoteObject, None), but the client expects to directly obtain the RemoteObject.
- Fix: Modified to directly return the bound object instead of calling MachoBindObject.
### 5. LSCProxyService JoinChannels Returns None
File: src/eve-server/lscproxy/LSCProxyService.cpp
- Question: JoinChannels returns None, causing a TypeError in the client.
- Fix: Modified to return an empty list instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Save coordinates when logging out: In WarpOut(), get the current precise coordinates of the ship, and then call m_ship->SaveShip() to save them to the database.
Database saving mechanism: SaveShip() calls ItemDB::SaveItem(), which saves the coordinates (x, y, z) of the ship to the corresponding fields of the entity table.
Restore on next login: When the character logs in next time, the system will read the saved coordinates of the ship from the database instead of using the default point or random point.
Summary by Sourcery
Persist ship position on logout and use it to avoid unnecessary login warp when the ship is already near its saved location.
Enhancements: