Skip to content

Commit

Permalink
style: code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed May 24, 2024
1 parent d974784 commit 0499a1c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
4 changes: 2 additions & 2 deletions include/bedrock/command/command_origin_identity.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
#include <string>

struct CommandOriginIdentity {
std::string mXuid;
std::string mPlatformOnlineId;
std::string xuid;
std::string platform_id;
};
2 changes: 1 addition & 1 deletion include/bedrock/hashed_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class HashedString {
public:
std::uint64_t hash;
std::string str;
const HashedString* mLastMatch;
const HashedString *last_match;
};
3 changes: 1 addition & 2 deletions include/bedrock/network/network_peer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#pragma once
#include <chrono>

// Only defined as a class to make sure that name mangling happens the same
class NetworkPeer {
public:
enum class Reliability {
Expand All @@ -23,6 +22,6 @@ class NetworkPeer {
Unreliable = 0x2,
UnreliableSequenced = 0x3,
};

using PacketRecvTimepoint = std::chrono::steady_clock::time_point;
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
#pragma once

enum class Compressibility {
Compressible = 0x0,
Compressible = 0x0,
Incompressible = 0x1,
};
};
18 changes: 9 additions & 9 deletions include/bedrock/network/protocol/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
// limitations under the License.

#pragma once
#include "bedrock/network/packet_priority.h"
#include "bedrock/network/network_peer.h"
#include "bedrock/network/protocol/compressibility.h"
#include "bedrock/network/protocol/sub_client_id.h"
#include "bedrock/network/compressibility.h"
#include "bedrock/network/raknet/packet_priority.h"
class Packet {
public:
virtual ~Packet() = default;

private:
PacketPriority mPriority; // + 8
NetworkPeer::Reliability mReliability; // + 12
SubClientId mSubClientId; // + 16
bool mIsHandled; // + 17
NetworkPeer::PacketRecvTimepoint mReceiveTimepoint; // + 24
void* mHandler; // + 32
Compressibility mCompressible; // + 40
PacketPriority priority_; // + 8
NetworkPeer::Reliability reliability_; // + 12
SubClientId sub_client_id_; // + 16
bool is_handled_; // + 17
NetworkPeer::PacketRecvTimepoint recv_timepoint_; // + 24
void *handler_; // + 32
Compressibility compressibility_; // + 40
};
BEDROCK_STATIC_ASSERT_SIZE(Packet, 48, 48);
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
// limitations under the License.
#pragma once


enum class PacketPriority {
IMMEDIATE_PRIORITY = 0x0,
HIGH_PRIORITY = 0x1,
MEDIUM_PRIORITY = 0x2,
LOW_PRIORITY = 0x3,
NUMBER_OF_PRIORITIES = 0x4,
};
IMMEDIATE_PRIORITY = 0x0,
HIGH_PRIORITY = 0x1,
MEDIUM_PRIORITY = 0x2,
LOW_PRIORITY = 0x3,
NUMBER_OF_PRIORITIES = 0x4,
};
8 changes: 4 additions & 4 deletions include/bedrock/social.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ class MultiplayerServiceObserver {
virtual ~MultiplayerServiceObserver() = 0;

private:
void *mpSubject;
// Real type of this is Core::Observer<Social::MultiplayerServiceObserver,Core::SingleThreadedLock>::SubjectType
// Core::Observer<Social::MultiplayerServiceObserver,Core::SingleThreadedLock>::SubjectType
void *subject_;
};

class XboxLiveUserObserver {
public:
virtual ~XboxLiveUserObserver() = 0;

private:
void *mpSubject;
// Real type of this is Core::Observer<Social::XboxLiveUserObserver,Core::SingleThreadedLock>::SubjectType ;
// Core::Observer<Social::XboxLiveUserObserver,Core::SingleThreadedLock>::SubjectType
void *subject_;
};

} // namespace Social

0 comments on commit 0499a1c

Please sign in to comment.