Merge review fixes: standing orders
This commit is contained in:
commit
2223a4b044
15 changed files with 481 additions and 65 deletions
|
|
@ -27,11 +27,11 @@ All notable changes to this project are documented here. The project follows
|
|||
- DDoS bandwidth now adds up: upstream scrubbing, edge filters and scrubbing centers work in sequence. The NOC uses the same figures as traffic routing, including floods that cannot reach a remote center.
|
||||
- Attacks can now use Memcached amplification or an ACK flood. Flowspec catches the former; the latter need mitigation.
|
||||
- Set the number of each optic model directly on land and subsea fiber links. Apply a whole change at once, with its total price shown before buying; removed optics return to the spares shelf.
|
||||
- Order PNIs with one network or every network at all shared POPs from the NOC Traffic tab: choose a port size, review the total cost, and add missing connections or upgrade smaller ones in one go. Each network keeps its own smallest PNI size and delivery time.
|
||||
- Order PNIs with one network or every network at all shared POPs from the Ops sheet: choose a port size, review the total cost, and add missing connections or upgrade smaller ones in one go. Each network keeps its own smallest PNI size and delivery time.
|
||||
- Utilities join route servers and request eligible peers across every joined IX, install missing PoP redundancy hardware and balance caches between sites, and request a cache from each eligible provider at each site. A POP's Infra tab shows the redundancy kit as one line with its price, above the rows it fills in.
|
||||
- Hire a NOC intern and give them standing orders: from customer level 2, Kevin from the night shift, Anycast Annie or Tracy Route runs your rules once a game day and pays exactly what your own clicks would. Keep transit above a multiple of its peak, add or swap routers above a load, take free caches, peer at every IX and PNI with the big networks every week, sign ready customers and decline tiny ones, rush repairs, light more fiber and retire small parallel waves. Each order has a pause switch, its own settings, a monthly budget and per-POP exceptions, and the intern writes one line a day in the NOC (#98, #100, #102, #181, #185, #192, #177).
|
||||
- Hire a NOC intern and give them standing orders: from customer level 2, Kevin from the night shift, Anycast Annie or Tracy Route runs your rules once a game day and pays exactly what your own clicks would. Keep transit above a multiple of its peak, add or swap routers above a load, take free caches, peer at every IX and PNI with the big networks every week, sign ready customers and decline tiny ones, rush repairs, light more fiber and retire small parallel waves. Each order has a pause switch, its own settings, a monthly budget and per-POP exceptions, never breaks a customer's or a bank's transit requirement, and shows what it adds to your monthly bill. The Ops sheet opens with the intern's mood and a weekly shift report, which is also the one notice a week the intern leaves in the NOC (#98, #100, #102, #181, #185, #192, #177).
|
||||
- Open a new city from a template in one tap: POP, broadband, transit, an IX port and the redundancy kit, priced up front, with your standing orders taking it from there (#98, #192).
|
||||
- Auto-accept and auto-pay repairs are now the intern's sales and repair orders and run once a game day; saved games keep both switched on, and they start working once you hire an intern. The bulk peering and PNI batches moved into the Ops sheet, next to the orders that repeat them (#185, #181, #192).
|
||||
- The intern only signs a customer after a trial run shows the network can carry them without hurting anyone else, and rushes every repair that has a price, while the budget lasts (#185). The bulk peering and PNI batches live in the Ops sheet, next to the orders that repeat them (#181, #192).
|
||||
|
||||
## [1.37.0] — 2026-10-28
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,8 @@ never freezes the game.
|
|||
4. Rolls failures (`fireFailure()`) and events (`fireEvent()`) when their timers run out,
|
||||
and expires incidents.
|
||||
Then the NOC intern's standing orders (`opsDay()`), if one is hired: each order clicks the same `ACT`
|
||||
actions a player would, muted, within its monthly budget, and the shift recomputes once at the end.
|
||||
actions a player would, muted, within its monthly budget, and the shift recomputes once at the end, only if
|
||||
a job changed the network. An order that throws is paused; the day goes on. The NOC gets one notice a week.
|
||||
5. Updates customer mood, churn and new offers; IX members join; loans tick.
|
||||
6. Every 30 days: bills the month (revenue minus costs) and checks for bankruptcy.
|
||||
7. Checks goals, level, badges and scenario end conditions.
|
||||
|
|
|
|||
|
|
@ -2533,8 +2533,10 @@
|
|||
"ops.anycast_annie":"Anycast-Annie",
|
||||
"ops.at_least_port":"mindestens {port}",
|
||||
"ops.budget":"Budget",
|
||||
"ops.budget_running":"Höchstens dazu",
|
||||
"ops.by_hand":"Einmal alles",
|
||||
"ops.by_hand_note":"Für den Moment, in dem alles sofort erledigt sein soll: jeder Peer an jedem Exchange, ein Redundanz-Kit, PNIs mit allen.",
|
||||
"ops.caches_rent":"Kostenlos ins Rack, aber jede Box kostet {price}/Monat für Platz und Strom.",
|
||||
"ops.cheapest":"Günstigster",
|
||||
"ops.ff_desc":"hat einen Port in {city} „TODO: später fixen (nicht fixen)“ beschriftet",
|
||||
"ops.ff_hostname":"hat den Router in {city} in router-final-FINAL-v2 umbenannt",
|
||||
|
|
@ -2547,8 +2549,8 @@
|
|||
"ops.floor":"Mindestens behalten",
|
||||
"ops.hire_an_intern":"NOC-Praktikant einstellen",
|
||||
"ops.hire_mo":"Einstellen · {price}/Monat",
|
||||
"ops.hire_pitch":"Keine Lust mehr, in jeder Stadt dieselben fünfzehn Buttons zu klicken? Stell einen NOC-Praktikanten ein. Du schreibst die Daueraufträge einmal; er arbeitet sie jeden Tag ab, zahlt genau das, was deine Klicks kosten würden, und hinterlässt eine Zeile im Log.",
|
||||
"ops.hire_pitch_short":"Regeln einmal festlegen, und ein Praktikant klickt jeden Tag die Buttons.",
|
||||
"ops.hire_pitch_weekly":"Keine Lust mehr, in jeder Stadt dieselben fünfzehn Buttons zu klicken? Stell einen NOC-Praktikanten ein. Du schreibst die Daueraufträge einmal; er arbeitet sie jeden Tag ab, zahlt genau das, was deine Klicks kosten würden, und gibt dir jede Woche einen Schichtbericht.",
|
||||
"ops.hired":"{name} ist im NOC. Schreib ein paar Daueraufträge, morgen geht es los.",
|
||||
"ops.how_add":"Router dazu",
|
||||
"ops.how_auto":"erst dazu, dann tauschen",
|
||||
|
|
@ -2563,6 +2565,7 @@
|
|||
"ops.l_decom":{"one":"hat eine kleine Wave auf {where} zurückgegeben","other":"hat {n} kleine Waves zurückgegeben ({where})"},
|
||||
"ops.l_line":"{name} {list}.",
|
||||
"ops.l_optics":{"one":"hat einen Kanal auf {where} aufgeschaltet","other":"hat {n} Kanäle aufgeschaltet ({where})"},
|
||||
"ops.l_paid":"Kosten: {cost} einmalig, {mo}/Monat.",
|
||||
"ops.l_peer":{"one":"hat mit einem Netz an {where} gepeert","other":"hat mit {n} Netzen an {where} gepeert"},
|
||||
"ops.l_pni":{"one":"hat einen PNI in {where} bestellt","other":"hat {n} PNIs bestellt ({where})"},
|
||||
"ops.l_quiet":"{name} hat auf die Graphen geschaut. Nichts zu tun.",
|
||||
|
|
@ -2570,10 +2573,22 @@
|
|||
"ops.l_routers":{"one":"hat Router in {where} aufgerüstet","other":"hat Router an {n} Orten aufgerüstet ({where})"},
|
||||
"ops.l_rs":{"one":"hat sich einem Route Server angeschlossen","other":"hat sich {n} Route Servern angeschlossen"},
|
||||
"ops.l_sales":{"one":"hat einen Kunden unterschrieben","other":"hat {n} Kunden unterschrieben"},
|
||||
"ops.l_snag":{"one":"ist bei {where} hängen geblieben und hat den Auftrag pausiert, bis du draufschaust","other":"ist bei {n} Aufträgen hängen geblieben ({where}) und hat sie pausiert, bis du draufschaust"},
|
||||
"ops.l_transit":{"one":"hat Transit in {where} aufgestockt","other":"hat {n}-mal Transit aufgestockt ({where})"},
|
||||
"ops.locked":"Das NOC stellt ab Kundenlevel {lv} Praktikanten ein.",
|
||||
"ops.lpm_off":"Die Peering-Inbox bleibt deine Sache. Dafür gibt es das Large Peering Model; {name} macht keine E-Mails.",
|
||||
"ops.lpm_on":"Das Large Peering Model beantwortet die Peering-Inbox. {name} geht ihm aus dem Weg.",
|
||||
"ops.mood_annie":"Annie hat drei Fragen beantwortet, bevor du sie gestellt hast, vom nächstgelegenen Schreibtisch aus.",
|
||||
"ops.mood_broke":"{name} hat schon eine Einkaufsliste für das Budget des nächsten Monats.",
|
||||
"ops.mood_busy":"{name} hatte eine volle Woche und ist beim dritten Energydrink.",
|
||||
"ops.mood_kevin":"Kevin sagt, 2001 war es ruhiger. War es nicht.",
|
||||
"ops.mood_new":"{name} hat die Kaffeemaschine und die CLI gefunden, in dieser Reihenfolge. Bereit, wenn du es bist.",
|
||||
"ops.mood_oops":"{name} ist heute sehr vorsichtig. Bitte niemand die Interface-Beschreibungen erwähnen.",
|
||||
"ops.mood_outage":"{name} beobachtet die Störungsgraphen und lädt die Statusseite neu. Sehr oft.",
|
||||
"ops.mood_quiet":"{name} liest in Ruhe RFCs. Die Graphen sind flach, genau wie es sein soll.",
|
||||
"ops.mood_sales":"{name} läuft heute etwas aufrechter: In der eigenen Schicht hat jemand unterschrieben.",
|
||||
"ops.mood_snag":"{name} ist auf etwas Seltsames gestoßen, hat den Auftrag pausiert und dir einen Zettel hingeklebt.",
|
||||
"ops.mood_tracy":"Tracy ist drei Hops tief in einem Traceroute, bisher mit nur einem Sternchen.",
|
||||
"ops.never":"nie",
|
||||
"ops.no_cap":"kein Limit",
|
||||
"ops.no_clock":"Keine Uhr, keine Schichten: Bei diesen Regeln gibt es keine Tage, an denen ein Praktikant arbeiten könnte.",
|
||||
|
|
@ -2611,9 +2626,11 @@
|
|||
"ops.per_pop":"Pro POP",
|
||||
"ops.per_pop_note":"Grüne Aufträge laufen in diesem POP. Schalte einen aus, um hier selbst zu entscheiden.",
|
||||
"ops.really_fire":"Wirklich entlassen?",
|
||||
"ops.report_last":"Schichtbericht der letzten Woche",
|
||||
"ops.report_now":"Diese Woche bisher",
|
||||
"ops.salary":"Gehalt {price}/Monat · seit {d}",
|
||||
"ops.shift":"Schicht von {name}",
|
||||
"ops.spent_this_month":"Diesen Monat ausgegeben: {price}",
|
||||
"ops.shift_report":"{name}s Woche",
|
||||
"ops.spent_and_mo":"Diesen Monat: {price} einmalig, {mo}/Monat auf der Rechnung",
|
||||
"ops.standing_orders":"Daueraufträge",
|
||||
"ops.template":"Neuer POP aus der Vorlage",
|
||||
"ops.template_note":"Wähle, was {name} einrichtet, wenn du eine Stadt aus der Vorlage eröffnest. Den Rest übernehmen die Daueraufträge.",
|
||||
|
|
@ -2629,6 +2646,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Verfolgt jedes Paket Hop für Hop. Kommt am Ende an, mit ein, zwei Sternchen unterwegs.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Woche gesamt: {cost} einmalig, {mo}/Monat.",
|
||||
"ops.w_oops":{"one":"hat sich einmal kurz vertippt","other":"hat sich {n}-mal kurz vertippt"},
|
||||
"ops.w_sales":{"one":"hat einen Kunden gewonnen ({rev}/Monat)","other":"hat {n} Kunden gewonnen ({rev}/Monat)"},
|
||||
"optic_counts.apply_price":"Übernehmen · {price}",
|
||||
"optic_counts.count_for_model":"Anzahl der {model}-Kanäle",
|
||||
"optic_counts.only_n_channels_free":"Auf dieser Glasfaser sind nur {n} Kanäle frei.",
|
||||
|
|
|
|||
|
|
@ -2531,8 +2531,10 @@
|
|||
"ops.anycast_annie":"Annie Anycast",
|
||||
"ops.at_least_port":"al menos {port}",
|
||||
"ops.budget":"Presupuesto",
|
||||
"ops.budget_running":"Añade como máximo",
|
||||
"ops.by_hand":"Lotes puntuales",
|
||||
"ops.by_hand_note":"Para cuando lo quieres todo hecho ya: cada peer en cada exchange, un kit de redundancia, PNIs con todos.",
|
||||
"ops.caches_rent":"Instalarla es gratis, pero cada caja cuesta {price}/mes en espacio y energía.",
|
||||
"ops.cheapest":"El más barato",
|
||||
"ops.ff_desc":"etiquetó un puerto en {city} como «TODO: arreglar luego (no arreglar)»",
|
||||
"ops.ff_hostname":"renombró el router de {city} a router-final-FINAL-v2",
|
||||
|
|
@ -2545,8 +2547,8 @@
|
|||
"ops.floor":"Conservar al menos",
|
||||
"ops.hire_an_intern":"Contratar a un becario del NOC",
|
||||
"ops.hire_mo":"Contratar · {price}/mes",
|
||||
"ops.hire_pitch":"¿Harto de pulsar los mismos quince botones en cada ciudad? Contrata a un becario del NOC. Escribes las órdenes permanentes una vez; las ejecuta cada día, paga exactamente lo que costarían tus clics y deja una línea en el registro.",
|
||||
"ops.hire_pitch_short":"Fija las reglas una vez y un becario pulsa los botones cada día.",
|
||||
"ops.hire_pitch_weekly":"¿Harto de pulsar los mismos quince botones en cada ciudad? Contrata a un becario del NOC. Escribes las órdenes permanentes una vez; las ejecuta cada día, paga exactamente lo que costarían tus clics y te entrega un informe de turno cada semana.",
|
||||
"ops.hired":"{name} se ha unido al NOC. Escribe unas órdenes permanentes y mañana se pone a trabajar.",
|
||||
"ops.how_add":"añadir router",
|
||||
"ops.how_auto":"añadir y luego cambiar",
|
||||
|
|
@ -2561,6 +2563,7 @@
|
|||
"ops.l_decom":{"one":"devolvió una wave pequeña en {where}","other":"devolvió {n} waves pequeñas ({where})"},
|
||||
"ops.l_line":"{name} {list}.",
|
||||
"ops.l_optics":{"one":"encendió un canal en {where}","other":"encendió {n} canales ({where})"},
|
||||
"ops.l_paid":"Coste: {cost} de entrada, {mo}/mes.",
|
||||
"ops.l_peer":{"one":"hizo peering con una red en {where}","other":"hizo peering con {n} redes en {where}"},
|
||||
"ops.l_pni":{"one":"pidió un PNI en {where}","other":"pidió {n} PNIs ({where})"},
|
||||
"ops.l_quiet":"{name} miró las gráficas. No había nada que hacer.",
|
||||
|
|
@ -2568,10 +2571,22 @@
|
|||
"ops.l_routers":{"one":"mejoró los routers en {where}","other":"mejoró los routers en {n} sitios ({where})"},
|
||||
"ops.l_rs":{"one":"se unió a un route server","other":"se unió a {n} route servers"},
|
||||
"ops.l_sales":{"one":"firmó un cliente","other":"firmó {n} clientes"},
|
||||
"ops.l_snag":{"one":"se atascó con {where} y la pausó hasta que le eches un vistazo","other":"se atascó con {n} órdenes ({where}) y las pausó hasta que les eches un vistazo"},
|
||||
"ops.l_transit":{"one":"amplió el tránsito en {where}","other":"amplió el tránsito {n} veces ({where})"},
|
||||
"ops.locked":"El NOC contrata becarios a partir del nivel de clientes {lv}.",
|
||||
"ops.lpm_off":"La bandeja de peering sigue siendo cosa tuya. Para eso está el Large Peering Model; {name} no contesta correos.",
|
||||
"ops.lpm_on":"El Large Peering Model contesta la bandeja de peering. {name} no se mete en su camino.",
|
||||
"ops.mood_annie":"Annie respondió tres preguntas antes de que las hicieras, desde la mesa más cercana.",
|
||||
"ops.mood_broke":"{name} ya tiene la lista de la compra para cuando llegue el presupuesto del mes que viene.",
|
||||
"ops.mood_busy":"{name} ha tenido una semana movida y va por la tercera bebida energética.",
|
||||
"ops.mood_kevin":"Kevin dice que en 2001 todo estaba más tranquilo. No lo estaba.",
|
||||
"ops.mood_new":"{name} ha encontrado la cafetera y la CLI, en ese orden. Cuando quieras.",
|
||||
"ops.mood_oops":"{name} va con mucho cuidado hoy. Que nadie mencione las descripciones de las interfaces.",
|
||||
"ops.mood_outage":"{name} está mirando las gráficas de la avería y recargando la página de estado. Mucho.",
|
||||
"ops.mood_quiet":"{name} lee RFCs tranquilamente. Las gráficas están planas, como debe ser.",
|
||||
"ops.mood_sales":"{name} camina un poco más erguido hoy: alguien firmó en su turno.",
|
||||
"ops.mood_snag":"{name} se topó con algo raro, pausó esa orden y te dejó un pósit.",
|
||||
"ops.mood_tracy":"Tracy va por el tercer salto de un traceroute, con solo un asterisco de momento.",
|
||||
"ops.never":"nunca",
|
||||
"ops.no_cap":"sin límite",
|
||||
"ops.no_clock":"Sin reloj no hay turnos: con estas reglas no hay días en los que un becario pueda trabajar.",
|
||||
|
|
@ -2609,9 +2624,11 @@
|
|||
"ops.per_pop":"Por POP",
|
||||
"ops.per_pop_note":"Las órdenes en verde se ejecutan en este POP. Apaga una para decidir aquí a mano.",
|
||||
"ops.really_fire":"¿Despedir de verdad?",
|
||||
"ops.report_last":"Informe del turno de la semana pasada",
|
||||
"ops.report_now":"Esta semana, hasta ahora",
|
||||
"ops.salary":"Sueldo {price}/mes · desde {d}",
|
||||
"ops.shift":"Turno de {name}",
|
||||
"ops.spent_this_month":"Gastado este mes: {price}",
|
||||
"ops.shift_report":"La semana de {name}",
|
||||
"ops.spent_and_mo":"Este mes: {price} de entrada, {mo}/mes en la factura",
|
||||
"ops.standing_orders":"Órdenes permanentes",
|
||||
"ops.template":"POP nuevo desde plantilla",
|
||||
"ops.template_note":"Elige lo que monta {name} cuando abres una ciudad desde la plantilla. Las órdenes permanentes se encargan del resto.",
|
||||
|
|
@ -2627,6 +2644,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Sigue cada paquete salto a salto. Al final llega, con alguna estrellita por el camino.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Total de la semana: {cost} de entrada, {mo}/mes.",
|
||||
"ops.w_oops":{"one":"tuvo un pequeño despiste","other":"tuvo {n} pequeños despistes"},
|
||||
"ops.w_sales":{"one":"firmó un cliente ({rev}/mes)","other":"firmó {n} clientes ({rev}/mes)"},
|
||||
"optic_counts.apply_price":"Aplicar · {price}",
|
||||
"optic_counts.count_for_model":"Número de canales {model}",
|
||||
"optic_counts.only_n_channels_free":"Solo quedan {n} canales libres en esta fibra.",
|
||||
|
|
|
|||
|
|
@ -2531,8 +2531,10 @@
|
|||
"ops.anycast_annie":"Annie Anycast",
|
||||
"ops.at_least_port":"au moins {port}",
|
||||
"ops.budget":"Budget",
|
||||
"ops.budget_running":"Ajoute au plus",
|
||||
"ops.by_hand":"Lots ponctuels",
|
||||
"ops.by_hand_note":"Pour quand tu veux tout, tout de suite : chaque peer sur chaque exchange, un kit de redondance, des PNI avec tout le monde.",
|
||||
"ops.caches_rent":"Gratuit à installer, mais chaque boîtier coûte {price}/mois en espace et en électricité.",
|
||||
"ops.cheapest":"Le moins cher",
|
||||
"ops.ff_desc":"a étiqueté un port à {city} « TODO : corriger plus tard (ne pas corriger) »",
|
||||
"ops.ff_hostname":"a renommé le routeur de {city} en router-final-FINAL-v2",
|
||||
|
|
@ -2545,8 +2547,8 @@
|
|||
"ops.floor":"Garder au moins",
|
||||
"ops.hire_an_intern":"Recruter un stagiaire NOC",
|
||||
"ops.hire_mo":"Recruter · {price}/mois",
|
||||
"ops.hire_pitch":"Marre de cliquer sur les mêmes quinze boutons dans chaque ville ? Recrute un stagiaire NOC. Tu écris les ordres permanents une fois ; il les exécute chaque jour, paie exactement ce que coûteraient tes clics et laisse une ligne dans le journal.",
|
||||
"ops.hire_pitch_short":"Fixe les règles une fois, un stagiaire clique sur les boutons chaque jour.",
|
||||
"ops.hire_pitch_weekly":"Marre de cliquer sur les mêmes quinze boutons dans chaque ville ? Recrute un stagiaire NOC. Tu écris les ordres permanents une fois ; il les exécute chaque jour, paie exactement ce que coûteraient tes clics et te remet un rapport de garde chaque semaine.",
|
||||
"ops.hired":"{name} a rejoint le NOC. Écris quelques ordres permanents, et au travail dès demain.",
|
||||
"ops.how_add":"ajouter un routeur",
|
||||
"ops.how_auto":"ajouter, puis changer",
|
||||
|
|
@ -2561,6 +2563,7 @@
|
|||
"ops.l_decom":{"one":"a rendu une petite wave sur {where}","other":"a rendu {n} petites waves ({where})"},
|
||||
"ops.l_line":"{name} {list}.",
|
||||
"ops.l_optics":{"one":"a allumé un canal sur {where}","other":"a allumé {n} canaux ({where})"},
|
||||
"ops.l_paid":"Coût : {cost} d'entrée, {mo}/mois.",
|
||||
"ops.l_peer":{"one":"a peeré avec un réseau à {where}","other":"a peeré avec {n} réseaux à {where}"},
|
||||
"ops.l_pni":{"one":"a commandé un PNI à {where}","other":"a commandé {n} PNI ({where})"},
|
||||
"ops.l_quiet":"{name} a surveillé les graphes. Rien à faire.",
|
||||
|
|
@ -2568,10 +2571,22 @@
|
|||
"ops.l_routers":{"one":"a mis à niveau les routeurs à {where}","other":"a mis à niveau les routeurs à {n} endroits ({where})"},
|
||||
"ops.l_rs":{"one":"a rejoint un route server","other":"a rejoint {n} route servers"},
|
||||
"ops.l_sales":{"one":"a signé un client","other":"a signé {n} clients"},
|
||||
"ops.l_snag":{"one":"a calé sur {where} et l'a mis en pause en attendant que tu jettes un œil","other":"a calé sur {n} ordres ({where}) et les a mis en pause en attendant que tu jettes un œil"},
|
||||
"ops.l_transit":{"one":"a renforcé le transit à {where}","other":"a renforcé le transit {n} fois ({where})"},
|
||||
"ops.locked":"Le NOC recrute des stagiaires à partir du niveau clients {lv}.",
|
||||
"ops.lpm_off":"La boîte de peering reste à toi. Pour ça, il y a le Large Peering Model ; {name} ne fait pas les mails.",
|
||||
"ops.lpm_on":"Le Large Peering Model répond à la boîte de peering. {name} reste hors de son chemin.",
|
||||
"ops.mood_annie":"Annie a répondu à trois questions avant que tu les poses, depuis le bureau le plus proche.",
|
||||
"ops.mood_broke":"{name} a déjà sa liste de courses pour le budget du mois prochain.",
|
||||
"ops.mood_busy":"{name} a eu une semaine chargée et en est à sa troisième boisson énergisante.",
|
||||
"ops.mood_kevin":"Kevin dit que c'était plus calme en 2001. Ce n'était pas le cas.",
|
||||
"ops.mood_new":"{name} a trouvé la machine à café et la CLI, dans cet ordre. Prêt quand tu veux.",
|
||||
"ops.mood_oops":"{name} fait très attention aujourd'hui. Personne ne parle des descriptions d'interface.",
|
||||
"ops.mood_outage":"{name} surveille les graphes de la panne et rafraîchit la page de statut. Beaucoup.",
|
||||
"ops.mood_quiet":"{name} lit tranquillement des RFC. Les graphes sont plats, comme il se doit.",
|
||||
"ops.mood_sales":"{name} marche un peu plus droit aujourd'hui : quelqu'un a signé pendant sa garde.",
|
||||
"ops.mood_snag":"{name} est tombé sur un truc bizarre, a mis cet ordre en pause et t'a laissé un post-it.",
|
||||
"ops.mood_tracy":"Tracy en est au troisième saut d'un traceroute, avec une seule étoile pour l'instant.",
|
||||
"ops.never":"jamais",
|
||||
"ops.no_cap":"sans limite",
|
||||
"ops.no_clock":"Pas d'horloge, pas de service : avec ces règles, il n'y a pas de jours où un stagiaire pourrait travailler.",
|
||||
|
|
@ -2609,9 +2624,11 @@
|
|||
"ops.per_pop":"Par POP",
|
||||
"ops.per_pop_note":"Les ordres en vert s'appliquent à ce POP. Désactive-en un pour décider ici à la main.",
|
||||
"ops.really_fire":"Vraiment remercier ?",
|
||||
"ops.report_last":"Rapport de garde de la semaine dernière",
|
||||
"ops.report_now":"Cette semaine, jusqu'ici",
|
||||
"ops.salary":"Salaire {price}/mois · depuis {d}",
|
||||
"ops.shift":"Le service de {name}",
|
||||
"ops.spent_this_month":"Dépensé ce mois-ci : {price}",
|
||||
"ops.shift_report":"La semaine de {name}",
|
||||
"ops.spent_and_mo":"Ce mois-ci : {price} d'entrée, {mo}/mois sur la facture",
|
||||
"ops.standing_orders":"Ordres permanents",
|
||||
"ops.template":"Nouveau POP depuis le modèle",
|
||||
"ops.template_note":"Choisis ce que {name} installe quand tu ouvres une ville depuis le modèle. Les ordres permanents s'occupent du reste.",
|
||||
|
|
@ -2627,6 +2644,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Suit chaque paquet saut par saut. Arrive au bout, avec une ou deux étoiles en chemin.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Total de la semaine : {cost} d'entrée, {mo}/mois.",
|
||||
"ops.w_oops":{"one":"a fait une petite bourde","other":"a fait {n} petites bourdes"},
|
||||
"ops.w_sales":{"one":"a signé un client ({rev}/mois)","other":"a signé {n} clients ({rev}/mois)"},
|
||||
"optic_counts.apply_price":"Appliquer · {price}",
|
||||
"optic_counts.count_for_model":"Nombre de canaux {model}",
|
||||
"optic_counts.only_n_channels_free":"Il ne reste que {n} canaux libres sur cette fibre.",
|
||||
|
|
|
|||
|
|
@ -2531,8 +2531,10 @@
|
|||
"ops.anycast_annie":"Annie Anycast",
|
||||
"ops.at_least_port":"almeno {port}",
|
||||
"ops.budget":"Budget",
|
||||
"ops.budget_running":"Aggiunge al massimo",
|
||||
"ops.by_hand":"Lotti una tantum",
|
||||
"ops.by_hand_note":"Per quando vuoi tutto fatto subito: ogni peer su ogni exchange, un kit di ridondanza, PNI con tutti.",
|
||||
"ops.caches_rent":"Gratis da montare, ma ogni box costa {price}/mese di spazio e corrente.",
|
||||
"ops.cheapest":"Il più economico",
|
||||
"ops.ff_desc":"ha etichettato una porta a {city} «TODO: sistemare dopo (non sistemare)»",
|
||||
"ops.ff_hostname":"ha rinominato il router di {city} in router-final-FINAL-v2",
|
||||
|
|
@ -2545,8 +2547,8 @@
|
|||
"ops.floor":"Tieni almeno",
|
||||
"ops.hire_an_intern":"Assumi uno stagista NOC",
|
||||
"ops.hire_mo":"Assumi · {price}/mese",
|
||||
"ops.hire_pitch":"Stufo di cliccare gli stessi quindici pulsanti in ogni città? Assumi uno stagista NOC. Scrivi gli ordini permanenti una volta sola; lui li esegue ogni giorno, paga esattamente quanto costerebbero i tuoi clic e lascia una riga nel registro.",
|
||||
"ops.hire_pitch_short":"Fissa le regole una volta, e uno stagista clicca i pulsanti ogni giorno.",
|
||||
"ops.hire_pitch_weekly":"Stufo di cliccare gli stessi quindici pulsanti in ogni città? Assumi uno stagista NOC. Scrivi gli ordini permanenti una volta sola; lui li esegue ogni giorno, paga esattamente quanto costerebbero i tuoi clic e ti consegna un rapporto del turno ogni settimana.",
|
||||
"ops.hired":"{name} è entrato nel NOC. Scrivi qualche ordine permanente e domani si comincia.",
|
||||
"ops.how_add":"aggiungi router",
|
||||
"ops.how_auto":"aggiungi, poi cambia",
|
||||
|
|
@ -2561,6 +2563,7 @@
|
|||
"ops.l_decom":{"one":"ha restituito una wave piccola su {where}","other":"ha restituito {n} wave piccole ({where})"},
|
||||
"ops.l_line":"{name} {list}.",
|
||||
"ops.l_optics":{"one":"ha acceso un canale su {where}","other":"ha acceso {n} canali ({where})"},
|
||||
"ops.l_paid":"Costo: {cost} subito, {mo}/mese.",
|
||||
"ops.l_peer":{"one":"ha fatto peering con una rete a {where}","other":"ha fatto peering con {n} reti a {where}"},
|
||||
"ops.l_pni":{"one":"ha ordinato un PNI a {where}","other":"ha ordinato {n} PNI ({where})"},
|
||||
"ops.l_quiet":"{name} ha guardato i grafici. Niente da fare.",
|
||||
|
|
@ -2568,10 +2571,22 @@
|
|||
"ops.l_routers":{"one":"ha potenziato i router a {where}","other":"ha potenziato i router in {n} posti ({where})"},
|
||||
"ops.l_rs":{"one":"si è unito a un route server","other":"si è unito a {n} route server"},
|
||||
"ops.l_sales":{"one":"ha firmato un cliente","other":"ha firmato {n} clienti"},
|
||||
"ops.l_snag":{"one":"si è bloccato su {where} e l'ha messo in pausa finché non dai un'occhiata","other":"si è bloccato su {n} ordini ({where}) e li ha messi in pausa finché non dai un'occhiata"},
|
||||
"ops.l_transit":{"one":"ha aumentato il transit a {where}","other":"ha aumentato il transit {n} volte ({where})"},
|
||||
"ops.locked":"Il NOC assume stagisti dal livello clienti {lv}.",
|
||||
"ops.lpm_off":"La casella del peering resta tua. Per quella c'è il Large Peering Model; {name} non risponde alle email.",
|
||||
"ops.lpm_on":"Il Large Peering Model risponde alla casella del peering. {name} gli sta alla larga.",
|
||||
"ops.mood_annie":"Annie ha risposto a tre domande prima che tu le facessi, dalla scrivania più vicina.",
|
||||
"ops.mood_broke":"{name} ha già la lista della spesa per quando arriva il budget del mese prossimo.",
|
||||
"ops.mood_busy":"{name} ha avuto una settimana piena ed è alla terza bevanda energetica.",
|
||||
"ops.mood_kevin":"Kevin dice che nel 2001 era più tranquillo. Non lo era.",
|
||||
"ops.mood_new":"{name} ha trovato la macchinetta del caffè e la CLI, in quest'ordine. Pronto quando vuoi.",
|
||||
"ops.mood_oops":"{name} oggi va con i piedi di piombo. Nessuno nomini le descrizioni delle interfacce.",
|
||||
"ops.mood_outage":"{name} guarda i grafici del guasto e ricarica la pagina di stato. Parecchio.",
|
||||
"ops.mood_quiet":"{name} legge RFC in santa pace. I grafici sono piatti, come devono essere.",
|
||||
"ops.mood_sales":"{name} cammina un po' più dritto oggi: qualcuno ha firmato nel suo turno.",
|
||||
"ops.mood_snag":"{name} ha trovato qualcosa di strano, ha messo in pausa quell'ordine e ti ha lasciato un post-it.",
|
||||
"ops.mood_tracy":"Tracy è al terzo hop di un traceroute, con un solo asterisco per ora.",
|
||||
"ops.never":"mai",
|
||||
"ops.no_cap":"nessun limite",
|
||||
"ops.no_clock":"Niente orologio, niente turni: con queste regole non ci sono giorni in cui uno stagista possa lavorare.",
|
||||
|
|
@ -2609,9 +2624,11 @@
|
|||
"ops.per_pop":"Per POP",
|
||||
"ops.per_pop_note":"Gli ordini in verde valgono per questo POP. Spegnine uno per decidere qui a mano.",
|
||||
"ops.really_fire":"Licenziare davvero?",
|
||||
"ops.report_last":"Rapporto del turno della settimana scorsa",
|
||||
"ops.report_now":"Questa settimana, finora",
|
||||
"ops.salary":"Stipendio {price}/mese · dal {d}",
|
||||
"ops.shift":"Il turno di {name}",
|
||||
"ops.spent_this_month":"Speso questo mese: {price}",
|
||||
"ops.shift_report":"La settimana di {name}",
|
||||
"ops.spent_and_mo":"Questo mese: {price} subito, {mo}/mese in bolletta",
|
||||
"ops.standing_orders":"Ordini permanenti",
|
||||
"ops.template":"Nuovo POP da modello",
|
||||
"ops.template_note":"Scegli cosa monta {name} quando apri una città dal modello. Al resto pensano gli ordini permanenti.",
|
||||
|
|
@ -2627,6 +2644,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Segue ogni pacchetto hop per hop. Alla fine arriva, con qualche asterisco per strada.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Totale della settimana: {cost} subito, {mo}/mese.",
|
||||
"ops.w_oops":{"one":"ha fatto un piccolo pasticcio","other":"ha fatto {n} piccoli pasticci"},
|
||||
"ops.w_sales":{"one":"ha firmato un cliente ({rev}/mese)","other":"ha firmato {n} clienti ({rev}/mese)"},
|
||||
"optic_counts.apply_price":"Applica · {price}",
|
||||
"optic_counts.count_for_model":"Numero di canali {model}",
|
||||
"optic_counts.only_n_channels_free":"Su questa fibra sono liberi solo {n} canali.",
|
||||
|
|
|
|||
|
|
@ -2531,8 +2531,10 @@
|
|||
"ops.anycast_annie":"Annie Anycast",
|
||||
"ops.at_least_port":"pelo menos {port}",
|
||||
"ops.budget":"Orçamento",
|
||||
"ops.budget_running":"Adiciona no máximo",
|
||||
"ops.by_hand":"Lotes avulsos",
|
||||
"ops.by_hand_note":"Para quando você quer tudo feito agora: cada peer em cada exchange, um kit de redundância, PNIs com todo mundo.",
|
||||
"ops.caches_rent":"Instalar é grátis, mas cada caixa custa {price}/mês em espaço e energia.",
|
||||
"ops.cheapest":"O mais barato",
|
||||
"ops.ff_desc":"etiquetou uma porta em {city} como “TODO: corrigir depois (não corrigir)”",
|
||||
"ops.ff_hostname":"renomeou o roteador de {city} para router-final-FINAL-v2",
|
||||
|
|
@ -2545,8 +2547,8 @@
|
|||
"ops.floor":"Manter pelo menos",
|
||||
"ops.hire_an_intern":"Contratar um estagiário de NOC",
|
||||
"ops.hire_mo":"Contratar · {price}/mês",
|
||||
"ops.hire_pitch":"Cansado de clicar nos mesmos quinze botões em cada cidade? Contrate um estagiário de NOC. Você escreve as ordens permanentes uma vez; ele as executa todo dia, paga exatamente o que seus cliques custariam e deixa uma linha no registro.",
|
||||
"ops.hire_pitch_short":"Defina as regras uma vez, e um estagiário clica nos botões todo dia.",
|
||||
"ops.hire_pitch_weekly":"Cansado de clicar nos mesmos quinze botões em cada cidade? Contrate um estagiário de NOC. Você escreve as ordens permanentes uma vez; ele as executa todo dia, paga exatamente o que seus cliques custariam e entrega um relatório de turno toda semana.",
|
||||
"ops.hired":"{name} entrou no NOC. Escreva algumas ordens permanentes e amanhã começa o trabalho.",
|
||||
"ops.how_add":"adicionar roteador",
|
||||
"ops.how_auto":"adicionar, depois trocar",
|
||||
|
|
@ -2561,6 +2563,7 @@
|
|||
"ops.l_decom":{"one":"devolveu uma wave pequena em {where}","other":"devolveu {n} waves pequenas ({where})"},
|
||||
"ops.l_line":"{name} {list}.",
|
||||
"ops.l_optics":{"one":"acendeu um canal em {where}","other":"acendeu {n} canais ({where})"},
|
||||
"ops.l_paid":"Custo: {cost} de entrada, {mo}/mês.",
|
||||
"ops.l_peer":{"one":"fez peering com uma rede em {where}","other":"fez peering com {n} redes em {where}"},
|
||||
"ops.l_pni":{"one":"pediu um PNI em {where}","other":"pediu {n} PNIs ({where})"},
|
||||
"ops.l_quiet":"{name} ficou olhando os gráficos. Nada a fazer.",
|
||||
|
|
@ -2568,10 +2571,22 @@
|
|||
"ops.l_routers":{"one":"melhorou os roteadores em {where}","other":"melhorou os roteadores em {n} lugares ({where})"},
|
||||
"ops.l_rs":{"one":"entrou em um route server","other":"entrou em {n} route servers"},
|
||||
"ops.l_sales":{"one":"fechou com um cliente","other":"fechou com {n} clientes"},
|
||||
"ops.l_snag":{"one":"travou em {where} e pausou a ordem até você dar uma olhada","other":"travou em {n} ordens ({where}) e pausou-as até você dar uma olhada"},
|
||||
"ops.l_transit":{"one":"reforçou o trânsito em {where}","other":"reforçou o trânsito {n} vezes ({where})"},
|
||||
"ops.locked":"O NOC contrata estagiários a partir do nível de clientes {lv}.",
|
||||
"ops.lpm_off":"A caixa de peering continua com você. Para isso existe o Large Peering Model; {name} não responde e-mail.",
|
||||
"ops.lpm_on":"O Large Peering Model responde a caixa de peering. {name} fica fora do caminho dele.",
|
||||
"ops.mood_annie":"Annie respondeu três perguntas antes de você fazê-las, da mesa mais próxima.",
|
||||
"ops.mood_broke":"{name} já tem a lista de compras para quando chegar o orçamento do mês que vem.",
|
||||
"ops.mood_busy":"{name} teve uma semana cheia e está na terceira bebida energética.",
|
||||
"ops.mood_kevin":"Kevin diz que em 2001 era mais tranquilo. Não era.",
|
||||
"ops.mood_new":"{name} encontrou a máquina de café e a CLI, nessa ordem. Pronto quando você estiver.",
|
||||
"ops.mood_oops":"{name} está tomando muito cuidado hoje. Ninguém fale das descrições das interfaces.",
|
||||
"ops.mood_outage":"{name} está olhando os gráficos da pane e recarregando a página de status. Muito.",
|
||||
"ops.mood_quiet":"{name} lê RFCs em paz. Os gráficos estão planos, como deve ser.",
|
||||
"ops.mood_sales":"{name} está andando um pouco mais ereto hoje: alguém assinou no seu turno.",
|
||||
"ops.mood_snag":"{name} encontrou algo estranho, pausou essa ordem e deixou um post-it para você.",
|
||||
"ops.mood_tracy":"Tracy está no terceiro salto de um traceroute, com só um asterisco até agora.",
|
||||
"ops.never":"nunca",
|
||||
"ops.no_cap":"sem limite",
|
||||
"ops.no_clock":"Sem relógio, sem turnos: com estas regras não há dias para um estagiário trabalhar.",
|
||||
|
|
@ -2609,9 +2624,11 @@
|
|||
"ops.per_pop":"Por POP",
|
||||
"ops.per_pop_note":"As ordens em verde valem neste POP. Desligue uma para decidir aqui na mão.",
|
||||
"ops.really_fire":"Dispensar mesmo?",
|
||||
"ops.report_last":"Relatório do turno da semana passada",
|
||||
"ops.report_now":"Esta semana, até agora",
|
||||
"ops.salary":"Salário {price}/mês · desde {d}",
|
||||
"ops.shift":"Turno de {name}",
|
||||
"ops.spent_this_month":"Gasto este mês: {price}",
|
||||
"ops.shift_report":"A semana de {name}",
|
||||
"ops.spent_and_mo":"Este mês: {price} de entrada, {mo}/mês na fatura",
|
||||
"ops.standing_orders":"Ordens permanentes",
|
||||
"ops.template":"Novo POP por modelo",
|
||||
"ops.template_note":"Escolha o que {name} monta quando você abre uma cidade pelo modelo. As ordens permanentes cuidam do resto.",
|
||||
|
|
@ -2627,6 +2644,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Segue cada pacote salto a salto. Chega no fim, com uma ou duas estrelinhas no caminho.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Total da semana: {cost} de entrada, {mo}/mês.",
|
||||
"ops.w_oops":{"one":"cometeu um pequeno deslize","other":"cometeu {n} pequenos deslizes"},
|
||||
"ops.w_sales":{"one":"assinou um cliente ({rev}/mês)","other":"assinou {n} clientes ({rev}/mês)"},
|
||||
"optic_counts.apply_price":"Aplicar · {price}",
|
||||
"optic_counts.count_for_model":"Número de canais {model}",
|
||||
"optic_counts.only_n_channels_free":"Só há {n} canais livres nesta fibra.",
|
||||
|
|
|
|||
|
|
@ -2,17 +2,18 @@
|
|||
A NOC intern runs the player's standing orders once per game day. Every job goes through the same action a click
|
||||
would (ACT.*, pniPlace, the #185/#192 planners), so it costs exactly what the click costs, with toasts and redraws
|
||||
muted and one recompute at the end. Without an intern nothing here runs and no random numbers are drawn. */
|
||||
const INTERN_MO=6000,OPS_LOG=12,OPS_CAPS=[10000,50000,250000,1e6,5e6,0],OPS_FLOORS=[0,50000,250000,1e6,5e6];
|
||||
const INTERN_MO=6000,OPS_LOG=12,OPS_CAPS=[10000,50000,250000,1e6,5e6,0],OPS_CAPS_MO=[1000,2500,5000,10000,25000,0],OPS_FLOORS=[0,50000,250000,1e6,5e6];
|
||||
const INTERNS={
|
||||
annie:{i:'📡',n:N_('ops.anycast_annie'),s:N_('ops.annie'),d:N_('ops.annie_d')},
|
||||
kevin:{i:'🌙',n:N_('ops.kevin_from_the_night_shift'),s:N_('ops.kevin'),d:N_('ops.kevin_d')},
|
||||
tracy:{i:'🧭',n:N_('ops.tracy_route'),s:N_('ops.tracy'),d:N_('ops.tracy_d')},
|
||||
};
|
||||
// The orders, in the order the panel shows them. pop: can be switched off per POP. cap: default monthly budget.
|
||||
// The orders, in the order the panel shows them. pop: can be switched off per POP. cap: default monthly budget, of setup
|
||||
// fees, or (mo) of the running costs the order adds, for caches, which are free to rack but cost rent every month.
|
||||
const OPS=[
|
||||
{k:'transit',i:'📈',pop:1,cap:50000,t:N_('ops.o_transit'),d:N_('ops.o_transit_d'),p:{x:{d:1.5,v:[1.25,1.5,2,3],l:N_('ops.p_x'),f:v=>v+'×'},prov:{d:'cheap',ok:v=>v==='cheap'||(isNet(v)&&!!NET[v].price),l:N_('ops.p_prov')}}},
|
||||
{k:'routers',i:'🧠',pop:1,cap:250000,t:N_('ops.o_routers'),d:N_('ops.o_routers_d'),p:{at:{d:80,v:[60,70,80,90],l:N_('ops.p_at'),f:v=>v+'%'},how:{d:'auto',v:['auto','add','swap'],l:N_('ops.p_how'),f:v=>tr({auto:N_('ops.how_auto'),add:N_('ops.how_add'),swap:N_('ops.how_swap')}[v])}}},
|
||||
{k:'caches',i:'📦',pop:1,t:N_('ops.o_caches'),d:N_('ops.o_caches_d'),p:{g:{d:5,v:[1,5,10,25,50],l:N_('ops.p_g'),f:v=>fmtG(v)}}},
|
||||
{k:'caches',i:'📦',pop:1,cap:5000,mo:1,t:N_('ops.o_caches'),d:N_('ops.o_caches_d'),p:{g:{d:5,v:[1,5,10,25,50],l:N_('ops.p_g'),f:v=>fmtG(v)}}},
|
||||
{k:'ix',i:'🔀',t:N_('ops.o_ix'),d:N_('ops.o_ix_d'),p:{}},
|
||||
{k:'pni',i:'🤝',pop:1,cap:50000,t:N_('ops.o_pni'),d:N_('ops.o_pni_d'),p:{g:{d:25,v:[5,10,25,50,100],l:N_('ops.p_g'),f:v=>fmtG(v)},tier:{d:0,v:[0,1,2],l:N_('ops.p_tier'),f:v=>tr('ops.at_least_port',{port:PORT[v].n})},paid:{d:false,v:[false,true],l:N_('ops.p_paid'),f:v=>tr(v?'common.on':'common.off')}}},
|
||||
{k:'sales',i:'💼',t:N_('ops.o_sales'),d:N_('ops.o_sales_d'),p:{acc:{d:true,v:[true,false],l:N_('ops.p_acc'),f:v=>tr(v?'common.on':'common.off')},min:{d:0,v:[0,2000,5000,10000,25000,50000],l:N_('ops.p_min'),f:v=>v?tr('common.price_mo',{price:fmt$(v)}):tr('ops.never')}}},
|
||||
|
|
@ -23,20 +24,22 @@ const OPS=[
|
|||
const OPSK=Object.fromEntries(OPS.map(o=>[o.k,o])),OPS_POP=OPS.filter(o=>o.pop).map(o=>o.k);
|
||||
const OPS_TPL=['bb','transit','ix','kit'];
|
||||
// What the shift log can say. One line per day: "{name} did this, that and the other."
|
||||
const OPS_SAY={transit:N_('ops.l_transit'),routers:N_('ops.l_routers'),caches:N_('ops.l_caches'),rs:N_('ops.l_rs'),peer:N_('ops.l_peer'),pni:N_('ops.l_pni'),sales:N_('ops.l_sales'),decline:N_('ops.l_decline'),repair:N_('ops.l_repair'),optics:N_('ops.l_optics'),decom:N_('ops.l_decom'),broke:N_('ops.l_broke')};
|
||||
const OPS_SAY={transit:N_('ops.l_transit'),routers:N_('ops.l_routers'),caches:N_('ops.l_caches'),rs:N_('ops.l_rs'),peer:N_('ops.l_peer'),pni:N_('ops.l_pni'),sales:N_('ops.l_sales'),decline:N_('ops.l_decline'),repair:N_('ops.l_repair'),optics:N_('ops.l_optics'),decom:N_('ops.l_decom'),broke:N_('ops.l_broke'),snag:N_('ops.l_snag')};
|
||||
// Fat fingers: rare, visible, harmless. Only the LAG one costs anything, and only a little.
|
||||
const OPS_FF=[N_('ops.ff_desc'),N_('ops.ff_hostname'),N_('ops.ff_typo'),N_('ops.ff_lag'),N_('ops.ff_ping')];
|
||||
const OPS_TRIALS=1,OPS_FF_RATE={oncall:1/150,bgp:1/60};
|
||||
function opsNew(){return {intern:null,hired:0,on:Object.fromEntries(OPS.map(o=>[o.k,false])),p:{},cap:{},spent:Object.fromEntries(OPS.filter(o=>o.cap).map(o=>[o.k,0])),mon:0,skip:{},log:[],floor:50000,tpl:{bb:true,transit:true,ix:true,kit:true}};}
|
||||
function opsNew(){return {intern:null,hired:0,on:Object.fromEntries(OPS.map(o=>[o.k,false])),p:{},cap:{},spent:Object.fromEntries(OPS.filter(o=>o.cap).map(o=>[o.k,0])),addMo:{},mon:0,skip:{},log:[],wk:null,rep:null,floor:50000,tpl:{bb:true,transit:true,ix:true,kit:true}};}
|
||||
const opsO=()=>S.ops||(S.ops=opsNew());
|
||||
const opsHired=()=>!!(S&&S.ops&&S.ops.intern&&own(INTERNS,S.ops.intern));
|
||||
const opsCanHire=()=>lvl()>=2;
|
||||
const opsName=(long)=>{const I=INTERNS[S.ops.intern];return I?tr(long?I.n:I.s):'';};
|
||||
function opsP(k,p){const P=OPSK[k].p[p],v=S.ops.p[k]&&S.ops.p[k][p];return v!==undefined&&(P.ok?P.ok(v):P.v.includes(v))?v:P.d;}
|
||||
function opsCap(k){const c=S.ops.cap[k];return OPS_CAPS.includes(c)?c:OPSK[k].cap||0;}
|
||||
const opsCaps=k=>OPSK[k].mo?OPS_CAPS_MO:OPS_CAPS;
|
||||
function opsCap(k){const c=S.ops.cap[k];return opsCaps(k).includes(c)?c:OPSK[k].cap||0;}
|
||||
const opsHere=(k,c)=>!(S.ops.skip[c]||[]).includes(k);
|
||||
const opsPops=k=>Object.keys(S.pops).filter(c=>opsHere(k,c));
|
||||
// Saves are untrusted: rebuild ops from known orders, params, cities and log shapes. Old saves get no intern,
|
||||
// Saves are untrusted: rebuild ops from known orders, params, cities and log shapes. Runs after the POPs are repaired,
|
||||
// so exceptions only survive for POPs that still exist. Old saves get no intern,
|
||||
// and the two #185 toggles (auto-accept, auto-pay repairs) become the sales and repair orders.
|
||||
function opsSanitize(s){const o=s.ops&&typeof s.ops==='object'&&!Array.isArray(s.ops)?s.ops:{},n=opsNew(),ob=x=>x&&typeof x==='object'&&!Array.isArray(x)?x:{};
|
||||
n.intern=typeof o.intern==='string'&&own(INTERNS,o.intern)?o.intern:null;n.hired=int(o.hired,0,1e7,0);n.mon=int(o.mon,0,1e6,0);
|
||||
|
|
@ -44,31 +47,73 @@ function opsSanitize(s){const o=s.ops&&typeof s.ops==='object'&&!Array.isArray(s
|
|||
const on=ob(o.on),p=ob(o.p),cap=ob(o.cap),sp=ob(o.spent);
|
||||
for(const d of OPS){const k=d.k;n.on[k]=on[k]===true;const q=ob(p[k]),r={};
|
||||
for(const pk of Object.keys(d.p)){const P=d.p[pk];if(own(q,pk)&&(P.ok?P.ok(q[pk]):P.v.includes(q[pk])))r[pk]=q[pk];}n.p[k]=r;
|
||||
if(d.cap&&OPS_CAPS.includes(cap[k]))n.cap[k]=cap[k];if(d.cap)n.spent[k]=Math.max(0,num(sp[k],0));}
|
||||
if(d.cap&&opsCaps(k).includes(cap[k]))n.cap[k]=cap[k];if(d.cap)n.spent[k]=Math.max(0,num(sp[k],0));
|
||||
{const v=num(ob(o.addMo)[k],0);if(v)n.addMo[k]=Math.max(-1e9,Math.min(1e9,v));}}
|
||||
{const t=ob(o.tpl);for(const k of OPS_TPL)if(typeof t[k]==='boolean')n.tpl[k]=t[k];}
|
||||
{const sk=ob(o.skip);for(const c of Object.keys(sk))if(isCity(c)&&Array.isArray(sk[c])){const ks=[...new Set(sk[c].filter(k=>OPS_POP.includes(k)))];if(ks.length)n.skip[c]=ks;}}
|
||||
{const sk=ob(o.skip);for(const c of Object.keys(sk))if(isCity(c)&&own(s.pops,c)&&Array.isArray(sk[c])){const ks=[...new Set(sk[c].filter(k=>OPS_POP.includes(k)))];if(ks.length)n.skip[c]=ks;}}
|
||||
if(Array.isArray(o.log))n.log=o.log.map(opsLogOk).filter(Boolean).slice(0,OPS_LOG);
|
||||
n.wk=opsWkOk(o.wk);n.rep=opsWkOk(o.rep);
|
||||
if(s.autoSales===true)n.on.sales=true;if(s.autoRepair===true)n.on.repair=true;delete s.autoSales;delete s.autoRepair;
|
||||
s.ops=n;}
|
||||
// A log entry: {d, i: intern, r: [[kind, n, [where…]]], f: fat-finger index, c: its city}.
|
||||
// A log entry: {d, i: intern, r: [[kind, n, [where…]]], f: fat-finger index, c: its city, up: paid up front, mo: running costs added}.
|
||||
const opsWhereOk=w=>typeof w==='string'&&w.length<=48&&/^[a-z0-9~|]+( [+\w.×→⇧]+)?$/i.test(w)&&w.split(' ')[0].split('|').every(x=>isIx(x)||own(OPSK,x)||isNet(x));
|
||||
function opsLogOk(e){if(!e||typeof e!=='object'||!own(INTERNS,e.i))return null;const r=Array.isArray(e.r)?e.r.filter(x=>Array.isArray(x)&&own(OPS_SAY,x[0])&&Array.isArray(x[2])).map(x=>[x[0],int(x[1],1,1e6,1),x[2].filter(opsWhereOk).slice(0,3)]).slice(0,16):[];
|
||||
const f=Number.isInteger(e.f)&&OPS_FF[e.f]?e.f:undefined;return {d:int(e.d,0,1e7,0),i:e.i,r,...(f!==undefined&&isCity(e.c)?{f,c:e.c}:{})};}
|
||||
const f=Number.isInteger(e.f)&&OPS_FF[e.f]?e.f:undefined,up=int(e.up,0,1e12,0),mo=int(e.mo,-1e9,1e9,0);
|
||||
return {d:int(e.d,0,1e7,0),i:e.i,r,...(f!==undefined&&isCity(e.c)?{f,c:e.c}:{}),...(up?{up}:{}),...(mo?{mo}:{})};}
|
||||
// A week's tally, for the shift report and the one NOC notice a week: {w: week, i: intern, n: {kind: count}, wh: {kind: [where…]}, up, mo, rev, ff}.
|
||||
function opsWkOk(x){if(!x||typeof x!=='object'||Array.isArray(x)||!own(INTERNS,x.i))return null;const n={},wh={},xn=x.n&&typeof x.n==='object'?x.n:{},xw=x.wh&&typeof x.wh==='object'?x.wh:{};
|
||||
for(const k of Object.keys(OPS_SAY)){if(own(xn,k)){const v=int(xn[k],0,1e6,0);if(v)n[k]=v;}if(own(xw,k)&&Array.isArray(xw[k])){const w=xw[k].filter(opsWhereOk).slice(0,3);if(w.length)wh[k]=w;}}
|
||||
return {w:int(x.w,0,1e6,0),i:x.i,n,wh,up:int(x.up,0,1e12,0),mo:int(x.mo,-1e9,1e9,0),rev:int(x.rev,0,1e9,0),ff:int(x.ff,0,7,0)};}
|
||||
const opsWkNew=w=>({w,i:S.ops.intern,n:{},wh:{},up:0,mo:0,rev:0,ff:0});
|
||||
const opsWkAny=x=>!!x&&(Object.keys(x.n).length>0||x.ff>0);
|
||||
// "Kevin's week: signed 3 customers (+$41k/mo), topped up transit 2 times (Frankfurt +1×100G), declined 17 tiny offers. Week total: …"
|
||||
function opsWeekLine(x){const I=INTERNS[x.i],name=I?tr(I.s):'',ks=Object.keys(x.n).sort((a,b)=>(a==='sales'?-1:b==='sales'?1:0)||(a==='broke')-(b==='broke'));
|
||||
const parts=ks.map(k=>k==='sales'?trn('ops.w_sales',x.n[k],{rev:opsMo$(x.rev)}):trn(OPS_SAY[k],x.n[k],{where:(x.wh[k]||[]).map(opsWhere).join(', ')}));
|
||||
if(x.ff)parts.push(trn('ops.w_oops',x.ff));
|
||||
return tr('ops.w_line',{name,list:parts.join(', ')})+(x.up||x.mo?' '+tr('ops.w_money',{cost:fmt$(x.up),mo:opsMo$(x.mo)}):'');}
|
||||
// The intern's mood, from what the week has been like. No dice: the same day always reads the same.
|
||||
function opsMood(){const O=S.ops,x=O.wk&&O.wk.w===Math.floor(S.day/7)?O.wk:null,n=x?x.n:{},jobs=Object.keys(n).filter(k=>k!=='broke'&&k!=='decline').reduce((a,k)=>a+n[k],0);
|
||||
const k=S.day-O.hired<7?'new':x&&x.ff?'oops':n.snag?'snag':S.inc.some(i=>i.until>S.day&&i.type!=='ddos')?'outage':n.sales?'sales':n.broke?'broke':jobs>=5?'busy':S.day%2?'quiet':O.intern;
|
||||
return tr({new:N_('ops.mood_new'),oops:N_('ops.mood_oops'),snag:N_('ops.mood_snag'),outage:N_('ops.mood_outage'),sales:N_('ops.mood_sales'),broke:N_('ops.mood_broke'),busy:N_('ops.mood_busy'),quiet:N_('ops.mood_quiet'),
|
||||
annie:N_('ops.mood_annie'),kevin:N_('ops.mood_kevin'),tracy:N_('ops.mood_tracy')}[k],{name:opsName()});}
|
||||
// "fra +1×100G", "fra|ams", "ams~3", "transit" (an order, for the budget line) or "ggl" (a network).
|
||||
function opsWhere(w){const [a,x]=w.split(' '),nm=a.split('|').map(p=>own(OPSK,p)?tr(OPSK[p].t):isCity(p)?CITY[p].name:isNet(p)?NET[p].name:ixName(p)).join('–');return x?nm+' '+(isNet(x)?NET[x].name:x):nm;}
|
||||
function opsLine(e){const I=INTERNS[e.i],name=I?tr(I.s):'',parts=e.r.map(([k,n,w])=>trn(OPS_SAY[k],n,{where:w.map(opsWhere).join(', ')}));
|
||||
return parts.length?tr('ops.l_line',{name,list:parts.join(', ')}):tr('ops.l_quiet',{name});}
|
||||
return (parts.length?tr('ops.l_line',{name,list:parts.join(', ')}):tr('ops.l_quiet',{name}))+opsPaid(e);}
|
||||
const opsMo$=v=>(v>0?'+':'')+fmt$(v);
|
||||
const opsPaid=e=>e.up||e.mo?' '+tr('ops.l_paid',{cost:fmt$(e.up||0),mo:opsMo$(e.mo||0)}):'';
|
||||
// What the network costs every month before traffic: what a job adds to the bill (ports, routers, rent, links, cache boxes).
|
||||
// PNIs count from the day they are ordered, at the size they are going to be.
|
||||
function opsMoNow(){let m=S.caches.length*CACHE_MO;
|
||||
for(const c in S.pops){const p=S.pops[c],rt=p.routers||1;m+=(rt-1)*ROUTER_MO+cageMo(rt)+rt*RG[p.rgen||0].mo;}
|
||||
for(const l of S.links)m+=(l.mo||0)+(l.kind==='df'?(l.spares?Math.round(150+(l.ch||[]).length*80):0)+(l.regen|0)*REGEN_MO:0);
|
||||
for(const t of S.transit)m+=transitMo(t,0);
|
||||
for(const p of S.pni){const q=p.up||p,N=NET[p.net];m+=(q.g1?Math.round(PORT[0].pni/2):PORT[q.tier].pni)*(q.n||1)+(N.pol==='paid'&&!paidFree(N)?N.paidFee:0);}
|
||||
return m;}
|
||||
const opsFFLine=e=>tr('ops.ff_line',{name:tr(INTERNS[e.i].s),what:tr(OPS_FF[e.f],{city:CITY[e.c].name})});
|
||||
// Mute what a click would show (toasts, sounds, floaters, the full redraw) and keep the player's selection.
|
||||
function opsQuiet(fn){const a=after,t=toast,s=sfx,f=floater,sel=UI.sel,cf=UI.confirm,tab=UI.tab;after=()=>{};toast=()=>{};sfx=()=>{};floater=()=>{};
|
||||
try{return fn();}finally{after=a;toast=t;sfx=s;floater=f;UI.confirm=cf;UI.tab=tab;UI.sel=sel&&(sel.type!=='link'||S.links.some(l=>l.id===sel.id))&&(sel.type!=='city'||isCity(sel.id))?sel:null;}}
|
||||
// One shift's bookkeeping: what got done, and whether a job had to wait for next month's budget.
|
||||
// dirty: a job changed the network, so R (loads, routing) is out of date until the next compute().
|
||||
// up/mo/rev: what this shift paid up front, added to the monthly bill, and signed in monthly revenue.
|
||||
function opsShift(){const r=new Map(),broke=new Set();
|
||||
return {r,broke,did(k,w){const x=r.get(k)||{n:0,w:[]};x.n++;if(w&&x.w.length<3&&!x.w.includes(w))x.w.push(w);r.set(k,x);},
|
||||
can(k,cost){const O=S.ops,cap=opsCap(k);if(cost<=0)return true;if(S.cash-cost<O.floor||(cap&&(O.spent[k]||0)+cost>cap)){broke.add(k);return false;}return true;},
|
||||
return {r,broke,dirty:false,up:0,mo:0,rev:0,did(k,w){if(k!=='decline')this.dirty=true;const x=r.get(k)||{n:0,w:[]};x.n++;if(w&&x.w.length<3&&!x.w.includes(w))x.w.push(w);r.set(k,x);},
|
||||
// A job that costs nothing up front still has to pass the cash floor if it adds to the monthly bill.
|
||||
can(k,cost,mo=0){const O=S.ops,cap=opsCap(k);if(cost<=0&&!(mo>0))return true;
|
||||
if(S.cash-Math.max(0,cost)<O.floor||(cap&&(OPSK[k].mo?(O.addMo[k]||0)+mo:(O.spent[k]||0)+cost)>cap)){broke.add(k);return false;}return true;},
|
||||
book(k,d,dm){const O=S.ops;if(d>0){this.up+=d;if(OPSK[k].cap)O.spent[k]=(O.spent[k]||0)+d;}if(dm){this.mo+=dm;O.addMo[k]=(O.addMo[k]||0)+dm;}},
|
||||
// Run a click and book what it really cost; false when the action refused (no ports, no cash, a quote changed).
|
||||
pay(k,fn){const c0=S.cash,x=fn();const d=c0-S.cash;if(d>0&&OPSK[k].cap)S.ops.spent[k]=(S.ops.spent[k]||0)+d;return x===undefined?d>0:x;}};}
|
||||
const cheapestTransit=c=>NETS.filter(n=>sellsAt(n,c)).sort((a,b)=>transitPerG(a,c,premOnlyAt(a,c))-transitPerG(b,c,premOnlyAt(b,c)))[0];
|
||||
pay(k,fn){const c0=S.cash,m0=opsMoNow(),x=fn();this.book(k,c0-S.cash,opsMoNow()-m0);return x===undefined?c0-S.cash>0:x;}};}
|
||||
// Never buy from a provider that breaks a promise: a customer's "no Cogentle" or "two upstreams", a bank's covenant,
|
||||
// or Cogentle while it is not speaking to Goggle (the Spat scenario, a de-peering). Only met → failed counts.
|
||||
const OPS_TREQ=['nocog','twoup'];
|
||||
function opsTransitOk(n,c){if(n.id==='cog'&&(scnRule('spat')||S.ev.depeer>S.day))return false;
|
||||
const bz=S.biz.filter(b=>(b.reqs||[]).some(k=>OPS_TREQ.includes(k))),ls=(S.loans||[]).filter(l=>(l.covs||[]).includes('nocog'));if(!bz.length&&!ls.length)return true;
|
||||
const chk=()=>bz.map(b=>b.reqs.every(k=>!OPS_TREQ.includes(k)||REQS[k].ok(b))).concat(ls.map(l=>COVS.nocog.ok(l)));
|
||||
const was=chk(),all=S.transit;S.transit=all.concat({net:n.id,city:c});try{const now=chk();return was.every((v,i)=>!v||now[i]);}finally{S.transit=all;}}
|
||||
const cheapestTransit=c=>NETS.filter(n=>sellsAt(n,c)&&opsTransitOk(n,c)).sort((a,b)=>transitPerG(a,c,premOnlyAt(a,c))-transitPerG(b,c,premOnlyAt(b,c)))[0];
|
||||
const opsProv=c=>{const pv=opsP('transit','prov');return pv!=='cheap'&&sellsAt(NET[pv],c)&&opsTransitOk(NET[pv],c)?NET[pv]:cheapestTransit(c);};
|
||||
// The orders. Each takes the shift and does its jobs through the player's own actions.
|
||||
const OPS_RUN={
|
||||
repair(X){purgeInc();for(const i of S.inc.slice())if(i.type!=='ddos'&&i.until>S.day&&i.cost>0&&!(i.slow&&i.rushed)&&X.can('repair',i.cost)&&X.pay('repair',()=>ACT.fixInc({id:i.id})))X.did('repair');},
|
||||
|
|
@ -77,7 +122,7 @@ const OPS_RUN={
|
|||
if(min&&v<min){S.offers=S.offers.filter(x=>x!==o);X.did('decline');continue;}
|
||||
// Each trial is a full routing pass: at most one a shift, and an offer that did not fit waits a week.
|
||||
if(acc&&o.exp>S.day&&bCities(o).every(popUp)&&reqOk(o)&&tries<OPS_TRIALS&&!(UI.opsTried&&UI.opsTried.s===S&&UI.opsTried.m.get(o.id)>S.day-7)){tries++;ACT.accept({id:o.id,auto:true});
|
||||
if(!S.offers.includes(o))X.did('sales');else{if(!UI.opsTried||UI.opsTried.s!==S)UI.opsTried={s:S,m:new Map()};UI.opsTried.m.set(o.id,S.day);}}}},
|
||||
if(!S.offers.includes(o)){X.did('sales');X.rev+=bizMo(o);}else{if(!UI.opsTried||UI.opsTried.s!==S)UI.opsTried={s:S,m:new Map()};UI.opsTried.m.set(o.id,S.day);}}}},
|
||||
routers(X){const at=opsP('routers','at')/100,how=opsP('routers','how');
|
||||
for(const c of opsPops('routers')){const p=S.pops[c];if(p.rupDay===S.day)continue;
|
||||
const ld=Math.max((R.nodeLoad[c]||0)/(R.nodeCap[c]||nodeCap(c)||1),portsUsed(c)/Math.max(1,portsMax(c)));if(ld<at)continue;
|
||||
|
|
@ -87,11 +132,11 @@ const OPS_RUN={
|
|||
const doSwap=how==='swap'?swap:how==='add'?false:swap&&(rt>=4||!add);if(!doSwap&&(how==='swap'||!add))continue;
|
||||
const cost=doSwap?swapCost(c,nx):routerCost(g,rt);if(!X.can('routers',cost))continue;
|
||||
if(X.pay('routers',()=>doSwap?ACT.upRouter({city:c,g:nx}):ACT.addRouter({city:c})))X.did('routers',c+(doSwap?' ⇧'+RG[nx].pn:' +1'));}},
|
||||
transit(X){if(scnRule('noTransit'))return;const N=opsP('transit','x'),pv=opsP('transit','prov');
|
||||
transit(X){if(scnRule('noTransit'))return;const N=opsP('transit','x');
|
||||
for(const c of opsPops('transit')){let ts=S.transit.filter(t=>t.city===c);if(!ts.length)continue;
|
||||
// Thirty days of 95th-percentile-ish history per port; their peaks summed is a safe (high) estimate of the POP's peak.
|
||||
const peak=ts.reduce((a,t)=>a+(t.hist||[]).reduce((m,v)=>Math.max(m,v),0),0);if(!(peak>0))continue;
|
||||
const n=pv!=='cheap'&&sellsAt(NET[pv],c)?NET[pv]:cheapestTransit(c);if(!n)continue;
|
||||
const n=opsProv(c);if(!n)continue;
|
||||
for(let step=0;step<4;step++){const cap=ts.reduce((a,t)=>a+lagCap(PORT[t.tier].g,t.n),0);if(cap>=N*peak)break;
|
||||
const t=ts.find(x=>x.net===n.id);let job=null;
|
||||
if(t){const k=t.n||1,up=t.tier+1;
|
||||
|
|
@ -116,7 +161,7 @@ const OPS_RUN={
|
|||
caches(X){const g=opsP('caches','g');
|
||||
for(const c of opsPops('caches')){const q=utilityCaches(c);if(!q||!q.add.length)continue;
|
||||
const want=q.add.filter(x=>(R.cityDem[c]||0)*(NSH[x.net]||0)>=g),free=Math.floor(portsMax(c)-portsUsed(c)+1e-9);
|
||||
for(const x of want.slice(0,Math.max(0,free))){S.caches.push({id:uid(),city:c,net:x.net,site:x.site});X.did('caches',c);}}},
|
||||
for(const x of want.slice(0,Math.max(0,free))){if(!X.can('caches',0,CACHE_MO))return;S.caches.push({id:uid(),city:c,net:x.net,site:x.site});X.book('caches',0,CACHE_MO);X.did('caches',c);}}},
|
||||
// Weekly, like a person going through PeeringDB on a Monday: route servers, then every willing member (#192).
|
||||
ix(X){if(S.day%7)return;for(const ix of utilityRouteServers()){S.rs[ix]=true;X.did('rs');}
|
||||
for(const row of utilityPeers())for(const id of row.requests){S.peers[id+'@'+row.ix]=true;X.did('peer',row.ix);}},
|
||||
|
|
@ -127,11 +172,14 @@ const OPS_RUN={
|
|||
if(!X.can('pni',q.cost))break;if(X.pay('pni',()=>{if(!spend(q.cost))return false;pniPlace(q);return true;}))X.did('pni',q.city+' '+q.net);}},
|
||||
// Hand back smaller waves once a bigger link between the same cities carries the pair with a quarter to spare (#102).
|
||||
decom(X){const keep=opsP('decom','keep'),by=new Map();for(const l of S.links)if(l.kind!=='vxc'){const k=edgeKey(l);(by.get(k)||by.set(k,[]).get(k)).push(l);}
|
||||
// Loads must include what this shift already did (a customer just signed, a repair): recompute first, if anything could go.
|
||||
if(X.dirty&&[...by.values()].some(ls=>ls.length>1&&ls.some(l=>l.kind==='wave'))){compute();X.dirty=false;}
|
||||
for(const ls of by.values()){if(ls.length<2)continue;const live=ls.filter(l=>!linkDown(l)),big=live.reduce((a,l)=>!a||capOf(l)>capOf(a)?l:a,null);if(!big)continue;
|
||||
let cap=live.reduce((a,l)=>a+capOf(l),0);const load=ls.reduce((a,l)=>a+((R.load&&R.load[l.id])||0),0);
|
||||
const small=live.filter(l=>l!==big&&l.kind==='wave'&&!l.standby&&!l.premium&&capOf(l)<capOf(big)&&!S.biz.some(b=>b.link===l.id)).sort((a,b)=>capOf(b)-capOf(a));
|
||||
if(keep)small.shift();
|
||||
for(const l of small.reverse()){if(cap-capOf(l)<load*1.25)break;if(!opsDecomSafe(l))continue;cap-=capOf(l);UI.confirm=l.id;ACT.rmLink({id:l.id});if(!S.links.includes(l))X.did('decom',l.a+'|'+l.b);}}},
|
||||
// The spare is there for when the big link's trench is cut, so it has to live in another trench.
|
||||
if(keep&&small.length){const tr=l=>l.trench||l.id,i=small.findIndex(l=>tr(l)!==tr(big));small.splice(Math.max(0,i),1);}
|
||||
for(const l of small.reverse()){if(cap-capOf(l)<load*1.25)break;if(!opsDecomSafe(l))continue;cap-=capOf(l);UI.confirm=l.id;X.pay('decom',()=>ACT.rmLink({id:l.id}));if(!S.links.includes(l))X.did('decom',l.a+'|'+l.b);}}},
|
||||
};
|
||||
// A wave can carry a promise: diverse paths, no subsea, a latency budget. Try the network without it first.
|
||||
function opsDecomSafe(l){const bz=S.biz.filter(b=>(b.reqs||[]).some(k=>k==='diverse'||k==='sharks'||k==='lat')&&b.city2);if(!bz.length)return true;
|
||||
|
|
@ -139,20 +187,28 @@ function opsDecomSafe(l){const bz=S.biz.filter(b=>(b.reqs||[]).some(k=>k==='dive
|
|||
const was=bz.filter(chk),all=S.links;S.links=all.filter(x=>x!==l);try{return was.every(chk);}finally{S.links=all;}}
|
||||
const OPS_ORDER=['repair','sales','routers','transit','optics','caches','ix','pni','decom'];
|
||||
// The shift: once per game day from dayTick, after outages and events have had their turn.
|
||||
function opsDay(d){if(!opsHired())return;const O=S.ops,m=Math.floor(d/30);if(m!==O.mon){O.mon=m;for(const k in O.spent)O.spent[k]=0;}
|
||||
const X=opsShift(),cash=S.cash;
|
||||
opsQuiet(()=>{for(const k of OPS_ORDER)if(O.on[k])OPS_RUN[k](X);});
|
||||
function opsDay(d){if(!opsHired())return;const O=S.ops,m=Math.floor(d/30);if(m!==O.mon){O.mon=m;for(const k in O.spent)O.spent[k]=0;O.addMo={};}
|
||||
// A new week: last week's tally becomes the shift report, and the one NOC notice of the week.
|
||||
const w=Math.floor(d/7);if(!O.wk||O.wk.w!==w){if(opsWkAny(O.wk)&&O.wk.w<w){O.rep=O.wk;logNote(`<b>${esc(tr('ops.shift_report',{name:opsName()}))}</b> ${esc(opsWeekLine(O.rep))}`,O.rep.rev>0?'good':'',[],{a:'tab',v:'noc'});}O.wk=opsWkNew(w);}
|
||||
const X=opsShift();
|
||||
// One order that trips over something (an odd save, a bug) is paused and noted; payday, goals and the save still happen.
|
||||
opsQuiet(()=>{for(const k of OPS_ORDER)if(O.on[k])try{OPS_RUN[k](X);}catch(err){O.on[k]=false;X.dirty=true;X.did('snag',k);console.error('[tubes] standing order failed',k,err);}});
|
||||
const e={d,i:O.intern,r:[]};for(const [k,x] of X.r)e.r.push([k,x.n,x.w]);if(X.broke.size)e.r.push(['broke',X.broke.size,[...X.broke]]);
|
||||
// Very rarely, and never under Change Freeze, the intern fat-fingers something harmless.
|
||||
const ff=OPS_FF_RATE[rulePreset()];if(ff&&Object.keys(S.pops).length&&Math.random()<ff){const c=pick(Object.keys(S.pops));let f=Math.floor(Math.random()*OPS_FF.length);
|
||||
if(f===3){const t=S.transit.find(t=>t.city===c&&(t.n||1)<LAG_MAX&&portOk(c,t.tier)&&PORT[t.tier].setup<=Math.min(20000,S.cash*0.05));if(!t||!opsQuiet(()=>X.pay('transit',()=>ACT.lagT({id:t.id,d:1}))))f=0;}
|
||||
if(f===3){const t=O.on.transit&&opsHere('transit',c)&&!scnRule('noTransit')&&S.transit.find(t=>t.city===c&&(t.n||1)<LAG_MAX&&portOk(c,t.tier)&&PORT[t.tier].setup<=Math.min(20000,S.cash*0.05));if(!t||!opsQuiet(()=>X.pay('transit',()=>ACT.lagT({id:t.id,d:1}))))f=0;else X.dirty=true;}
|
||||
e.f=f;e.c=c;toast(esc(opsFFLine(e)),'',[{l:tr('ops.ops'),act:'opsOpen',args:{}}]);}
|
||||
if(e.r.length||e.f!==undefined){compute();O.log.unshift(e);O.log.length=Math.min(O.log.length,OPS_LOG);}
|
||||
if(e.r.length)logNote(`<b>${esc(tr('ops.shift',{name:opsName()}))}</b> ${esc(opsLine(e))}`,cash>S.cash?'':'good',[],{a:'tab',v:'noc'});}
|
||||
if(X.up)e.up=Math.round(X.up);if(Math.round(X.mo))e.mo=Math.round(X.mo);
|
||||
// Declining an offer or stopping at a budget changes nothing a route depends on: no recompute for those.
|
||||
if(X.dirty)compute();
|
||||
if(e.r.length||e.f!==undefined){O.log.unshift(e);O.log.length=Math.min(O.log.length,OPS_LOG);}
|
||||
// The day's detail stays in the Ops sheet; the NOC gets one notice a week (above).
|
||||
const W=O.wk;for(const [k,n,ws] of e.r){W.n[k]=(W.n[k]||0)+n;const a=W.wh[k]||(W.wh[k]=[]);for(const x of ws)if(a.length<3&&!a.includes(x))a.push(x);}
|
||||
W.up+=e.up||0;W.mo+=e.mo||0;W.rev+=Math.round(X.rev);if(e.f!==undefined)W.ff=Math.min(7,W.ff+1);}
|
||||
// New POP from the template: price the whole bundle first, then click through it in one go.
|
||||
function opsTplQuote(c){if(!S||S.pops[c]||!cityOn(c)||(cnCity(c)&&!cnOk()))return null;const T=S.ops.tpl,parts=[];let cost=popCost(c),net=null,ix=null,kit=null;
|
||||
if(T.bb){cost+=bbCost(c);parts.push(tr('ops.tpl_bb'));}
|
||||
if(T.transit&&!scnRule('noTransit')){const pv=opsP('transit','prov');net=pv!=='cheap'&&sellsAt(NET[pv],c)?NET[pv]:cheapestTransit(c);if(net){cost+=PORT[0].setup;parts.push(tr('ops.tpl_transit'));}}
|
||||
if(T.transit&&!scnRule('noTransit')){net=opsProv(c);if(net){cost+=PORT[0].setup;parts.push(tr('ops.tpl_transit'));}}
|
||||
// Priced as if the POP were already there (an IX port is dearer from afar). DE-KICKS wants a sales call first, so not those.
|
||||
S.pops[c]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false};
|
||||
try{if(T.ix&&CITY[c].ix&&!isDk(c)&&S.ixp[c]===undefined){ix=c;cost+=ixPortMo(c,0);parts.push(tr('ops.tpl_ix'));}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ function sanitize(s){
|
|||
['pops','ixp','rs','peers','myIx','done','ev','stats','ixn','ixPref','ixSite','confReg','ach','pairMet'].forEach(obj);
|
||||
s.v=1;s.name=String(s.name==null?'Packet Pals':s.name).slice(0,24);s.day=int(s.day,0,1e7,0);s.cash=num(s.cash,0);s.asn=int(s.asn,1,4294967294,200000);
|
||||
s.priceMul=num(s.priceMul,1);s.nextFail=num(s.nextFail,s.day+45);s.nextEvent=num(s.nextEvent,s.day+40);s.lvl=int(s.lvl,1,LEVELS.length,1);s.neg=int(s.neg,0,1e7,0);s.loanStrikes=int(s.loanStrikes,0,1e3,0);
|
||||
opsSanitize(s);
|
||||
for(const k of Object.keys(s.stats)){const v=s.stats[k];if(k==='by'||k==='f'){if(!v||typeof v!=='object')s.stats[k]={};else for(const j of Object.keys(v))v[j]=num(v[j],0);}else if(typeof v!=='boolean')s.stats[k]=num(v,0);}
|
||||
for(const k of ['survived','incidents','peak'])s.stats[k]=num(s.stats[k],0);
|
||||
for(const c of Object.keys(s.pops)){const p=s.pops[c];if(!isCity(c)||!p||typeof p!=='object'){delete s.pops[c];continue;}p.routers=int(p.routers,1,RMAX,1);if(p.rupDay!==undefined)p.rupDay=num(p.rupDay,-1);if(p.rgen!==undefined)p.rgen=int(p.rgen,0,RG.length-1,0);p.down=num(p.down,0);if(p.bb&&typeof p.bb==='object')p.bb.d=num(p.bb.d,0);else p.bb=null;}
|
||||
if(!isCity(s.home))s.home=Object.keys(s.pops)[0]||'fra';
|
||||
opsSanitize(s);
|
||||
const tier=v=>int(v,0,PORT.length-1,0),lag=v=>int(v,1,LAG_MAX,1),sid=v=>String(v==null?uid():v).slice(0,40);
|
||||
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&!own(CAB,l.cable))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);return l;});
|
||||
for(const l of s.links)repairSubUpgradeDates(l,s.day);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
const opsCycle=(a,v)=>a[(a.indexOf(v)+1)%a.length];
|
||||
Object.assign(ACT,{
|
||||
opsOpen:()=>{if(S)opsModal();},
|
||||
opsHire:({id})=>{if(!S||opsHired()||!own(INTERNS,id)||!opsCanHire()||!rule('clock'))return;if(!spend(INTERN_MO))return;const O=opsO();O.intern=id;O.hired=S.day;O.mon=Math.floor(S.day/30);
|
||||
opsHire:({id})=>{if(!S||opsHired()||!own(INTERNS,id)||!opsCanHire()||!rule('clock'))return;if(!spend(INTERN_MO))return;const O=opsO(),m=Math.floor(S.day/30);O.intern=id;O.hired=S.day;O.wk=null;
|
||||
// A new hire starts on a fresh month's budget, whatever the last one spent.
|
||||
if(m!==O.mon){O.mon=m;for(const k in O.spent)O.spent[k]=0;O.addMo={};}
|
||||
O.log.unshift({d:S.day,i:id,r:[]});toast(esc(tr('ops.hired',{name:opsName(true)})),'good',[{l:tr('ops.ops'),act:'opsOpen',args:{}}]);after();opsModal();},
|
||||
opsFire:()=>{if(!opsHired())return;if(UI.confirm!=='opsFire'){UI.confirm='opsFire';opsModal();return;}UI.confirm=null;const nm=opsName();S.ops.intern=null;
|
||||
toast(esc(tr('ops.fired',{name:nm})),'');after();opsModal();},
|
||||
|
|
@ -10,7 +12,7 @@ Object.assign(ACT,{
|
|||
opsParam:({k,p})=>{if(!opsHired()||!own(OPSK,k)||!own(OPSK[k].p,p))return;const P=OPSK[k].p[p];let v;
|
||||
if(p==='prov'){const ids=['cheap',...NETS.filter(n=>n.price&&Object.keys(S.pops).some(c=>sellsAt(n,c))).map(n=>n.id)];v=opsCycle(ids,opsP(k,p));}else v=opsCycle(P.v,opsP(k,p));
|
||||
(S.ops.p[k]||(S.ops.p[k]={}))[p]=v;sfx('click');after();opsModal();},
|
||||
opsCap:({k})=>{if(!opsHired()||!own(OPSK,k)||!OPSK[k].cap)return;S.ops.cap[k]=opsCycle(OPS_CAPS,opsCap(k));sfx('click');after();opsModal();},
|
||||
opsCap:({k})=>{if(!opsHired()||!own(OPSK,k)||!OPSK[k].cap)return;S.ops.cap[k]=opsCycle(opsCaps(k),opsCap(k));sfx('click');after();opsModal();},
|
||||
opsFloor:()=>{if(!opsHired())return;S.ops.floor=opsCycle(OPS_FLOORS,S.ops.floor);sfx('click');after();opsModal();},
|
||||
opsCity:({v})=>{if(!S||!S.pops[v])return;UI.opsCity=v;opsModal();},
|
||||
opsPop:({k,city})=>{if(!opsHired()||!OPS_POP.includes(k)||!S.pops[city])return;const sk=S.ops.skip,a=sk[city]||[];sk[city]=a.includes(k)?a.filter(x=>x!==k):[...a,k];if(!sk[city].length)delete sk[city];
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@ function opsCard(){if(!S)return '';const last=opsHired()&&S.ops.log[0];
|
|||
<div class="btns">${btn(opsHired()?tr('ops.standing_orders'):tr('ops.hire_an_intern'),'opsOpen',{},opsHired()?'sm':'pink sm',!opsHired()&&!opsCanHire())}</div></div>`;}
|
||||
const opsEntry=e=>(e.f!==undefined?opsFFLine(e)+' ':'')+(e.r.length||e.f===undefined?opsLine(e):'');
|
||||
function opsVal(k,p){const P=OPSK[k].p[p],v=opsP(k,p);return p==='prov'?(v==='cheap'?tr('ops.cheapest'):NET[v].name):P.f(v);}
|
||||
function opsOrderHtml(d){const k=d.k,on=S.ops.on[k],cap=d.cap?opsCap(k):0;
|
||||
return `<div class="ops-o${on?' on':''}"><div class="ops-h"><span class="ops-i" aria-hidden="true">${d.i}</span><div class="grow"><div class="nm">${tr(d.t)}</div><div class="meta">${tr(d.d)}</div></div>
|
||||
function opsOrderHtml(d){const k=d.k,on=S.ops.on[k],cap=d.cap?opsCap(k):0,sp=S.ops.spent[k]||0,am=Math.round(S.ops.addMo[k]||0);
|
||||
return `<div class="ops-o${on?' on':''}"><div class="ops-h"><span class="ops-i" aria-hidden="true">${d.i}</span><div class="grow"><div class="nm">${tr(d.t)}</div><div class="meta">${tr(d.d)}${k==='caches'?' '+tr('ops.caches_rent',{price:fmt$(CACHE_MO)}):''}</div></div>
|
||||
<button class="b sm ${on?'green':'ghost'}" data-act="opsToggle" data-args='{"k":"${k}"}' aria-pressed="${on}" aria-label="${esc(tr(d.t))}">${on?tr('common.on'):tr('ops.paused')}</button></div>
|
||||
${on?`<div class="ops-p">${Object.keys(d.p).map(p=>btn(`${tr(d.p[p].l)}: <b>${esc(opsVal(k,p))}</b>`,'opsParam',{k,p},'ghost sm')).join('')}
|
||||
${d.cap?btn(`${tr('ops.budget')}: <b>${cap?tr('common.price_mo',{price:fmt$(cap)}):tr('ops.no_cap')}</b>`,'opsCap',{k},'ghost sm'):''}</div>
|
||||
${d.cap&&S.ops.spent[k]?`<div class="meta">${tr('ops.spent_this_month',{price:fmt$(S.ops.spent[k])})}</div>`:''}
|
||||
${d.cap?btn(`${d.mo?tr('ops.budget_running'):tr('ops.budget')}: <b>${cap?tr('common.price_mo',{price:(d.mo?'+':'')+fmt$(cap)}):tr('ops.no_cap')}</b>`,'opsCap',{k},'ghost sm'):''}</div>
|
||||
${sp||am?`<div class="meta">${tr('ops.spent_and_mo',{price:fmt$(sp),mo:opsMo$(am)})}</div>`:''}
|
||||
${k==='ix'&&ppol()!=='open'?`<p class="why">${tr('link_panels.off_while_your_peering_policy_is',{pol:tr(PPOL_N[ppol()])})}</p>`:''}`:''}</div>`;}
|
||||
function opsModal(){if(!S)return;const hired=opsHired();let h=`<div style="display:flex;align-items:center"><div><div class="eyebrow">${tr('ops.ops')}</div><h2 style="font-size:26px">${tr('ops.standing_orders')}</h2></div><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div>`;
|
||||
if(!hired){h+=`<p class="tagline">${tr('ops.hire_pitch')}</p>`;
|
||||
if(!hired){h+=`<p class="tagline">${tr('ops.hire_pitch_weekly')}</p>`;
|
||||
if(!rule('clock'))h+=`<p class="why">${tr('ops.no_clock')}</p>`;else if(!opsCanHire())h+=`<p class="why">${tr('ops.locked',{lv:2})}</p>`;
|
||||
else h+=Object.entries(INTERNS).map(([id,I])=>`<div class="ops-o"><div class="ops-h"><span class="ops-i" aria-hidden="true">${I.i}</span><div class="grow"><div class="nm">${tr(I.n)}</div><div class="meta">${tr(I.d)}</div></div>
|
||||
${btn(tr('ops.hire_mo',{price:fmt$(INTERN_MO)}),'opsHire',{id},'pink sm',S.cash<INTERN_MO)}</div></div>`).join('');
|
||||
|
|
@ -22,6 +22,7 @@ function opsModal(){if(!S)return;const hired=opsHired();let h=`<div style="displ
|
|||
const O=S.ops,I=INTERNS[O.intern];
|
||||
h+=`<div class="ops-o on"><div class="ops-h"><span class="ops-i" aria-hidden="true">${I.i}</span><div class="grow"><div class="nm">${tr(I.n)}</div><div class="meta">${tr('ops.salary',{price:fmt$(INTERN_MO),d:dateStr(O.hired)})}</div></div>
|
||||
${btn(UI.confirm==='opsFire'?tr('ops.really_fire'):tr('ops.fire'),'opsFire',{},'ghost sm')}</div>
|
||||
<p class="ops-mood">${esc(opsMood())}</p>${opsReportHtml()}
|
||||
${O.log.length?`<pre class="term ops-log">${O.log.slice(0,6).map(e=>esc(tr('peering_inbox.day_d',{d:e.d})+': '+opsEntry(e))).join('\n')}</pre>`:''}
|
||||
<p class="meta">${ibx().bot?tr('ops.lpm_on',{name:opsName()}):tr('ops.lpm_off',{name:opsName()})}</p>
|
||||
<div class="ops-p">${btn(`${tr('ops.floor')}: <b>${O.floor?fmt$(O.floor):tr('ops.no_cap')}</b>`,'opsFloor',{},'ghost sm')}</div></div>`;
|
||||
|
|
@ -33,6 +34,10 @@ function opsModal(){if(!S)return;const hired=opsHired();let h=`<div style="displ
|
|||
<p class="meta">${tr('ops.per_pop_note')}</p></section>`;
|
||||
h+=`<section><h3>${tr('ops.template')}</h3><p class="meta">${tr('ops.template_note',{name:opsName()})}</p><div class="ops-p">${OPS_TPL.map(k=>`<button class="b sm ${O.tpl[k]?'green':'ghost'}" data-act="opsTpl" data-args='{"k":"${k}"}' aria-pressed="${O.tpl[k]}">${tr(OPS_TPL_L[k])}</button>`).join('')}</div></section>`;
|
||||
h+=opsOnceHtml();openModal(h,'ops');}
|
||||
// The shift report: last week in one paragraph, and this week so far. The daily lines below are the detail.
|
||||
function opsReportHtml(){const O=S.ops,w=Math.floor(S.day/7),cur=O.wk&&O.wk.w===w&&opsWkAny(O.wk)?O.wk:null,rep=O.rep&&O.rep.w===w-1?O.rep:null;if(!cur&&!rep)return '';
|
||||
const row=(t,x)=>`<div class="ops-rep"><div class="eyebrow">${t}</div><div>${esc(opsWeekLine(x))}</div></div>`;
|
||||
return (rep?row(tr('ops.report_last'),rep):'')+(cur?row(tr('ops.report_now'),cur):'');}
|
||||
// The big one-off batches (#181, #192) live here now, next to the orders that run them every week.
|
||||
const opsOnceHtml=()=>`<section><h3>${tr('ops.by_hand')}</h3><p class="meta">${tr('ops.by_hand_note')}</p><div class="btns">${btn(tr('utilities.title'),'utilities',{},'sm')}${btn(tr('pni_all.peer_all_networks'),'pniAllOpen',{net:null},'sm')}</div></section>`;
|
||||
// On a city without a POP: open it from the template in one tap.
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ function decomModal(){const sel=[...(UI.decom||[])],im=decomImpact(sel),all=Obje
|
|||
function decommission(cities){const set=new Set(cities),im=decomImpact(cities),lids=new Set(im.links.map(l=>l.id)),bids=new Set(im.biz.map(b=>b.id));
|
||||
S.links=S.links.filter(l=>!lids.has(l.id));prunePairMet();S.biz=S.biz.filter(b=>!bids.has(b.id));S.offers=S.offers.filter(o=>!bCities(o).some(c=>set.has(c)));
|
||||
S.transit=S.transit.filter(t=>!set.has(t.city));S.pni=S.pni.filter(x=>!set.has(x.city));S.caches=S.caches.filter(x=>!set.has(x.city));S.nni=(S.nni||[]).filter(x=>!set.has(x.city));
|
||||
for(const c of cities){for(const x of ixIdsIn(c)){delete S.ixp[x];delete S.rs[x];if(S.ixn)delete S.ixn[x];if(S.ixSite)delete S.ixSite[x];for(const k in S.peers)if(k.endsWith('@'+x))delete S.peers[k];}delete S.myIx[c];S.scrubs=S.scrubs.filter(x=>x.city!==c);delete S.pops[c];}
|
||||
for(const c of cities){for(const x of ixIdsIn(c)){delete S.ixp[x];delete S.rs[x];if(S.ixn)delete S.ixn[x];if(S.ixSite)delete S.ixSite[x];for(const k in S.peers)if(k.endsWith('@'+x))delete S.peers[k];}delete S.myIx[c];S.scrubs=S.scrubs.filter(x=>x.city!==c);if(S.ops)delete S.ops.skip[c];delete S.pops[c];}
|
||||
const rem=remoteCities();for(const x in S.ixp){const c=ixCity(x);if(!S.pops[c]&&!rem.includes(c)){delete S.ixp[x];delete S.rs[x];for(const k in S.peers)if(k.endsWith('@'+x))delete S.peers[k];}}
|
||||
if(set.has(S.home))S.home=Object.keys(S.pops)[0];
|
||||
purgeInc();S.cash-=im.fee;S.stats.decom=(S.stats.decom||0)+cities.length;
|
||||
|
|
|
|||
|
|
@ -2532,8 +2532,10 @@
|
|||
"ops.anycast_annie":"Anycast Annie",
|
||||
"ops.at_least_port":"at least {port}",
|
||||
"ops.budget":"Budget",
|
||||
"ops.budget_running":"Adds at most",
|
||||
"ops.by_hand":"One-off batches",
|
||||
"ops.by_hand_note":"For when you want it all done right now: every peer at every exchange, a redundancy kit, PNIs with everyone.",
|
||||
"ops.caches_rent":"Free to rack, but each box costs {price}/mo in space and power.",
|
||||
"ops.cheapest":"Cheapest",
|
||||
"ops.ff_desc":"labelled a port in {city} “TODO: fix later (do not fix)”",
|
||||
"ops.ff_hostname":"renamed the router in {city} to router-final-FINAL-v2",
|
||||
|
|
@ -2546,8 +2548,8 @@
|
|||
"ops.floor":"Keep at least",
|
||||
"ops.hire_an_intern":"Hire a NOC intern",
|
||||
"ops.hire_mo":"Hire · {price}/mo",
|
||||
"ops.hire_pitch":"Tired of clicking the same fifteen buttons in every city? Hire a NOC intern. You write the standing orders once; they run them every day, pay exactly what your clicks would, and leave one line in the log.",
|
||||
"ops.hire_pitch_short":"Set the rules once, and an intern clicks the buttons every day.",
|
||||
"ops.hire_pitch_weekly":"Tired of clicking the same fifteen buttons in every city? Hire a NOC intern. You write the standing orders once; they run them every day, pay exactly what your clicks would, and hand you a shift report every week.",
|
||||
"ops.hired":"{name} joined the NOC. Write some standing orders and they get to work tomorrow.",
|
||||
"ops.how_add":"add a router",
|
||||
"ops.how_auto":"add, then swap",
|
||||
|
|
@ -2562,6 +2564,7 @@
|
|||
"ops.l_decom":{"one":"handed back a small wave on {where}","other":"handed back {n} small waves ({where})"},
|
||||
"ops.l_line":"{name} {list}.",
|
||||
"ops.l_optics":{"one":"lit a channel on {where}","other":"lit {n} channels ({where})"},
|
||||
"ops.l_paid":"Cost: {cost} up front, {mo}/mo.",
|
||||
"ops.l_peer":{"one":"peered with a network at {where}","other":"peered with {n} networks at {where}"},
|
||||
"ops.l_pni":{"one":"ordered a PNI in {where}","other":"ordered {n} PNIs ({where})"},
|
||||
"ops.l_quiet":"{name} watched the graphs. Nothing needed doing.",
|
||||
|
|
@ -2569,10 +2572,22 @@
|
|||
"ops.l_routers":{"one":"upgraded routers in {where}","other":"upgraded routers in {n} places ({where})"},
|
||||
"ops.l_rs":{"one":"joined a route server","other":"joined {n} route servers"},
|
||||
"ops.l_sales":{"one":"signed a customer","other":"signed {n} customers"},
|
||||
"ops.l_snag":{"one":"got stuck on {where} and paused it until you have a look","other":"got stuck on {n} orders ({where}) and paused them until you have a look"},
|
||||
"ops.l_transit":{"one":"topped up transit in {where}","other":"topped up transit {n} times ({where})"},
|
||||
"ops.locked":"The NOC hires interns from customer level {lv}.",
|
||||
"ops.lpm_off":"The peering inbox is still yours. Hire the Large Peering Model for that; {name} does not do email.",
|
||||
"ops.lpm_on":"The Large Peering Model answers the peering inbox. {name} keeps out of its way.",
|
||||
"ops.mood_annie":"Annie answered three questions before you asked them, from whichever desk was closest.",
|
||||
"ops.mood_broke":"{name} has a shopping list ready for when next month's budget comes in.",
|
||||
"ops.mood_busy":"{name} has had a busy week and is on their third energy drink.",
|
||||
"ops.mood_kevin":"Kevin says it was quieter back in 2001. It was not.",
|
||||
"ops.mood_new":"{name} has found the coffee machine and the CLI, in that order. Ready when you are.",
|
||||
"ops.mood_oops":"{name} is being very careful today. Nobody mention the interface descriptions.",
|
||||
"ops.mood_outage":"{name} is watching the outage graphs and refreshing the status page. A lot.",
|
||||
"ops.mood_quiet":"{name} is quietly reading RFCs. The graphs are flat, which is how they like them.",
|
||||
"ops.mood_sales":"{name} is walking a little taller: someone signed on their shift.",
|
||||
"ops.mood_snag":"{name} hit something odd, paused that order and left you a sticky note.",
|
||||
"ops.mood_tracy":"Tracy is three hops into a traceroute, with only one star so far.",
|
||||
"ops.never":"never",
|
||||
"ops.no_cap":"no limit",
|
||||
"ops.no_clock":"No clock, no shifts: these rules have no days for an intern to work.",
|
||||
|
|
@ -2610,9 +2625,11 @@
|
|||
"ops.per_pop":"Per POP",
|
||||
"ops.per_pop_note":"Green orders run in this POP. Switch one off to decide here by hand.",
|
||||
"ops.really_fire":"Really let go?",
|
||||
"ops.report_last":"Last week's shift report",
|
||||
"ops.report_now":"This week so far",
|
||||
"ops.salary":"Salary {price}/mo · since {d}",
|
||||
"ops.shift":"{name}'s shift",
|
||||
"ops.spent_this_month":"Spent this month: {price}",
|
||||
"ops.shift_report":"{name}'s week",
|
||||
"ops.spent_and_mo":"This month: {price} up front, {mo}/mo on the bill",
|
||||
"ops.standing_orders":"Standing orders",
|
||||
"ops.template":"New POP from template",
|
||||
"ops.template_note":"Pick what {name} sets up when you open a city from the template. The standing orders take it from there.",
|
||||
|
|
@ -2628,6 +2645,10 @@
|
|||
"ops.tracy":"Tracy",
|
||||
"ops.tracy_d":"Follows every packet hop by hop. Gets there in the end, with a star or two on the way.",
|
||||
"ops.tracy_route":"Tracy Route",
|
||||
"ops.w_line":"{name} {list}.",
|
||||
"ops.w_money":"Week total: {cost} up front, {mo}/mo.",
|
||||
"ops.w_oops":{"one":"made one small oops","other":"made {n} small oopses"},
|
||||
"ops.w_sales":{"one":"signed a customer ({rev}/mo)","other":"signed {n} customers ({rev}/mo)"},
|
||||
"optic_counts.apply_price":"Apply · {price}",
|
||||
"optic_counts.count_for_model":"Number of {model} channels",
|
||||
"optic_counts.only_n_channels_free":"Only {n} channels are free on this fiber.",
|
||||
|
|
|
|||
|
|
@ -11,3 +11,6 @@
|
|||
.ops-p{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
|
||||
.ops-p .b{white-space:normal;text-align:left;min-height:36px}
|
||||
.ops-log{white-space:pre-wrap;font-size:11.5px;max-height:160px;overflow:auto}
|
||||
.ops-mood{margin:6px 0 0;font-style:italic;font-size:13px;color:var(--ink2)}
|
||||
.ops-rep{border-left:3px solid #8E5CF7;background:#F7F2FF;border-radius:0 8px 8px 0;padding:6px 8px;margin:6px 0;font-size:13px;line-height:1.35;overflow-wrap:anywhere}
|
||||
.ops-rep .eyebrow{margin-bottom:2px}
|
||||
|
|
|
|||
|
|
@ -231,13 +231,66 @@ test('the shift runs inside dayTick, respects a stopped clock, batches its work
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the daily log line is folded into one NOC notification', t => {
|
||||
test('the NOC gets one notice a week, the shift report; the daily lines stay in the Ops sheet', t => {
|
||||
const { ev, errors } = game(t, "S.transit[0].hist=[600]");
|
||||
hire(ev); on(ev, 'transit', { x: 1.5 });
|
||||
ev('S.day=14');
|
||||
hire(ev); on(ev, 'transit', { x: 1.5 }); on(ev, 'sales', { acc: true, min: 5000 });
|
||||
ev('S.transit[0].tier=3;S.pops.fra.rgen=3;compute()');
|
||||
const n0 = ev('S.log.length');
|
||||
shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 1);
|
||||
assert.match(ev('S.log[0].t'), /Kevin's shift Kevin topped up transit/);
|
||||
for (let d = 14; d < 21; d++) {
|
||||
if (d === 15) ev("S.offers=[{id:'tiny',city:'fra',name:'Tiny',type:'dia',bw:1,rate:600,reqs:[],exp:60},{id:'big',city:'fra',name:'Big',type:'dia',bw:10,rate:600,reqs:[],exp:60}]");
|
||||
ev(`S.day=${d}`); shift(ev);
|
||||
}
|
||||
assert.equal(ev('S.log.length'), n0, 'a whole week of shifts: no NOC notice yet');
|
||||
assert.ok(ev('S.ops.log.length') >= 2, 'the Ops sheet has the daily detail');
|
||||
ev('S.day=21'); shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 1, 'one notice for the week');
|
||||
assert.match(ev('S.log[0].t'), /^Kevin's week Kevin signed a customer \(\+\$6\.0k\/mo\), topped up transit .*declined a tiny offer.*Week total: \$[\d.]+k up front, \+\$[\d.]+k\/mo\./);
|
||||
assert.equal(ev('S.log[0].k'), 'good');
|
||||
ev('S.day=22'); shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 1, 'and nothing more until the next week ends');
|
||||
// Only the sales order now: one tiny offer declined on day 23, reported when the week ends.
|
||||
ev("for(const k in S.ops.on)S.ops.on[k]=false;S.ops.on.sales=true;S.offers=[{id:'t2',city:'fra',name:'T2',type:'dia',bw:1,rate:600,reqs:[],exp:60}];S.day=23");shift(ev);
|
||||
ev("S.day=28");shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 2);
|
||||
assert.match(ev('S.log[0].t'), /declined a tiny offer\.$/, 'nothing spent: no money line');
|
||||
assert.equal(ev('S.log[0].k'), '');
|
||||
ev("S.day=35");shift(ev);
|
||||
assert.equal(ev('S.log.length'), n0 + 2, 'an idle week: no notice');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the Ops sheet opens with the intern\'s mood and the weekly shift report, at 360 px, in every language', t => {
|
||||
for (const lang of ['en', 'de', 'es', 'fr', 'it', 'pt']) {
|
||||
const h = load(lang === 'en' ? {} : { lang });
|
||||
const { ev, dom, errors } = h;
|
||||
ev(BASE); ev('S.day=14'); dom.window.innerWidth = 360;
|
||||
hire(ev);
|
||||
ev('opsModal()');
|
||||
const mood = () => dom.window.document.querySelector('#modalCard .ops-mood').textContent;
|
||||
assert.equal(mood(), ev("tr('ops.mood_new',{name:opsName()})"), lang + ': a new hire says so');
|
||||
on(ev, 'transit', { x: 1.5 }, 0);
|
||||
ev("S.transit[0].hist=[600];S.day=21");shift(ev);ev("S.transit[0].hist=[6000];S.day=28");shift(ev);ev('opsModal()');
|
||||
const reps = [...dom.window.document.querySelectorAll('#modalCard .ops-rep')];
|
||||
assert.equal(reps.length, 2, lang + ': last week, and this week so far');
|
||||
assert.equal(reps[0].lastElementChild.textContent, ev('opsWeekLine(S.ops.rep)'), lang);
|
||||
assert.ok(mood().length > 10, lang);
|
||||
assert.doesNotMatch(dom.window.document.getElementById('modalCard').textContent, /\bops\.[a-z_]+/, lang);
|
||||
assert.deepEqual(errors, [], lang);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('the mood follows the week, with no dice', t => {
|
||||
const { ev, errors } = game(t);
|
||||
ev('S.day=100'); hire(ev); ev('S.day=110');
|
||||
const quiet = ev('opsMood()');
|
||||
assert.equal(ev('opsMood()'), quiet, 'the same day reads the same');
|
||||
assert.ok([ev("tr('ops.mood_quiet',{name:'Kevin'})"), ev("tr('ops.mood_kevin')")].includes(quiet));
|
||||
ev("S.ops.wk=opsWkNew(Math.floor(S.day/7));S.ops.wk.n.sales=1");
|
||||
assert.equal(ev('opsMood()'), ev("tr('ops.mood_sales',{name:'Kevin'})"));
|
||||
ev("S.ops.wk.n.broke=1;delete S.ops.wk.n.sales");
|
||||
assert.equal(ev('opsMood()'), ev("tr('ops.mood_broke',{name:'Kevin'})"));
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
|
@ -292,6 +345,9 @@ test('saves: old saves load with no intern and everything off, settings survive
|
|||
assert.equal(ev("JSON.stringify(S.ops.skip)"), '{"fra":["transit"]}');
|
||||
assert.equal(ev("JSON.stringify(S.ops.log)"), '[{"d":1,"i":"kevin","r":[["transit",2,["fra +1×100G"]]]}]');
|
||||
assert.equal(ev('S.ops.floor===50000&&S.ops.tpl.bb===true'), true);
|
||||
ev(`S.ops.wk={w:3,i:'kevin',n:{sales:2,evil:9,transit:'x'},wh:{transit:['fra +1×100G','<b>']},up:-5,mo:'a',rev:41000,ff:99};S.ops.rep={i:'mallory'};S=migrate(S)`);
|
||||
assert.equal(ev("JSON.stringify(S.ops.wk)"), '{"w":3,"i":"kevin","n":{"sales":2},"wh":{"transit":["fra +1×100G"]},"up":0,"mo":0,"rev":41000,"ff":7}');
|
||||
assert.equal(ev('S.ops.rep'), null);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
|
@ -339,3 +395,170 @@ test('sales trial at most one offer a shift, and an offer that did not fit waits
|
|||
ev('autoOffer=__a');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('re-hiring in a later month starts on a fresh budget, not last month\'s spending', t => {
|
||||
const { ev, errors } = game(t);
|
||||
hire(ev);
|
||||
ev("S.ops.spent.transit=50000;ACT.opsFire();ACT.opsFire();S.day=400;ACT.opsHire({id:'kevin'});closeModal()");
|
||||
assert.equal(ev('S.ops.spent.transit'), 0);
|
||||
assert.equal(ev('S.ops.mon'), ev('Math.floor(S.day/30)'));
|
||||
ev("S.ops.spent.transit=1234;ACT.opsFire();ACT.opsFire();ACT.opsHire({id:'annie'});closeModal()");
|
||||
assert.equal(ev('S.ops.spent.transit'), 1234, 'the same month: what was spent stays spent');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('transit never comes from a provider that breaks a promise: no-Cogentle customers, bank covenants, the Spat', t => {
|
||||
const { ev, errors } = game(t, "S.transit=[];ACT.buyTransit({city:'fra',net:'lvl',tier:0});compute();S.transit[0].hist=Array(30).fill(200)");
|
||||
hire(ev); on(ev, 'transit', { x: 1.5 });
|
||||
assert.equal(ev("cheapestTransit('fra').id"), 'cog', 'Cogentle is the cheapest here, so it would be the pick');
|
||||
ev("S.biz.push({id:'b1',city:'fra',name:'X',type:'dia',bw:1,rate:100,mood:100,since:S.day,reqs:['nocog']})");
|
||||
assert.equal(ev("reqOk(S.biz[0])"), true);
|
||||
shift(ev);
|
||||
assert.ok(ev('S.transit.length') > 1 || ev('S.transit[0].n') > 1, 'the intern still topped up');
|
||||
assert.equal(ev("S.transit.some(t=>t.net==='cog')"), false);
|
||||
assert.equal(ev("reqOk(S.biz[0])"), true, 'the customer still gets what they signed for');
|
||||
ev("S.ops.p.transit={x:1.5,prov:'cog'}");
|
||||
assert.notEqual(ev("opsProv('fra').id"), 'cog', 'even when the player picked Cogentle');
|
||||
assert.notEqual(ev("opsTplQuote('ams').net"), 'cog', 'and the new-POP template too');
|
||||
// A bank covenant says the same.
|
||||
ev("S.biz=[];S.loans=[{bank:'db',covs:['nocog'],pay:1,bal:1}]");
|
||||
assert.notEqual(ev("cheapestTransit('fra').id"), 'cog');
|
||||
// Cogentle is not speaking to Goggle: the Spat scenario, or a de-peering.
|
||||
ev("S.loans=[]");
|
||||
assert.equal(ev("cheapestTransit('fra').id"), 'cog');
|
||||
ev("S.ev.depeer=S.day+5");
|
||||
assert.notEqual(ev("cheapestTransit('fra').id"), 'cog');
|
||||
ev("S.ev.depeer=0;S.scn={id:'spat',rules:{spat:true}}");
|
||||
assert.notEqual(ev("cheapestTransit('fra').id"), 'cog');
|
||||
// Two upstreams: once met, never undone (adding is fine; the order never removes).
|
||||
ev("S.scn=null;S.biz=[{id:'b2',city:'fra',name:'Y',type:'dia',bw:1,rate:1,mood:100,since:0,reqs:['twoup']}]");
|
||||
assert.ok(ev("cheapestTransit('fra')"));
|
||||
ev("S.transit=[]");
|
||||
assert.equal(ev("cheapestTransit('fra')"), undefined, 'a lone first upstream would break "two upstreams"');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('decommission keeps its spare in another trench than the big link', t => {
|
||||
const { ev, errors } = game(t, "ACT.buildPop({city:'ams'});S.pops.ams.rgen=1;for(const [id,tier,tr] of [['big',2,'T1'],['s1',1,'T1'],['s2',0,'T2']])S.links.push({id,a:'fra',b:'ams',kind:'wave',tier,km:400,sub:false,cut:0,mo:100,trench:tr});compute()");
|
||||
hire(ev); on(ev, 'decom', { keep: true });
|
||||
ev("R.load={big:1,s1:0,s2:0}");
|
||||
shift(ev);
|
||||
assert.deepEqual(JSON.parse(ev("JSON.stringify(S.links.map(l=>l.id).sort())")), ['big', 's2'], 'the 100G in the same trench goes, the 10G in its own trench stays');
|
||||
// Every small wave shares the big one's trench: keep the largest, as before.
|
||||
ev("S.links=S.links.filter(l=>l.id==='big');for(const [id,tier] of [['a',1],['b',0]])S.links.push({id,a:'fra',b:'ams',kind:'wave',tier,km:400,sub:false,cut:0,mo:100,trench:'T1'});compute();R.load={big:1}");
|
||||
shift(ev);
|
||||
assert.deepEqual(JSON.parse(ev("JSON.stringify(S.links.map(l=>l.id).sort())")), ['a', 'big']);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('decommission sees the traffic of a customer signed earlier in the same shift', t => {
|
||||
const { ev, errors } = game(t, "S.pops.fra.bb.d=30;ACT.buildPop({city:'ams'});S.pops.ams.rgen=1;for(const [id,tier,tr] of [['big',2,'T1'],['s1',1,'T2'],['s2',1,'T3']])S.links.push({id,a:'fra',b:'ams',kind:'wave',tier,km:400,sub:false,cut:0,mo:1000,trench:tr});compute()");
|
||||
hire(ev); on(ev, 'sales', { acc: true, min: 0 }); on(ev, 'decom', { keep: false });
|
||||
ev("S.offers=[{id:'o1',city:'fra',city2:'ams',name:'Bulk Co',type:'l2vpn',bw:450,rate:20,reqs:[],exp:S.day+20}]");
|
||||
shift(ev);
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(S.biz.map(b=>b.id))')).length, 1, 'signed');
|
||||
assert.equal(ev('S.links.length'), 3, 'its 450G needs every wave, so none goes');
|
||||
ev('compute()');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(bizWhy(S.biz[0]))')), []);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('no recompute on a shift that only declined offers or stopped at a budget', t => {
|
||||
const { ev, errors } = game(t);
|
||||
hire(ev); on(ev, 'sales', { acc: false, min: 50000 }); on(ev, 'transit', { x: 3 }, 10000);
|
||||
ev("S.ops.spent.transit=10000;S.transit[0].hist=[600];S.offers=[{id:'tiny',city:'fra',name:'Tiny',type:'dia',bw:1,rate:600,reqs:[],exp:30}]");
|
||||
const n = ev("window.__c=compute;window.__n=0;compute=()=>{__n++;return __c()};opsDay(S.day);compute=__c;__n");
|
||||
assert.equal(n, 0, 'nothing in the network changed');
|
||||
assert.match(ev('opsEntry(S.ops.log[0])'), /declined a tiny offer, stopped at the budget/);
|
||||
ev("S.ops.spent.transit=0");
|
||||
assert.equal(ev("window.__n=0;compute=()=>{__n++;return __c()};opsDay(S.day);compute=__c;__n"), 1, 'a real job still recomputes once');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('per-POP exceptions go with the POP: on decommission, and in a save that lost it', t => {
|
||||
const { ev, errors } = game(t, "ACT.buildPop({city:'ams'});ACT.buildPop({city:'lon'});compute()");
|
||||
hire(ev);
|
||||
ev("ACT.opsPop({k:'transit',city:'ams'});ACT.opsPop({k:'caches',city:'lon'});closeModal()");
|
||||
ev("decommission(['ams'])");
|
||||
assert.equal(ev('JSON.stringify(S.ops.skip)'), '{"lon":["caches"]}');
|
||||
ev("ACT.buildPop({city:'ams'});closeModal()");
|
||||
assert.equal(ev("opsHere('transit','ams')"), true, 'a rebuilt POP starts with every order on');
|
||||
ev("S.ops.skip.par=['transit'];S=migrate(JSON.parse(JSON.stringify(S)))");
|
||||
assert.equal(ev('JSON.stringify(S.ops.skip)'), '{"lon":["caches"]}', 'no POP in Paris: its exception is dropped on load');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('one order that throws is paused and noted; the rest of the shift and the day still run', t => {
|
||||
const { ev, errors } = game(t, "S.transit[0].hist=[60,80,70]");
|
||||
hire(ev); on(ev, 'repair'); on(ev, 'transit', { x: 1.5 });
|
||||
ev("window.__r=OPS_RUN.repair;OPS_RUN.repair=()=>{throw new Error('boom')};window.__e=console.error;console.error=()=>{}");
|
||||
const d = ev('S.day'), saves = ev("window.__s=0;window.__sv=save;save=()=>{__s++;return __sv()};S.day=29;dayTick();save=__sv;__s");
|
||||
ev("OPS_RUN.repair=__r;console.error=__e");
|
||||
assert.ok(d >= 0 && saves >= 1, 'dayTick reached the save on day 30');
|
||||
assert.equal(ev('S.ops.on.repair'), false, 'the broken order is paused');
|
||||
assert.ok(ev("(S.transit[0].n||1)") > 1, 'the next order still ran');
|
||||
assert.match(ev('opsEntry(S.ops.log[0])'), /got stuck on Rush repairs and paused it/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the fat-fingered LAG member respects a paused transit order and per-POP exceptions', t => {
|
||||
const { ev, errors } = game(t);
|
||||
hire(ev);
|
||||
// Each shift rolls: fat finger yes, the only POP, the LAG slip (index 3).
|
||||
ev("S.rules=makeRules('bgp');window.__r=Math.random;window.__k=0;Math.random=()=>[0,0,0.7][__k++%3]");
|
||||
const n0 = ev('S.transit[0].n||1'), c0 = cash(ev);
|
||||
shift(ev);
|
||||
assert.equal(ev('__k'), 3);
|
||||
assert.equal(ev('S.ops.log[0].f'), 0, 'transit order paused: a harmless label instead');
|
||||
assert.equal(ev('S.transit[0].n||1'), n0); assert.equal(cash(ev), c0);
|
||||
on(ev, 'transit', { x: 1 }); ev("ACT.opsPop({k:'transit',city:'fra'});closeModal();S.transit[0].hist=[0]");
|
||||
shift(ev);
|
||||
assert.equal(ev('S.ops.log[0].f'), 0, 'Frankfurt excepted: the same');
|
||||
ev("ACT.opsPop({k:'transit',city:'fra'});closeModal()");
|
||||
shift(ev);
|
||||
assert.equal(ev('S.ops.log[0].f'), 3, 'allowed: the extra member');
|
||||
assert.equal(ev('S.transit[0].n||1'), n0 + 1);
|
||||
ev('Math.random=__r');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('caches: the cash floor and a running-cost budget hold; the panel and the log show what a month costs', t => {
|
||||
const { ev, errors } = game(t);
|
||||
hire(ev); on(ev, 'caches', { g: 1 });
|
||||
const add = () => ev("utilityCaches('fra').add.filter(x=>(R.cityDem.fra||0)*NSH[x.net]>=1).length");
|
||||
assert.ok(add() >= 2, 'several boxes on offer');
|
||||
ev('S.ops.floor=50000;S.cash=1000');
|
||||
shift(ev);
|
||||
assert.equal(ev('S.caches.length'), 0, 'below the floor: no new rent either');
|
||||
assert.match(ev('opsEntry(S.ops.log[0])'), /stopped at the budget for Accept free caches/);
|
||||
ev('S.cash=1e8;S.ops.cap.caches=1000');
|
||||
const m0 = ev('opsMoNow()');
|
||||
shift(ev);
|
||||
assert.equal(ev('S.caches.length'), 2, 'a $1k/mo budget fits two $400/mo boxes');
|
||||
assert.equal(ev('S.ops.addMo.caches'), 800);
|
||||
assert.equal(ev('opsMoNow()') - m0, 800);
|
||||
assert.equal(ev('S.ops.log[0].mo'), 800);
|
||||
assert.match(ev('opsEntry(S.ops.log[0])'), /racked 2 free caches \(Frankfurt\).*Cost: \$0 up front, \+\$800\/mo\./);
|
||||
ev('opsModal()');
|
||||
const txt = ev("document.getElementById('modalCard').textContent");
|
||||
assert.match(txt, /each box costs \$400\/mo/);
|
||||
assert.match(txt, /Adds at most: \+\$1\.0k\/mo/);
|
||||
assert.match(txt, /This month: \$0 up front, \+\$800\/mo on the bill/);
|
||||
ev('S.day+=30;S.ops.cap.caches=0'); shift(ev);
|
||||
assert.equal(ev('S.ops.addMo.caches'), (ev('S.caches.length') - 2) * 400, 'a new month counts from zero');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('transit: the log line and budget line show the monthly cost a top-up adds', t => {
|
||||
const { ev, errors } = game(t, "S.transit[0].hist=[60,80,70]");
|
||||
hire(ev); on(ev, 'transit', { x: 1.5 });
|
||||
const m0 = ev('opsMoNow()'), c0 = cash(ev);
|
||||
shift(ev);
|
||||
const mo = ev('opsMoNow()') - m0;
|
||||
assert.ok(mo > 0);
|
||||
assert.equal(ev('S.ops.log[0].up'), c0 - cash(ev));
|
||||
assert.equal(ev('S.ops.log[0].mo'), Math.round(mo));
|
||||
assert.equal(ev('Math.round(S.ops.addMo.transit)'), Math.round(mo));
|
||||
assert.match(ev('opsEntry(S.ops.log[0])'), /Cost: \$[\d.]+k up front, \+\$[\d.]+k?\/mo\./);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue