Skip to content

Commit

Permalink
修正所有的拼写错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Daylily-Zeleen committed Jan 9, 2025
1 parent b807c33 commit b6a5438
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 201 deletions.
193 changes: 97 additions & 96 deletions gd_eos/eos_code_generator.py

Large diffs are not rendered by default.

140 changes: 70 additions & 70 deletions gd_eos/include/core/utils.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gd_eos/include/eos_multiplayer_peer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class EOSMultiplayerPeer : public MultiplayerPeerExtension {
public:
enum Event : uint8_t {
EVENT_STORE_PACKET,
EVENT_RECIEVE_PEER_ID,
EVENT_RECEIVE_PEER_ID,
EVENT_MESH_CONNECTION_REQUEST
};

Expand Down
10 changes: 5 additions & 5 deletions gd_eos/src/editor/eos_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ void EOSExportPlugin::_export_begin(const PackedStringArray &features, bool is_d
String arch;
for (const String &feature : features) {
if (feature == "arm32") {
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architechture tags!");
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architecture tags!");
arch = feature;
} else if (feature == "arm64") {
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architechture tags!");
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architecture tags!");
arch = feature;
} else if (feature == "x86_32") {
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architechture tags!");
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architecture tags!");
arch = feature;
} else if (feature == "x86_64") {
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architechture tags!");
ERR_CONTINUE_MSG(!arch.is_empty(), "Exporting features have multiple architecture tags!");
arch = feature;
}
}
ERR_FAIL_COND_MSG(arch.is_empty(), "EOS Exporting: Unknown architechture, can't add shared object.");
ERR_FAIL_COND_MSG(arch.is_empty(), "EOS Exporting: Unknown architecture, can't add shared object.");
add_shared_object(binary_base_dir.path_join("android").path_join(arch).path_join("libEOSSDK.so"), Array::make(arch), "/");
}
}
Expand Down
36 changes: 18 additions & 18 deletions gd_eos/src/eos_multiplayer_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Error EOSMultiplayerPeer::create_client(const String &socket_id, const Ref<EOSPr

//send connection request to server
EOSPacket packet;
packet.set_event(EVENT_RECIEVE_PEER_ID);
packet.set_event(EVENT_RECEIVE_PEER_ID);
packet.set_channel(CH_RELIABLE);
packet.set_reliability(EOS_EPacketReliability::EOS_PR_ReliableUnordered);
packet.set_sender_peer_id(unique_id);
Expand Down Expand Up @@ -410,8 +410,8 @@ Dictionary EOSMultiplayerPeer::get_all_peers() {
* Parameters:
* allow - bool used to set allowed delivery.
* Description: Set whether or not delayed delivery should be allowed on all sent packets.
* This means that packets will be delayed in their delivery if a connenetion with the other
* peer has not been estalished yet, otherwise the packets will be dropped.
* This means that packets will be delayed in their delivery if a connection with the other
* peer has not been established yet, otherwise the packets will be dropped.
****************************************/
void EOSMultiplayerPeer::set_allow_delayed_delivery(bool allow) {
allow_delayed_delivery = allow;
Expand All @@ -430,7 +430,7 @@ bool EOSMultiplayerPeer::is_allowing_delayed_delivery() {
* Parameters:
* enable - bool used to set auto accept connection requests.
* Description: Set whether or not to auto accept connection requests when they are
* recieved. If this is off, connection requests are put into a list to be accepted
* received. If this is off, connection requests are put into a list to be accepted
* or denied later if desired.
****************************************/
void EOSMultiplayerPeer::set_auto_accept_connection_requests(bool enable) {
Expand Down Expand Up @@ -597,8 +597,8 @@ Error EOSMultiplayerPeer::_put_packet(const uint8_t *p_buffer, int32_t p_buffer_

/*IMPORTANT NOTE: EOS does not support an unreliable ordered transfer mode,
so it has been left out. EOSMultiplayerPeer prints a warning and automatically sets the transfer
mode to TRANSFER_MODE_RELIABLE if the user tries to set to unreliable ordred.
See _set_transer_mode()*/
mode to TRANSFER_MODE_RELIABLE if the user tries to set to unreliable ordered.
See _set_transfer_mode()*/
switch (_get_transfer_mode()) {
case TRANSFER_MODE_UNRELIABLE: {
reliability = EOS_EPacketReliability::EOS_PR_UnreliableUnordered;
Expand Down Expand Up @@ -649,7 +649,7 @@ Error EOSMultiplayerPeer::_put_packet(const uint8_t *p_buffer, int32_t p_buffer_
* _get_available_packet_count
* Description: Called by MultiplayerAPI to query how
* many packets are currently queued. The MultiplayerAPI calls this method
* every time it polls to determine if there are packets to recieve.
* every time it polls to determine if there are packets to receive.
****************************************/
int32_t EOSMultiplayerPeer::_get_available_packet_count() const {
return socket.get_packet_count();
Expand All @@ -667,7 +667,7 @@ int32_t EOSMultiplayerPeer::_get_max_packet_size() const {
/****************************************
* _get_packet_channel
* Description: Called by MultiplayerAPI to get the channel of next
* avaialble packet in the packet queue.
* available packet in the packet queue.
****************************************/
int32_t EOSMultiplayerPeer::_get_packet_channel() const {
return socket.get_packet_channel();
Expand All @@ -676,7 +676,7 @@ int32_t EOSMultiplayerPeer::_get_packet_channel() const {
/****************************************
* _get_packet_mode
* Description: Called by MultiplayerAPI to get the transfer mode of next
* avaialble packet in the packet queue.
* available packet in the packet queue.
****************************************/
MultiplayerPeer::TransferMode EOSMultiplayerPeer::_get_packet_mode() const {
return _convert_eos_reliability_to_transfer_mode(socket.get_packet_reliability());
Expand Down Expand Up @@ -761,10 +761,10 @@ bool EOSMultiplayerPeer::_is_server() const {
/****************************************
* _poll
* Description: Called by MultiplayerAPI every network frame to poll queued packets inside EOSPacketPeerMediator.
* Packets are recieved first from EOSPacketPeerMediator. Once polled, the event type of each packet
* Packets are received first from EOSPacketPeerMediator. Once polled, the event type of each packet
* are retrieved from the first byte of the packet.
* 1. If the event type is EVENT_RECIEVED_PEER_ID, the sender peer id contained inside the packet header is added to the list of
* connected peers for this mutliplayer instance. This usually happens only once when peers first establish a connection.
* 1. If the event type is EVENT_RECEIVED_PEER_ID, the sender peer id contained inside the packet header is added to the list of
* connected peers for this multiplayer instance. This usually happens only once when peers first establish a connection.
* 2. If the event is EVENT_STORE_PACKET, the packet is queued into the socket's packet queue to be
* retrieved by the MultiplayerAPI later (See _get_packet()).
* 3. If the event is EVENT_MESH_CONNECTION_REQUEST, then do nothing. This event is just to notify the multiplayer instance
Expand Down Expand Up @@ -813,11 +813,11 @@ void EOSMultiplayerPeer::_poll() {

socket.push_packet(packet);
} break;
case Event::EVENT_RECIEVE_PEER_ID: {
case Event::EVENT_RECEIVE_PEER_ID: {
uint32_t peer_id = *reinterpret_cast<const uint32_t *>(data_ptr.ptr() + INDEX_PEER_ID);

if (event == Event::EVENT_RECIEVE_PEER_ID) {
ERR_FAIL_COND_MSG(active_mode == MODE_CLIENT && connection_status == CONNECTION_CONNECTED, "Client has recieved a EVENT_RECIEVE_PEER_ID packet when already connected. This shouldn't have happened!");
if (event == Event::EVENT_RECEIVE_PEER_ID) {
ERR_FAIL_COND_MSG(active_mode == MODE_CLIENT && connection_status == CONNECTION_CONNECTED, "Client has received a EVENT_RECEIVE_PEER_ID packet when already connected. This shouldn't have happened!");

if (active_mode == MODE_CLIENT && peer_id != 1) {
_close();
Expand Down Expand Up @@ -1061,7 +1061,7 @@ bool EOSMultiplayerPeer::_is_requesting_connection(EOS_ProductUserId p_remote_us
* Parameters:
* mode - The transfer mode to convert.
* Description: A helper function that converts the given transfer mode to matching packet reliability.
* If TRANSFER_MODE_UNRELIABLE_ORDED is passed, the function returns EOS_PR_ReliableOrdered because EOS
* If TRANSFER_MODE_UNRELIABLE_ORDERED is passed, the function returns EOS_PR_ReliableOrdered because EOS
* does not support unreliable ordered
****************************************/
EOS_EPacketReliability EOSMultiplayerPeer::_convert_transfer_mode_to_eos_reliability(TransferMode mode) const {
Expand Down Expand Up @@ -1122,15 +1122,15 @@ void EOSMultiplayerPeer::_disconnect_remote_user(EOS_ProductUserId remote_user_i
* peer who just connected, the socket id that the remote peer connected to, the connection type (which tells
* you whether it was a new connection or a re-connection), and the network type (which tells you if it is a direct
* connection or a relay server is being used.) When a connection is established for the first time and the instance
* is not a client, a packet will be sent back to the newly connected peer with the EVENT_RECIEVE_PEER_ID event.
* is not a client, a packet will be sent back to the newly connected peer with the EVENT_RECEIVE_PEER_ID event.
* This is how servers and mesh instances peers exchange their peer ids with newly connected peers.
****************************************/
void EOSMultiplayerPeer::peer_connection_established_callback(const EOS_P2P_OnPeerConnectionEstablishedInfo *data) {
if (data->ConnectionType == EOS_EConnectionEstablishedType::EOS_CET_NewConnection &&
active_mode != MODE_CLIENT) { //We're either a server or mesh
//Send peer id to connected peer
EOSPacket packet;
packet.set_event(EVENT_RECIEVE_PEER_ID);
packet.set_event(EVENT_RECEIVE_PEER_ID);
packet.set_channel(CH_RELIABLE);
packet.set_reliability(EOS_EPacketReliability::EOS_PR_ReliableUnordered);
packet.set_sender_peer_id(unique_id);
Expand Down
22 changes: 11 additions & 11 deletions gd_eos/src/eos_packet_peer_mediator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* The mediator receives packets from the EOS P2P interface every process
* frame and sorts those packets according to their destination socket so
* that the appropriate multiplayer instance can poll them later. The mediator
* receives EOS notifications and fowards it to the appropriate multiplayer
* receives EOS notifications and forwards it to the appropriate multiplayer
* instance according to the socket the notification was received from.
* Mediator manages incoming connection requests and forwards them to the
* appropriate multiplayer instance according to the socket id of the
Expand Down Expand Up @@ -52,7 +52,7 @@ void EOSPacketPeerMediator::_bind_methods() {
* that it can execute every process frame (see _init()). Checks if there are
* any packets available from the incoming packet queue. If there are, receives
* the packet and sorts it into separate queues according to it's destination socket. Packets that
* are peer id packets (packets with EVENT_RECIEVE_PEER_ID) and pushed to the front. Packets will
* are peer id packets (packets with EVENT_RECEIVE_PEER_ID) and pushed to the front. Packets will
* stop being polled if the queue size limit is reached.
****************************************/
void EOSPacketPeerMediator::_on_process_frame() {
Expand All @@ -70,11 +70,11 @@ void EOSPacketPeerMediator::_on_process_frame() {
packet_size_options.RequestedChannel = nullptr;
uint32_t max_packet_size;

EOS_P2P_ReceivePacketOptions recieve_packet_options;
recieve_packet_options.ApiVersion = EOS_P2P_RECEIVEPACKET_API_LATEST;
recieve_packet_options.LocalUserId = local_user_id;
recieve_packet_options.MaxDataSizeBytes = EOS_P2P_MAX_PACKET_SIZE;
recieve_packet_options.RequestedChannel = nullptr;
EOS_P2P_ReceivePacketOptions receive_packet_options;
receive_packet_options.ApiVersion = EOS_P2P_RECEIVEPACKET_API_LATEST;
receive_packet_options.LocalUserId = local_user_id;
receive_packet_options.MaxDataSizeBytes = EOS_P2P_MAX_PACKET_SIZE;
receive_packet_options.RequestedChannel = nullptr;

bool next_packet_available = true;
EOS_EResult result = EOS_EResult::EOS_Success;
Expand All @@ -97,7 +97,7 @@ void EOSPacketPeerMediator::_on_process_frame() {
uint8_t channel;
EOS_P2P_SocketId socket;
EOS_ProductUserId remote_user;
result = EOS_P2P_ReceivePacket(EOSP2P::get_singleton()->get_handle(), &recieve_packet_options, &remote_user, &socket, &channel, packet_data.ptrw(), &buffer_size);
result = EOS_P2P_ReceivePacket(EOSP2P::get_singleton()->get_handle(), &receive_packet_options, &remote_user, &socket, &channel, packet_data.ptrw(), &buffer_size);
String socket_name = socket.SocketName;

ERR_FAIL_COND_MSG(result == EOS_EResult::EOS_InvalidParameters, "Failed to get packet! Invalid parameters.");
Expand All @@ -112,7 +112,7 @@ void EOSPacketPeerMediator::_on_process_frame() {
packet->set_sender(remote_user);
uint8_t event = packet->get_data().ptr()[EOSMultiplayerPeer::INDEX_EVENT_TYPE];

if (event == EOSMultiplayerPeer::EVENT_RECIEVE_PEER_ID) {
if (event == EOSMultiplayerPeer::EVENT_RECEIVE_PEER_ID) {
socket_packet_queues[socket_name].push_front(packet);
} else {
socket_packet_queues[socket_name].push_back(packet);
Expand Down Expand Up @@ -169,7 +169,7 @@ bool EOSPacketPeerMediator::register_peer(EOSMultiplayerPeer *peer) {
* unregister_peer
* Parameters:
* peer - The peer to be unregistered with the mediator.
* Description: Unregisteres a peer and it's socket with the mediator.
* Description: Unregisters a peer and it's socket with the mediator.
* Peers can no longer receive packets, notifications, or connection requests once this is done.
* unregistration usually happens when a peer closes.
****************************************/
Expand Down Expand Up @@ -308,7 +308,7 @@ bool EOSPacketPeerMediator::next_packet_is_peer_id_packet(const String &socket_i
const SharedPtr<PacketData> &packet = socket_packet_queues[socket_id][0];
uint8_t event = packet->get_data().ptr()[EOSMultiplayerPeer::INDEX_EVENT_TYPE];

return event == EOSMultiplayerPeer::EVENT_RECIEVE_PEER_ID;
return event == EOSMultiplayerPeer::EVENT_RECEIVE_PEER_ID;
}

/****************************************
Expand Down

0 comments on commit b6a5438

Please sign in to comment.