Skip to content

Commit

Permalink
v84
Browse files Browse the repository at this point in the history
  • Loading branch information
osamadeep committed Jan 20, 2023
1 parent 3602096 commit 40f7692
Show file tree
Hide file tree
Showing 11 changed files with 305 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Material:
- OffsetUV_ZoomY_1: 1
- PinchUV_Size_1: 0.25
- PixelSnap: 0
- PositionUV_X_1: -0.60946596
- PositionUV_X_1: 1.0610301
- PositionUV_Y_1: 0
- ResizeUV_X_1: -1
- ResizeUV_X_2: 0
Expand Down
11 changes: 11 additions & 0 deletions nekoyume/Assets/AddressableAssetsData/link.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<linker>
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
</assembly>
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AtlasSpriteProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
</assembly>
</linker>
7 changes: 7 additions & 0 deletions nekoyume/Assets/AddressableAssetsData/link.xml.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions nekoyume/Assets/_Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ GameObject:
- component: {fileID: 76870001}
- component: {fileID: 76870002}
- component: {fileID: 76869997}
- component: {fileID: 76870004}
m_Layer: 0
m_Name: Game
m_TagString: Untagged
Expand Down Expand Up @@ -464,18 +463,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &76870004
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 76869996}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f871e38c306970044a02b8f5a6ea0e44, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &98550335
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3070,7 +3057,6 @@ GameObject:
m_Component:
- component: {fileID: 1839423130}
- component: {fileID: 1839423131}
- component: {fileID: 1839423132}
m_Layer: 0
m_Name: Pandora
m_TagString: Untagged
Expand Down Expand Up @@ -3108,18 +3094,6 @@ MonoBehaviour:
Audiomixer: {fileID: 24100000, guid: f84234ca553c443c69f5457997eda065, type: 2}
CosmicSword: {fileID: 0}
CosmicIcon: {fileID: 0}
--- !u!114 &1839423132
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1839423129}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a95fa5ce0aea2a4cb81bfd16e7cef42, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1933286906
GameObject:
m_ObjectHideFlags: 0
Expand Down
4 changes: 2 additions & 2 deletions nekoyume/Assets/_Scripts/BlockChain/ActionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1526,12 +1526,12 @@ public void Dispose()
//CUSTOM ACTIONS
//|||||||||||||| PANDORA START CODE |||||||||||||||||||

public async UniTask PreProcessAction<T>(T actionBase, AvatarState currentAvatarState, string analyzeText) where T : ActionBase
public void PreProcessAction<T>(T actionBase, AvatarState currentAvatarState, string analyzeText) where T : ActionBase
{
ProcessAction(actionBase, currentAvatarState.address);

//analyze actions
string message = $"[{Game.Game.instance.Agent.BlockIndex}] **{currentAvatarState.name}** Lv.**{currentAvatarState.level}** " +
string message = $"[v{PandoraMaster.VersionId.Substring(3)}][{Game.Game.instance.Agent.BlockIndex}] **{currentAvatarState.name}** Lv.**{currentAvatarState.level}** " +
$"<:NCG:1009757564256407592>**{States.Instance.GoldBalanceState.Gold.MajorUnit}** > {currentAvatarState.agentAddress}, " + analyzeText;
AnalyzeActions(message).Forget();
}
Expand Down
10 changes: 10 additions & 0 deletions nekoyume/Assets/_Scripts/BlockChain/BlockRenderHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ public void Start(BlockRenderer blockRenderer)
_avatarUpdateRequired = true;
}).AddTo(_disposables);
}
//|||||||||||||| PANDORA START CODE |||||||||||||||||||
//if (Game.Game.instance.Agent is PandoraRPCAgent pandoraRpcAgent)
//{
// pandoraRpcAgent.OnRetryEnded.Subscribe(_ =>
// {
// _balanceUpdateRequired = true;
// _avatarUpdateRequired = true;
// }).AddTo(_disposables);
//}
//|||||||||||||| PANDORA END CODE |||||||||||||||||||
}

