mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-19 22:43:32 +00:00
FIX: MSVC compile and item gui on desktop
This commit is contained in:
@@ -5,7 +5,10 @@ include(cmake/CPM.cmake)
|
|||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||||
set(CMAKE_CXX_FLAGS "-Wno-c++11-narrowing -Wno-invalid-source-encoding -Wno-reserved-user-defined-literal")
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
set(CMAKE_CXX_FLAGS "-Wno-c++11-narrowing -Wno-invalid-source-encoding -Wno-reserved-user-defined-literal")
|
||||||
|
endif()
|
||||||
|
|
||||||
CPMAddPackage("gh:madler/zlib@1.3.2")
|
CPMAddPackage("gh:madler/zlib@1.3.2")
|
||||||
CPMAddPackage(
|
CPMAddPackage(
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ First of all I made it build with CMake (w/o VS2012). Also I fixed some compile
|
|||||||
- [x] Add platform GLFW
|
- [x] Add platform GLFW
|
||||||
- [x] Compile for Linux
|
- [x] Compile for Linux
|
||||||
- [ ] Compile for android aarch64
|
- [ ] Compile for android aarch64
|
||||||
|
- [ ] Rewrite platform logic
|
||||||
|
- [ ] Fix sound
|
||||||
|
- [ ] Do a server connection gui
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
## CMake
|
## CMake
|
||||||
|
|||||||
@@ -665,7 +665,12 @@ void Minecraft::tickInput() {
|
|||||||
|
|
||||||
if (e.action == MouseAction::ACTION_WHEEL) {
|
if (e.action == MouseAction::ACTION_WHEEL) {
|
||||||
Inventory* v = player->inventory;
|
Inventory* v = player->inventory;
|
||||||
int numSlots = gui.getNumSlots() - 1;
|
|
||||||
|
int numSlots = gui.getNumSlots();
|
||||||
|
#ifndef PLATFORM_DESKTOP
|
||||||
|
numSlots--;
|
||||||
|
#endif
|
||||||
|
|
||||||
int slot = (v->selected - e.dy + numSlots) % numSlots;
|
int slot = (v->selected - e.dy + numSlots) % numSlots;
|
||||||
v->selectSlot(slot);
|
v->selectSlot(slot);
|
||||||
}
|
}
|
||||||
@@ -1266,7 +1271,7 @@ void Minecraft::hostMultiplayer(int port) {
|
|||||||
//
|
//
|
||||||
/*static*/
|
/*static*/
|
||||||
|
|
||||||
void* Minecraft::prepareLevel_tspawn(void *p_param)
|
void* Minecraft::prepareLevel_tspawn(void *p_param)
|
||||||
{
|
{
|
||||||
Minecraft* mc = (Minecraft*) p_param;
|
Minecraft* mc = (Minecraft*) p_param;
|
||||||
mc->generateLevel("Currently not used", mc->level);
|
mc->generateLevel("Currently not used", mc->level);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ void Options::initDefaultValues() {
|
|||||||
keyBuild = KeyMapping("key.inventory", Keyboard::KEY_E);
|
keyBuild = KeyMapping("key.inventory", Keyboard::KEY_E);
|
||||||
keySneak = KeyMapping("key.sneak", Keyboard::KEY_LSHIFT);
|
keySneak = KeyMapping("key.sneak", Keyboard::KEY_LSHIFT);
|
||||||
#ifndef RPI
|
#ifndef RPI
|
||||||
keyCraft = KeyMapping("key.crafting", Keyboard::KEY_Q);
|
// keyCraft = KeyMapping("key.crafting", Keyboard::KEY_Q);
|
||||||
keyDrop = KeyMapping("key.drop", Keyboard::KEY_Q);
|
keyDrop = KeyMapping("key.drop", Keyboard::KEY_Q);
|
||||||
keyChat = KeyMapping("key.chat", Keyboard::KEY_T);
|
keyChat = KeyMapping("key.chat", Keyboard::KEY_T);
|
||||||
keyFog = KeyMapping("key.fog", Keyboard::KEY_F);
|
keyFog = KeyMapping("key.fog", Keyboard::KEY_F);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "Gui.h"
|
#include "Gui.h"
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
|
#include "client/Options.h"
|
||||||
#include "screens/IngameBlockSelectionScreen.h"
|
#include "screens/IngameBlockSelectionScreen.h"
|
||||||
#include "../Minecraft.h"
|
#include "../Minecraft.h"
|
||||||
#include "../player/LocalPlayer.h"
|
#include "../player/LocalPlayer.h"
|
||||||
@@ -106,12 +107,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
|
|||||||
|
|
||||||
renderToolBar(a, ySlot, screenWidth);
|
renderToolBar(a, ySlot, screenWidth);
|
||||||
|
|
||||||
|
|
||||||
//font->drawShadow(APP_NAME, 2, 2, 0xffffffff);
|
|
||||||
//font->drawShadow("This is a demo, not the finished product", 2, 10 + 2, 0xffffffff);
|
|
||||||
#ifdef APPLE_DEMO_PROMOTION
|
|
||||||
font->drawShadow("Demo version", 2, 0 + 2, 0xffffffff);
|
|
||||||
#endif /*APPLE_DEMO_PROMOTION*/
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
unsigned int max = 10;
|
unsigned int max = 10;
|
||||||
bool isChatting = false;
|
bool isChatting = false;
|
||||||
@@ -123,9 +118,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) {
|
|||||||
renderDebugInfo();
|
renderDebugInfo();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// glPopMatrix2();
|
|
||||||
//
|
|
||||||
// glEnable(GL_ALPHA_TEST);
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
glEnable2(GL_ALPHA_TEST);
|
glEnable2(GL_ALPHA_TEST);
|
||||||
}
|
}
|
||||||
@@ -188,11 +180,13 @@ void Gui::handleClick(int button, int x, int y) {
|
|||||||
int slot = getSlotIdAt(x, y);
|
int slot = getSlotIdAt(x, y);
|
||||||
if (slot != -1)
|
if (slot != -1)
|
||||||
{
|
{
|
||||||
|
#ifndef PLATFORM_DESKTOP
|
||||||
if (slot == (getNumSlots()-1))
|
if (slot == (getNumSlots()-1))
|
||||||
{
|
{
|
||||||
minecraft->screenChooser.setScreen(SCREEN_BLOCKSELECTION);
|
minecraft->screenChooser.setScreen(SCREEN_BLOCKSELECTION);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
minecraft->player->inventory->selectSlot(slot);
|
minecraft->player->inventory->selectSlot(slot);
|
||||||
itemNameOverlayTime = 0;
|
itemNameOverlayTime = 0;
|
||||||
@@ -220,6 +214,10 @@ void Gui::handleKeyPressed(int key)
|
|||||||
{
|
{
|
||||||
minecraft->screenChooser.setScreen(SCREEN_BLOCKSELECTION);
|
minecraft->screenChooser.setScreen(SCREEN_BLOCKSELECTION);
|
||||||
}
|
}
|
||||||
|
else if (key == minecraft->options.keyDrop.key)
|
||||||
|
{
|
||||||
|
minecraft->player->inventory->dropSlot(minecraft->player->inventory->selected, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::tick() {
|
void Gui::tick() {
|
||||||
@@ -395,6 +393,7 @@ void Gui::onConfigChanged( const Config& c ) {
|
|||||||
//LOGI("x,y: %f, %f\n", xx, yy);
|
//LOGI("x,y: %f, %f\n", xx, yy);
|
||||||
}
|
}
|
||||||
rcFeedbackInner = t.end(true, rcFeedbackInner.vboId);
|
rcFeedbackInner = t.end(true, rcFeedbackInner.vboId);
|
||||||
|
|
||||||
if (c.minecraft->useTouchscreen()) {
|
if (c.minecraft->useTouchscreen()) {
|
||||||
// I'll bump this up to 6.
|
// I'll bump this up to 6.
|
||||||
int num = 6; // without "..." dots
|
int num = 6; // without "..." dots
|
||||||
@@ -452,9 +451,16 @@ void Gui::tickItemDrop()
|
|||||||
// Handle item drop
|
// Handle item drop
|
||||||
static bool isCurrentlyActive = false;
|
static bool isCurrentlyActive = false;
|
||||||
isCurrentlyActive = false;
|
isCurrentlyActive = false;
|
||||||
|
|
||||||
|
int slots = getNumSlots();
|
||||||
|
|
||||||
|
#ifndef PLATFORM_DESKTOP
|
||||||
|
slots--;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) {
|
if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) {
|
||||||
int slot = getSlotIdAt(Mouse::getX(), Mouse::getY());
|
int slot = getSlotIdAt(Mouse::getX(), Mouse::getY());
|
||||||
if (slot >= 0 && slot < getNumSlots()-1) {
|
if (slot >= 0 && slot < slots) {
|
||||||
if (slot != _currentDropSlot) {
|
if (slot != _currentDropSlot) {
|
||||||
_currentDropTicks = 0;
|
_currentDropTicks = 0;
|
||||||
_currentDropSlot = slot;
|
_currentDropSlot = slot;
|
||||||
@@ -756,20 +762,24 @@ void Gui::renderToolBar( float a, int ySlot, const int screenWidth ) {
|
|||||||
t.beginOverride();
|
t.beginOverride();
|
||||||
|
|
||||||
float x = baseItemX;
|
float x = baseItemX;
|
||||||
for (int i = 0; i < getNumSlots()-1; i++) {
|
|
||||||
|
int slots = getNumSlots();
|
||||||
|
|
||||||
|
// TODO: if using touchscreen
|
||||||
|
|
||||||
|
#ifndef PLATFORM_DESKTOP
|
||||||
|
slots--;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (int i = 0; i < slots; i++) {
|
||||||
renderSlot(i, (int)x, ySlot, a);
|
renderSlot(i, (int)x, ySlot, a);
|
||||||
x += 20;
|
x += 20;
|
||||||
}
|
}
|
||||||
_inventoryNeedsUpdate = false;
|
_inventoryNeedsUpdate = false;
|
||||||
//_inventoryRc = t.end(_inventoryRc.vboId);
|
|
||||||
|
|
||||||
//drawArrayVTC(_inventoryRc.vboId, _inventoryRc.vertexCount);
|
#ifndef PLATFORM_DESKTOP
|
||||||
|
|
||||||
//renderSlotWatch.stop();
|
|
||||||
//renderSlotWatch.printEvery(100, "Render slots:");
|
|
||||||
|
|
||||||
//int x = screenWidth / 2 + getNumSlots() * 10 + (getNumSlots()-1) * 20 + 2;
|
|
||||||
blit(screenWidth / 2 + 10 * getNumSlots() - 20 + 4, ySlot + 6, 242, 252, 14, 4, 14, 4);
|
blit(screenWidth / 2 + 10 * getNumSlots() - 20 + 4, ySlot + 6, 242, 252, 14, 4, 14, 4);
|
||||||
|
#endif
|
||||||
|
|
||||||
minecraft->textures->loadAndBindTexture("gui/gui_blocks.png");
|
minecraft->textures->loadAndBindTexture("gui/gui_blocks.png");
|
||||||
t.endOverrideAndDraw();
|
t.endOverrideAndDraw();
|
||||||
@@ -779,7 +789,7 @@ void Gui::renderToolBar( float a, int ySlot, const int screenWidth ) {
|
|||||||
glDisable2(GL_TEXTURE_2D);
|
glDisable2(GL_TEXTURE_2D);
|
||||||
t.beginOverride();
|
t.beginOverride();
|
||||||
x = baseItemX;
|
x = baseItemX;
|
||||||
for (int i = 0; i < getNumSlots()-1; i++) {
|
for (int i = 0; i < slots; i++) {
|
||||||
ItemRenderer::renderGuiItemDecorations(minecraft->player->inventory->getItem(i), x, (float)ySlot);
|
ItemRenderer::renderGuiItemDecorations(minecraft->player->inventory->getItem(i), x, (float)ySlot);
|
||||||
x += 20;
|
x += 20;
|
||||||
}
|
}
|
||||||
@@ -799,7 +809,7 @@ void Gui::renderToolBar( float a, int ySlot, const int screenWidth ) {
|
|||||||
t.beginOverride();
|
t.beginOverride();
|
||||||
if (minecraft->gameMode->isSurvivalType()) {
|
if (minecraft->gameMode->isSurvivalType()) {
|
||||||
x = baseItemX;
|
x = baseItemX;
|
||||||
for (int i = 0; i < getNumSlots()-1; i++) {
|
for (int i = 0; i < slots; i++) {
|
||||||
ItemInstance* item = minecraft->player->inventory->getItem(i);
|
ItemInstance* item = minecraft->player->inventory->getItem(i);
|
||||||
if (item && item->count >= 0)
|
if (item && item->count >= 0)
|
||||||
renderSlotText(item, k*x, k*ySlot + 1, true, true);
|
renderSlotText(item, k*x, k*ySlot + 1, true, true);
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ unsigned int splitPacketId, unsigned int splitPacketIndex, unsigned int splitPac
|
|||||||
sprintf(str3,"%5u",reliableMessageNumber);
|
sprintf(str3,"%5u",reliableMessageNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(into, "%s,%s%s,%s,%s,%5u,%s,%u,%"PRINTF_64_BIT_MODIFIER"u,%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
|
, localtime
|
||||||
, prefix
|
, prefix
|
||||||
, dir
|
, dir
|
||||||
@@ -144,7 +144,7 @@ void PacketLogger::OnAck(unsigned int messageNumber, SystemAddress remoteSystemA
|
|||||||
char localtime[128];
|
char localtime[128];
|
||||||
GetLocalTime(localtime);
|
GetLocalTime(localtime);
|
||||||
|
|
||||||
sprintf(str, "%s,Rcv,Ack,%i,,,,%"PRINTF_64_BIT_MODIFIER"u,%s,%s,,,,,,"
|
sprintf(str, "%s,Rcv,Ack,%i,,,,%" PRINTF_64_BIT_MODIFIER "u,%s,%s,,,,,,"
|
||||||
, localtime
|
, localtime
|
||||||
, messageNumber
|
, messageNumber
|
||||||
, (unsigned long long) time
|
, (unsigned long long) time
|
||||||
@@ -164,7 +164,7 @@ void PacketLogger::OnPushBackPacket(const char *data, const BitSize_t bitsUsed,
|
|||||||
char localtime[128];
|
char localtime[128];
|
||||||
GetLocalTime(localtime);
|
GetLocalTime(localtime);
|
||||||
|
|
||||||
sprintf(str, "%s,Lcl,PBP,,,%s,%i,%"PRINTF_64_BIT_MODIFIER"u,%s,%s,,,,,,"
|
sprintf(str, "%s,Lcl,PBP,,,%s,%i,%" PRINTF_64_BIT_MODIFIER "u,%s,%s,,,,,,"
|
||||||
, localtime
|
, localtime
|
||||||
, BaseIDTOString(data[0])
|
, BaseIDTOString(data[0])
|
||||||
, bitsUsed
|
, bitsUsed
|
||||||
@@ -226,7 +226,7 @@ void PacketLogger::WriteMiscellaneous(const char *type, const char *msg)
|
|||||||
char localtime[128];
|
char localtime[128];
|
||||||
GetLocalTime(localtime);
|
GetLocalTime(localtime);
|
||||||
|
|
||||||
sprintf(str, "%s,Lcl,%s,,,,,%"PRINTF_64_BIT_MODIFIER"u,%s,,,,,,,%s"
|
sprintf(str, "%s,Lcl,%s,,,,,%" PRINTF_64_BIT_MODIFIER "u,%s,,,,,,,%s"
|
||||||
, localtime
|
, localtime
|
||||||
, type
|
, type
|
||||||
, (unsigned long long) time
|
, (unsigned long long) time
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ void RAK_DLL_EXPORT RakNet::StatisticsToString( RakNetStatistics *s, char *buffe
|
|||||||
if (verbosityLevel==0)
|
if (verbosityLevel==0)
|
||||||
{
|
{
|
||||||
sprintf(buffer,
|
sprintf(buffer,
|
||||||
"Bytes per second sent %"PRINTF_64_BIT_MODIFIER"u\n"
|
"Bytes per second sent %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Bytes per second received %"PRINTF_64_BIT_MODIFIER"u\n"
|
"Bytes per second received %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Current packetloss %.1f%%\n",
|
"Current packetloss %.1f%%\n",
|
||||||
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_SENT],
|
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_SENT],
|
||||||
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_RECEIVED],
|
(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)
|
else if (verbosityLevel==1)
|
||||||
{
|
{
|
||||||
sprintf(buffer,
|
sprintf(buffer,
|
||||||
"Actual bytes per second sent %"PRINTF_64_BIT_MODIFIER"u\n"
|
"Actual bytes per second sent %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Actual bytes per second received %"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"
|
"Message bytes per second pushed %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Total actual bytes sent %"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 actual bytes received %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Total message bytes pushed %"PRINTF_64_BIT_MODIFIER"u\n"
|
"Total message bytes pushed %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Current packetloss %.1f%%\n"
|
"Current packetloss %.1f%%\n"
|
||||||
"Average packetloss %.1f%%\n"
|
"Average packetloss %.1f%%\n"
|
||||||
"Elapsed connection time in seconds %"PRINTF_64_BIT_MODIFIER"u\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_SENT],
|
||||||
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_RECEIVED],
|
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_RECEIVED],
|
||||||
(long long unsigned int) s->valueOverLastSecond[USER_MESSAGE_BYTES_PUSHED],
|
(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];
|
char buff2[128];
|
||||||
sprintf(buff2,
|
sprintf(buff2,
|
||||||
"Send capacity %"PRINTF_64_BIT_MODIFIER"u bytes per second (%.0f%%)\n",
|
"Send capacity %" PRINTF_64_BIT_MODIFIER "u bytes per second (%.0f%%)\n",
|
||||||
(long long unsigned int) s->BPSLimitByCongestionControl,
|
(long long unsigned int) s->BPSLimitByCongestionControl,
|
||||||
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / 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];
|
char buff2[128];
|
||||||
sprintf(buff2,
|
sprintf(buff2,
|
||||||
"Send limit %"PRINTF_64_BIT_MODIFIER"u (%.0f%%)\n",
|
"Send limit %" PRINTF_64_BIT_MODIFIER "u (%.0f%%)\n",
|
||||||
(long long unsigned int) s->BPSLimitByOutgoingBandwidthLimit,
|
(long long unsigned int) s->BPSLimitByOutgoingBandwidthLimit,
|
||||||
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / 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
|
else
|
||||||
{
|
{
|
||||||
sprintf(buffer,
|
sprintf(buffer,
|
||||||
"Actual bytes per second sent %"PRINTF_64_BIT_MODIFIER"u\n"
|
"Actual bytes per second sent %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Actual bytes per second received %"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 sent %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Message bytes per second resent %"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 pushed %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Message bytes per second processed %"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"
|
"Message bytes per second ignored %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Total bytes sent %"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 bytes received %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Total message bytes sent %"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 resent %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Total message bytes pushed %"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 received %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Total message bytes ignored %"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"
|
"Messages in send buffer, by priority %i,%i,%i,%i\n"
|
||||||
"Bytes 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"
|
"Messages in resend buffer %i\n"
|
||||||
"Bytes in resend buffer %"PRINTF_64_BIT_MODIFIER"u\n"
|
"Bytes in resend buffer %" PRINTF_64_BIT_MODIFIER "u\n"
|
||||||
"Current packetloss %.1f%%\n"
|
"Current packetloss %.1f%%\n"
|
||||||
"Average packetloss %.1f%%\n"
|
"Average packetloss %.1f%%\n"
|
||||||
"Elapsed connection time in seconds %"PRINTF_64_BIT_MODIFIER"u\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_SENT],
|
||||||
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_RECEIVED],
|
(long long unsigned int) s->valueOverLastSecond[ACTUAL_BYTES_RECEIVED],
|
||||||
(long long unsigned int) s->valueOverLastSecond[USER_MESSAGE_BYTES_SENT],
|
(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];
|
char buff2[128];
|
||||||
sprintf(buff2,
|
sprintf(buff2,
|
||||||
"Send capacity %"PRINTF_64_BIT_MODIFIER"u bytes per second (%.0f%%)\n",
|
"Send capacity %" PRINTF_64_BIT_MODIFIER "u bytes per second (%.0f%%)\n",
|
||||||
(long long unsigned int) s->BPSLimitByCongestionControl,
|
(long long unsigned int) s->BPSLimitByCongestionControl,
|
||||||
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / 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];
|
char buff2[128];
|
||||||
sprintf(buff2,
|
sprintf(buff2,
|
||||||
"Send limit %"PRINTF_64_BIT_MODIFIER"u (%.0f%%)\n",
|
"Send limit %" PRINTF_64_BIT_MODIFIER "u (%.0f%%)\n",
|
||||||
(long long unsigned int) s->BPSLimitByOutgoingBandwidthLimit,
|
(long long unsigned int) s->BPSLimitByOutgoingBandwidthLimit,
|
||||||
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / s->BPSLimitByOutgoingBandwidthLimit
|
100.0f * s->valueOverLastSecond[ACTUAL_BYTES_SENT] / s->BPSLimitByOutgoingBandwidthLimit
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1361,7 +1361,7 @@ bool ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer(
|
|||||||
#ifdef PRINT_TO_FILE_ROT
|
#ifdef PRINT_TO_FILE_ROT
|
||||||
if (fp)
|
if (fp)
|
||||||
{
|
{
|
||||||
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);
|
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);
|
fflush(fp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1248,7 +1248,7 @@ int SocketLayer::SendTo_PC( SOCKET s, const char *data, int length, const System
|
|||||||
#ifdef DEBUG_SENDTO_SPIKES
|
#ifdef DEBUG_SENDTO_SPIKES
|
||||||
RakNetTime end = RakNet::GetTime();
|
RakNetTime end = RakNet::GetTime();
|
||||||
static unsigned int callCount=1;
|
static unsigned int callCount=1;
|
||||||
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);
|
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
|
#endif
|
||||||
if (len<0)
|
if (len<0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user