Conferences stop notifying once you are Tier 1 (#101)
After the Tier 1 goal, the 30-day reminders, the report (and its coin sound) on the day and the sales engineer's booking notes are no longer shown or logged. Registering, sponsoring, the glow, raffles and capacity deals work as before, and the Deals tab still lists conferences. Fixes #101
This commit is contained in:
parent
99b16f6184
commit
9c26d03952
5 changed files with 54 additions and 5 deletions
|
|
@ -12,6 +12,7 @@ All notable changes to this project are documented here. The project follows
|
|||
- The Connections list in the NOC dashboard no longer stays blank when you sort it by load or show only NNI ports while a fabric port runs at 400G. A 400G fabric port is the fastest there is, so the list now offers it one more LAG member instead of a faster port that does not exist. (#342)
|
||||
- You can now start a link by typing where it goes: open one of your POPs, go to Infra and tap Link to a city, then type a city, country or exchange and pick it. You get the same link window as dragging between the two on the map, which is much easier on a crowded phone screen (#343).
|
||||
- The Connections tab of the NOC dashboard can now shrink connections as well as grow them. Next to the upgrades, transit ports, PNIs and exchange ports get a downgrade to the next smaller port and a button to drop one LAG member, and a PNI that is still on order can be chased from the list, just like from the POP panel (#336).
|
||||
- Once you have made Tier 1, conferences stop sending notifications. No more 30-day reminders, reports from the hallway track or notes from your sales engineer about bookings; you can still register and sponsor from the Deals tab, and everything a conference does works as before (#101).
|
||||
|
||||
## [3.4.0] — 2026-11-10
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,14 @@ function confKey(cf,y){return cf.n+'@'+cf.c+'@'+y;}
|
|||
// No conference season in Best Effort: nothing to register for, nothing in the panel, no invitations.
|
||||
function upcomingConfs(within){if(!confsOn())return [];const y0=cal(S.day).y-1,out=[];for(const y of [y0,y0+1])for(const cf of CONFS){const d=confDay(cf,y);if(d>=S.day&&d-S.day<=within)out.push({...cf,day:d,key:confKey(cf,y)});}return out.sort((a,b)=>a.day-b.day);}
|
||||
function confBoost(id){const cb=S.conf;if(!cb||!(cb.until>S.day))return 1;const n=NET[id];return n&&n.pops.some(c=>CITY[c]&&CITY[c].reg===cb.reg)?0.5:1;}
|
||||
function confTick(d){S.confReg=S.confReg||{};
|
||||
for(const cf of upcomingConfs(30)){if(cf.day-d===30&&!S.confReg[cf.key])toast(tr('conferences.conf_comes_to_city_in_30',{conf:esc(cf.n),city:esc(CITY[cf.c].name)}),'goal',[{l:tr('common.show_me'),act:'leftTab',args:{t:'deals'}}]);}
|
||||
// Once you have made Tier 1, conferences go quiet (#101): no reminders and no reports, only the Deals panel.
|
||||
const confQuiet=()=>!!(S.done&&S.done.t1!==undefined);
|
||||
function confTick(d){S.confReg=S.confReg||{};const q=confQuiet();
|
||||
for(const cf of upcomingConfs(30)){if(!q&&cf.day-d===30&&!S.confReg[cf.key])toast(tr('conferences.conf_comes_to_city_in_30',{conf:esc(cf.n),city:esc(CITY[cf.c].name)}),'goal',[{l:tr('common.show_me'),act:'leftTab',args:{t:'deals'}}]);}
|
||||
for(const cf of upcomingConfs(0)){if(cf.day!==d||!S.confReg[cf.key])continue;const reg=CITY[cf.c].reg,sp=S.confReg[cf.key]==='sp';S.conf={until:d+CONF_DAYS,reg,name:cf.n,sp};S.stats.confs=(S.stats.confs||0)+1;if(sp)S.stats.confSp=(S.stats.confSp||0)+1;
|
||||
if(cf.cap)S.capDeal={at:d+4+Math.floor(Math.random()*5),c:cf.c};
|
||||
const r=Math.random();let extra='';if(r<0.3){const cash=5000+Math.floor(Math.random()*4)*5000;S.cash+=cash;extra=' '+tr('conferences.you_also_won_the_raffle_cash',{cash:fmt$(cash)});}else if(r<0.5)extra=' '+tr('conferences.someone_from_goggle_bought_you_a');if(cf.j)extra=' '+tr(cf.j)+(r<0.3?extra:'');
|
||||
toast(tr('conferences.conf_in_city_you_shook_a',{conf:esc(cf.n),city:esc(CITY[cf.c].name),n:CONF_DAYS,region:esc(REG[reg])})+(sp?' '+tr('conferences.your_logo_was_on_every_lanyard',{region:esc(REG[reg])}):'')+(cf.cap?' '+tr('conferences.carriers_took_your_card_expect_big'):'')+extra,'goal');sfx('coin');}
|
||||
if(!q){toast(tr('conferences.conf_in_city_you_shook_a',{conf:esc(cf.n),city:esc(CITY[cf.c].name),n:CONF_DAYS,region:esc(REG[reg])})+(sp?' '+tr('conferences.your_logo_was_on_every_lanyard',{region:esc(REG[reg])}):'')+(cf.cap?' '+tr('conferences.carriers_took_your_card_expect_big'):'')+extra,'goal');sfx('coin');}}
|
||||
capDealTick(d);}
|
||||
function confSection(){const up=upcomingConfs(75).slice(0,3),cb=S.conf&&S.conf.until>S.day?S.conf:null;if(!up.length&&!cb)return '';
|
||||
return `<h3 style="font-size:15px;margin:10px 0 4px">${tr('common.conferences')}</h3>${cb?`<div class="inc" style="background:#EAF7EE"><div class="nm">${tr('conferences.name_glow_n_days_left',{name:esc(cb.name),n:cb.until-S.day})}</div><div class="meta">${tr('conferences.selective_networks_in_region_need',{region:esc(REG[cb.reg])})}${cb.sp?' '+tr('conferences.as_a_sponsor_you_also_get',{region:esc(REG[cb.reg])}):''}</div></div>`:''}${up.map(confRow).join('')}`;}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ function salesDay(d){const L=S.sales;if(!L)return;
|
|||
if(L.vp&&d>=L.vp){L.p=null;L.vp=null;toast(tr('sales.vp_arrived'),'good',[{l:tr('sales.desk'),act:'salesOpen',args:{}}]);return;}
|
||||
const p=slP();if(!p)return;
|
||||
if(p==='eng')for(const cf of upcomingConfs(30)){if(cf.cap||cf.day-d!==30||(S.confReg||{})[cf.key])continue;
|
||||
if(S.cash>=CONF_COST){S.cash-=CONF_COST;(S.confReg=S.confReg||{})[cf.key]=true;toast(tr('sales.eng_booked',{name:esc(slCap()),conf:esc(cf.n),city:esc(CITY[cf.c].name),cost:fmt$(CONF_COST)}),'');}}
|
||||
if(S.cash>=CONF_COST){S.cash-=CONF_COST;(S.confReg=S.confReg||{})[cf.key]=true;if(!confQuiet())toast(tr('sales.eng_booked',{name:esc(slCap()),conf:esc(cf.n),city:esc(CITY[cf.c].name),cost:fmt$(CONF_COST)}),'');}}
|
||||
if(p==='ceo'){if(!(L.golf>=d))L.golf=d+50+Math.floor(slR('golf|'+d)*30);else if(d===L.golf){salesGolf(d);L.golf=d+50+Math.floor(slR('golf|'+d)*30);}
|
||||
if(!(L.say>=d))L.say=d+20+Math.floor(slR('say|'+d)*15);else if(d===L.say){toast(tr('sales.ceo_says',{say:tr(SALES_SAY[Math.floor(slR('sayl|'+d)*SALES_SAY.length)])}),'');L.say=d+20+Math.floor(slR('say|'+d)*15);}}}
|
||||
// The golf course: the biggest internet customer this network can take, in its biggest city, at 30% off, signed on the spot.
|
||||
|
|
|
|||
45
tests/conference-quiet.test.js
Normal file
45
tests/conference-quiet.test.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// #101: once you have made Tier 1, conferences stop announcing themselves: no 30-day reminders, no report when one
|
||||
// happens, no note from the sales engineer who booked it. What they do is unchanged, and the Deals panel still lists them.
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
const setup = t1 => {
|
||||
const r = load();
|
||||
r.ev("ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})");
|
||||
r.ev(t1 ? 'S.done.t1=1' : 'delete S.done.t1');
|
||||
// Record every notification the conference code raises (toasts land in the NOC log too, so this catches both).
|
||||
r.ev("window.__t=[];const __o=toast;toast=(h,...a)=>{__t.push(String(h));return __o(h,...a)}");
|
||||
return r;
|
||||
};
|
||||
// A non-capacity conference: the day 30 days before it, and the day itself.
|
||||
const CF = "CONFS.find(c=>!c.cap)";
|
||||
const run = (ev, reg) => ev(`(()=>{const cf=${CF},d=confDay(cf,0),k=confKey(cf,0);
|
||||
S.day=d-30;confTick(d-30);${reg ? "S.confReg[k]=true;" : ''}S.day=d;confTick(d);return JSON.stringify(window.__t)})()`);
|
||||
|
||||
test('#101 before Tier 1, conferences still remind you and report back', () => {
|
||||
const { ev, errors } = setup(false);
|
||||
const t = JSON.parse(run(ev, true));
|
||||
assert.ok(t.some(h => /comes to .* in 30 days/.test(h)), 'the 30-day reminder');
|
||||
assert.ok(t.some(h => /You shook a lot of hands/.test(h)), 'the report on the day');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('#101 after Tier 1, conferences say nothing, but attending still works and the Deals panel still lists them', () => {
|
||||
const { ev, errors } = setup(true);
|
||||
const t = JSON.parse(run(ev, true));
|
||||
assert.deepEqual(t, [], 'no reminder and no report');
|
||||
assert.ok(ev('!!(S.conf&&S.conf.until>S.day)'), 'the conference still gave its glow');
|
||||
assert.ok(ev(`(()=>{S.day=confDay(${CF},1)-20;return /Attend/.test(confSection())})()`), 'still listed in Deals');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('#101 after Tier 1, a sales engineer still books conferences, without telling you each time', () => {
|
||||
const { ev, errors } = setup(true);
|
||||
// Hand the desk an engineer and run the desk on the day 30 days before the next conference.
|
||||
const booked = ev(`(()=>{const cf=${CF},d=confDay(cf,1),k=confKey(cf,1);S.day=d-30;
|
||||
S.sales={p:'eng'};S.confReg={};salesDay(d-30);return !!S.confReg[k]})()`);
|
||||
assert.equal(booked, true, 'the booking still happens');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(window.__t)')), []);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
@ -377,7 +377,8 @@ test('Flood Season: attacks keep coming, grow, and only count when service held'
|
|||
|
||||
test('DKNOG in Copenhagen is on the conference calendar', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0");
|
||||
// Not Tier 1 yet: after that, conferences no longer report back (#101).
|
||||
ev("ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0;delete S.done.t1");
|
||||
const cf = JSON.parse(ev("JSON.stringify(CONFS.find(c=>c.n==='DKNOG'))"));
|
||||
assert.equal(cf.c, 'cph');
|
||||
assert.equal(ev(`MONTHS[${cf.m}]`), 'Mar', 'held in March, like the real one');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue