-
-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add createBuilding for server #3897
base: master
Are you sure you want to change the base?
Add createBuilding for server #3897
Conversation
@@ -129,8 +129,12 @@ class CClientGame | |||
SCRIPTFILE, | |||
WATER, | |||
WEAPON, | |||
POINTLIGHTS, | |||
_DATABASE_CONNECTION, // server only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not DATABASE_CONNECTION
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's server only and unexpected on the client.
POINTLIGHTS, | ||
_DATABASE_CONNECTION, // server only | ||
TRAIN_TRACK, | ||
ROOT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ROOT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synced with the server.
case CCLIENTBUILDING: | ||
{ | ||
CClientBuilding* pBuilding = static_cast<CClientBuilding*>(pSource); | ||
const unsigned short usCurrentModel = pBuilding->GetModel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto
or std::uint16_t
currentModel
instead of usCurrentModel
?
building
instead of pBuilding
?
CClientBuilding* pBuilding = static_cast<CClientBuilding*>(pSource); | ||
const unsigned short usCurrentModel = pBuilding->GetModel(); | ||
|
||
if (usCurrentModel != usModel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
early break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok with one break at the end of the block.
CBuildingListType::const_iterator IterBegin() const { return m_List.begin(); }; | ||
CBuildingListType::const_iterator IterEnd() const { return m_List.end(); }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
begin()
and end()
const noexcept
useless trailing ;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should share the same interface with another managers. It's useful for lambda functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should share the same interface with another managers.
Understandable. Please make at least a begin and end methods for standard range based loop
It's useful for lambda functions
Not really since for range loops exist
@@ -82,6 +82,8 @@ class CElement | |||
TRAIN_TRACK, | |||
ROOT, | |||
UNKNOWN, | |||
BUILDING, | |||
_POINTLIGHTS, // client only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why _
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clientside only
…te_building_server
Closes #3716
Test resource: building_serverside.zip