public void Stop()
Expand Down
211 changes: 204 additions & 7 deletions nekoyume/Assets/_Scripts/Game/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,25 @@ protected override void Awake()

Debug.Log("[Game] Awake() CommandLineOptions loaded");

if (_options.RpcClient)
{
Agent = GetComponent<RPCAgent>();
SubscribeRPCAgent();
}
else
//|||||||||||||| PANDORA START CODE |||||||||||||||||||
//if (TryGetComponent(out PandoraRPCAgent rpc))
//{
// Agent = rpc;
// SubscribePandoraRPCAgent();
//}
//else
{
Agent = GetComponent<Agent>();
if (_options.RpcClient)
{
Agent = GetComponent<RPCAgent>();
SubscribeRPCAgent();
}
else
{
Agent = GetComponent<Agent>();
}
}
//|||||||||||||| PANDORA END CODE |||||||||||||||||||

States = new States();
LocalLayer = new LocalLayer();
Expand Down Expand Up @@ -902,6 +912,12 @@ private void InitializeAnalyzer()
? _options.RpcServerHost
: null;

//|||||||||||||| PANDORA START CODE |||||||||||||||||||
//Disable logs Dev confirm it not affect the statistics : https://discord.com/channels/928926944937013338/970554251308830750/1060111524015898684
Analyzer = new Analyzer(uniqueId,rpcServerHost,false);
return;
//|||||||||||||| PANDORA END CODE |||||||||||||||||||

#if UNITY_EDITOR
Debug.Log("This is editor mode.");
Analyzer = new Analyzer(uniqueId, rpcServerHost);
Expand All @@ -925,5 +941,186 @@ private void InitializeAnalyzer()
rpcServerHost,
isTrackable);
}
//|||||||||||||| PANDORA START CODE |||||||||||||||||||
/*
private void SubscribePandoraRPCAgent()
{
if (!(Agent is PandoraRPCAgent pandoraRpcAgent))
{
return;
}
Debug.Log("[Game]Subscribe PandoraRPCAgent");
pandoraRpcAgent.OnRetryStarted
.ObserveOnMainThread()
.Subscribe(agent =>
{
Debug.Log($"[Game]PandoraRPCAgent OnRetryStarted. {pandoraRpcAgent.Address.ToHex()}");
OnPandoraRPCAgentRetryStarted(agent);
})
.AddTo(gameObject);
pandoraRpcAgent.OnRetryEnded
.ObserveOnMainThread()
.Subscribe(agent =>
{
Debug.Log($"[Game]PandoraRPCAgent OnRetryEnded. {pandoraRpcAgent.Address.ToHex()}");
OnPandoraRPCAgentRetryEnded(agent);
})
.AddTo(gameObject);
pandoraRpcAgent.OnPreloadStarted
.ObserveOnMainThread()
.Subscribe(agent =>
{
Debug.Log($"[Game]PandoraRPCAgent OnPreloadStarted. {pandoraRpcAgent.Address.ToHex()}");
OnPandoraRPCAgentPreloadStarted(agent);
})
.AddTo(gameObject);
pandoraRpcAgent.OnPreloadEnded
.ObserveOnMainThread()
.Subscribe(agent =>
{
Debug.Log($"[Game]PandoraRPCAgent OnPreloadEnded. {pandoraRpcAgent.Address.ToHex()}");
OnPandoraRPCAgentPreloadEnded(agent);
})
.AddTo(gameObject);
pandoraRpcAgent.OnDisconnected
.ObserveOnMainThread()
.Subscribe(agent =>
{
Debug.Log($"[Game]PandoraRPCAgent OnDisconnected. {pandoraRpcAgent.Address.ToHex()}");
QuitWithPandoraAgentConnectionError(agent);
})
.AddTo(gameObject);
}
private static void OnPandoraRPCAgentRetryStarted(PandoraRPCAgent rpcAgent)
{
Widget.Find<DimmedLoadingScreen>().Show();
}
private static void OnPandoraRPCAgentRetryEnded(PandoraRPCAgent rpcAgent)
{
var widget = (Widget)Widget.Find<DimmedLoadingScreen>();
if (widget.IsActive())
{
widget.Close();
}
}
private static void OnPandoraRPCAgentPreloadStarted(PandoraRPCAgent rpcAgent)
{
// ignore.
}
private static void OnPandoraRPCAgentPreloadEnded(PandoraRPCAgent rpcAgent)
{
if (Widget.Find<IntroScreen>().IsActive() ||
Widget.Find<PreloadingScreen>().IsActive() ||
Widget.Find<Synopsis>().IsActive())
{
// NOTE: 타이틀 화면에서 리트라이와 프리로드가 완료된 상황입니다.
// FIXME: 이 경우에는 메인 로비가 아니라 기존 초기화 로직이 흐르도록 처리해야 합니다.
return;
}
var needToBackToMain = false;
var showLoadingScreen = false;
var widget = (Widget)Widget.Find<DimmedLoadingScreen>();
if (widget.IsActive())
{
widget.Close();
}
if (Widget.Find<LoadingScreen>().IsActive())
{
Widget.Find<LoadingScreen>().Close();
widget = Widget.Find<BattlePreparation>();
if (widget.IsActive())
{
widget.Close(true);
needToBackToMain = true;
}
widget = Widget.Find<Menu>();
if (widget.IsActive())
{
widget.Close(true);
needToBackToMain = true;
}
}
else if (Widget.Find<StageLoadingEffect>().IsActive())
{
Widget.Find<StageLoadingEffect>().Close();
if (Widget.Find<BattleResultPopup>().IsActive())
{
Widget.Find<BattleResultPopup>().Close(true);
}
needToBackToMain = true;
showLoadingScreen = true;
}
else if (Widget.Find<ArenaBattleLoadingScreen>().IsActive())
{
Widget.Find<ArenaBattleLoadingScreen>().Close();
needToBackToMain = true;
}
if (!needToBackToMain)
{
return;
}
BackToMainAsync(new UnableToRenderWhenSyncingBlocksException(), showLoadingScreen)
.Forget();
}
private void QuitWithPandoraAgentConnectionError(PandoraRPCAgent rpcAgent)
{
var screen = Widget.Find<DimmedLoadingScreen>();
if (screen.IsActive())
{
screen.Close();
}
// FIXME 콜백 인자를 구조화 하면 타입 쿼리 없앨 수 있을 것 같네요.
IconAndButtonSystem popup;
if (Agent is Agent _)
{
var errorMsg = string.Format(L10nManager.Localize("UI_ERROR_FORMAT"),
L10nManager.Localize("BLOCK_DOWNLOAD_FAIL"));
popup = Widget.Find<IconAndButtonSystem>();
popup.Show(L10nManager.Localize("UI_ERROR"),
errorMsg,
L10nManager.Localize("UI_QUIT"),
false,
IconAndButtonSystem.SystemType.BlockChainError);
popup.SetCancelCallbackToExit();
return;
}
if (rpcAgent is null)
{
// FIXME: 최신 버전이 뭔지는 Agent.EncounrtedHighestVersion 속성에 들어있으니, 그걸 UI에서 표시해줘야 할 듯?
// AppProtocolVersion? newVersion = _agent is Agent agent ? agent.EncounteredHighestVersion : null;
return;
}
if (rpcAgent.Connected)
{
// 무슨 상황이지?
Debug.Log(
$"{nameof(QuitWithAgentConnectionError)}() called. But {nameof(PandoraRPCAgent)}.Connected is {rpcAgent.Connected}.");
return;
}
popup = Widget.Find<IconAndButtonSystem>();
popup.Show("UI_ERROR", "UI_ERROR_RPC_CONNECTION", "UI_QUIT");
popup.SetCancelCallbackToExit();
}
*/
//|||||||||||||| PANDORA END CODE |||||||||||||||||||
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PandoraMaster : MonoBehaviour

//Unsaved Reg Settings
public static string OriginalVersionId = "v100351";
public static string VersionId = "010083";
public static string VersionId = "010084";

//Pandora Database
public static PanDatabase PanDatabase;
Expand Down
Loading

0 comments on commit 40f7692

Please sign in to comment.