Fix telemetry delivery and report loaded island names; record Workshop 0.0.130
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -11,7 +11,6 @@ for a,b in [
|
||||
('JsonLoadContext sent = new JsonLoadContext()', 'Json sent'), ('JsonLoadContext reply = new JsonLoadContext()', 'Json reply'),
|
||||
('ERR_CommunityStatistics community;', 'Community* community = nullptr;'), ('community.', 'community->'),
|
||||
('m_Mode.ERR_PublishCommunityStatistics(', 'mode.Publish('), ('m_State.serverId','serverId'),
|
||||
('GetGame().GetWorldFile()', 'world'),
|
||||
]: callbacks=callbacks.replace(a,b)
|
||||
run(r'''
|
||||
#include <cassert>
|
||||
@@ -32,7 +31,7 @@ struct Json {
|
||||
};
|
||||
struct RestCallback {string data="response";string GetData(){return data;}};
|
||||
struct Service {
|
||||
bool m_Ended=true,current=true,m_CommunityReady=false;string m_FinalEventId="final",m_FinalOutcome="victory",m_InFlight="final",serverId="server",m_MissionId="mission",world="map";
|
||||
bool m_Ended=true,current=true,m_CommunityReady=false;string m_FinalEventId="final",m_FinalOutcome="victory",m_InFlight="final",serverId="server",m_MissionId="mission",m_FinalTerrain="map";
|
||||
struct Mode {int writes=0;string text;void Publish(string v){writes++;text=v;}} mode;
|
||||
bool Current(){return current;}
|
||||
'''+callbacks+r'''
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
"""Exercise production terrain selection with engine world boundaries doubled."""
|
||||
from policy_harness import ROOT, body, run
|
||||
|
||||
p = ROOT / 'addons/core/Scripts/Game/ERR/00_Core/ERR_Telemetry.c'
|
||||
method = body(p, 'protected string Terrain(')
|
||||
for a, b in [('protected ', ''), ('GetGame().', 'GetGame()->'),
|
||||
('GetWorld().', 'GetWorld()->'), ('ERR_TerrainDisplayName.Resolve', 'Resolve')]:
|
||||
method = method.replace(a, b)
|
||||
run(r'''
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
struct string:std::string {using std::string::string;bool IsEmpty(){return empty();}};
|
||||
struct World {
|
||||
string root="$armareforger:Worlds/Eden/Eden.ent";int count=1;
|
||||
int GetNumSubScenes(){return count;}
|
||||
string GetSubSceneName(int index){assert(index==0);return root;}
|
||||
} world;
|
||||
struct Game {
|
||||
World* loaded=&world;string scenario="$armareforger:Worlds/GameMaster/GameMaster.ent";
|
||||
World* GetWorld(){return loaded;}string GetWorldFile(){return scenario;}
|
||||
} game;
|
||||
Game* GetGame(){return &game;}
|
||||
// The existing mission-title resolver is a separate native resource boundary.
|
||||
string Resolve(string resource){
|
||||
if(resource=="$armareforger:Worlds/Eden/Eden.ent")return "Everon";
|
||||
if(resource=="$custom:Worlds/Nogova.ent")return "Nogova";
|
||||
return resource;
|
||||
}
|
||||
struct Telemetry {
|
||||
''' + method + r'''
|
||||
};
|
||||
int main(){
|
||||
Telemetry service;
|
||||
assert(service.Terrain()=="Everon");
|
||||
// Same generic scenario name, different underlying island.
|
||||
world.root="$custom:Worlds/Nogova.ent";
|
||||
assert(service.Terrain()=="Nogova");
|
||||
// Follow the loaded scene, even while scenario metadata is stale.
|
||||
game.scenario="$armareforger:Worlds/GameMaster/GM_Eden.ent";
|
||||
assert(service.Terrain()=="Nogova");
|
||||
world.count=0;assert(service.Terrain()==game.scenario);
|
||||
world.count=1;world.root="";assert(service.Terrain()==game.scenario);
|
||||
game.loaded=nullptr;assert(service.Terrain()==game.scenario);
|
||||
}
|
||||
''')
|
||||
print('PASS: telemetry uses the loaded island beneath scenario wrappers and handles unavailable roots')
|
||||
Reference in New Issue
Block a user