Skip to content
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

fix: NetworkStats: use the correct types to reflect open.mp's struct #2

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

ZantetsukenGT
Copy link
Contributor

Original c++ struct:

struct NetworkStats
{
	unsigned connectionStartTime;
	unsigned messageSendBuffer;
	unsigned messagesSent;
	unsigned totalBytesSent;
	unsigned acknowlegementsSent;
	unsigned acknowlegementsPending;
	unsigned messagesOnResendQueue;
	unsigned messageResends;
	unsigned messagesTotalBytesResent;
	float packetloss;
	unsigned messagesReceived;
	unsigned messagesReceivedPerSecond;
	unsigned bytesReceived;
	unsigned acknowlegementsReceived;
	unsigned duplicateAcknowlegementsReceived;
	double bitsPerSecond;
	double bpsSent;
	double bpsReceived;
	bool isActive; // only for player network statistics
	int connectMode; // only for player network statistics
	unsigned connectionElapsedTime;
};
  • unsigned doesn't map to usize, the correct equivalent is u32
  • int doesn't map to isize, the correct equivalent is i32
  • double doesn't map to f32, the correct equivalent is f64
  • the comments belong to different attributes

@Sreyas-Sreelal Sreyas-Sreelal self-assigned this Jun 7, 2024
@Sreyas-Sreelal
Copy link
Owner

Thank you :)

@Sreyas-Sreelal Sreyas-Sreelal merged commit 94e9ac5 into Sreyas-Sreelal:master Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants