Skip to content

Commit

Permalink
Merge pull request #7 from kbengine/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
jay602 committed Apr 11, 2019
2 parents 6a60657 + a70d6b4 commit b8ffb96
Show file tree
Hide file tree
Showing 627 changed files with 38,714 additions and 21,119 deletions.
Expand Up @@ -6,6 +6,9 @@
#include "KBDebug.h"
#include "ObjectPool.h"

namespace KBEngine
{

static ObjectPool<Bundle> _g_bundlePool;

Bundle::Bundle():
Expand Down Expand Up @@ -292,4 +295,6 @@ void Bundle::writeVector4(const FVector4& v)
{
checkStream(16);
(*pCurrPacket_).writeVector4(v);
}

}
Expand Up @@ -4,6 +4,9 @@

#include "KBECommon.h"

namespace KBEngine
{

class MemoryStream;
class NetworkInterfaceBase;
class Message;
Expand Down Expand Up @@ -145,3 +148,5 @@ class KBENGINEPLUGINS_API Bundle
Message* pMsgtype_;
int curMsgStreamIndex_;
};

}
@@ -0,0 +1,62 @@
#include "ClientSDKUpdateUI.h"
#include "Engine.h"
#include "KBEvent.h"
#include "KBEngine.h"
#include "KBEventTypes.h"
#include "SlateOptMacros.h"

BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SClientSDKUpdateUI::Construct(const FArguments& args)
{
FTextBlockStyle textStyle = FCoreStyle::Get().GetWidgetStyle< FTextBlockStyle >("NormalText");
textStyle.SetFont(FSlateFontInfo("Veranda", 26));
textStyle.SetColorAndOpacity(FLinearColor::White);

ChildSlot
[
SNew(SOverlay)
/*+ SOverlay::Slot()
.HAlign(HAlign_Center)
.VAlign(VAlign_Top)
[
SNew(STextBlock)
.ColorAndOpacity(FLinearColor::White)
.ShadowColorAndOpacity(FLinearColor::Black)
.ShadowOffset(FIntPoint(-1, 1))
.Font(FSlateFontInfo("Arial", 26))
.Text(FText::FromString("Main Menu"))
]*/
+ SOverlay::Slot()
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.Padding(20)
[
SNew(SButton)
.Text(FText::FromString("Update SDK"))
.TextStyle(&textStyle)
.ContentPadding(FMargin(30.0, 15.0))
.ButtonColorAndOpacity(FLinearColor::Green)
.HAlign(HAlign_Center)
.VAlign(VAlign_Top)
.OnClicked(this, &SClientSDKUpdateUI::UpdateSDKClicked)
]
]
];
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION

FReply SClientSDKUpdateUI::UpdateSDKClicked()
{
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 3.f, FColor::Yellow, TEXT("Update SDK!"));
}

UKBEventData_onDownloadSDK* pEventData = NewObject<UKBEventData_onDownloadSDK>();
pEventData->isDownload = true;
KBENGINE_EVENT_FIRE(KBEngine::KBEventTypes::onDownloadSDK, pEventData);
return FReply::Handled();
}
@@ -0,0 +1,19 @@
#pragma once

#include "KBEnginePluginsPrivatePCH.h"


class KBENGINEPLUGINS_API SClientSDKUpdateUI : public SCompoundWidget
{

public:
SLATE_BEGIN_ARGS(SClientSDKUpdateUI){}

SLATE_END_ARGS()

void Construct(const FArguments& args);

FReply UpdateSDKClicked();


};
Expand Up @@ -9,8 +9,8 @@
#include "FileHelper.h"
#include "OutPutDeviceDebug.h"

using namespace std;

namespace KBEngine
{

ClientSDKUpdater::ClientSDKUpdater()
{
Expand Down Expand Up @@ -246,11 +246,12 @@ void ClientSDKUpdater::moveToFile(FString fromFileName, FString toFileName)
PlatformFile.MoveFile(*toFileName, *fromFileName);
}

void ClientSDKUpdater::copyDirectory(FString fromDicPath, FString toDicPath)
void ClientSDKUpdater::copyDirectory(FString fromDicPath, FString toDicPath)
{
FPaths::NormalizeDirectoryName(fromDicPath);
FPaths::NormalizeDirectoryName(toDicPath);
IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
PlatformFile.CopyDirectoryTree(*toDicPath, *fromDicPath, true);
}

}
Expand Up @@ -18,6 +18,9 @@
/**
*
*/
namespace KBEngine
{

class KBENGINEPLUGINS_API ClientSDKUpdater
{
public:
Expand Down Expand Up @@ -53,3 +56,5 @@ class KBENGINEPLUGINS_API ClientSDKUpdater

MemoryStream* pSdkFileStream = nullptr;
};

}
Expand Up @@ -4,6 +4,10 @@
#include "EntityDef.h"
#include "KBDebug.h"
#include "Runtime/Core/Public/Misc/Variant.h"
#include "Bundle.h"

namespace KBEngine
{

KBVar* DATATYPE_INT8::createFromStream(MemoryStream& stream)
{
Expand Down Expand Up @@ -589,3 +593,5 @@ bool DATATYPE_FIXED_DICT::isSameType(KBVar& v)

return true;
}

}
Expand Up @@ -5,13 +5,17 @@
#include "KBECommon.h"
#include "KBVar.h"

class Bundle;
class MemoryStream;

/*
entitydef所支持的基本数据类型
改模块中的类抽象出了所有的支持类型并提供了这些类型的数据序列化成二进制数据与反序列化操作(主要用于网络通讯的打包与解包)
*/
namespace KBEngine
{

class Bundle;
class MemoryStream;

class KBENGINEPLUGINS_API DATATYPE_BASE
{
public:
Expand Down Expand Up @@ -88,7 +92,7 @@ class KBENGINEPLUGINS_API DATATYPE_INT32 : public DATATYPE_BASE
{
public:
virtual KBVar* createFromStream(MemoryStream& stream) override;
virtual void addToStream(Bundle& stream, KBVar& v) override;
virtual void addToStream(KBEngine::Bundle& stream, KBVar& v) override;

virtual KBVar* parseDefaultValStr(const FString& v) override;

Expand Down Expand Up @@ -382,15 +386,4 @@ class KBENGINEPLUGINS_API DATATYPE_FIXED_DICT : public DATATYPE_BASE
TMap<FString, uint16> dicttype_map;
};













}

0 comments on commit b8ffb96

Please sign in to comment.