revert all code back except platform

This commit is contained in:
Kolyah35
2026-03-03 01:22:26 +03:00
parent a86d333478
commit 13010f10fa
16 changed files with 90 additions and 98 deletions

View File

@@ -85,7 +85,7 @@ unsigned int splitPacketId, unsigned int splitPacketIndex, unsigned int splitPac
sprintf(str3,"%5u",reliableMessageNumber);
}
sprintf(into, "%s,%s%s,%s,%s,%5u,%s,%u,%llu,%s,%s,%i,%i,%i,%i,%s,"
sprintf(into, "%s,%s%s,%s,%s,%5u,%s,%u,%"PRINTF_64_BIT_MODIFIER"u,%s,%s,%i,%i,%i,%i,%s,"
, localtime
, prefix
, dir
@@ -144,7 +144,7 @@ void PacketLogger::OnAck(unsigned int messageNumber, SystemAddress remoteSystemA
char localtime[128];
GetLocalTime(localtime);
sprintf(str, "%s,Rcv,Ack,%i,,,,%llu,%s,%s,,,,,,"
sprintf(str, "%s,Rcv,Ack,%i,,,,%"PRINTF_64_BIT_MODIFIER"u,%s,%s,,,,,,"
, localtime
, messageNumber
, (unsigned long long) time
@@ -164,7 +164,7 @@ void PacketLogger::OnPushBackPacket(const char *data, const BitSize_t bitsUsed,
char localtime[128];
GetLocalTime(localtime);
sprintf(str, "%s,Lcl,PBP,,,%s,%i,%llu,%s,%s,,,,,,"
sprintf(str, "%s,Lcl,PBP,,,%s,%i,%"PRINTF_64_BIT_MODIFIER"u,%s,%s,,,,,,"
, localtime
, BaseIDTOString(data[0])
, bitsUsed
@@ -226,7 +226,7 @@ void PacketLogger::WriteMiscellaneous(const char *type, const char *msg)
char localtime[128];
GetLocalTime(localtime);
sprintf(str, "%s,Lcl,%s,,,,,%llu,%s,,,,,,,%s"
sprintf(str, "%s,Lcl,%s,,,,,%"PRINTF_64_BIT_MODIFIER"u,%s,,,,,,,%s"
, localtime
, type
, (unsigned long long) time

View File

@@ -25,8 +25,8 @@ void RAK_DLL_EXPORT RakNet::StatisticsToString( RakNetStatistics *s, char *buffe
if (verbosityLevel==0)
{
sprintf(buffer,
"Bytes per second sent %llu\n"
"Bytes per second received %llu\n"
"Bytes per second sent %"PRINTF_64_BIT_MODIFIER"u\n"
"Bytes per second received %"PRINTF_64_BIT_MODIFIER"u\n"
"Current packetloss %.1f%%\n",
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_SENT],
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_RECEIVED],
@@ -36,15 +36,15 @@ void RAK_DLL_EXPORT RakNet::StatisticsToString( RakNetStatistics *s, char *buffe
else if (verbosityLevel==1)
{
sprintf(buffer,
"Actual bytes per second sent %llu\n"
"Actual bytes per second received %llu\n"
"Message bytes per second pushed %llu\n"
"Total actual bytes sent %llu\n"
"Total actual bytes received %llu\n"
"Total message bytes pushed %llu\n"
"Actual bytes per second sent %"PRINTF_64_BIT_MODIFIER"u\n"
"Actual bytes per second received %"PRINTF_64_BIT_MODIFIER"u\n"
"Message bytes per second pushed %"PRINTF_64_BIT_MODIFIER"u\n"
"Total actual bytes sent %"PRINTF_64_BIT_MODIFIER"u\n"
"Total actual bytes received %"PRINTF_64_BIT_MODIFIER"u\n"
"Total message bytes pushed %"PRINTF_64_BIT_MODIFIER"u\n"
"Current packetloss %.1f%%\n"
"Average packetloss %.1f%%\n"
"Elapsed connection time in seconds %llu\n",
"Elapsed connection time in seconds %"PRINTF_64_BIT_MODIFIER"u\n",
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_SENT],
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_RECEIVED],
(long long unsigned int) s->valueOverLastSecond[USER_MESSAGE_BYTES_PUSHED],
@@ -60,7 +60,7 @@ void RAK_DLL_EXPORT RakNet::StatisticsToString( RakNetStatistics *s, char *buffe
{
char buff2[128];
sprintf(buff2,
"Send capacity %llu bytes per second (%.0f%%)\n",
"Send capacity %"PRINTF_64_BIT_MODIFIER"u bytes per second (%.0f%%)\n",
(long long unsigned int) s->BPSLimitByCongestionControl,
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / s->BPSLimitByCongestionControl
);
@@ -70,7 +70,7 @@ void RAK_DLL_EXPORT RakNet::StatisticsToString( RakNetStatistics *s, char *buffe
{
char buff2[128];
sprintf(buff2,
"Send limit %llu (%.0f%%)\n",
"Send limit %"PRINTF_64_BIT_MODIFIER"u (%.0f%%)\n",
(long long unsigned int) s->BPSLimitByOutgoingBandwidthLimit,
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / s->BPSLimitByOutgoingBandwidthLimit
);
@@ -80,27 +80,27 @@ void RAK_DLL_EXPORT RakNet::StatisticsToString( RakNetStatistics *s, char *buffe
else
{
sprintf(buffer,
"Actual bytes per second sent %llu\n"
"Actual bytes per second received %llu\n"
"Message bytes per second sent %llu\n"
"Message bytes per second resent %llu\n"
"Message bytes per second pushed %llu\n"
"Message bytes per second processed %llu\n"
"Message bytes per second ignored %llu\n"
"Total bytes sent %llu\n"
"Total bytes received %llu\n"
"Total message bytes sent %llu\n"
"Total message bytes resent %llu\n"
"Total message bytes pushed %llu\n"
"Total message bytes received %llu\n"
"Total message bytes ignored %llu\n"
"Actual bytes per second sent %"PRINTF_64_BIT_MODIFIER"u\n"
"Actual bytes per second received %"PRINTF_64_BIT_MODIFIER"u\n"
"Message bytes per second sent %"PRINTF_64_BIT_MODIFIER"u\n"
"Message bytes per second resent %"PRINTF_64_BIT_MODIFIER"u\n"
"Message bytes per second pushed %"PRINTF_64_BIT_MODIFIER"u\n"
"Message bytes per second processed %"PRINTF_64_BIT_MODIFIER"u\n"
"Message bytes per second ignored %"PRINTF_64_BIT_MODIFIER"u\n"
"Total bytes sent %"PRINTF_64_BIT_MODIFIER"u\n"
"Total bytes received %"PRINTF_64_BIT_MODIFIER"u\n"
"Total message bytes sent %"PRINTF_64_BIT_MODIFIER"u\n"
"Total message bytes resent %"PRINTF_64_BIT_MODIFIER"u\n"
"Total message bytes pushed %"PRINTF_64_BIT_MODIFIER"u\n"
"Total message bytes received %"PRINTF_64_BIT_MODIFIER"u\n"
"Total message bytes ignored %"PRINTF_64_BIT_MODIFIER"u\n"
"Messages in send buffer, by priority %i,%i,%i,%i\n"
"Bytes in send buffer, by priority %i,%i,%i,%i\n"
"Messages in resend buffer %i\n"
"Bytes in resend buffer %llu\n"
"Bytes in resend buffer %"PRINTF_64_BIT_MODIFIER"u\n"
"Current packetloss %.1f%%\n"
"Average packetloss %.1f%%\n"
"Elapsed connection time in seconds %llu\n",
"Elapsed connection time in seconds %"PRINTF_64_BIT_MODIFIER"u\n",
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_SENT],
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_RECEIVED],
(long long unsigned int) s->valueOverLastSecond[USER_MESSAGE_BYTES_SENT],
@@ -128,7 +128,7 @@ void RAK_DLL_EXPORT RakNet::StatisticsToString( RakNetStatistics *s, char *buffe
{
char buff2[128];
sprintf(buff2,
"Send capacity %llu bytes per second (%.0f%%)\n",
"Send capacity %"PRINTF_64_BIT_MODIFIER"u bytes per second (%.0f%%)\n",
(long long unsigned int) s->BPSLimitByCongestionControl,
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / s->BPSLimitByCongestionControl
);
@@ -138,7 +138,7 @@ void RAK_DLL_EXPORT RakNet::StatisticsToString( RakNetStatistics *s, char *buffe
{
char buff2[128];
sprintf(buff2,
"Send limit %llu (%.0f%%)\n",
"Send limit %"PRINTF_64_BIT_MODIFIER"u (%.0f%%)\n",
(long long unsigned int) s->BPSLimitByOutgoingBandwidthLimit,
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / s->BPSLimitByOutgoingBandwidthLimit
);

View File

@@ -124,7 +124,7 @@ static const unsigned int MAX_OFFLINE_DATA_LENGTH=400; // I set this because I l
#pragma warning(disable:4309) // 'initializing' : truncation of constant value
#endif
// Make sure highest bit is 0, so isValid in DatagramHeaderFormat is false
static const char OFFLINE_MESSAGE_DATA_ID[16]={0x00,(char)0xFF,(char)0xFF,0x00,(char)0xFE,(char)0xFE,(char)0xFE,(char)0xFE,(char)0xFD,(char)0xFD,(char)0xFD, (char)0xFD,0x12,0x34,0x56,0x78};
static const char OFFLINE_MESSAGE_DATA_ID[16]={0x00,0xFF,0xFF,0x00,0xFE,0xFE,0xFE,0xFE,0xFD,0xFD,0xFD,0xFD,0x12,0x34,0x56,0x78};
struct PacketFollowedByData
{

View File

@@ -1361,7 +1361,7 @@ bool ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer(
#ifdef PRINT_TO_FILE_ROT
if (fp)
{
fprintf(fp, "Heap push %i, %s, weight=%llu. OI=%i. waiting on %i. SI=%i.\n", receivedPacketNumber, type, weight, internalPacket->orderingIndex.val, orderedReadIndex[internalPacket->orderingChannel].val, internalPacket->sequencingIndex);
fprintf(fp, "Heap push %i, %s, weight=%"PRINTF_64_BIT_MODIFIER"u. OI=%i. waiting on %i. SI=%i.\n", receivedPacketNumber, type, weight, internalPacket->orderingIndex.val, orderedReadIndex[internalPacket->orderingChannel].val, internalPacket->sequencingIndex);
fflush(fp);
}
#endif

View File

@@ -1248,7 +1248,7 @@ int SocketLayer::SendTo_PC( SOCKET s, const char *data, int length, const System
#ifdef DEBUG_SENDTO_SPIKES
RakNetTime end = RakNet::GetTime();
static unsigned int callCount=1;
RAKNET_DEBUG_PRINTF("%i. SendTo_PC, time=%llu, elapsed=%llu, length=%i, returned=%i, binaryAddress=%i, port=%i, file=%s, line=%i\n", callCount++, end, end-start, length, len, binaryAddress, port, file, line);
RAKNET_DEBUG_PRINTF("%i. SendTo_PC, time=%"PRINTF_64_BIT_MODIFIER"u, elapsed=%"PRINTF_64_BIT_MODIFIER"u, length=%i, returned=%i, binaryAddress=%i, port=%i, file=%s, line=%i\n", callCount++, end, end-start, length, len, binaryAddress, port, file, line);
#endif
if (len<0)
{